]> git.eshelyaron.com Git - emacs.git/commit
Don't escape "." in `prin1' when followed by a letter
authorSpencer Baugh <sbaugh@janestreet.com>
Tue, 4 Jun 2024 14:35:10 +0000 (10:35 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 29 Apr 2025 07:33:16 +0000 (09:33 +0200)
commite0dce7dc5b0429c9ab28f8d3c6885cf27ccd0e70
tree1fd6ed3f3403d6fdb0cf7c969ad35bfaed2ce174
parent617c9b107ff809bbb78c2a0c3b9320cda5eee335
Don't escape "." in `prin1' when followed by a letter

Among other users, let-alist widely uses symbols which start with a ".".
Make those symbols print more nicely by tweaking the escaping rules in
print_object to not escape a leading "." followed by a letter.  This is
a conservative change to avoid constraining future lexer changes.

This is a followup to 637dde4aba921435f78d0de769ad74c4f3230aa6, which
removed some unnecessary escaping of "." and "?" when printing symbols
in prin1.  (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 "?")

* src/print.c (print_object): Don't escape "." as the first
character in a symbol if followed by a letter. (bug#77656).
* test/src/print-tests.el (test-dots): Update for new behavior.

(cherry picked from commit 21e340494a5a832453999d3853839db5d8a4d865)
src/print.c
test/src/print-tests.el