Don't remap RET to 'icomplete-ret' in 'icomplete-mode' (bug#62108)

* lisp/icomplete.el (icomplete-show-matches-on-no-input): Fix docstring.
(icomplete-minibuffer-map): Don't remap 'minibuffer-complete-and-exit' (RET)
to 'icomplete-ret'.
(icomplete-ret): Improve docstring.
This commit is contained in:
Juri Linkov 2026-02-11 09:50:34 +02:00
parent 79fda66327
commit f13ab20f04
2 changed files with 21 additions and 6 deletions

View file

@ -3092,6 +3092,18 @@ Meant to be given a global binding convenient to the user. Example:
** Icomplete
*** Change in meaning of 'icomplete-show-matches-on-no-input' (again).
Previously, choosing a different completion with commands like 'C-.'
and then hitting 'RET' would choose the completion under point
when 'icomplete-show-matches-on-no-input' is customized to non-nil.
Doing this will now choose the default value instead. There is
still 'C-j' to choose the completion under point in 'icomplete-mode'.
You can get back the old behavior of the 'RET' key with
(keymap-set
icomplete-minibuffer-map "<remap> <minibuffer-complete-and-exit>"
#'icomplete-ret)
*** New user options for 'icomplete-vertical-mode'.
New user options have been added to enhance 'icomplete-vertical-mode':

View file

@ -80,10 +80,10 @@ selection process starts again from the user's $HOME."
"When non-nil, show completions when first prompting for input.
This means to show completions even when the current minibuffer contents
is the same as was the initial input after minibuffer activation.
This also means that if you traverse the list of completions with
commands like \\`C-.' and just hit \\`RET' without typing any
This also means that if you just hit \\`C-j' without typing any
characters, the match under point will be chosen instead of the
default."
default. But \\`RET' will still choose the default value exactly
as when this option is nil."
:type 'boolean
:version "24.4")
@ -243,11 +243,14 @@ Used to implement the option `icomplete-show-matches-on-no-input'.")
"C-M-i" #'icomplete-force-complete
"C-j" #'icomplete-force-complete-and-exit
"C-." #'icomplete-forward-completions
"C-," #'icomplete-backward-completions
"<remap> <minibuffer-complete-and-exit>" #'icomplete-ret)
"C-," #'icomplete-backward-completions)
(defun icomplete-ret ()
"Exit minibuffer for icomplete."
"Exit minibuffer for icomplete.
You can bind this command to \\`RET' in `icomplete-minibuffer-map',
or remap from `minibuffer-complete-and-exit', to be able to choose
the completion under point with \\`RET' instead of choosing the
default value."
(interactive)
(if (and icomplete-show-matches-on-no-input
(car completion-all-sorted-completions)