Subject: Re: bug#22324: 25.0.50; completion-category-defaults style doesn't override completion-styles (gets prepended instead)

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 06 Dec 2021 03:25:31 +0100

Dmitry Gutov <[email-masked]> writes:

>> (defun completion--category-override (category tag)
>>    (or (assq tag (cdr (assq category completion-category-overrides)))
>>        (assq tag (cdr (assq category completion-category-defaults)))))
>> But...  I think saying that that "overrides" is fine?
>
> I think an "override" has a particular meaning, and that's replacing
> something that was there before. Not prepending to it.
>
> Why is it important? Suppose the "category defaults" entry has a
> "permissive" style set up for a certain completion category.
>
> As a user, I might try to override it with an entry in
> completion-category-overrides, to use a stricter style like
> 'partial-completion' or even 'basic'.

Well, it overrides the specific tag/category -- but
completion-category-overrides doesn't (by being non-nil) override the
entirety of completion-category-defaults.

So it's two types of overrides.

> But what happens when my input fails to find any completions with the
> style I specified? It will fall back the default one, which is both
> surprising, given the current documentation, and can be problematic
> with respect to performance ('flex' is slower than
> 'partial-completion') and behavior (bringing lots of probably
> irrelevant completions which match my input because 'flex' is quite
> lax).

Yes, it doesn't seem to allow dropping any of them out completely.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no