emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 8 Nov 2019 16:01:54 +0000

On Fri, Nov 8, 2019 at 3:34 PM Eli Zaretskii <address@hidden> wrote:
>
> > From: João Távora <address@hidden>
> > Date: Fri, 8 Nov 2019 15:09:31 +0000
> > Cc: Ergus <address@hidden>, emacs-devel <address@hidden>,
> >       Stefan Monnier <address@hidden>, Dmitry Gutov <address@hidden>
> >
> > > > >>   fabrobazor
> > > > >>   ^   ^   ^
> > > > >>   `---`---`----- I want these bold by default in the future
> > > > >>
> > > > >> no change to the 'basic/prefix' completion.
> > > > >
> > > > > I understand that you want to highlight both f, o, o, and r, but the
> > > > > latter with a different face.  If my understanding is incorrect,
> > > >
> > > > It is incorrect indeed: 'r' is should have the same face as 'a' or 'b'.
> > >
> > > Did I say that _only_ r will be highlighted with that face?
> >
> > I don' think so. I think you can read what you said above.
> >
> > I confirmed your sentence "if my understanding is incorrect". Because
> > I _don't_ intend flex to  "highlight" r at all, or 'a' or any other 
> > character
> > except 'f', 'o' and ' o'.  So these characters ('a','b','r' and 'z' in this
> > example) should, for now, have the same face, 'default'. We can think
> > about the value of highlighting other neighboring characters later.
> >
> > > I'm okay with highlighting a and b as well in this example, provided
> > > that typing "faoo" will include "fabrobazor" in the results.
> >
> > It will indeed include that in the results.  But in that your
> > example only 4 characters should be highlighted: f,
> > a (the first one),o, and o .  So no 'b'.
>
> 'b' comes from what you originally wrote.

My example was different from yours.  I just wrote 'b' there to
exemplify a thing that would not be highlighted when the pattern
is "foo" and the candidate is "fabrobazor"

> I admit I don't understand why 'b' won't be highlighted: wouldn't
> typing "fobo" narrow the list of candidates shown by "foo"?  If so,
> 'b' should be highlighted like 'a' and 'r', no?

When you type "fobo" the 'b' is highlighted .What you seem to
propose later doesn't make much sense in flex, because usually
there can be many such things that you "could" type to narrow
the selection.If 'basic' there is at most one. And in other more
complex styles like Drew's regexp styles or Helm's advances stylee,
there can probably be many more such things, even characters that
are not literally in the candidates.

> > > That would mean this face is used inconsistently: in basic and other
> > > similar styles it highlights the character(s) that narrow(s) the
> > > selection of candidates, while in flex they will highlight the
> > > characters already typed by the user.  Is that correct?
> >
> > Yes it is, but "this face" would now be called "completion-emphasis"
> > , not "completion-narrower" or "completion-already-typed" or
> > "completion-first-difference".   That's why the renames are
> > important.
>
> I don't think that names that obfuscate the use of the face is a good

I don't think it obfuscates, but it displaces the meaning, yes.
Since there can be many styles, which rely on visually
highlighting things according to a particular, well, "style",
I thought it a good strategy to have face names that don't
restrict them from doing so.

So, according to your decision, the way to achieve that
freedom seems to be, to me, to have more face names
like "flex-completion-pattern",  "flex-completion-likely-next-char".
"forgiving-completion-typo",  etc.  (the latter is a hypothetical
example of a face used in the implementation of a "forgiving"
style that allows some typos).  I am correct?

This affords the "consistency" you want, at the expense of
requiring the user to customize a whole new set of faces
if he ever switches styles.  The upside is that the defaults
problem goes away and perhaps face inheritance can hide
part of the complexity from the user.

So, using the opportunity that the subject is fresh now, would
you object that 'flex' starts using a new face, say
'completion-flex-pattern-emphasis' or 'flex-pattern-emphasis' ,
that inherits from the current 'completions-first-difference' face?

Thanks,
João



reply via email to

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