unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: "João Távora" <joaotavora@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: BIKESHED: completion faces
Date: Wed, 6 Nov 2019 00:22:33 +0200	[thread overview]
Message-ID: <3f7afc8e-b3d1-07a4-9350-3bfc5775ba21@yandex.ru> (raw)
In-Reply-To: <CALDnm5163_h0j3nc5K0JiZmysHqkWJ1vYs84NP82F7PhTPtckw@mail.gmail.com>

On 05.11.2019 18:31, João Távora wrote:

> I would rather say that setting a change to Emacs defaults as a bar to
> clear is counter-productive.  And frequently demotivational.

Emacs has a problem of trying to accommodate too many workflows in the 
same UI. The result sometimes turns out to not be optimal for any of 
them. I'm trying to avoid this problem here.

> Best solutions arise when we can understand exactly what it is that
> people like about current defaults, and can accomodate that specific
> preference in a new system, so that they barely notice it.

That sounds like a change in defaults, though.

>  > > So what you are proposing with the "do-nothing" approach amounts to a
>  > > lose-lose.
>  > Have you read my other idea, then?
> 
> Yes.  A new face, I presume.  And a generic attempt to figure a good
> place to apply it for every possible style.

Yup. Okay.

> By the way, every other proposal in this thread, is trivial.  Only yours
> adds significant new logic.  Not saying that's bad, but it's a drawback
> the others don't have.

Your proposal would add a different styling for different completion 
styles. That would require some code as well, likely a similar amount.

>  > > The former part can be improved in flex, the latter can't: it's
>  > > intrinsic to the technique.
>  > All can be improved, just with varying degrees of difficulty.
> 
> Sure, a pig and a large enough rocket...

Is that because the current completion system is not optimal for flex?

>  > But there
>  > are other techniques, like limiting the number of matches shown at a
>  > time.
> 
> Sure, I was talking about parts of 'flex' itself.  There are of course
> improvements outside it (even besides the large enough rocket).  Say,
> generators and lazy evaluation in completions could indeed be useful.
> But that's a possibly big big change in minibuffer.el and, much worse,
> all its users.

minibuffer.el will likely need changes, yes.

But as for "outside"... I was thinking of a data structure where you 
would accumulate completions in a sorted tree, of sorts. And, when a new 
one is added, if the maximum allowed number of completions has been 
reached, the least-scored one is evicted. Or we do the eviction at the 
end, whatever.

Point is, we end up with a limited-size list containing only the best 
matches. That wouldn't avoid performance problems with the flex 
algorithm itself, but any subsequent bottlenecks would not be triggered.

This approach really relies on good and fast scoring, though.

>  > One just has to make sure not to cache the result improperly.
> 
> Cache invalidation, one of the "hard" problems in computing.  Buying
> trouble, I say.

Let us not forget that we're competing with other editors who routinely 
show off flex matching and somehow deal with accompanying performance 
problems.

>  > As you can imagine, IMHO this part "making sense" is less important than
>  > the consistency in highlighting.
> 
> It's only "inconsistent" if you you refuse to accept that concepts such
> as "relevance" or "emphasis" are more important the specifics of the
> matching technique implemented.

I'm more interested in highlighting being consistent and relevant to 
whatever the next action the user should perform.

>  > > What I'm proposing is no different from say, mode-line-emphasis, which
>  > > lisp/man.el and lisp/vc/vc-dispatcher.el use in "two wildly different
>  > > things".
>  >
>  > Here's an example. When the input is one char, how will you figure out
>  > what the highlighting in the *Completions* buffer means?
> 
> OK, let's take that example.  It depends on whether I'm using a "prefix"
> or "flex" style.  But even if I'm using them both together, or I'm such
> a doofus that I don't remember anymore:
> 
> 1. If I see that "one char" being matched in the middle of a lot of
> completions, I know what it means: I'm using 'flex' and/or 'substring'
> and that is the character that's matched.

That implies an extra thinking step. Whatever synapses take part it 
that, my brain could've used for something else.

> 2. If I see that every completion has its second character highlighted,
> I know I'm using prefix.

_Probably_, but you won't know for sure until you also read those 
characters. There could be just 2-3 completions anyway, so you wouldn't 
get the picture at a glance.

> This is discounting the fact that I probably want to know and control
> whether I'm using flex or prefix anyway.

