From: Gerd Möllmann Date: Fri, 21 Oct 2022 11:23:06 +0000 (+0200) Subject: print-test fixes X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=671078f30f189d061e537cd5fda5a9e64fd487bf;p=emacs.git print-test fixes * src/print.c (print_symbol): Fix printing of empty symbol names to be compatible. --- diff --git a/src/print.c b/src/print.c index af23aade6f7..3463d8ec5de 100644 --- a/src/print.c +++ b/src/print.c @@ -2226,11 +2226,6 @@ print_symbol (Lisp_Object symbol, Lisp_Object printcharfun, { if (!NILP (Vprint_gensym)) print_c_string ("#:", printcharfun); - else if (*SDATA (name) == 0) - { - print_c_string ("##", printcharfun); - return; - } } else { @@ -2250,7 +2245,13 @@ print_symbol (Lisp_Object symbol, Lisp_Object printcharfun, } } - print_symbol_name (name, printcharfun, escape); + /* In Common Lisp, this would be ||, but we don't have multi-escapes + in Emacs, and we will probably never have them because '| has + been a valid symbol, and it is used, for instance in rx.el. */ + if (SBYTES (name) == 0) + print_c_string ("##", printcharfun); + else + print_symbol_name (name, printcharfun, escape); }