[Top][All Lists]

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

Re: BIKESHED: completion faces

From: João Távora
Subject: Re: BIKESHED: completion faces
Date: Mon, 04 Nov 2019 22:52:46 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Dmitry Gutov <address@hidden> writes:

> Some other ideas:
> - No nothing, on the reasoning that 'flex' is not in
>   'completion-styles' by default. And many users who would add it
>  there would probably use it exclusively, and could thus customize
> their completions-common-part face to be more informative, to their
> satisfaction. This suggestion could be in the docs somewhere, maybe in
> the NEWS section that introduces 'flex'.

I don't agree with this reasoning at all.  First I think we agree Emacs
would profit (in influx from users) from defaults that make it behave
less like 90's Emacs and more like other younger editors.  However we
also know that we can't just change the defaults without bothering
users already relying on those defaults.

So the next best thing is to add new functionality with a minimum of
customization necessary.  So, IMO, it's nonsensical to ask users to
customize the matching style to 'flex' AND also ask them customize a
face so that that more-than-familiar matching strategy reveals its

> - Define a new face that would be applied by callers of
>   completion-all-completions to those completions where the equation 
> "common part == the whole part of the string before the char
> highlighted by first-difference" doesn't hold true. So all uses of
> this face would be informative. Although some absences of it might
> stand out (where a flex match is a strict-prefix one). That face would
> have a distinct background or foreground.

This is better: I think this would lead you to my idea of a new
`completion-relevant` face, which we would set to bold or something very
prominent.  For the 'prefix' the relevant part is the "next character"
and for the 'flex' style is whatever has matched.
completions-first-difference could then be made an alias of that new

So my idea is:

1.  New 'completion-relevant' face, defaulting to the current
completions-first-difference value, used for emphasizing the relevant
parts of a completion.  Also alias the exiting
'completions-first-difference' to this new face.

2.  New 'completion-shadow' face, defaulting to the current
'completions-common-part' values, used for marking "seconday" parts of
completions .  Also alias the existing 'completions-common-part' face to
this new face.

Instead of 'completion-shadow', we could also call this
'completion-auxiliary' or something like that.

3. Completion styles decide which parts which faces to apply and when.
Prefix uses both like it does now.  Flex should probably only use


reply via email to

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