emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: Other details about completion.


From: Juri Linkov
Subject: Re: [PATCH] Re: Other details about completion.
Date: Thu, 07 Apr 2022 20:57:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> So why do you think that switching to the Completions window
>> is required to select a completion candidate?
>
> Basically because we don't need that exact behavior in all the details
> as our use case is a bit different different (and simpler). we use
> single commands most if the time. I mean, most of the completion we need
> are for single commands/candidates/files because we can't do things
> like: "M-x find-file /my/file/path" in a single line. (there are some
> exceptions line shell-commands or so... but those are the exception, not
> the rule)
>
> But also because emulating that from completions is straight forward
> considering that Completions is read-only and any edit attempt (insert a
> letter) will emit an error we can handle moving to the minibuffer and
> executing there whatever we need.
>
> zsh adds an extra space before the letter so even if it does not leave
> the command line completely there is a switch to a state where arrows
> navigate, a letter inserts a space and C-g restores to the initial... So
> there is a mode and context change.

So inserting a letter from the Completions buffer is the only thing
that you miss from zsh?  But you also said above that this feature is
not important because such cases are rare: "M-x find-file /my/file/path".

In all other regards, currently it works exactly like in zsh:
'TAB TAB' selects the Completions window, and C-g cancels it.

>> But in zsh <up> and <down> wrap to the top/bottom of the same column.
>
> Yes, I already implemented that and you didn't liked because it was a
> bit long ;p... Now this is getting longer and longer....

Indeed, its logic looks complicated.  But maybe we could implement
simple rules like in zsh?  Then <up> ans <down> in the Completions
buffer could be bound to new commands.

>> Also in zsh TAB moves vertically when columns are sorted vertically.
>> Shouldn't TAB in Emacs move vertically too when 'completions-format'
>> is 'vertical'?
>
> Actually yes... But implementation will be long and ugly... I don't
> think it worth it...
>
> The ideal case may be to have some modes completions-vertical,
> completions-horizontal and completions-one-column that will handle all
> the pack together (bindings, order, formats)... but may break some of
> the external packages. Otherwise we will end with a code full of if-else
> and hard to maintain or extend...

Looks like the right thing to do.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]