]> git.eshelyaron.com Git - emacs.git/commitdiff
print-tests failure for esoteric symbols
authorGerd Möllmann <gerd@gnu.org>
Fri, 21 Oct 2022 11:32:55 +0000 (13:32 +0200)
committerGerd Möllmann <gerd@gnu.org>
Fri, 21 Oct 2022 11:32:55 +0000 (13:32 +0200)
* src/print.c (print_symbol_name): Fix printing of symbols that
look like numbers.

src/print.c

index 3463d8ec5dea10645c360fe833ea534051cebef1..f909c3c8cc262fd386b3d2956a46e510b83d882d 100644 (file)
@@ -2198,13 +2198,17 @@ static void
 print_symbol_name (Lisp_Object name, Lisp_Object printcharfun,
                   bool escape)
 {
-  const bool like_number_p = looks_like_number_p (name);
+  bool like_number_p = looks_like_number_p (name);
   for (ptrdiff_t ibyte = 0, ichar = 0; ibyte < SBYTES (name);)
     {
       const int c = fetch_string_char_advance (name, &ichar, &ibyte);
       maybe_quit ();
-      if (escape && (like_number_p || must_escape_p (c, ichar)))
-       printchar ('\\', printcharfun);
+      if (escape)
+       if (like_number_p || must_escape_p (c, ichar))
+         {
+           printchar ('\\', printcharfun);
+           like_number_p = false;
+         }
       printchar (c, printcharfun);
     }
 }