From 06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:44:11 +0000 Subject: [PATCH] (eval-last-sexp): Don't cons a new symbol each time. (eval-last-sexp-fake-value): New variable. --- lisp/emacs-lisp/lisp-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) -- 2.39.2