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

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Thu, 7 Jan 2016 20:28:01 UTC

Severity: normal

Merged with 38101

Found in version 25.0.50

Fixed in version 29.1

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22324 <at> debbugs.gnu.org
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
On 21.01.2022 15:46, Lars Ingebrigtsen wrote:
> Lars Ingebrigtsen<larsi <at> gnus.org>  writes:
> 
>> Dmitry Gutov<dgutov <at> 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)




This bug report was last modified 3 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.