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: Tue, 13 Dec 2022 20:34:00 -0500 Message-ID: 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="10632"; 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 Wed Dec 14 02:35: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 1p5Gfw-0002Yj-UD for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Dec 2022 02:35:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5Gfo-0006ae-4R; Tue, 13 Dec 2022 20:35: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 1p5Gfm-0006Wc-LX for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 20:35: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 1p5Gfm-0006iE-DY for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 20:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5Gfl-0008Ir-Qs for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 20:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2022 01:35: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.167098165131906 (code B ref 59314); Wed, 14 Dec 2022 01:35:01 +0000 Original-Received: (at 59314) by debbugs.gnu.org; 14 Dec 2022 01:34:11 +0000 Original-Received: from localhost ([127.0.0.1]:35787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Gex-0008IY-5y for submit@debbugs.gnu.org; Tue, 13 Dec 2022 20:34:11 -0500 Original-Received: from mail.fitzsim.org ([69.165.165.189]:60282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Get-0008IS-WE for 59314@debbugs.gnu.org; Tue, 13 Dec 2022 20:34:10 -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=AuWPwTsQYKEtfna7YU6K7T8k6uaQbxT6oqCcUiuTHh4=; b=ivaJnKb2/fyPraYEK2NU2cwq6M r+wXMODDNkj9D9/5xFAGGY332HiCt/vcxeNcWBF6sxN+hNmXpDaxQZM3oU6M/t8HASkqQMrDsONUI Su3TY34csMbnVOHLNlN1dSucsoS/wInWyozRatXE6sF3szAZcXo1bJlEB0gKEp3mLLLKHjky0vdV/ kC/VgJ7odo8LSsE44BSAaVOfZnRhgK9o8R+q3KtJYBrifj2TrELnPlzCAyPw5Ozq31N293KM/NRxW WzViNVgV0z/GSDTiv/Qhb2W1c0sM0pukmMzyckyURM3E5EyjU5g9vWp1CHwUpxNkkqfcPZOmPF5aN D5w4WiLQ==; 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 1p5Gem-0008Tk-Jp; Tue, 13 Dec 2022 20:34:01 -0500 In-Reply-To: <7e3a877bcb178da3a5a4be518c7567f1@condition-alpha.com> (Alexander Adolf's message of "Mon, 12 Dec 2022 23:10:39 +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:250904 Archived-At: Alexander Adolf writes: > Thomas Fitzsimmons writes: > >> [...] >> The scenario I'd like you to make work with a minimal patch is: >> Scenario 3+1 + (setq message-expand-name-standard-ui t). >> >> Did you try that? > > Yes. > >> I'm pretty sure if you get that working you'll find that we don't need >> eudc-capf-complete in completion-at-point-functions (yet), since what >> was there will already do what eudc-capf-complete was trying to >> achieve. >> >> Basically, this whole part of the discussion I've been thinking in terms >> of "(setq message-expand-name-standard-ui t)". >> >> When message-expand-name-standard-ui is nil, I think we've determined >> that eudc-capf-complete's presence in completion-at-point-functions >> breaks EUDC functionality. Do you concur? > > Yes. > >> If that's the case we should probably remove eudc-capf-complete from >> completion-at-point-functions for Emacs 29.1, since that would >> represent a regression. > > That's one option of addressing this case. The other option would be to > apply the last patch I sent to add `(setq-local completion-styles...)` > to `eudc-capf-complete` (because this is a defect and needs to be added > in any case). Albeit with an updated message, because the message > pretends to fix the bug, which it apparently doesn't. > > My preferred outcome would thus be: > > 1) Re-remove the `(add-hook 'completion-at-point-functions > #'eudc-capf-complete ...)` line from message.el. > > 2) Add the `(setq-local completion-styles ...)` fix to > `eudc-capf-complete`. > > 3) See if we can figure a root cause for the completion styles breakage > within reasonable time and effort. > > The attached patch implements 1) and 2). > >> I now understand that the intent of the code that was there before we >> added eudc-capf-complete was: >> >> message-expand-name-standard-ui nil => use EUDC multi-selector UI >> message-expand-name-standard-ui t => use completion-at-point selector UI >> >> But the second case was already broken before we added >> eudc-capf-complete. > > Indeed. > > And it also broken when not using EUDC at all, as I reported in my > last message ('eudc removed from `message-expand-name-databases`). > >> I want to understand and fix that case. >> [...] > > My suspicion is that something about the completion styles was changed. > Mu next step would hence be to meditate over the `git blame` of > minibuffer.el. > > Looking forward to your thoughts, I've applied your patch locally and I'm testing with it, thanks. I'm also setting (setq message-expand-name-standard-ui t). 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)))))))) results in the expansion working (albeit always expanding to Emacs ERT4). So it seems the issue is with a list of more than one candidate, probably on the return path through the completion functions in minibuffer.el. I haven't been able to follow the return path all the way yet. Other complications: 1. If I do completion via bbdb-complete-mail first, before I've done (setq message-expand-name-standard-ui t), message-expand-name gets added to message--old-style-completion-functions dynamically, resulting in completion doing absolutely nothing. If I set message-expand-name-standard-ui back to nil, then stock BBDB completion works again. So there is a stateful interaction between stock BBDB completion and message-expand-name-standard-ui, where you have to set message--old-style-completion-functions back to nil if you want to change between the two. 2. When I switch to the *unsent mail* buffer, and press TAB, message-tab runs. But if I then press TAB again, completion-at-point runs. I have to switch out of the buffer then back in for message-tab to be run again. It seems to enter a mode, with a new TAB keybinding, where it's trying to use completion-at-point within a region. Thomas