From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alexander Adolf Newsgroups: gmane.emacs.bugs Subject: bug#59314: 29.0.50; EUDC and message-mode header completion Date: Mon, 19 Dec 2022 17:09:01 +0100 Message-ID: <3c62ae5a325020cfe7d66168372685d0@condition-alpha.com> References: <87a64q7p25.fsf@ericabrahamsen.net> <878rka1y4n.fsf@ericabrahamsen.net> <9cad334f4f42725f2e244c8c81528856@condition-alpha.com> <4d1810369df651d02ceeb522b8f05370@condition-alpha.com> <7e3a877bcb178da3a5a4be518c7567f1@condition-alpha.com> <510a05ef2cfdb4984b7aa51d0d330fbf@condition-alpha.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5960"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eric Abrahamsen , 59314@debbugs.gnu.org To: Thomas Fitzsimmons Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 19 17:10:24 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 1p7Iid-0001ML-T0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Dec 2022 17:10:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7IiK-0000Gb-TI; Mon, 19 Dec 2022 11:10:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7IiI-0000FD-Bw for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:10:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7IiI-0004Hc-2G for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7IiH-0004DM-Jg for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 11:10:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexander Adolf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2022 16:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59314 X-GNU-PR-Package: emacs Original-Received: via spool by 59314-submit@debbugs.gnu.org id=B59314.167146615016148 (code B ref 59314); Mon, 19 Dec 2022 16:10:01 +0000 Original-Received: (at 59314) by debbugs.gnu.org; 19 Dec 2022 16:09:10 +0000 Original-Received: from localhost ([127.0.0.1]:38954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7IhR-0004CO-NS for submit@debbugs.gnu.org; Mon, 19 Dec 2022 11:09:10 -0500 Original-Received: from smtprelay04.ispgateway.de ([80.67.18.16]:55812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7IhO-0004CI-12 for 59314@debbugs.gnu.org; Mon, 19 Dec 2022 11:09:08 -0500 Original-Received: from [46.244.208.108] (helo=condition-alpha.com) by smtprelay04.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p7Ihr-0004uq-Kc; Mon, 19 Dec 2022 17:09:35 +0100 In-Reply-To: X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251440 Archived-At: Hello Thomas, Thomas Fitzsimmons writes: > [...] >>> This may be a clue; while I was experimenting, I found that this: >>> >>> @@ -8432,7 +8438,7 @@ message--name-table >>> (all-completions string >>> (ecomplete-completion-table 'mail) >>> pred))))) >>> - (if action candidates (try-completion string candidates)))))))) >>> + (if action (cdr candidates) (try-completion string candidates)))))))) >>> [...] >> >> Interesting; thanks for sharing this. Effectively, you're dropping the >> first entry from the `candidates` list before returning it. What does >> your `candidates` list contain at that point (before removal)? > > ("Emacs ERT3 " > "Emacs ERT4 ") Looking at the code in `completion-pcm--merge-try` (which is part of the partial-completion style, and gets called from the basic, substring, and flex completion styles), reducing it to a single candidate may make a difference; the function begins like this: ---------------------------- Begin Quote ----------------------------- (defun completion-pcm--merge-try (pattern all prefix suffix) (cond ((not (consp all)) all) ((and (not (consp (cdr all))) ;Only one completion. ;; Ignore completion-ignore-case here. (equal (completion-pcm--pattern->string pattern) (car all))) t) (t [...] ----------------------------- End Quote ------------------------------ I.e. the behaviour for a single candidate (second condition case) is different from when there's more than one candidate (third, and default condition case). This could explain why you change seemed to improve things. > [...] > OK, interesting; maybe we've found a bug in the completion engine > itself. That may well be the case. And as the completion styles generously call each other, any change in that area will require extra care. > [...] > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 5faa3c8d4e8..455135628c8 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -1191,7 +1191,7 @@ completion--nth-completion > (error "Invalid completion style %s" style)) > string table pred point))) > (and probe (cons probe style)))) > - (completion--styles md))) > + (let ((styles (completion--styles md))) (message "STYLES: %S" styles) styles))) > > When I press TAB, it prints: > > STYLES: (substring partial-completion basic emacs22) > > even though globally, completion-styles is set to its default, > (basic partial-completion emacs22) Yes, the the "completion-category-defaults" logic does work, and what you're seeing is that `completion-category-defaults` (or *-overrides) when non-nil gets pre-pended to the buffer-local value of `completion-styles`. Cheers, --alexander