Subject: bug#77253: 30.1.50; Support RET choosing the selected completion without rebinding arrow keys, [PATCH] Make RET in minibuffer choose selected completion

From: Juri Linkov <[email-masked]>
Date: Thu, 24 Jul 2025 20:10:41 +0300

>> @@ -3235,6 +3241,7 @@ minibuffer-local-completion-map
>>    ;; another binding for it.
>>    ;; "M-TAB"  #'minibuffer-force-complete
>>    "SPC"       #'minibuffer-complete-word
>> +  "RET"       #'minibuffer-choose-completion-just-exit
>>    "?"         #'minibuffer-completion-help
>>    "<prior>"   #'switch-to-completions
>>    "M-v"       #'switch-to-completions
>> @@ -3246,7 +3253,7 @@ minibuffer-local-completion-map
>>  (defvar-keymap minibuffer-local-must-match-map
>>    :doc "Local keymap for minibuffer input with completion, for exact match."
>>    :parent minibuffer-local-completion-map
>> -  "RET" #'minibuffer-complete-and-exit
>> +  "RET" #'minibuffer-choose-completion-or-exit
>>    "C-j" #'minibuffer-complete-and-exit)
>
> Can we please not to change commands bound to keys?  That will make
> the changes much more backward-compatible.

First we discussed adding a new option like 'minibuffer-visible-completions'
that affects only RET, not arrow keys.  But now we arrived at a patch that
rebinds the default keybindings.  So I'm not sure how this would affect
the current default behavior.  IIUC, previously after selecting a candidate
with M-down the user needed to type M-RET, and after applying the patch
just RET will be sufficient?  But it was already possible to use RET
with 'minibuffer-completion-auto-choose' equal to t when M-down inserts
the completion candidate to the minibuffer.