From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#22324: 25.0.50; completion-category-defaults style doesn't override completion-styles (gets prepended instead) Date: Tue, 25 Jan 2022 04:27:00 +0200 Message-ID: <43725c9f-1f0a-fb43-82a2-3f284791fdf5@yandex.ru> References: <868u41rv84.fsf@yandex.ru> <83fuy8p8oq.fsf@gnu.org> <568FA9D0.2040609@yandex.ru> <83egdsp88n.fsf@gnu.org> <568FABFC.3000205@yandex.ru> <87tufr74of.fsf@gnus.org> <87lf0yjwpw.fsf@gnus.org> <87r1aodus0.fsf@gnus.org> <66aa873d-5f5f-9024-efb6-e6110c27ab3a@yandex.ru> <87ilvy4m94.fsf@gnus.org> <87czklnqvs.fsf@gnus.org> <3045ca8b-f5d6-c85e-d170-3fe158fec64e@yandex.ru> <87ilu94gac.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10427"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 Cc: 22324@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 25 03:28:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nCBZ7-0002aA-2G for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 03:28:13 +0100 Original-Received: from localhost ([::1]:56606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCBZ5-0002op-RS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jan 2022 21:28:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCBYw-0002oh-O3 for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 21:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCBYw-00017Y-EW for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 21:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCBYw-00072m-7Y for bug-gnu-emacs@gnu.org; Mon, 24 Jan 2022 21:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jan 2022 02:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22324 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 22324-submit@debbugs.gnu.org id=B22324.164307763127010 (code B ref 22324); Tue, 25 Jan 2022 02:28:02 +0000 Original-Received: (at 22324) by debbugs.gnu.org; 25 Jan 2022 02:27:11 +0000 Original-Received: from localhost ([127.0.0.1]:46434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCBY6-00071a-WB for submit@debbugs.gnu.org; Mon, 24 Jan 2022 21:27:11 -0500 Original-Received: from mail-wr1-f50.google.com ([209.85.221.50]:34566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCBY4-00071H-IJ for 22324@debbugs.gnu.org; Mon, 24 Jan 2022 21:27:09 -0500 Original-Received: by mail-wr1-f50.google.com with SMTP id f17so17080062wrx.1 for <22324@debbugs.gnu.org>; Mon, 24 Jan 2022 18:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=6rhgCiQy36EOx2vojieoswxQN1WTP2s7kv9P0eWHjC0=; b=TNfRcUqLymTjVbn0QaHQQlPJLdv8pnTZ3TkEQZijKxRyHnbTFAkohMkHBC3bWkq8V2 ntS6Z4YpMULWyFUtF/sXcn99ez8PcoPklCnmbvQadUgwFFbCo+6+8sUTfzubracUTspP bUpjjUiDtDztRa1LamUexYa9Oic+NbFDnY9qVnADd25VBoyj03AmyhoeROJrnd61M57k iP+Q1nSHqZ3Wjfbhi8y38djsBkIKOh0bFqlkFtfZ5imI0tA6e4F6pqsVnNS8KABDfgrZ kbt6sA0t49UeJ028wJJRX+U+PvwwXZ8JzEiGvLVlOO5NdGrQNX3s6k/WfGaAgrpNVI1v 5hfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6rhgCiQy36EOx2vojieoswxQN1WTP2s7kv9P0eWHjC0=; b=1+hUj+1FDVoBX7X/VStnJVr3imFQvx5FnoeCxSFlPLp2XKPJAeOevMLJNSJ2koTQDT dvBISnJ/oWAbRDYljXAyaqtx99kiRTAGcSafIU83DRJ+PGJNIrKGlwhQBtd53kAU9G1K gQ2V5irp4k3nTCSfzYZ6GxQw3FDEK7mw8EBzs3ahQpgopO0kTJoGtcKoAn23OEq6vQvD D5JU/PmL4IOmhe8R5FKoLPJQDZI7xI2kkiE4fBGWaVB1DmXs+6COVHlL2Udr5bfL1DqB SNAlW4u8rRrAe82KfORN93ApI/5sso/pszgIa0mDcxlN0gkgl/xYPUPmAGkYxLnRTwm6 bNRQ== X-Gm-Message-State: AOAM530CGS5D1UzjkIJaXD0t+qn+bC7+Jegpv8sLL/H5ZstEEZurc3pG PgolIMzy/7HXtmI7fZ8Gw6W25YUI2vTNIg== X-Google-Smtp-Source: ABdhPJyvw3G/+nhvz2z7i6ubXeDlNMZRjRFxkIKb5vXFW/Ipb1NCMeoGGxfZeAiX7s/XZ/6OawZCOA== X-Received: by 2002:adf:9cd2:: with SMTP id h18mr6622810wre.483.1643077622487; Mon, 24 Jan 2022 18:27:02 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id n11sm2323716wms.3.2022.01.24.18.27.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 18:27:01 -0800 (PST) In-Reply-To: <87ilu94gac.fsf@gnus.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:225140 Archived-At: On 24.01.2022 11:46, Lars Ingebrigtsen wrote: > Dmitry Gutov writes: > >> 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))) > > Oh, I see. Hm... that would change the behaviour for those that depend > on this working the old way. My theory is that this has never been reported because people never really notice the distinction in practice since if the completions styles are customized, that's usually done in favor of more lax ones. So appending the default styles at the end doesn't affect the behavior in 99% of the cases. But it does add some CPU usage/latency in the "no matches" case, because that's the only case when the failover happens. There might be a few users out there, of course, who rely on the current behavior, but I'm not sure what their use cases would be, and there can't be many people like that either because the completion styles stuff is fairly obscure. People have been exploring alternative front-ends recently that plug into CAPF, but completion-category-overrides is probably not a popular variable to customize still. > Perhaps it'd make more sense to add a new variable to allow real overrides? I don't know. What would it be called? completion-category-overrides-for-real-now? 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.