But you probably won't. Or other users won't. That's the idea behind 
completion-styles anyway. If you are the "controlling" type anyway, you 
would probably customize faces anyway.

And here's also the argument for waiting until the default changes: 
because if the new default is (setq completion-styles '(flex)), then the 
dilemma we have before us now is easily dismissed.

> It's also discounting the fact that in 2. prefix completion should, IMO,
> use my proposed "emphasis" face to highlight the first -- not the second
> -- character. I've argued before that no loss of explanatory power would
> materialize from this.

No loss of explanatory power indeed. The only argument we've made is 
that it'll probably be annoying.

> Finally it also dicounts the fact that yours is an extremely contorted
> example.  I almost never want completions for stuff that contains or
> starts with a specific single character.  Flex/substring becomes really
> useful when you type 2-4 characters, and you are made visually aware of
> the subsequence they matched within the candidate.

But okay, should those really be emphasized more than "first 
difference"? The latter tells the user what they might want to type 
next. The former is mostly useful to see "why am I getting these 
completions at all" or they're bored and want to study the completion 
logic or something. In other words, less frequent situations than simply 
typing code.



  reply	other threads:[~2019-11-05 22:22 UTC|newest]

Thread overview: 169+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-27  1:58 BIKESHED: completion faces Stefan Monnier
2019-10-27 11:34 ` João Távora
2019-10-27 21:45 ` Juri Linkov
2019-10-28  0:43   ` João Távora
2019-10-28 22:29     ` Juri Linkov
2019-10-28 23:31       ` João Távora
2019-10-29 21:53         ` Juri Linkov
2019-10-29 22:09           ` Dmitry Gutov
2019-10-29 22:57           ` João Távora
2019-10-29  1:12       ` Stefan Monnier
2019-10-29 21:58         ` Juri Linkov
2019-10-29 22:59           ` João Távora
2019-10-29 23:11 ` Dmitry Gutov
2019-10-30  1:49   ` Stefan Monnier
2019-11-03 21:53     ` Dmitry Gutov
2019-11-03 23:30       ` Stefan Monnier
2019-11-04 16:30         ` Dmitry Gutov
2019-11-04 18:31           ` Stefan Monnier
2019-11-04 22:52           ` João Távora
2019-11-04 23:25             ` Dmitry Gutov
2019-11-05 11:10               ` João Távora
2019-11-05 14:57                 ` Dmitry Gutov
2019-11-05 15:44                   ` Stefan Monnier
2019-11-05 16:30                     ` João Távora
2019-11-05 21:27                     ` Juri Linkov
2019-11-05 23:06                       ` Stefan Monnier
2019-11-05 22:01                     ` Dmitry Gutov
2019-11-06  0:18                       ` Stefan Monnier
2019-11-06  8:24                         ` Dmitry Gutov
2019-11-06 13:42                           ` VOTE: Changing completions-common-part face's default Stefan Monnier
2019-11-06 17:16                             ` João Távora
2019-11-06 17:26                               ` Dmitry Gutov
2019-11-06 18:10                                 ` João Távora
2019-11-06 22:20                                   ` Dmitry Gutov
2019-11-06 22:42                                     ` João Távora
2019-11-06 22:57                                       ` Dmitry Gutov
2019-11-06 23:14                                 ` Stefan Monnier
2019-11-07  8:09                                   ` Dmitry Gutov
2019-11-07 10:27                                     ` João Távora
2019-11-07 13:27                                       ` Yuri Khan
2019-11-07 13:52                                         ` João Távora
2019-11-07 14:41                                           ` Yuri Khan
2019-11-07 14:57                                             ` João Távora
2019-11-07 16:04                                               ` Stefan Monnier
2019-11-07 16:09                                                 ` João Távora
2019-11-07 14:43                                           ` Dmitry Gutov
2019-11-07 14:54                                             ` João Távora
2019-11-07 14:33                                       ` Dmitry Gutov
2019-11-07 14:44                                         ` João Távora
2019-11-07 14:58                                           ` Dmitry Gutov
2019-11-07 15:54                                             ` João Távora
2019-11-07 16:57                                               ` Drew Adams
2019-11-08 23:38                                               ` Dmitry Gutov
2019-11-09  0:24                                                 ` João Távora
2019-11-09  1:53                                                   ` Drew Adams
2019-11-09 21:57                                                     ` Juri Linkov
2019-11-09 22:17                                                       ` João Távora
2019-11-09  7:30                                                   ` Eli Zaretskii
2019-11-09 11:42                                                     ` João Távora
2019-11-09 12:04                                                       ` Eli Zaretskii
2019-11-09 13:22                                                         ` João Távora
2019-11-09 16:44                                                     ` Drew Adams
2019-11-07 15:08                                     ` Stefan Monnier
2019-11-08 10:15                                       ` Dmitry Gutov
2019-11-08 19:19                                         ` Stefan Monnier
2019-11-08 19:43                                           ` Eli Zaretskii
2019-11-08 21:42                                             ` Stefan Monnier
2019-11-09  6:52                                               ` Eli Zaretskii
2019-11-09 15:25                                                 ` Stefan Monnier
2019-11-09 15:52                                                   ` Eli Zaretskii
2019-11-09 16:17                                                     ` Stefan Monnier
2019-11-08 20:11                                           ` Dmitry Gutov
2019-11-08 22:57                                           ` João Távora
2019-11-06 23:12                               ` Stefan Monnier
2019-11-05 16:31                   ` BIKESHED: completion faces João Távora
2019-11-05 22:22                     ` Dmitry Gutov [this message]
2019-11-05 23:11                       ` João Távora
2019-11-06  8:18                         ` Dmitry Gutov
2019-11-06  8:53                           ` João Távora
2019-11-06 15:16                             ` Dmitry Gutov
2019-11-06 15:56                               ` João Távora
2019-11-06 10:25                           ` João Távora
2019-11-06 15:11                             ` Dmitry Gutov
2019-11-06 15:31                               ` João Távora
2019-11-06 15:43                                 ` Dmitry Gutov
2019-11-06 15:48                                   ` João Távora
2019-11-06 16:01                                     ` Dmitry Gutov
2019-11-06 16:20                               ` Eli Zaretskii
2019-11-06 21:36                               ` Juri Linkov
2019-11-07 14:25                                 ` Eli Zaretskii
2019-11-07 22:40                                   ` Juri Linkov
2019-11-08  6:43                                     ` Eli Zaretskii
2019-11-06 16:12                           ` Eli Zaretskii
2019-11-06 16:14                             ` João Távora
2019-11-06  0:24                       ` Stefan Monnier
2019-11-05 18:36               ` Stefan Monnier
2019-11-05 18:51                 ` Eli Zaretskii
2019-11-05 19:16                   ` João Távora
2019-11-05 19:23                     ` Eli Zaretskii
2019-11-05 21:43                       ` João Távora
2019-11-06 16:03                         ` Eli Zaretskii
2019-11-06 16:26                           ` João Távora
2019-11-06 18:07                             ` Eli Zaretskii
2019-11-06 18:14                               ` João Távora
2019-11-06 18:29                                 ` Eli Zaretskii
2019-11-06 18:48                                   ` João Távora
2019-11-06 20:51                                   ` Ergus
2019-11-07 14:08                                     ` Eli Zaretskii
2019-11-07 14:28                                       ` João Távora
2019-11-07 14:47                                         ` Eli Zaretskii
2019-11-07 15:00                                           ` João Távora
2019-11-07 15:40                                             ` Eli Zaretskii
2019-11-07 16:00                                               ` João Távora
2019-11-07 17:39                                                 ` Eli Zaretskii
2019-11-07 17:53                                                   ` João Távora
2019-11-07 18:16                                                     ` Eli Zaretskii
2019-11-07 18:37                                                       ` João Távora
2019-11-07 21:07                                                         ` Eli Zaretskii
2019-11-07 21:43                                                           ` João Távora
2019-11-08  6:35                                                             ` Eli Zaretskii
2019-11-08 10:15                                                               ` João Távora
2019-11-08 14:02                                                                 ` Eli Zaretskii
2019-11-08 15:09                                                                   ` João Távora
2019-11-08 15:33                                                                     ` Eli Zaretskii
2019-11-08 16:01                                                                       ` João Távora
2019-11-08 16:16                                                                         ` Eli Zaretskii
2019-11-08 16:27                                                                           ` João Távora
2019-11-08 17:05                                                                             ` Eli Zaretskii
2019-11-08 17:21                                                                               ` João Távora
2019-11-08 19:06                                                                                 ` Eli Zaretskii
2019-11-08 22:49                                                                                   ` João Távora
2019-11-09  6:57                                                                                     ` Eli Zaretskii
2019-11-09 11:20                                                                                       ` João Távora
2019-11-09 11:51                                                                                         ` Eli Zaretskii
2019-11-09 12:14                                                                                           ` João Távora
2019-11-09 12:19                                                                                             ` Eli Zaretskii
2019-11-09 13:29                                                                                               ` João Távora
2019-11-09 13:52                                                                                                 ` João Távora
2019-11-09 15:31                                                                                                 ` Eli Zaretskii
2019-11-09 18:51                                                                                                   ` João Távora
2019-11-10  9:18                                                                                                   ` Dmitry Gutov
2019-11-14  9:45                                                                                                     ` Eli Zaretskii
2019-11-14 10:40                                                                                                       ` Dmitry Gutov
2019-11-14 14:16                                                                                                         ` Eli Zaretskii
2019-11-14 14:19                                                                                                           ` João Távora
2019-11-14 14:42                                                                                                             ` Eli Zaretskii
2019-11-14 14:49                                                                                                               ` João Távora
2019-11-16 20:10                                                                                                       ` Juri Linkov
2019-11-16 23:40                                                                                                         ` João Távora
2019-11-17 17:27                                                                                                           ` Eli Zaretskii
2019-11-17 17:47                                                                                                             ` João Távora
2019-11-08 12:58                                                               ` Stefan Monnier
2019-11-08 13:08                                                                 ` João Távora
2019-11-08 14:07                                                                 ` Eli Zaretskii
2019-11-06 20:34                               ` Drew Adams
2019-11-06 20:42                                 ` Eli Zaretskii
2019-11-05 21:40                     ` Dmitry Gutov
2019-11-05 23:02                       ` Stefan Monnier
2019-11-05 18:54                 ` João Távora
2019-11-05 19:07                   ` Stefan Monnier
2019-11-05 21:39                   ` Dmitry Gutov
2019-11-05 21:54                     ` João Távora
2019-11-05 21:55                       ` Dmitry Gutov
2019-11-05 21:54                 ` Dmitry Gutov
2019-11-05 21:58                   ` João Távora
2019-11-05 22:03                     ` Dmitry Gutov
2019-11-05 22:07                       ` João Távora
     [not found] <<jwvwocr7yt6.fsf-monnier+emacs@gnu.org>
     [not found] ` <<b7e361ee-6fc4-b52e-3bd2-1f6862bbcf23@yandex.ru>
     [not found]   ` <<jwva79jyqrp.fsf-monnier+emacs@gnu.org>
     [not found]     ` <<4c5631d4-9dfd-04c6-c573-b83c67fcc2fa@yandex.ru>
     [not found]       ` <<jwvd0e8k0gi.fsf-monnier+emacs@gnu.org>
     [not found]         ` <<c6718807-b3fc-5bed-6a4b-b1ccc52649de@yandex.ru>
     [not found]           ` <<87pni7p83l.fsf@gmail.com>
     [not found]             ` <<fdec6d86-e1b9-19cb-18aa-ef835972f315@yandex.ru>
     [not found]               ` <<jwv8soub2u5.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <<83h83ignrz.fsf@gnu.org>
     [not found]                   ` <<CALDnm50SjOOKOiZVmdNJc8zVsfZXbPQcBOYoeJe9MbO62Lartw@mail.gmail.com>
     [not found]                     ` <<83ftj2gma8.fsf@gnu.org>
     [not found]                       ` <<87zhhaxalt.fsf@gmail.com>
     [not found]                         ` <<83bltpgffr.fsf@gnu.org>
     [not found]                           ` <<CALDnm50YW0cjdN1Z7eJs6K-dXpfwp1VOe3NPi6WH+iF1oU1HmA@mail.gmail.com>
     [not found]                             ` <<83tv7gg9oz.fsf@gnu.org>
     [not found]                               ` <<7916c845-1ce2-4abd-937f-09036cd60bec@default>
     [not found]                                 ` <<83pni4g2iq.fsf@gnu.org>
2019-11-06 21:40                                   ` Drew Adams
2019-11-07 14:19                                     ` Eli Zaretskii

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=3f7afc8e-b3d1-07a4-9350-3bfc5775ba21@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --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).