aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2010-06-13 16:36:17 -0400
committerStefan Monnier <[email protected]>2010-06-13 16:36:17 -0400
commitb9598260f96ddc652cd82ab64bbe922ccfc48a29 (patch)
tree2a692a8471de07f2578ea481c99971585def8eda /lisp/emacs-lisp/lisp-mode.el
parenta6e8d97c1414230e577d375c27da78c858a5fa75 (diff)
New branch for lexbind, losing all history.
This initial patch is based on 2002-06-27T22:39:[email protected] of the original lexbind branch.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 02477baf74..1185f79806 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -701,7 +701,15 @@ If CHAR is not a character, return nil."
(defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
"Evaluate sexp before point; print value in minibuffer.
With argument, print output into current buffer."
- (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t)))
+ (let ((standard-output (if eval-last-sexp-arg-internal (current-buffer) t))
+ ;; preserve the current lexical environment
+ (internal-interpreter-environment internal-interpreter-environment))
+ ;; Setup the lexical environment if lexical-binding is enabled.
+ ;; Note that `internal-interpreter-environment' _can't_ be both
+ ;; assigned and let-bound above -- it's treated specially (and
+ ;; oddly) by the interpreter!
+ (when lexical-binding
+ (setq internal-interpreter-environment '(t)))
(eval-last-sexp-print-value (eval (preceding-sexp)))))