From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sAs4JURC6WKABQEAbAwnHQ (envelope-from ) for ; Tue, 02 Aug 2022 17:27:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cIE0JURC6WJLbQEA9RJhRA (envelope-from ) for ; Tue, 02 Aug 2022 17:27:00 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3548835AFF for ; Tue, 2 Aug 2022 17:27:00 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EEB9A5F38C; Tue, 2 Aug 2022 15:26:56 +0000 (UTC) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.18.28]) by mail.notmuchmail.org (Postfix) with ESMTPS id 8077C5F386 for ; Tue, 2 Aug 2022 15:26:54 +0000 (UTC) Received: from [46.244.210.168] (helo=condition-alpha.com) by smtprelay05.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oItnY-0006Zv-IW; Tue, 02 Aug 2022 17:27:08 +0200 Message-Id: From: Alexander Adolf To: David Bremner , notmuch@notmuchmail.org Subject: Re: [Emacs] Using notmuch-address with EUDC, and completion-at-point In-Reply-To: <878roa7p45.fsf@tethera.net> References: <8a437e3f646f7972c86c4aae57ae7452@condition-alpha.com> <878roa7p45.fsf@tethera.net> Date: Tue, 02 Aug 2022 17:26:51 +0200 MIME-Version: 1.0 X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Message-ID-Hash: SRU3TQK7SAPT4GR23KBJH3KBJKGCNVVL X-Message-ID-Hash: SRU3TQK7SAPT4GR23KBJH3KBJKGCNVVL X-MailFrom: alexander.adolf@condition-alpha.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659454020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=kbRgx52ezik128n9Y6aXM1ENnSIiX74o1gHVTZJ5ZCM=; b=HAVISgrnltiZ5xxEtySXs1v52dbptWDlDKujxPk4Wkq8hCeM4cHESv7g7iJAqY4mxthn48 OeO9knc0MTJTMh5wbaiPI36Hsk5yi9apSHFqeUIJnIIiw61uZL4QX5STgguaJoiG7bwtVi r9F6HObju2gZxF+NhYUskzENWAtybermh8kjzwmVUjq3xCKO1LWk0dBeD5MDGA6UGmFia2 TcwTPPMrCJWYJnyfqmHiGZSfdqL/Z7SbETn5Ch/fjynfmQ8+pWkLrFA9jl5BktEYOAxlfJ duhg+xpFHP0Tv76VEx1tvk6qSjUOMoBIbqsuED+3wSDbS4jAIZwrUKsHMEtPNw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659454020; a=rsa-sha256; cv=none; b=ZEjI6SUmWX/0Utd1PJ7B/nLCESO8lnrbWgCnxTY61JrLnCHa+nWZZJpk3NeH1IK0Wdojd9 CACK2mU79nof+eIXXIN/n5zavit88a/OzNcfTz6mU2Zy48LNXimOHkx8bmpOrQgl+RZBig xOfOFwJPBlYEMC84Wz6XIoAL86diQ5Xr1yz4aBzdEBtPw7GeXEkNzYOOgHGMHbRxy/Rtd4 TxsVjZTF94PvLrzkkZzVnn6fob8byzE2GjZZqMMEThBhK5qArIIpvWdRll4tfBzwdmEmO0 MYCcOdXqpKGNqT8NWFWXG8PO2I319kdZTUHvL9zmpwBjzVEJeoJ2cIe91/eLKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -3.26 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 3548835AFF X-Spam-Score: -3.26 X-Migadu-Scanner: scn0.migadu.com X-TUID: zKpBMN29BSH9 Hello David, thanks for your comments and questions. David Bremner writes: > Alexander Adolf writes: > >> As I wanted email address completion via completion-at-point in >> message-mode too, I implemented a new EUDC function to go into >> completion-at-point-functions [3]. >> >> [1] https://company-mode.github.io >> [2] https://github.com/minad/corfu >> [3] https://github.com/emacs-mirror/emacs/blob/master/lisp/net/eudc-capf.el >> > > I will have to leave to others to test this, since I'm personally still > running emacs 27 (and that is likely to continue for a while, at least > on some machines). You could do (require 'eudcb-notmuch-address) (eudc-notmuch-address-set-server "localhost") and bind the function eudc-expand-inline to a key chord of your choice in message-mode-map. Then you'd no longer have to tweak message-completion-alist. This assumes that eudc-expand-inline is present in Emacs 27, of course, which I admittedly haven't checked. What you'd probably lose (or no longer need, whichever way you view it) is any company-mode integration. >> To close the loop, I also wrote an EUDC back-end to get candidates from >> notmuch-address (which attached). > > Is this something that you think should be included with notmuch? Good question. From my point of view: why not? Its added value would be "separation of concerns", i.e. you could drop any company-mode integration (and resort to whatever UI completion-at-point uses), you could stop modifying message-completion-alist, and notmuch-address-command could stay set to 'internal in all configurations. BUT, using the full potential depends on some core Emacs infrastructure, which will not be released until Emacs 29. Thus, from your point of view, it could be a two step process. In the first step, you could describe in the documentation how to bind eudc-expand-inline in message-mode-map, and how to set notmuch-address as the eudc-server. Just as I described above for your Emacs 27 setup. This would allow you to refrain from modifying message-completion-alist, and you could also drop any company mode integration from notmuch-address.el In the second step, when Emacs 29 will be released, the need for using eudc-expan-inline will be removed, and adding notmuch-address as an EUDC server alone will be enough. > If so, is it testable without requiring any extra packages? The short answer is yes. On an Emacs prior to version 29, there will be two restrictions: there won't be any way of having EUDC contribute to completion-at-point, and there won't be any multi-server query support in EUDC either. That said, you can still use it in a less versatile way as I have described above for your Emacs 27 setup. On an Emacs 29 or better, both gaps are filled (EUDC multi-server query, and completion-at-point), and message.el is updated to give the EUDC completion-at-point function a "foot in the door", i.e. it will be called _before_ message-completion-function when completion-at-point is invoked. Thus, if you add notmuch-address to eudc-server-hotlist, completion candidates from normuch-address will automagically show up without any further tweaking of message-mode on your part. Many thanks and looking forward to your thoughts, --alexander