mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Update 'crm-complete-and-exit' from 'minibuffer-complete-and-exit'
* lisp/emacs-lisp/crm.el (crm-complete-and-exit): Add new arg 'no-exit'. Call 'minibuffer-choose-completion' when 'completion--selected-candidate' returns non-nil (bug#80821).
This commit is contained in:
parent
126eab79b0
commit
d88e73d047
1 changed files with 10 additions and 3 deletions
|
|
@ -192,14 +192,21 @@ Like `minibuffer-complete-word' but for `completing-read-multiple'."
|
|||
(crm--completion-command beg end
|
||||
(completion-in-region--single-word beg end)))
|
||||
|
||||
(defun crm-complete-and-exit ()
|
||||
(defun crm-complete-and-exit (&optional no-exit)
|
||||
"If all of the minibuffer elements are valid completions then exit.
|
||||
All elements in the minibuffer must match. If there is a mismatch, move point
|
||||
to the location of mismatch and do not exit.
|
||||
|
||||
If a completion candidate is selected in the *Completions* buffer, it
|
||||
will be inserted in the minibuffer first. If NO-EXIT is non-nil, don't
|
||||
actually exit the minibuffer, just insert the selected completion if
|
||||
any.
|
||||
|
||||
This function is modeled after `minibuffer-complete-and-exit'."
|
||||
(interactive)
|
||||
(let ((doexit t))
|
||||
(interactive "P")
|
||||
(when (completion--selected-candidate)
|
||||
(minibuffer-choose-completion t t))
|
||||
(let ((doexit (not no-exit)))
|
||||
(goto-char (minibuffer-prompt-end))
|
||||
(while
|
||||
(and doexit
|
||||
|
|
|
|||
Loading…
Reference in a new issue