[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 031af49 4/7: Fix byte-compile of interactive closur
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master 031af49 4/7: Fix byte-compile of interactive closures |
Date: |
Sat, 6 Aug 2016 20:16:33 +0000 (UTC) |
branch: master
commit 031af49e74195ed1645b53dca741fff8a8411a08
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Fix byte-compile of interactive closures
* lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Put
bindings after docstring and `interactive' form, if any (Bug #24122).
---
lisp/emacs-lisp/bytecomp.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index dc7574e..175690a 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2582,7 +2582,13 @@ FUN should be either a `lambda' value or a `closure'
value."
(pcase-let* (((or (and `(lambda ,args . ,body) (let env nil))
`(closure ,env ,args . ,body))
fun)
+ (preamble nil)
(renv ()))
+ ;; Split docstring and `interactive' form from body.
+ (when (stringp (car body))
+ (push (pop body) preamble))
+ (when (eq (car-safe (car body)) 'interactive)
+ (push (pop body) preamble))
;; Turn the function's closed vars (if any) into local let bindings.
(dolist (binding env)
(cond
@@ -2595,8 +2601,8 @@ FUN should be either a `lambda' value or a `closure'
value."
((eq binding t))
(t (push `(defvar ,binding) body))))
(if (null renv)
- `(lambda ,args ,@body)
- `(lambda ,args (let ,(nreverse renv) ,@body)))))
+ `(lambda ,args ,@preamble ,@body)
+ `(lambda ,args ,@preamble (let ,(nreverse renv) ,@body)))))
;;;###autoload
(defun byte-compile (form)
- [Emacs-diffs] master updated (b593ea1 -> 37cef5f), Noam Postavsky, 2016/08/06
- [Emacs-diffs] master 4dec928 2/7: Fix quoted lambda warning from lexical-let, Noam Postavsky, 2016/08/06
- [Emacs-diffs] master a90d5e6 3/7: Error if --eval arg has text beyond 1 expression, Noam Postavsky, 2016/08/06
- [Emacs-diffs] master ff40055 1/7: Make emerge always use shell-quote-argument, Noam Postavsky, 2016/08/06
- [Emacs-diffs] master 031af49 4/7: Fix byte-compile of interactive closures,
Noam Postavsky <=
- [Emacs-diffs] master 37cef5f 7/7: Make sh-mode always use p-s-lookup-properties, Noam Postavsky, 2016/08/06
- [Emacs-diffs] master 9ae89c2 5/7: Don't delete selection after indent-rigidly, Noam Postavsky, 2016/08/06
- [Emacs-diffs] master 0095837 6/7: Fix cl-assert with atomp FORM, non-nil SHOW-ARGS, Noam Postavsky, 2016/08/06