changeset 55829:fcd2e17daffa

(prin1-char): Catch errors from `string'. (eval-last-sexp-print-value): Print char equivalent regardless of standard-output value.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 May 2004 15:33:30 +0000
parents af9432138635
children 2fe67fa04b1a
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Sat May 29 15:23:42 2004 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Sat May 29 15:33:30 2004 +0000
@@ -470,7 +470,10 @@
 	  (cond
 	   ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
 	   ((eq c 127) "\\C-?")
-	   (t (string c)))))))
+	   (t
+	    (condition-case nil
+		(string c)
+	      (error nil))))))))
 
 (defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
   "Evaluate sexp before point; print value in minibuffer.
@@ -538,9 +541,8 @@
 	end)
     (prog1
 	(prin1 value)
-      (if (eq standard-output t)
-          (let ((str (eval-expression-print-format value)))
-            (if str (princ str))))
+      (let ((str (eval-expression-print-format value)))
+	(if str (princ str)))
       (setq end (point))
       (when (and (bufferp standard-output)
 		 (or (not (null print-length))