summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-06-16 12:53:59 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2021-06-16 12:53:59 -0400
commitff053c706cb903534936c45b04a2aa38e3db1261 (patch)
tree275a73a5513ee2e31ea9a73a3fec2d890cc5651f /lisp/emacs-lisp
parent7c22aa36cd622ba2a9176e319ce5fb2b06f87801 (diff)
downloademacs-ff053c706cb903534936c45b04a2aa38e3db1261.tar.gz
emacs-ff053c706cb903534936c45b04a2aa38e3db1261.tar.bz2
emacs-ff053c706cb903534936c45b04a2aa38e3db1261.zip
* lisp/emacs-lisp/cl-generic.el: Fix bug#49053 and bug#47454
(cl-generic-define-method): Shorten the time window where the symbol is defined to `dummy`.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-generic.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 31aa0cb4f9c..544704be387 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -568,17 +568,17 @@ The set of acceptable TYPEs (also called \"specializers\") is defined
(cons method mt)
;; Keep the ordering; important for methods with :extra qualifiers.
(mapcar (lambda (x) (if (eq x (car me)) method x)) mt)))
- (let ((sym (cl--generic-name generic))) ; Actual name (for aliases).
+ (let ((sym (cl--generic-name generic)) ; Actual name (for aliases).
+ ;; FIXME: Try to avoid re-constructing a new function if the old one
+ ;; is still valid (e.g. still empty method cache)?
+ (gfun (cl--generic-make-function generic)))
(unless (symbol-function sym)
(defalias sym 'dummy)) ;Record definition into load-history.
(cl-pushnew `(cl-defmethod . ,(cl--generic-load-hist-format
(cl--generic-name generic)
qualifiers specializers))
current-load-list :test #'equal)
- ;; FIXME: Try to avoid re-constructing a new function if the old one
- ;; is still valid (e.g. still empty method cache)?
- (let ((gfun (cl--generic-make-function generic))
- ;; Prevent `defalias' from recording this as the definition site of
+ (let (;; Prevent `defalias' from recording this as the definition site of
;; the generic function.
current-load-list
;; BEWARE! Don't purify this function definition, since that leads