]> git.eshelyaron.com Git - emacs.git/commit
Improve 'completing-read-multiple'
authorEshel Yaron <me@eshelyaron.com>
Wed, 3 Jan 2024 13:13:17 +0000 (14:13 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 3 Jan 2024 13:13:17 +0000 (14:13 +0100)
commitb00b378ecf2a9abf39d4314374e21a031be7f1e1
treef9a0cdb0313a77b053fd6e567341e51c8a8e15fd
parent74f18ee9eb9e2b221d5a2dbaca05f95fa035d4d9
Improve 'completing-read-multiple'

This simplifies the implementation of crm.el, making it a thin wrapper
around 'completing-read'.  This obviates the need for bespoke commands
such as 'crm-complete' and 'crm-completion-help', and allows us to
remove incorrect code in minibuffer.el that tried to accommodate for
both 'completing-read' and 'completing-read-multiple'.
'crm-complete-and-exit' is still required to get the right behavior.
While we're at it, also add a command for changing 'crm-separator'
interactively, and an indication of 'completing-read-multiple' in
the *Completions* buffer mode line.

* lisp/emacs-lisp/crm.el (crm-local-completion-map)
(crm-local-must-match-map): No longer used, replace with obsolete
aliases of 'completing-read-multiple-mode-map' in favor of third party
code that uses these variables.
(crm-completion-table, crm--current-element)
(crm--completion-command, crm-completion-help)
(crm-complete, crm-complete-word)
(crm--choose-completion-string): No longer used, remove.
(crm-complete-and-exit): Update.
(read-string-matching-regexp): New local variable.
(read-string-matching-try-exit)
(crm-change-separator): New commands.
(read-string-matching-mode-map)
(completing-read-multiple-mode-map): New keymap variables.
(read-string-matching-mode)
(completing-read-multiple-mode)
(completions-multi-mode): New minor modes.
(read-string-matching, crm-completion-setup): New functions.
(completing-read-multiple): Update.

* lisp/minibuffer.el (minibuffer-sort-completions)
(minibuffer-narrow-buffer-completions)
(minibuffer--add-completions-predicate)
(minibuffer-narrow-completions-to-current)
(minibuffer-widen-completions)
(completions-auto-update): Delegate completion boundaries calculation.

* doc/lispref/minibuf.texi (Minibuffer Completion): Document c-r-m.
* etc/NEWS: Announce 'crm-change-separator'.
doc/lispref/minibuf.texi
etc/NEWS
lisp/emacs-lisp/crm.el
lisp/minibuffer.el