mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-28 10:56:36 +00:00
(eval-last-sexp): Don't cons a new symbol each time.
(eval-last-sexp-fake-value): New variable.
This commit is contained in:
parent
6931181604
commit
06f308a7e2
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user