From 984b18eef61facadfef0697ee6dadc598f04d63a Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 14 Jun 2009 23:15:29 +0200 Subject: [PATCH] When using ~:c, graphic characters are not printed by name --- src/lsp/format.lsp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp index bfa41f07e..85b8b144a 100644 --- a/src/lsp/format.lsp +++ b/src/lsp/format.lsp @@ -953,19 +953,17 @@ (prin1 (next-arg) stream) (write-char (next-arg) stream))))) -(defun format-print-named-character (char stream) - #-formatter +;;; "printing" as defined in the ANSI CL glossary, which is normative. +(defun char-printing-p (char) (declare (si::c-local)) - (let* ((name (char-name char))) - (cond (name - (write-string name stream)) - #-ecl - ((<= 0 (char-code char) 31) - ;; Print control characters as "^" - (write-char #\^ stream) - (write-char (code-char (+ 64 (char-code char))) stream)) - (t - (write-char char stream))))) + (and (not (eql char #\Space)) + (graphic-char-p char))) + +(defun format-print-named-character (char stream) + (cond ((not (char-printing-p char)) + (write-string (string-capitalize (char-name char)) stream)) + (t + (write-char char stream)))) (def-format-directive #\W (colonp atsignp params) (check-output-layout-mode 1)