From 4289ea136de4876b5dfc20d83b5a2556d1b5d8e6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 3 Feb 2018 20:39:48 -0800 Subject: [PATCH 4/4] Escape ? only at start of symbol * src/print.c (print_object): Do it. --- etc/NEWS | 4 ++++ src/print.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2a46002..c435136 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -94,6 +94,10 @@ set of characters that do not need escaping. For example, (print the reader that the "і" is not the usual U+0069 LATIN SMALL LETTER I, but is instead U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I. +** 'print' etc. no longer escape non-initial '?' in symbols. +For example, the symbol 'list?' is now printed as-is. Initial '?' +is still escaped, e.g., (print (intern "?x")) still outputs "\?x". + * Editing Changes in Emacs 27.1 diff --git a/src/print.c b/src/print.c index 7eca36a..dfd6c50 100644 --- a/src/print.c +++ b/src/print.c @@ -1938,7 +1938,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) confusing = (end == p); } else - confusing = false; + confusing = *p == '?'; if (! NILP (Vprint_gensym) && !SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (obj)) @@ -1969,7 +1969,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) case '*': case '-': case '+': case '/': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - case ':': case '<': case '=': case '>': case '@': + case ':': case '<': case '=': case '>': case '?': case '@': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': -- 2.7.4