From 3b72b47cbd3e1a4b575d5ecc886e506d22a50a0c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Aug 2022 10:15:48 -0400 Subject: [PATCH] * lisp/progmodes/elisp-mode.el (elisp--local-variables-1): Fix bug#50034 Don't burp if the arg list of a function is not actually a list. --- lisp/progmodes/elisp-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 4617a01947c..9dc67010aa7 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -383,7 +383,9 @@ be used instead. (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) -- 2.39.5