diff options
| author | Richard M. Stallman | 2004-08-16 22:44:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-08-16 22:44:11 +0000 |
| commit | 06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0 (patch) | |
| tree | 959a8e95966b799b5564b6d4d40b99c39b5f5422 | |
| parent | 693118160404cef460e0db29953176d67a8aa29a (diff) | |
| download | emacs-06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0.tar.gz emacs-06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0.zip | |
(eval-last-sexp): Don't cons a new symbol each time.
(eval-last-sexp-fake-value): New variable.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 4 |
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." | |||
| 555 | )))) | 555 | )))) |
| 556 | 556 | ||
| 557 | 557 | ||
| 558 | (defvar eval-last-sexp-fake-value (make-symbol "t")) | ||
| 559 | |||
| 558 | (defun eval-last-sexp (eval-last-sexp-arg-internal) | 560 | (defun eval-last-sexp (eval-last-sexp-arg-internal) |
| 559 | "Evaluate sexp before point; print value in minibuffer. | 561 | "Evaluate sexp before point; print value in minibuffer. |
| 560 | Interactively, with prefix argument, print output into current buffer." | 562 | Interactively, with prefix argument, print output into current buffer." |
| 561 | (interactive "P") | 563 | (interactive "P") |
| 562 | (if (null eval-expression-debug-on-error) | 564 | (if (null eval-expression-debug-on-error) |
| 563 | (eval-last-sexp-1 eval-last-sexp-arg-internal) | 565 | (eval-last-sexp-1 eval-last-sexp-arg-internal) |
| 564 | (let ((old-value (make-symbol "t")) new-value value) | 566 | (let ((old-value eval-last-sexp-fake-value) new-value value) |
| 565 | (let ((debug-on-error old-value)) | 567 | (let ((debug-on-error old-value)) |
| 566 | (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) | 568 | (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) |
| 567 | (setq new-value debug-on-error)) | 569 | (setq new-value debug-on-error)) |