From: Ergus <spacibba@aol.com>
To: Juri Linkov <juri@linkov.net>
Cc: Philip Kaludercic <philipk@posteo.net>, emacs-devel@gnu.org
Subject: Re: [PATCH] Re: Other details about completion.
Date: Thu, 7 Apr 2022 19:22:01 +0200 [thread overview]
Message-ID: <20220407172201.qwggexthtersxi7x@Ergus> (raw)
In-Reply-To: <867d80c00z.fsf@mail.linkov.net>
On Thu, Apr 07, 2022 at 07:50:28PM +0300, Juri Linkov wrote:
>>> So C-g in the minibuffer could be two-step as well:
>>> first C-g closes the completions window and clears the suffix,
>>> second C-g exits the minibuffer.
>>
>> The most I go into this the most convinced I get that
>> completion-auto-select and selecting the Completions windows is the
>> simplest and cleaner way to go.
>
>Earlier you said that it should work like zsh. But does zsh
>really select the Completions window? I see that typing a letter
>while a completion candidate is highlighted in zsh, inserts both
>the highlighted completion candidate and the letter.
>This looks like it never leaves the command line
>that corresponds to the minibuffer in Emacs.
>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.
>>>> Then it should probably be line-move but forward-line goes to column zero.
>>>
>>> Neither of them wraps to the beginning like next-completion does.
>>
>> The wrap behavior is only set for tab and backtab commands (yes, it is
>> hardcoded there... don't blame me) not even for all next-completion
>> uses. I prefer not to touch that code anymore or add more stuff
>> there... At some point we will decide to fix/replace the mouse-face
>> approach there and all this will be a nightmare to support the legacy
>> behavior. >This means we need a new command next-completion-vertical.
>>
>> I already tried that in the first version of zcomplete I did long time
>> ago. And you said (and I agreed) that it was too complicated.
>
>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....
>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...
next prev parent reply other threads:[~2022-04-07 17:22 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220401153839.idrzrbfl2yfzga3y.ref@Ergus>
2022-04-01 15:38 ` Other details about completion Ergus
2022-04-01 16:21 ` Eli Zaretskii
2022-04-01 16:43 ` Juri Linkov
2022-04-01 16:45 ` Ergus
2022-04-01 20:24 ` [PATCH] " Ergus
2022-04-02 18:09 ` Juri Linkov
2022-04-03 0:39 ` Ergus
2022-04-04 19:35 ` Ergus
2022-04-04 19:45 ` Juri Linkov
2022-04-04 20:31 ` Philip Kaludercic
2022-04-05 11:06 ` Ergus
2022-04-04 22:33 ` Ergus
2022-04-05 19:22 ` Juri Linkov
2022-04-05 23:20 ` Ergus
2022-04-06 7:35 ` Juri Linkov
2022-04-06 13:21 ` Ergus
2022-04-06 16:48 ` Juri Linkov
2022-04-06 17:45 ` [External] : " Drew Adams
2022-04-06 18:25 ` Juri Linkov
2022-04-06 20:01 ` Drew Adams
2022-04-06 17:45 ` Ergus
2022-04-06 18:29 ` Juri Linkov
2022-04-06 19:50 ` Ergus
2022-04-07 7:35 ` Juri Linkov
2022-04-07 9:16 ` Ergus
2022-04-07 16:53 ` Juri Linkov
2022-04-07 17:38 ` Ergus
2022-04-07 18:04 ` Juri Linkov
2022-04-07 18:35 ` Ergus
2022-04-08 7:40 ` Juri Linkov
2022-04-08 8:42 ` Ergus
2022-04-08 16:20 ` [External] : " Drew Adams
2022-04-08 16:46 ` Juri Linkov
2022-04-08 9:31 ` Philip Kaludercic
2022-04-08 16:20 ` [External] : " Drew Adams
2022-04-08 16:51 ` Juri Linkov
2022-04-08 20:12 ` Philip Kaludercic
2022-04-06 23:55 ` Ergus
2022-04-06 18:13 ` Ergus
2022-04-06 18:34 ` Juri Linkov
2022-04-06 20:34 ` Ergus
2022-04-07 7:39 ` Juri Linkov
2022-04-07 9:08 ` Ergus
2022-04-07 16:50 ` Juri Linkov
2022-04-07 17:22 ` Ergus [this message]
2022-04-07 17:57 ` Juri Linkov
2022-04-07 18:27 ` Ergus
2022-04-08 7:45 ` Juri Linkov
2022-04-08 8:46 ` Ergus
2022-04-08 16:20 ` [External] : " Drew Adams
2022-04-08 16:53 ` Juri Linkov
2022-04-06 9:07 ` Lars Ingebrigtsen
2022-04-06 16:43 ` Juri Linkov
2022-04-07 11:09 ` Lars Ingebrigtsen
2022-04-07 16:46 ` Juri Linkov
2022-04-08 12:59 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220407172201.qwggexthtersxi7x@Ergus \
--to=spacibba@aol.com \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).