From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] EUDC email addresses via completion-at-point in message-mode Date: Wed, 13 Apr 2022 18:44:38 -0700 Message-ID: <87o814wi9l.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38933"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Alexander Adolf Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 14 03:46:08 2022 Return-path: Envelope-to: ged-emacs-devel@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 1neoYi-0009ye-GU for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Apr 2022 03:46:08 +0200 Original-Received: from localhost ([::1]:40622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neoYh-0000Wx-As for ged-emacs-devel@m.gmane-mx.org; Wed, 13 Apr 2022 21:46:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neoXT-0008Fh-AZ for emacs-devel@gnu.org; Wed, 13 Apr 2022 21:44:51 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:51906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neoXR-0002yQ-Jx for emacs-devel@gnu.org; Wed, 13 Apr 2022 21:44:51 -0400 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 3B70DFA028; Thu, 14 Apr 2022 01:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1649900680; bh=76mxNr9LHr0ZSVkVj0w+4HdXWLAwgWa4toO7szkGe6g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Pj8H2MMYd72aB6hb73rtueOONp6pHewzZkSConVoNTQq/SA1TCO+CElewdVf5HjTc +KS8LaWa2JYF0CYa6scsma3bm88uvzmTklH9f3adZwazLY5LuZqrxB2TDMeif/LODS NqBZWjWeUi3e/UUmVyBg2yWlpe9wEh/Jz50TWlHU= In-Reply-To: (Alexander Adolf's message of "Sat, 09 Apr 2022 18:24:02 +0200") Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288377 Archived-At: Alexander Adolf writes: > Hello, > > when switching to a new in-buffer completion user interface package > which is solely based on completion-at-point, I observed that email > address completion in message-mode happens in the minibuffer, regardless > of what UI on top of completion-at-point I use. Also, EUDC's ability to > aggregate search results from several servers, which was recently added > with commit 0470a4a939772c4bd25123b15f5eadab41f8bee5, was not kicking > in, i.e. I was presented results from a single EUDC server only. > > Browsing through message.el quickly brought me to the sixth of the 21 > FIXMEs in that file, which reads on line 3183: > > ;; FIXME: merge the completion tables from ecomplete/bbdb/...? > ;;(add-hook 'completion-at-point-functions #'message-ecomplete-capf nil t) > (add-hook 'completion-at-point-functions #'message-completion-function nil t) > > Thus, the most straightforward solution to my problem seemed to make a > new EUDC function that can be added to completion-at-point-functions, > and to update message-mode to actually add that function to > completion-at-point-functions. This is what the below attached patch > does. Thank you for working on this! I think everyone can agree that the current setup is tricky to work within. As the author of (yet another) contact management package, I do what I assume anyone else would do: clobber the binding of TAB altogether. I understand that EUDC has the capability of combining results from multiple backends, but completion-at-point also has those capabilities, and personally I would much prefer to see message-mode make use of one of completion-table combining functions. Better to be wrapped inside one burrito than two! The `message-tab' would still need to check where it's been called and make a decision before calling `completion-at-point', but it seems much cleaner for each package to provide a function that's suitable for use in a combined capf completion table, rather than writing an adapter for EUDC. What do you think? Eric