diff options
Diffstat (limited to 'lisp/erc/erc-backend.el')
-rw-r--r-- | lisp/erc/erc-backend.el | 15 |
1 files changed, 9 insertions, 6 deletions
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. |