aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1992-10-31 09:27:47 +0000
committerRichard M. Stallman <[email protected]>1992-10-31 09:27:47 +0000
commitffc394dd585f2d0eeef6bf6551219e8eb7349aba (patch)
tree8d269b2248e6040d7a1555ad2aedac6eb6c30bf2 /lisp
parent259c5af9d8f4c900177a7783e179fc1caf1cbe1c (diff)
(byte-compile-lambda):
Don't compile the interactive spec if it is a call to `list'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/bytecomp.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index a337c7d8d9..a981a3cf03 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1659,12 +1659,19 @@ If FORM is a lambda or a macro, byte-compile it as a function."
;; Skip (interactive) if it is in front (the most usual location).
(if (eq int (car body))
(setq body (cdr body)))
- (cond ((cdr int)
+ (cond ((consp (cdr int))
(if (cdr (cdr int))
(byte-compile-warn "malformed interactive spec: %s"
(prin1-to-string int)))
- (setq int (list 'interactive (byte-compile-top-level
- (nth 1 int))))))))
+ ;; If the interactive spec is a call to `list',
+ ;; don't compile it, because `call-interactively'
+ ;; looks at the args of `list'.
+ (or (eq (car-safe (nth 1 int)) 'list)
+ (setq int (list 'interactive
+ (byte-compile-top-level (nth 1 int))))))
+ ((cdr int)
+ (byte-compile-warn "malformed interactive spec: %s"
+ (prin1-to-string int))))))
(let ((compiled (byte-compile-top-level (cons 'progn body) nil 'lambda)))
(if (and (eq 'byte-code (car-safe compiled))
(byte-compile-version-cond