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

From: Dmitry Gutov <[email-masked]>
Date: Fri, 28 Jan 2022 23:23:25 +0200

On 28.01.2022 18:59, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Dmitry Gutov [2022-01-28 04:37:36] wrote:
>> On 26.01.2022 15:36, Stefan Monnier via Bug reports for GNU Emacs, the Swiss
>> army knife of text editors wrote:
>>> We can probably have our cake and eat it too by adding a `fail`
>>> completion style.  Such a style would always take responsibility
>>> (i.e. would never return nil to delegate to subsequent styles), but
>>> would always return a "useless" value that gives no completions.
>> *If*  we did end up adding such style, would the default value of
>>   completion-category-defaults include 'fail' at the end of its every line?
> No, since the fallback was chosen specifically for
> `completion-category-defaults`, we'd want to keep it for the cases that
> are already present at least.

Depends on how you look at it: out of 6 entries in there currently, I 
added two of them, and since I was unaware of the fallback mechanism, it 
wasn't quite intentional. Even if certain edge cases ended up using the 
fallback to their benefit.

Knowing that now, I would probably rewrite those 
completion-category-defaults to include all styles that would be tried 
explicitly (meaning, add 'partial-completion' after 'substring').