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: Wed, 14 Dec 2022 19:07:13 +0100 Message-ID: <510a05ef2cfdb4984b7aa51d0d330fbf@condition-alpha.com> References: <87a64q7p25.fsf@ericabrahamsen.net> <878rka1y4n.fsf@ericabrahamsen.net> <9cad334f4f42725f2e244c8c81528856@condition-alpha.com> <4d1810369df651d02ceeb522b8f05370@condition-alpha.com> <7e3a877bcb178da3a5a4be518c7567f1@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="32826"; 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 Wed Dec 14 19:08:14 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 1p5WAw-0008Mo-7R for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Dec 2022 19:08:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5WAl-0006G8-Sw; Wed, 14 Dec 2022 13:08:03 -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 1p5WAl-0006Fz-7C for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 13:08:03 -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 1p5WAj-00046e-PK for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 13:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5WAj-00062o-KD for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 13:08: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: Wed, 14 Dec 2022 18:08: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.167104123923227 (code B ref 59314); Wed, 14 Dec 2022 18:08:01 +0000 Original-Received: (at 59314) by debbugs.gnu.org; 14 Dec 2022 18:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:40733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WA2-00062Z-Jj for submit@debbugs.gnu.org; Wed, 14 Dec 2022 13:07:18 -0500 Original-Received: from smtprelay01.ispgateway.de ([80.67.18.13]:11008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WA0-00062T-IQ for 59314@debbugs.gnu.org; Wed, 14 Dec 2022 13:07:17 -0500 Original-Received: from [46.244.215.67] (helo=condition-alpha.com) by smtprelay01.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p5WAl-00013g-Pn; Wed, 14 Dec 2022 19:08:03 +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:250980 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)? I have some observations to share, too. When the lambda function returned by `message--name-table` is called with 't as the action argument, that is when it is expected to return completion candidates, I have modified the code to return a static list so I can experiment. It turns out that the breakage is triggered by the _last_ candidate in that list. If & when the last element contains white-space in what would be the "common prefix", then things go south. All other candidates in that list may contain generous amounts of white-space anywhere, and things will still work as expected (selection UI is presented upon the second TAB key press). The second observation is related to completion styles. With our test-case, 'partial-completion does not produce useful results for my standards. Perhaps a "collateral conclusion" will be that 'substring is all that is needed when completing email recipients? Let's see. I'll now dig further into minibuffer.el and what happens in the 'substring completion style code with the last element of the candidates list. Cheers, --alexander