From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#59314: 29.0.50; EUDC and message-mode header completion Date: Wed, 14 Dec 2022 22:32:43 -0500 Message-ID: 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="17587"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eric Abrahamsen , 59314@debbugs.gnu.org To: Alexander Adolf Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 15 04:33:33 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 1p5f00-0004Mz-2m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Dec 2022 04:33:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5ezd-00053s-7k; Wed, 14 Dec 2022 22:33:09 -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 1p5ezX-00053Z-B2 for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 22:33:04 -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 1p5ezW-0007fZ-UP for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 22:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5ezW-0004ww-EA for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 22:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Dec 2022 03:33:02 +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.167107517619018 (code B ref 59314); Thu, 15 Dec 2022 03:33:02 +0000 Original-Received: (at 59314) by debbugs.gnu.org; 15 Dec 2022 03:32:56 +0000 Original-Received: from localhost ([127.0.0.1]:42297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5ezQ-0004wg-0j for submit@debbugs.gnu.org; Wed, 14 Dec 2022 22:32:56 -0500 Original-Received: from mail.fitzsim.org ([69.165.165.189]:38626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5ezL-0004wY-3G for 59314@debbugs.gnu.org; Wed, 14 Dec 2022 22:32:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fitzsim.org ; s=20220430; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=UbJK8//2xtOBm+oFfgX+HsdYs/W0ZHDRDUGhchh64Bc=; b=ATx5GM7KLivMWq8jU92rk1ck1Q hhtoH6xGGINMo2Ysm4/t6z7JODA8XZJZM5j9UyoVFcuL9vznNl6Q40feGQOEVZWV336dXY4gN0bns XI0Twds6zdC5ndL09V+Dox4Zz2ayFBXnssuCbSY3zlK2GBgn+g6DzE6vrLP4GLLbK+JqvvbvRN82/ b17z7nJcGRMx0jZRDG9BKRPSmfUmPGwfVxV2zHLrBOSEyWEQV23kTEp5An03VXa+xH4wObQqzqTlF RLDBii66AvYjXTzqzkMHF1xgrVrIXq0D/ZY8BdI7PhJCfMtV69TqvC38yEsJub3Ax4o7Yd7FDayrk pcY1bRlg==; Original-Received: from [192.168.1.1] (helo=localhost.localdomain) by mail.fitzsim.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1p5ezE-0009T6-26; Wed, 14 Dec 2022 22:32:44 -0500 In-Reply-To: <510a05ef2cfdb4984b7aa51d0d330fbf@condition-alpha.com> (Alexander Adolf's message of "Wed, 14 Dec 2022 19:07:13 +0100") 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:251019 Archived-At: Hi Alexander, Alexander Adolf writes: > 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 ") > 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). OK, interesting; maybe we've found a bug in the completion engine itself. > 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. Maybe, but it seems like the "completion-category-defaults" logic that you pointed out earlier is working, such that when completion is attempted, 'substring is in completion-styles. Here is the debugging patch I have to print completion styles in-context: 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) > 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. OK, it sounds like you're close to finding the root cause. Thanks, Thomas