]> git.eshelyaron.com Git - emacs.git/commit
Consider shorthands in Elisp's elisp-completion-at-point
authorJoão Távora <joaotavora@gmail.com>
Tue, 21 Sep 2021 21:20:17 +0000 (22:20 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 27 Sep 2021 00:07:11 +0000 (01:07 +0100)
commit90cbf0cb8d9959b94ba09f1faa0dcb50c8dbddbd
treee76f8770ee587a6cfc0f77bd20ec2ce2c199eca1
parent68d73eb154c745cbba7b3fd6a0a0a087d7c157da
Consider shorthands in Elisp's elisp-completion-at-point

Instead of referencing obarray directly, that function has to consider
a collection of completions which includes the shorthand versions of
some of the symbols.  That collection changes from buffer to buffer,
depending on the choice of elisp-shorthands.

To make this process efficient, and avoid needless recalculation of
the above collection, a new obarray-specific cache was invented.  The
Elisp variable obarray-cache is immediately nullified if something
touches the obarray.

* lisp/progmodes/elisp-mode.el : New helper.
(elisp-completion-at-point): Use new helpers.
(elisp--completion-local-symbols)
(elisp--fboundp-considering-shorthands)
(elisp--bboundp-considering-shorthands): New helpers

* src/lread.c (intern_driver): Nullify Qobarray_cache.
(syms_of_lread): Add Qobarray_cache.

* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-completion-at-point): New test.

* test/lisp/progmodes/elisp-resources/simple-shorthand-test.el
(f-test-complete-me): New fixture.
lisp/progmodes/elisp-mode.el
src/lread.c
test/lisp/progmodes/elisp-mode-tests.el
test/lisp/progmodes/elisp-resources/simple-shorthand-test.el