unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation.
Date: Mon, 16 Nov 2020 04:37:19 +0100	[thread overview]
Message-ID: <20201116033719.63dryvqm4ozfer2r@Ergus> (raw)
In-Reply-To: <jwvv9e6kxob.fsf-monnier+emacs@gnu.org>

Hi Stefan:

On Sun, Nov 15, 2020 at 06:32:08PM -0500, Stefan Monnier wrote:
>>> Please write a description that can be understood by someone who doesn't
>>> know Zsh (or Helm or Ivy or ...).
>> Done!
>
>Much better, thanks.
>
>> Maybe it needs some comments in the manual/NEWS too? If so, where?
>
>I haven't looked at it enough to know, yet, sorry.
>
>> Please check if it needs anything else to be merged into master.  I am
>> reusing the highlight face... but maybe the package needs its own face
>> for the overlay?
>
>Sorry haven't looked at the code yet.
>
:(

>> How can I make that emacs find the file automatically? It needs to be
>> added in cus-<something>.el right?
>
>What do you mean by "find the file automatically"?
>
Now I have to load the file with -l to be allowed to use the command.

>BTW, this new feature reminds me of completion-cycle-threshold.
>
More or less is the same basic functionality for tabs, but with a lot of
steroids.

1) When completion-cycle-threshold is nil (the default completion) tab
functionality ends when the *Completions* is visible. After that tab
does nothing else unless there are too many candidates and the list
needs to be scrolled.

2) On the other hand when completion-cycle-threshold is t the
completions buffer is never shown. So the completion system behaves more
like vim (ugh), the next completion is not easily predictable. And, of
course, the user can't know how many tabs will need to reach what he
wants.

3) If completion-cycle-threshold is a number then candidates are shown,
but when start cycling, the <tab> order is independent from the one in
*Completions* (this behavior IMO is even worst). Also, there is not
feedback between the current candidate and the visible completions list.

-----------------

This mode shows the completions buffer (like when
completion-cycle-threshold is nil), but then cycles there (like when
completion-cycle-threshold is non-nil). But over a visible list of
candidates and highlighting the current one.

Once cycling started it is easy to know what will be the next <tab>
candidate or how many tabs (or arrows) are needed to get to a
candidate. It is also possible to go to the candidate down, up, or the
previous one (left) if you accidentally passed it.

Another advantage is that the cursor (point) stays in the same
mini-buffer place after completion, so, in case the list is too long and
you want to reduce it (or a wrong letter was inserted); you only need to
type another letter(backspace) and tab again (like in bash or zsh or the
default completion engine to get a new list).

Finally the mode only changes the default completion behavior once the
completions are visible and another tab is pressed (Where by default Tab
did nothing before).

Hope this helps.
>
>        Stefan
>
BTW:

1) completion-cycle-threshold t: is somehow equivalent to bash:

bind "TAB:menu-complete"
bind "set show-all-if-ambiguous on"

2) completion-cycle-threshold nil: is somehow similar to default bash
completion. (tab shows the list and wait more letters)

3) This mode mimics zle from zsh. It is impossible to have this behavior
in bash because readline can't give this. zsh team needed to create zle
to have it.

There are known limitations like that some users will like the
candidates bellow the prompt and not over or have everything in the same
window, or C-g should hide completions instead of exiting the
mini-buffer... But adding them may be too invasive or collide with the
default behavior and may add some worthless complexity.

Best, Ergus.



  reply	other threads:[~2020-11-16  3:37 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201115023629.19537.77471@vcs0.savannah.gnu.org>
     [not found] ` <20201115023631.C78AB20A27@vcs0.savannah.gnu.org>
2020-11-15 18:41   ` feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation Stefan Monnier
2020-11-15 22:49     ` Ergus
2020-11-15 23:32       ` Stefan Monnier
2020-11-16  3:37         ` Ergus [this message]
2020-11-16  3:56           ` Stefan Monnier
2020-11-16  5:40             ` Drew Adams
2020-11-16  7:39             ` Ergus
2020-11-16  5:38           ` Drew Adams
2020-11-16  8:54             ` Juri Linkov
2020-11-16 10:27               ` Ergus
2020-11-16 20:23                 ` Juri Linkov
2020-11-16 21:16                   ` Drew Adams
2020-11-17  0:46                   ` Ergus
2020-11-17 20:02                     ` Juri Linkov
2020-11-17 20:52                       ` Drew Adams
2020-11-18 19:43                 ` Juri Linkov
2020-11-18 22:45                   ` Drew Adams
2020-11-19  3:25                   ` Ergus
2020-11-19  7:45                     ` Juri Linkov
2020-11-19 10:50                       ` Ergus
2020-11-20  9:32                         ` Juri Linkov
     [not found]                           ` <20201120145248.wmbv2zgbvs7bg25i@Ergus>
2020-11-21 19:30                             ` Juri Linkov
2020-11-22 13:28                               ` Ergus
2020-11-22 20:03                                 ` Juri Linkov
2020-11-22 23:09                               ` Ergus
2020-11-23  9:14                                 ` Juri Linkov
2020-11-23 11:46                                   ` Ergus
2020-11-23 14:13                                     ` Jean Louis
2020-11-23 19:12                                       ` Eli Zaretskii
2020-11-23 19:44                                         ` Jean Louis
2020-11-23 20:54                                     ` Dmitry Gutov
2020-11-23 23:27                                       ` Ergus via Emacs development discussions.
2020-12-10  1:16                                         ` Dmitry Gutov
2020-12-10  8:23                                           ` Juri Linkov
2020-11-25  8:49                                     ` Juri Linkov
2020-11-20 14:24                         ` Stefan Monnier
     [not found]                           ` <20201120144940.p55brblxpuowslag@Ergus>
2020-11-20 15:15                             ` Stefan Monnier
2020-11-16 16:03               ` Drew Adams
2020-11-16 20:28                 ` Juri Linkov
2020-11-16 21:31                   ` Drew Adams
2020-11-18 19:30                   ` Juri Linkov

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=20201116033719.63dryvqm4ozfer2r@Ergus \
    --to=spacibba@aol.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).