From 0bacb8f9e74aefd39c492d34b01800aeb1e53c98 Mon Sep 17 00:00:00 2001
From: dickmao <dick.r.chiang@gmail.com>
Date: Fri, 1 Jul 2022 11:06:51 -0400
Subject: Use compatibility macro for ISUPPORT caching in ERC

* lisp/erc/erc-backend.el (erc--with-memoization): Defalias was a
kung-fu I've never seen before. (Bug#56340)
---
 lisp/erc/erc-backend.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'lisp/erc/erc-backend.el')

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index bee2551d76e..bc7a7d14dc2 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1673,12 +1673,15 @@ Then display the welcome message."
          (split-string value ",")
        (list value)))))
 
-;; FIXME move to erc-compat (once we decide how to load it)
-(defalias 'erc--with-memoization
-  (cond
-   ((fboundp 'with-memoization) #'with-memoization) ; 29.1
-   ((fboundp 'cl--generic-with-memoization) #'cl--generic-with-memoization)
-   (t (lambda (_ v) v))))
+(defmacro erc--with-memoization (table &rest forms)
+  "Adapter to be migrated to erc-compat."
+  (declare (indent defun))
+  `(cond
+    ((fboundp 'with-memoization)
+     (with-memoization ,table ,@forms)) ; 29.1
+    ((fboundp 'cl--generic-with-memoization)
+     (cl--generic-with-memoization ,table ,@forms))
+    (t ,@forms)))
 
 (defun erc--get-isupport-entry (key &optional single)
   "Return an item for \"ISUPPORT\" token KEY, a symbol.
-- 
cgit v1.2.3