]> git.eshelyaron.com Git - emacs.git/commit
Use #N# syntax for repeated symbols in dumped.elc.
authorKen Raeburn <raeburn@raeburn.org>
Sat, 31 Dec 2016 00:44:27 +0000 (19:44 -0500)
committerKen Raeburn <raeburn@raeburn.org>
Sat, 22 Jul 2017 08:36:20 +0000 (04:36 -0400)
commit19efb25e52a018f20fe083ed887fe9105642a46a
tree03aff9f4186dccfee8a1454e9a9a3535564f6f09
parent1184a17f61549a5279ece2080cd12192cf8c4f66
Use #N# syntax for repeated symbols in dumped.elc.

Parsing symbol names involves processing for possible multibyte
characters and comparisons against other symbol-name strings in the
obarray.  The #N# syntax is simpler, uses an automatically resized
hash table keyed by integers, and is in most cases shorter, so reading
can be a little faster.

When doing this we have to avoid the special "," syntax because we
would wind up printing "#1=,foo" which reads back as setting #1# to
,foo when we really wanted to set #1# to just the comma symbol.

* src/print.c (syms_of_print): Define new Lisp variable
print-symbols-as-references.
(PRINT_CIRCLE_CANDIDATE_P): If it's set, accept interned symbols.
(print_preprocess): Update comment.
(print_object): When printing "," or related symbols with special
syntax, don't use print_object on the special symbol itself.
* lisp/loadup.el: Bind print-symbols-as-references to t while creating
the dumped.elc file.
lisp/loadup.el
src/print.c