]> git.eshelyaron.com Git - emacs.git/commit
Complete shorthands to longhands for symbol-completing tables
authorJoão Távora <joaotavora@gmail.com>
Wed, 6 Oct 2021 10:30:29 +0000 (11:30 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 10 Oct 2021 13:33:23 +0000 (14:33 +0100)
commit4c7e74c386219e9b20cb52176c88260709e7741d
treecb6fb57a4e48409a345b83d102c8ad13460376c3
parentc2513c5d0d51159a87d7718be5cd043b6d1a7e9a
Complete shorthands to longhands for symbol-completing tables

Shorthands aren't symbols, they're text forms that 'read' into
symbols.  As such, shorthands aren't candidates in these tables of
symbols.  But in some situations, if no other candidates match the
pattern, we can e.g. complete "x-foo" to "xavier-foo" if the shorthand

  (("x-" . "xavier-"))

is set up in the buffer of origin.

bug#50959

* lisp/help-fns.el (help--symbol-completion-table): Report
`symbol-help' category.

* lisp/minibuffer.el (completion-styles-alist): New 'shorthand'
style.
(completion-category-defaults): Link 'symbol-help' category with
'shorthand' style.
(minibuffer--original-buffer): New variable.
(completing-read-default): Setup minibuffer--original-buffer.
(completion-shorthand-try-completion)
(completion-shorthand-all-completions): New helpers.
lisp/help-fns.el
lisp/minibuffer.el