mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-09 07:40:39 -08:00
(byte-compile-lambda):
Don't compile the interactive spec if it is a call to `list'.
This commit is contained in:
parent
259c5af9d8
commit
ffc394dd58
1 changed files with 10 additions and 3 deletions
|
|
@ -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).
|
;; Skip (interactive) if it is in front (the most usual location).
|
||||||
(if (eq int (car body))
|
(if (eq int (car body))
|
||||||
(setq body (cdr body)))
|
(setq body (cdr body)))
|
||||||
(cond ((cdr int)
|
(cond ((consp (cdr int))
|
||||||
(if (cdr (cdr int))
|
(if (cdr (cdr int))
|
||||||
(byte-compile-warn "malformed interactive spec: %s"
|
(byte-compile-warn "malformed interactive spec: %s"
|
||||||
(prin1-to-string int)))
|
(prin1-to-string int)))
|
||||||
(setq int (list 'interactive (byte-compile-top-level
|
;; If the interactive spec is a call to `list',
|
||||||
(nth 1 int))))))))
|
;; 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)))
|
(let ((compiled (byte-compile-top-level (cons 'progn body) nil 'lambda)))
|
||||||
(if (and (eq 'byte-code (car-safe compiled))
|
(if (and (eq 'byte-code (car-safe compiled))
|
||||||
(byte-compile-version-cond
|
(byte-compile-version-cond
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue