accept M RET on all input with vertico#694
Conversation
3491ded to
3c94a82
Compare
|
Interesting you decided to work on this now. Certainly sounds useful.
|
| ;; If in the minibuffer and reading an argument with vertico | ||
| ;; run the vertico command on {M-RET} which accepts the first | ||
| ;; line of minibuffer input, rather than any candidate. | ||
| ((and hargs:reading-type |
There was a problem hiding this comment.
I’m fine with everything here except the first line. We’ll have to think about how this could impact other things, i.e. the above line was put there for a reason.
There was a problem hiding this comment.
Can hargs:reading-type and vertico-mode be non-nil at the same time? If I remember correct they can not so the check on hargs:reading-type effectively ignores vertico reading the input.
Anyway I'm far from sure here. Could be a case where vertico is prompting for input where we want the action key to kick in instead? So I added a test case for hkey-alist so we can verify that different scenarios are handled properly. If we can identify the case we can add tests for that so we can verify that both scenarios works as expected.
I did not. It was an old branch. But I got bitten again yesterday being stuck at a prompt without getting out (without doing the suggested workaround) so decided it was time to share it. |
| ;; If in the minibuffer and reading an argument with vertico | ||
| ;; run the vertico command on {M-RET} which accepts the first | ||
| ;; line of minibuffer input, rather than any candidate. | ||
| ((and hargs:reading-type |
There was a problem hiding this comment.
Why don't we just add an appropriate check for whether the vertico-mode variable is true or not and dispatch as needed (defer to vertico) rather than touching the hargs:reading-type clause?
rswgnu
left a comment
There was a problem hiding this comment.
I have manually integrated the needed code from here and will push it to the rsw branch today. We can close this PR.
What
Why
Vertico uses the keybinding M-RET for vertico-exit-input for exiting
the minibuffer using the current minibuffer input. For example when
creating a new file where there is no candidate to select. An
alternative is to use the uparrow to go to the input prompt and use
RET there. That fails however for the case when there is no input and
the empty input is used to terminate. The user gets stuck in this case
and only way out is to use M-x vertico-exit-input or similar tricks.
This PR takes the approach to always respect vertico's view when
reading an argument.
The PR is also a start for verifying that the hkey-alist will call the
expected actions from a given state and not something else.