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: Mon, 24 Jan 2022 04:03:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 21.01.2022 15:46, Lars Ingebrigtsen wrote:
Lars Ingebrigtsen<larsi@gnus.org>  writes:

Dmitry Gutov<dgutov@yandex.ru>  writes:

Consider changing the behavior instead, though.

Yes, it's been like this for a long time, but I imagine most users
won't notice the change.

We could experiment on master.
I'd rather not change something as subtle as this (especially in a
mechanism that's been around for a while like this as).
Nobody had any further opinions here in a month, so I went ahead and
changed the doc string.  If somebody feels strongly that the semantics
should be tweaked, I don't really have a strong opinion either way.

Hi Lars,

The doc change you have pushed in 62a84eea34c33bd1d4b1 misses the point, which leads me to believe that I have not explained the problem well.

The issue is not that an entry in completion-category-overrides doesn't override all properties wholesale, that is falls back to defaults for properties not specified among the overrides.

The issue is that when the 'styles' property is looked up (which is 99% of the uses of this variable), the override value is not used as-is. Instead, the default value is appended.

So the fix I had in mind looks like:

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d58c23af8f..0aee55f33c 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1043,7 +1043,7 @@ completion--styles
   (let* ((cat (completion-metadata-get metadata 'category))
          (over (completion--category-override cat 'styles)))
     (if over
-        (delete-dups (append (cdr over) (copy-sequence completion-styles)))
+        (cdr over)
        completion-styles)))

 (defun completion--nth-completion (n string table pred point metadata)





reply via email to

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