From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Daniel Mendler <mail@daniel-mendler.de>, 50034-done@debbugs.gnu.org
Subject: bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp"
Date: Tue, 23 Aug 2022 10:17:52 -0400 [thread overview]
Message-ID: <jwv7d2z9hal.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87v949ee54.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Aug 2021 14:13:27 +0200")
> Slightly simpler repro:
>
> (defmacro foo bar
> M-: (elisp--local-variables) RET
>
> It fails here:
>
> (`(lambda ,args . ,body)
> (elisp--local-variables-1
> (append (remq '&optional (remq '&rest args)) vars)
> (car (last body))))
>
> where it expects args to be a list, but it's the symbol
> `elisp--witness--lisp'.
Since the code can be completely non-sensical, `elisp--local-variables`
shouldn't presume that the arglist is indeed a list. I installed the fix
below on `master`.
Stefan
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 0c4a9bfdbea..6d8ced7f220 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -383,7 +383,9 @@ elisp--local-variables-1
(setq sexp nil))
(`(lambda ,args . ,body)
(elisp--local-variables-1
- (append (remq '&optional (remq '&rest args)) vars)
+ (let ((args (if (listp args) args)))
+ ;; FIXME: Exit the loop if witness is in args.
+ (append (remq '&optional (remq '&rest args)) vars))
(car (last body))))
(`(condition-case ,_ ,e) (elisp--local-variables-1 vars e))
(`(condition-case ,v ,_ . ,catches)
prev parent reply other threads:[~2022-08-23 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 1:25 bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" Daniel Mendler
2021-08-13 12:13 ` Lars Ingebrigtsen
2022-08-22 13:15 ` Lars Ingebrigtsen
2022-08-23 2:05 ` Michael Heerdegen
2022-08-23 14:17 ` 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=jwv7d2z9hal.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=50034-done@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=mail@daniel-mendler.de \
--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).