changeset 52208:4a7f0e1b3678

(eval-last-sexp-print-value): New subroutine, broken out of eval-last-sexp-1. (eval-last-sexp-1): Use eval-last-sexp-print-value.
author Richard M. Stallman <rms@gnu.org>
date Sun, 17 Aug 2003 00:18:15 +0000
parents c26f56efcd5d
children abb0fb200345
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 24 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Sun Aug 17 00:17:16 2003 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Sun Aug 17 00:18:15 2003 +0000
@@ -512,27 +512,30 @@
 						      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)