changeset 81723:4e74ad9f4345

(eval-last-sexp): Avoid introducing any dynamic bindings around the evaluation of the expression.
author Andreas Schwab <schwab@suse.de>
date Fri, 06 Jul 2007 17:26:29 +0000
parents 8215e5c92612
children e98ada190411
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Fri Jul 06 16:14:39 2007 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Fri Jul 06 17:26:29 2007 +0000
@@ -628,13 +628,13 @@
   (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.