unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 47454@debbugs.gnu.org
Subject: bug#47454: plist-put should have a version which accepts multiple properties
Date: Wed, 16 Jun 2021 12:55:49 -0400	[thread overview]
Message-ID: <jwvzgvpkax9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwvim2fqor3.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 15 Jun 2021 08:48:25 -0400")

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






      reply	other threads:[~2021-06-16 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 17:34 bug#47454: plist-put should have a version which accepts multiple properties scame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-18 16:13 ` Lars Ingebrigtsen
2021-06-14 21:53   ` Juri Linkov
2021-06-15 12:48     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-16 16:55       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzgvpkax9.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=47454@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).