emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0bacb8f9e7 1/2: Use compatibility macro for ISUPPORT caching in E


From: F. Jason Park
Subject: master 0bacb8f9e7 1/2: Use compatibility macro for ISUPPORT caching in ERC
Date: Wed, 6 Jul 2022 05:21:18 -0400 (EDT)

branch: master
commit 0bacb8f9e74aefd39c492d34b01800aeb1e53c98
Author: dickmao <dick.r.chiang@gmail.com>
Commit: F. Jason Park <jp@neverwas.me>

    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(-)

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index bee2551d76..bc7a7d14dc 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]