emacs-devel
[Top][All Lists]
Advanced

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

Re: BIKESHED: completion faces


From: Dmitry Gutov
Subject: Re: BIKESHED: completion faces
Date: Wed, 30 Oct 2019 01:11:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 27.10.2019 3:58, Stefan Monnier wrote:
In Emacs-26, completion faces looked like the following:

- the "common" part shown like the default face.
- the "first-difference" shown in bold.
- everything else uses the default face.

The "common" part is the part applied to the characters that are also
found in the current minibuffer.  E.g. when completing

    M-x ne-li ?

the "ne" and "-li" chars in the *Completions* are the "common" part.

With the basic, prefix completion, the "common" part is not very
important and is separated from the rest at the "first-difference", so
the default faces make a fair bit of sense there.

But for other completion styles such as `substring`,
`partial-completion`, and even more so for `flex`, it's not always
immediately obvious how the minibuffer contents relate to the possible
completions displayed in *Completions*.

I wonder if it's *that* important, to be able to see the matching chars.

The -first-difference face shows actionable info: the next character to type, to narrow down the completions list as much as possible while ensuring that a given completion is still in. You could type other chars, but the likelihood of ending up with several options (and no more characters to type) will be higher.

So IMHO we could do nothing, and it will be a valid choice. As long as all completion styles highlight completion-first-difference properly.

Furthermore, the position of -first-difference also hints at what characters were matched (definitely ones before it).

For this reason, it is common in other completion systems to
highlight the "common" part somehow (e.g. underline, bold, ...).

Personally, I'm not a big fan of underline, italic and even bold (unless it's used sparingly, like it is now). With that said...

I think Emacs's defaults should be changed so that the "common" part
(which uses the `completions-common-part` face) is highlighted somehow.

So, what should we go for:
- bold (but then we need to change the `completions-first-difference`
   face to keep it different, e.g. underlined)?

If we end up doing this, we might as well change completions-first-difference to be indistinguishable from 'default'. Because the common part, when highlighted, duplicates the information. The "first difference" character is simply the one after the last segment of the common part, isn't it?

- underlined (tho I don't like underlined text very much)?
- some foreground color?
- some background color?
- something else?

If we do end up highlighting completions-common-part somehow, I vote for background color, some very subtle one. Because using bold is going to be annoying with prefix-based styles, and I don't think we can/should use different methods for different styles.

Using "white smoke" seems okay with the default theme, as well as with the light-background theme I'm using. No idea what color would be good with dark-background themes.



reply via email to

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