summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-08-16 22:44:11 +0000
committerRichard M. Stallman <rms@gnu.org>2004-08-16 22:44:11 +0000
commit06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0 (patch)
tree959a8e95966b799b5564b6d4d40b99c39b5f5422 /lisp/emacs-lisp/lisp-mode.el
parent693118160404cef460e0db29953176d67a8aa29a (diff)
downloademacs-06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0.tar.gz
emacs-06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0.tar.bz2
emacs-06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0.zip
(eval-last-sexp): Don't cons a new symbol each time.
(eval-last-sexp-fake-value): New variable.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index d471ad79538..df05555ae7b 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -555,13 +555,15 @@ With argument, print output into current buffer."
))))
+(defvar eval-last-sexp-fake-value (make-symbol "t"))
+
(defun eval-last-sexp (eval-last-sexp-arg-internal)
"Evaluate sexp before point; print value in minibuffer.
Interactively, with prefix argument, print output into current buffer."
(interactive "P")
(if (null eval-expression-debug-on-error)
(eval-last-sexp-1 eval-last-sexp-arg-internal)
- (let ((old-value (make-symbol "t")) new-value value)
+ (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))