]> git.eshelyaron.com Git - emacs.git/commit
Move most of the shorthand implementation to C code
authorJoão Távora <joaotavora@gmail.com>
Sat, 19 Sep 2020 21:16:38 +0000 (22:16 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 27 Sep 2021 00:07:11 +0000 (01:07 +0100)
commit71857d410635743d437ce1ee73dff69de50030d6
treefa5491b2f0c8106dfbc3efaa6e01d363871eefef
parent6237bad419a23fcbefb2c33728522b1bb52cb557
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.
lisp/international/mule.el
lisp/loadup.el
lisp/progmodes/elisp-mode.el
lisp/shorthand.el [deleted file]
src/lread.c
test/lisp/progmodes/elisp-mode-tests.el
test/lisp/progmodes/elisp-resources/simple-shorthand-test.el [new file with mode: 0644]
test/lisp/shorthand-tests.el [deleted file]