diff options
author | dickmao <dick.r.chiang@gmail.com> | 2022-07-01 11:06:51 -0400 |
---|---|---|
committer | F. Jason Park <jp@neverwas.me> | 2022-07-06 01:54:55 -0700 |
commit | 0bacb8f9e74aefd39c492d34b01800aeb1e53c98 (patch) | |
tree | ec3e6a2781376c59a43b1cd763cc50230548817b /lisp/erc/erc-backend.el | |
parent | e6504c3eda12c72268d2db6598764f043b74c24d (diff) | |
download | emacs-0bacb8f9e74aefd39c492d34b01800aeb1e53c98.tar.gz emacs-0bacb8f9e74aefd39c492d34b01800aeb1e53c98.tar.bz2 emacs-0bacb8f9e74aefd39c492d34b01800aeb1e53c98.zip |
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)
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. |