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

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

bug#22324: 25.0.50; completion-category-defaults style doesn't override


From: Dmitry Gutov
Subject: bug#22324: 25.0.50; completion-category-defaults style doesn't override completion-styles (gets prepended instead)
Date: Wed, 26 Jan 2022 03:43:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 25.01.2022 14:19, Lars Ingebrigtsen wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

Given that the only times people are likely to notice the distinction
are some odd edge cases (and the extra lag is not so big or obvious),
there will be even fewer occasions for people to learn about and
customize the new var.

Unless we obsolete the previous one, which would be a fair approach,
if we knew that it actually has a fair amount of users who need to
migrate.

Hard to say.  Perhaps searching on Github for usages of the variable
might give us a clue?

Sure.

https://github.com/search?q=%22completion-category-overrides%22&type=code should a grand total of 2,433 matches, but the vast majority of those seem to be users of Orderless who use this scheme:

  (setq completion-styles '(orderless))
  (setq completion-category-defaults nil)
(setq completion-category-overrides '((file (styles partial-completion))))

Some add 'basic' before 'partial-completion' for better "Tramp hostname completion".

Do these users expect the failover to the orderless style when partial-completion fails to complete? Possible. Orderless is more lax.

But also kinda doubtful since partial-completion is fairly powerful by itself, and entering the segments of a file name in a different order is not something does often or intentionally.

Apparently this config is recommended in the README of both Corfu and Vertico (https://github.com/minad/vertico#configuration), both projects by Daniel Mendler.

I guess we should ask Daniel whether he has been aware of the completion-styles failover mechanic, and what he thinks about it.

***

And there are occasionally configs like

  (setq completion-styles
        '(partial-completion substring initials basic))
  ;; override default completion style of specific modes
  (setq completion-category-overrides
        '((file (styles . (flex)))
          (buffer (styles . (flex)))
          (project-file (styles . (flex)))
          (info-menu (styles . (flex)))))

where the override is explicitly more powerful, so we know that failover is not desirable, just wasted CPU cycles.





reply via email to

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