]> git.eshelyaron.com Git - emacs.git/commit
Support narrowing (restricting) minibuffer completions
authorEshel Yaron <me@eshelyaron.com>
Thu, 21 Dec 2023 19:43:59 +0000 (20:43 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 19 Jan 2024 10:05:42 +0000 (11:05 +0100)
commitab27da21e6ac5602dc10ea039c0c7e82c746f743
tree477cf3ebd04cadba9c3bfac3906739ef93cea6c4
parentdd2caf1a7634ea6fd8aebbdc45ea4caf22d786cd
Support narrowing (restricting) minibuffer completions

Add new minibuffer commands for restricting the list of possible
completion candidates.

* lisp/minibuffer.el (completion-fail-discreetly): Fix docstring typo.
(minibuffer-narrow-completions-function): New variable.
(completion--fail, minibuffer-narrow-completions-p)
(minibuffer-narrow-completions-by-regexp)
(minibuffer--completion-predicate-description)
(minibuffer--add-completions-predicate): New functions.
(minibuffer-narrow-completions-to-current)
(minibuffer-narrow-completions)
(minibuffer-widen-completions): New commands.
(minibuffer-narrow-completions-map): New prefix keymap.  Bind new
commands to 'n', 'm' and 'w', respectively.
(minibuffer-local-completion-map): Bind new prefix keymap to 'C-x n'.
(completions-header-format, completion--do-completion)
(display-completion-list, minibuffer-completion-help): Update.

* lisp/simple.el (completions-narrow-mode): New minor mode.
(completion-setup-function): Enable it in *Completions* buffer when
there are completions restrictions in place.

* lisp/menu-bar.el (minibuffer-local-completion-map): Add completions
narrowing commands to "Minibuf" menu.

* lisp/help-fns.el (help--symbol-completion-table): Provide bespoke
'narrow-completions-function' that keeps only symbols with a given
symbol property.

* doc/emacs/emacs.texi (Top)
* doc/emacs/mini.texi (Completion): Update menu.
(Narrow Completions): New subsection.
(Completion Commands, Completion Styles)
(Completion Options)
* doc/emacs/help.texi (Name Help)
* doc/lispref/minibuf.texi (Completion Commands):
(Programmed Completion): Update documenation.

* etc/NEWS: Announce new feature.
doc/emacs/emacs.texi
doc/emacs/help.texi
doc/emacs/mini.texi
doc/lispref/minibuf.texi
etc/NEWS
lisp/help-fns.el
lisp/menu-bar.el
lisp/minibuffer.el
lisp/simple.el