diff options
| author | Richard M. Stallman | 2003-08-17 00:18:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-08-17 00:18:15 +0000 |
| commit | 606f5e7543edb11fe55b8c1c4e82bf006b26db6d (patch) | |
| tree | 20984bee5e4497204ad242ac8795f585d4a323f8 | |
| parent | a8c78057ff55ebfde9531c2d70eaf575e1009227 (diff) | |
| download | emacs-606f5e7543edb11fe55b8c1c4e82bf006b26db6d.tar.gz 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.
| -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." | |||
| 512 | expr | 512 | expr |
| 513 | 'args))))) | 513 | 'args))))) |
| 514 | expr))))))) | 514 | expr))))))) |
| 515 | (let ((unabbreviated (let ((print-length nil) (print-level nil)) | 515 | (eval-last-sexp-print-value value)))) |
| 516 | (prin1-to-string value))) | 516 | |
| 517 | (print-length eval-expression-print-length) | 517 | (defun eval-last-sexp-print-value (value) |
| 518 | (print-level eval-expression-print-level) | 518 | (let ((unabbreviated (let ((print-length nil) (print-level nil)) |
| 519 | (char-string (prin1-char value)) | 519 | (prin1-to-string value))) |
| 520 | (beg (point)) | 520 | (print-length eval-expression-print-length) |
| 521 | end) | 521 | (print-level eval-expression-print-level) |
| 522 | (prog1 | 522 | (char-string (prin1-char value)) |
| 523 | (prin1 value) | 523 | (beg (point)) |
| 524 | (if (and (eq standard-output t) char-string) | 524 | end) |
| 525 | (princ (concat " = " char-string))) | 525 | (prog1 |
| 526 | (setq end (point)) | 526 | (prin1 value) |
| 527 | (when (and (bufferp standard-output) | 527 | (if (and (eq standard-output t) char-string) |
| 528 | (or (not (null print-length)) | 528 | (princ (concat " = " char-string))) |
| 529 | (not (null print-level))) | 529 | (setq end (point)) |
| 530 | (not (string= unabbreviated | 530 | (when (and (bufferp standard-output) |
| 531 | (buffer-substring-no-properties beg end)))) | 531 | (or (not (null print-length)) |
| 532 | (last-sexp-setup-props beg end value | 532 | (not (null print-level))) |
| 533 | unabbreviated | 533 | (not (string= unabbreviated |
| 534 | (buffer-substring-no-properties beg end)) | 534 | (buffer-substring-no-properties beg end)))) |
| 535 | )))))) | 535 | (last-sexp-setup-props beg end value |
| 536 | unabbreviated | ||
| 537 | (buffer-substring-no-properties beg end)) | ||
| 538 | )))) | ||
| 536 | 539 | ||
| 537 | 540 | ||
| 538 | (defun eval-last-sexp (eval-last-sexp-arg-internal) | 541 | (defun eval-last-sexp (eval-last-sexp-arg-internal) |