diff options
| author | Richard M. Stallman | 1992-10-31 09:27:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-10-31 09:27:47 +0000 |
| commit | ffc394dd585f2d0eeef6bf6551219e8eb7349aba (patch) | |
| tree | 8d269b2248e6040d7a1555ad2aedac6eb6c30bf2 | |
| parent | 259c5af9d8f4c900177a7783e179fc1caf1cbe1c (diff) | |
| download | emacs-ffc394dd585f2d0eeef6bf6551219e8eb7349aba.tar.gz emacs-ffc394dd585f2d0eeef6bf6551219e8eb7349aba.zip | |
(byte-compile-lambda):
Don't compile the interactive spec if it is a call to `list'.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a337c7d8d97..a981a3cf033 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." | |||
| 1659 | ;; Skip (interactive) if it is in front (the most usual location). | 1659 | ;; Skip (interactive) if it is in front (the most usual location). |
| 1660 | (if (eq int (car body)) | 1660 | (if (eq int (car body)) |
| 1661 | (setq body (cdr body))) | 1661 | (setq body (cdr body))) |
| 1662 | (cond ((cdr int) | 1662 | (cond ((consp (cdr int)) |
| 1663 | (if (cdr (cdr int)) | 1663 | (if (cdr (cdr int)) |
| 1664 | (byte-compile-warn "malformed interactive spec: %s" | 1664 | (byte-compile-warn "malformed interactive spec: %s" |
| 1665 | (prin1-to-string int))) | 1665 | (prin1-to-string int))) |
| 1666 | (setq int (list 'interactive (byte-compile-top-level | 1666 | ;; If the interactive spec is a call to `list', |
| 1667 | (nth 1 int)))))))) | 1667 | ;; don't compile it, because `call-interactively' |
| 1668 | ;; looks at the args of `list'. | ||
| 1669 | (or (eq (car-safe (nth 1 int)) 'list) | ||
| 1670 | (setq int (list 'interactive | ||
| 1671 | (byte-compile-top-level (nth 1 int)))))) | ||
| 1672 | ((cdr int) | ||
| 1673 | (byte-compile-warn "malformed interactive spec: %s" | ||
| 1674 | (prin1-to-string int)))))) | ||
| 1668 | (let ((compiled (byte-compile-top-level (cons 'progn body) nil 'lambda))) | 1675 | (let ((compiled (byte-compile-top-level (cons 'progn body) nil 'lambda))) |
| 1669 | (if (and (eq 'byte-code (car-safe compiled)) | 1676 | (if (and (eq 'byte-code (car-safe compiled)) |
| 1670 | (byte-compile-version-cond | 1677 | (byte-compile-version-cond |