From 671078f30f189d061e537cd5fda5a9e64fd487bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerd=20M=C3=B6llmann?= Date: Fri, 21 Oct 2022 13:23:06 +0200 Subject: [PATCH] print-test fixes * src/print.c (print_symbol): Fix printing of empty symbol names to be compatible. --- src/print.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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); } -- 2.39.2