summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2007-07-06 17:29:20 +0000
committerAndreas Schwab <schwab@suse.de>2007-07-06 17:29:20 +0000
commit78ddf12f9733f9caba6d6aa40558c1967f23aabe (patch)
tree5934b76e6cdd5132cda8c5b25b065662e3bb5f23 /lisp/emacs-lisp
parent3ada466d17d737ccbdef16f89214156d54325f61 (diff)
downloademacs-78ddf12f9733f9caba6d6aa40558c1967f23aabe.tar.gz
emacs-78ddf12f9733f9caba6d6aa40558c1967f23aabe.tar.bz2
emacs-78ddf12f9733f9caba6d6aa40558c1967f23aabe.zip
(eval-last-sexp): Avoid introducing any
dynamic bindings around the evaluation of the expression.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 164756dfdc3..73379a816d7 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -628,13 +628,13 @@ this command arranges for all errors to enter the debugger."
(interactive "P")
(if (null eval-expression-debug-on-error)
(eval-last-sexp-1 eval-last-sexp-arg-internal)
- (let ((old-value eval-last-sexp-fake-value) new-value value)
- (let ((debug-on-error old-value))
- (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal))
- (setq new-value debug-on-error))
- (unless (eq old-value new-value)
- (setq debug-on-error new-value))
- value)))
+ (let ((value
+ (let ((debug-on-error eval-last-sexp-fake-value))
+ (cons (eval-last-sexp-1 eval-last-sexp-arg-internal)
+ debug-on-error))))
+ (unless (eq (cdr value) eval-last-sexp-fake-value)
+ (setq debug-on-error (cdr value)))
+ (car value))))
(defun eval-defun-1 (form)
"Treat some expressions specially.