summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-backend.el
diff options
context:
space:
mode:
authordickmao <dick.r.chiang@gmail.com>2022-07-01 11:06:51 -0400
committerF. Jason Park <jp@neverwas.me>2022-07-06 01:54:55 -0700
commit0bacb8f9e74aefd39c492d34b01800aeb1e53c98 (patch)
treeec3e6a2781376c59a43b1cd763cc50230548817b /lisp/erc/erc-backend.el
parente6504c3eda12c72268d2db6598764f043b74c24d (diff)
downloademacs-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.el15
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.