diff options
author | Richard M. Stallman <rms@gnu.org> | 2003-08-17 00:18:15 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2003-08-17 00:18:15 +0000 |
commit | 606f5e7543edb11fe55b8c1c4e82bf006b26db6d (patch) | |
tree | 20984bee5e4497204ad242ac8795f585d4a323f8 /lisp/emacs-lisp/lisp-mode.el | |
parent | a8c78057ff55ebfde9531c2d70eaf575e1009227 (diff) | |
download | emacs-606f5e7543edb11fe55b8c1c4e82bf006b26db6d.tar.gz emacs-606f5e7543edb11fe55b8c1c4e82bf006b26db6d.tar.bz2 emacs-606f5e7543edb11fe55b8c1c4e82bf006b26db6d.zip |
(eval-last-sexp-print-value): New subroutine, broken out of eval-last-sexp-1.
(eval-last-sexp-1): Use eval-last-sexp-print-value.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fa9661f54a5..dcb8848a7a4 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -512,27 +512,30 @@ With argument, print output into current buffer." expr 'args))))) expr))))))) - (let ((unabbreviated (let ((print-length nil) (print-level nil)) - (prin1-to-string value))) - (print-length eval-expression-print-length) - (print-level eval-expression-print-level) - (char-string (prin1-char value)) - (beg (point)) - end) - (prog1 - (prin1 value) - (if (and (eq standard-output t) char-string) - (princ (concat " = " char-string))) - (setq end (point)) - (when (and (bufferp standard-output) - (or (not (null print-length)) - (not (null print-level))) - (not (string= unabbreviated - (buffer-substring-no-properties beg end)))) - (last-sexp-setup-props beg end value - unabbreviated - (buffer-substring-no-properties beg end)) - )))))) + (eval-last-sexp-print-value value)))) + +(defun eval-last-sexp-print-value (value) + (let ((unabbreviated (let ((print-length nil) (print-level nil)) + (prin1-to-string value))) + (print-length eval-expression-print-length) + (print-level eval-expression-print-level) + (char-string (prin1-char value)) + (beg (point)) + end) + (prog1 + (prin1 value) + (if (and (eq standard-output t) char-string) + (princ (concat " = " char-string))) + (setq end (point)) + (when (and (bufferp standard-output) + (or (not (null print-length)) + (not (null print-level))) + (not (string= unabbreviated + (buffer-substring-no-properties beg end)))) + (last-sexp-setup-props beg end value + unabbreviated + (buffer-substring-no-properties beg end)) + )))) (defun eval-last-sexp (eval-last-sexp-arg-internal) |