GNU bug report logs - #50034
28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp"

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Fri, 13 Aug 2021 01:27:01 UTC

Severity: normal

Found in version 28.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 50034-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 50034-done <at> debbugs.gnu.org
Subject: Re: bug#50034: 28.0.50; elisp capf error "Wrong type argument:
 listp, elisp--witness--lisp"
Date: Tue, 23 Aug 2022 10:17:52 -0400
> 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)





This bug report was last modified 2 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.