help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: can vertico approximate this ido setup?


From: Tassilo Horn
Subject: Re: can vertico approximate this ido setup?
Date: Mon, 05 Jun 2023 09:08:03 +0200
User-agent: mu4e 1.11.6; emacs 30.0.50

Samuel Wales <samologist@gmail.com> writes:

> On 6/4/23, Tassilo Horn <tsdh@gnu.org> wrote:
>
>> FWIW, I see that you put the flex and orderless completion style in
>> completion-styles.  You have to be aware that at least flex matches very
>> distant candidates, e.g., foo matches after-some-root.  Ok, that's the
>
> ok.
>
> my sequening sounds like it could be bad.

Since you are pushing, you append very unspecific styles at the front,
yes.

> to me, above would be more desirable if f were not a single letter.
> to match above i might do ftoot not foo or foot.
>
> i think ido-clever-match got that right:
> https://github.com/Bogdanp/ido-clever-match .  it is almost perfect.

You might want to play around with flex-score-match-tightness for the
flex style,

> btw i have trouble understanding the emacs manual on completion.  the
> completion styles don't make sense to me whent they talk about text
> after point.  idk what i am missing there. 

Do emacs -Q (and probably set one completion-style at a time), enter
something and move point forward again.  At least some styles seem to
ignore text after point or at least handle it differently.

> here is a big long quote from ido-clever-match exactly what it does.
> i wonder if vertico/orderless can do it similarly?

Vertico doesn't come into play here and I don't know orderless well
enough.  I think it's similar to partial-completion where the order of
words doesn't matter.

>> purpose of the style but I think it's only useful if you place it at the
>> very end of completion-styles with more exact styles at the beginning,
>> e.g. (partial-completion substring flex).
>
> ok.  even after orderless?

Yes, think (... orderless flex) would be most sensible but of course
that's a matter of preference.

>> Also, I have the experience that some completion styles work great for
>> one kind/category of completion but not for others, so I use
>> completion-category-overrides.
>>
>> --8<---------------cut here---------------start------------->8---
>> (setopt completion-styles '(partial-completion substring flex))
>
> ok so we are out of the territory of cl-pushnew or add-to-list i think
> now and i have to do my own setopt.  like setq?

Yes, setopt is like setq but would also do what the customize machinery
would do.  But it doesn't make a difference for those variables.  Using
setq/setopt instead of cl-pushnew/add-to-list just ensures the order and
that you get what you want in cases the defaults might change.

>> (setopt completion-category-overrides
>>         '((project-file
>>            (styles partial-completion substring initials))
>
>>           (file
>>            (styles partial-completion substring initials))
>
> i'd want almple or alcp to match .../alpha-completion.el.  not sure if
> this would do it without flex?

I think, it does.  One thing to note is that with completion-styles (a b
c) is that b won't kick in as long as a delivers matches and c won't
kick in as long as b finds matches.

Bye,
Tassilo



reply via email to

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