Subject: bug#77656: [PATCH] Don't escape "." in `prin1' unless followed by "?" or nothing

From: Stefan Kangas <[email-masked]>
Date: Sat, 12 Apr 2025 08:33:58 -0500

Eli Zaretskii <[email-masked]> writes:

>> Cc: Lars Ingebrigtsen <[email-masked]>
>> Date: Tue, 08 Apr 2025 17:41:56 -0400
>> From:  Spencer Baugh via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>>
>> This is a followup to 637dde4aba921435f78d0de769ad74c4f3230aa6, which
>> removed some unnecessary escaping of "." and "?" when printing symbols
>> in prin1.
>>
>> This change removes more unnecessary escaping of "."; "." only
>> needs to be escaped when it's the entire symbol or if it's
>> followed by a "?".
>>
>> (Actually, if we always escaped "?" (which was the case before
>> 637dde4aba92) then "." only ever needs to be escaped when
>> string_to_number returns non-nil.  So 637dde4aba92 could have
>> just dropped the escaping of "." with no other changes, if it
>> didn't also remove escaping of "?")
>
> Any objections or comments, anyone?

I guess the difference is this chunk:

-  (should (equal (prin1-to-string '.foo) "\\.foo"))
-  (should (equal (prin1-to-string '.foo.) "\\.foo."))
+  (should (equal (prin1-to-string '.foo) ".foo"))
+  (should (equal (prin1-to-string '.foo.) ".foo."))

No objections from me.