[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#47454: plist-put should have a version which accepts multiple proper
From: |
Stefan Monnier |
Subject: |
bug#47454: plist-put should have a version which accepts multiple properties |
Date: |
Wed, 16 Jun 2021 12:55:49 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
forcemerge 47454 49053
close 47454 49053
thanks
Stefan Monnier [2021-06-15 08:48:25] wrote:
> Juri Linkov [2021-06-15 00:53:54] wrote:
>
>>> (setf (seq-elt plist ...))
>>>
>>> may help with that, though.
>>
>> BTW, often after pulling from master and recompiling,
>> Emacs fails to start with such errors:
>>
>> Debugger entered--Lisp error: (error "(setf seq-elt) is already defined as
>> something else than a generic function")
>> error("%s is already defined as something else than a generic function"
>> \(setf\ seq-elt\))
>> cl-generic-ensure-function(\(setf\ seq-elt\))
>> cl-generic-define-method(\(setf\ seq-elt\) nil (store (sequence array) n)
>> nil #f(compiled-function (store sequence n)
>
> Hmm....
>
> When you see that, could you show us the value of:
>
> (symbol-function '\(setf\ seq-elt\))
I installed the patch below which apparently fixes this problem
Stefan
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 31aa0cb4f9..544704be38 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -568,17 +568,17 @@ cl-generic-define-method
(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