diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-02-17 17:12:27 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-02-17 17:12:31 +0100 |
commit | 0324ec17375028bd1b26a6d695535450d5a5a9c5 (patch) | |
tree | d3ff5d38042d37eb9347725bc76b5135c17b67d1 /lisp/emacs-lisp | |
parent | cccd701ac952f81da8444576a72d92b37ddf42d2 (diff) | |
download | emacs-0324ec17375028bd1b26a6d695535450d5a5a9c5.tar.gz emacs-0324ec17375028bd1b26a6d695535450d5a5a9c5.tar.bz2 emacs-0324ec17375028bd1b26a6d695535450d5a5a9c5.zip |
Fix recently introduced bug in `byte-compile-lambda'
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Fix recently
introduced error when compiling non-lexical commands (bug#46589).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5c6b9c2e39a..9d80afd774f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2951,7 +2951,9 @@ for symbols generated by the byte compiler itself." ;; Skip (interactive) if it is in front (the most usual location). (if (eq int (car body)) (setq body (cdr body))) - (cond ((consp (cdr int)) + (cond ((consp (cdr int)) ; There is an `interactive' spec. + ;; Check that the bit after the `interactive' spec is + ;; just a list of symbols (i.e., modes). (unless (seq-every-p #'symbolp (cdr (cdr int))) (byte-compile-warn "malformed interactive specc: %s" (prin1-to-string int))) @@ -2966,16 +2968,14 @@ for symbols generated by the byte compiler itself." (while (consp (cdr form)) (setq form (cdr form))) (setq form (car form))) - (setq int - (if (and (eq (car-safe form) 'list) - ;; For code using lexical-binding, form is not - ;; valid lisp, but rather an intermediate form - ;; which may include "calls" to - ;; internal-make-closure (Bug#29988). - (not lexical-binding)) - `(interactive ,form) - `(interactive ,newform))))) - ((cdr int) + (when (or (not (eq (car-safe form) 'list)) + ;; For code using lexical-binding, form is not + ;; valid lisp, but rather an intermediate form + ;; which may include "calls" to + ;; internal-make-closure (Bug#29988). + lexical-binding) + (setq int `(interactive ,newform))))) + ((cdr int) ; Invalid (interactive . something). (byte-compile-warn "malformed interactive spec: %s" (prin1-to-string int))))) ;; Process the body. |