0.8.10.3:
[sbcl.git] / src / code / print.lisp
index 9682372..4981c77 100644 (file)
 ;;; READTABLE-CASE.
 (defun output-symbol-name (name stream &optional (maybe-quote t))
   (declare (type simple-string name))
-  (setup-printer-state)
-  (if (and maybe-quote (symbol-quotep name))
-      (output-quoted-symbol-name name stream)
-      (funcall *internal-symbol-output-fun* name stream)))
+  (let ((*readtable* (if *print-readably* *standard-readtable* *readtable*)))
+    (setup-printer-state)
+    (if (and maybe-quote (symbol-quotep name))
+       (output-quoted-symbol-name name stream)
+       (funcall *internal-symbol-output-fun* name stream))))
 \f
 ;;;; escaping symbols
 
 ;;; the character name or the character in the #\char format.
 (defun output-character (char stream)
   (if (or *print-escape* *print-readably*)
-      (let ((name (char-name char)))
+      (let ((graphicp (graphic-char-p char))
+           (name (char-name char)))
        (write-string "#\\" stream)
-       (if name
+       (if (and name (not graphicp))
            (quote-string name stream)
            (write-char char stream)))
       (write-char char stream)))