summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2020-09-19 22:16:38 +0100
committerJoão Távora <joaotavora@gmail.com>2021-09-27 01:07:11 +0100
commit71857d410635743d437ce1ee73dff69de50030d6 (patch)
treefa5491b2f0c8106dfbc3efaa6e01d363871eefef /src/syntax.c
parent6237bad419a23fcbefb2c33728522b1bb52cb557 (diff)
downloademacs-71857d410635743d437ce1ee73dff69de50030d6.tar.gz
emacs-71857d410635743d437ce1ee73dff69de50030d6.tar.bz2
emacs-71857d410635743d437ce1ee73dff69de50030d6.zip
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 'src/syntax.c')
0 files changed, 0 insertions, 0 deletions