diff options
author | João Távora <joaotavora@gmail.com> | 2020-09-19 22:16:38 +0100 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2021-09-27 01:07:11 +0100 |
commit | 71857d410635743d437ce1ee73dff69de50030d6 (patch) | |
tree | fa5491b2f0c8106dfbc3efaa6e01d363871eefef /lisp/loadup.el | |
parent | 6237bad419a23fcbefb2c33728522b1bb52cb557 (diff) | |
download | emacs-71857d410635743d437ce1ee73dff69de50030d6.tar.gz |
Move most of the shorthand implementation to C code
It passes the tests designed for the previous Elisp implementation.
Likely, this isn't the final form of the implementation. For one, the
reader is much slower and allocates a Lisp string for every atom read,
regardless if its already interned or not. This has the potential to
be catastrophic in terms of GC.
Also rename the main variable to elisp-shorthands, from the
repetitive shorthand-shorthands.
For some reason, I had to put 'hack-elisp-shorthands' and
'load-with-shorthands-and-code-conversion', the new source-file
loading functions, in lisp/international/mule.el.
Otherwise, lisp/loadup.el wouldn't see them, for some reason that I
didn't investigate. This should probably be fixed.
* lisp/shorthand.el: Remove.
* test/lisp/shorthand-tests.el: Remove.
* src/lread.c:
(read1, Fintern, Fintern_soft, Funintern): Use
oblookup_considering_shorthand.
(oblookup_considering_shorthand): New helper.
(syms_of_lread): Declare elisp-shorthands.
* lisp/progmodes/elisp-mode.el (elisp-shorthands):
Put a safe-local-variable spec.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-read-buffer)
(elisp-shorthand-read-from-string)
(elisp-shorthand-byte-compile-a-file)
(elisp-shorthand-load-a-file): New tests.
* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el: New file
* lisp/loadup.el (load-source-file-function): Set to
load-with-shorthands-and-code-conversion.
* lisp/international/mule.el (hack-elisp-shorthands): Move here.
(load-with-shorthands-and-code-conversion): And here.
Diffstat (limited to 'lisp/loadup.el')
-rw-r--r-- | lisp/loadup.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/loadup.el b/lisp/loadup.el index fce17bf1137..942057c838f 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -151,7 +151,7 @@ ;; variable its advertised default value (it starts as nil, see ;; xdisp.c). (setq resize-mini-windows 'grow-only) -(setq load-source-file-function #'load-with-code-conversion) +(setq load-source-file-function #'load-with-shorthands-and-code-conversion) (load "files") ;; Load-time macro-expansion can only take effect after setting |