From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0OOfELyDJmL+3gAAgWs5BA (envelope-from ) for ; Mon, 07 Mar 2022 23:14:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MPqBDbyDJmKWfgAAauVa8A (envelope-from ) for ; Mon, 07 Mar 2022 23:14:20 +0100 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 C0151AC1B for ; Mon, 7 Mar 2022 23:14:19 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E72735F6CC; Mon, 7 Mar 2022 22:14:16 +0000 (UTC) Received: from smtprelay08.ispgateway.de (smtprelay08.ispgateway.de [134.119.228.109]) by mail.notmuchmail.org (Postfix) with ESMTPS id 40E355F6B9 for ; Mon, 7 Mar 2022 22:14:15 +0000 (UTC) Received: from [46.244.211.227] (helo=condition-alpha.com) by smtprelay08.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nRLc1-0003dv-Rt; Mon, 07 Mar 2022 23:13:53 +0100 Message-Id: <3444ac96512ebdb53fb1faf90a2db263@condition-alpha.com> From: Alexander Adolf To: Utkarsh Singh , Tomi Ollila , Notmuch mailing list Subject: Re: [PATCH] emacs: Add more front ends for address completion In-Reply-To: <871qzfzgic.fsf@gmail.com> References: <87bkzhbez9.fsf@gmail.com> <115f4649ac25dff4073a32dba70e6db7@condition-alpha.com> <87wnhfjrer.fsf@gmail.com> <871qzfzgic.fsf@gmail.com> Date: Mon, 07 Mar 2022 23:14:13 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Message-ID-Hash: GDBZXOQ3RGAYVNEM43JAOEKV4UEJ7ROV X-Message-ID-Hash: GDBZXOQ3RGAYVNEM43JAOEKV4UEJ7ROV 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: X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646691260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=dpMFWGP1GPYqd4/vIyhIuj1ZQ7rKkNAz70JJthB9P/k=; b=kHxGqE7Ei0byzHZsj1n51aRob9Sswcl2ewtoNz/Lpy+GFPaR89qfC00iQkVskz1HvrMo3o ShUGB+4y4XxWqGQQSRXBumXQXeSCJU+FusVKh/3DQsebWwBRG8pE0Cb7JRmBVfBMepCsFs AK5AuyrdLssWxUrSnzYXy4NqHLlzuJc2Pr2A4uGgIYu8w3xlJhQK+ElUsXqTCCMcUwXT/b N/FHW78TRKShStKhx5TAczd1HgOcSKDYQ6YS6B/yktEM+NJx7K/upc4xc2SiX1TzI76VX2 8RKLVAMGaG99k9xVxibQWuoLxFBjf/IH4x6RT5KlhgRJgEL0uaTv1ceK/2f98g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646691260; a=rsa-sha256; cv=none; b=S4a8tBt2HFgm4EcglUFaL/kqs8lwA5U7mUy63/QVjz6xfZy9jaDeSCK0riODGF3TYq/RZn dA0jg0YpveshsctTRmXPMNOPuI0lUUYcXjlyC7GoZiKERCWVt9lQ4wng3j1V7AMZ5pA/ZX EW6x4phYhf73HfaN0+2JjPnn2x4mb7gj2EWR2WVrhzLhr9JF+eALySAr3AZ1tderfZKlMv TUsNKWPJSquzoAnQUy5Qd3d4L9bGXSub1W2FaHBP5GVDRDCeGioaVCn+L+OHfVUJML6IvS oU5/+TKTaaA+S1S2Lkz8OTuCEBYrrXmOPrKwCaJkgzQvaplaWSGhMYsmwku2kw== 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: -2.09 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: C0151AC1B X-Spam-Score: -2.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: bzEacWeFKidH --=-=-= Content-Type: text/plain Utkarsh Singh writes: > [...] > I don't think its possible to modify `notmuch-expand-name' into CAPF > without breaking backward compatibility. > [...] See attached. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=patch-notmuch-address.el Content-Transfer-Encoding: quoted-printable (defcustom notmuch-address-completion-style 'completion-at-point "Select the framework to use for email address completion. This variable determines which of the completion frameworks to use in the header area in `notmuch-message-mode' for completing email addresses. When set to `completion-at-point' (the default), in-buffer completion (i.e. where the point is) is used. This will trigger any third party package(s) providing a user interface on top of `completion-at-point'. When set to `completing-read', completion candidates will be offered in the minibuffer using `completing-read'. This will trigger any third party package(s) providing a user interface on top of `completing-read'." :type '(choice (const :tag "in-buffer (completion-at-point)" completion-a= t-point) (const :tag "minibuffer (completing-read)" completing-r= ead)) :group 'notmuch-send :group 'notmuch-address :group 'notmuch-external) (make-obsolete-variable notmuch-address-use-company "`company' support has been removed from notumuch-address. To continue using `company', set `notmuch-address-completion-style' to 'completion-at-point, and configure `company' to use the `company-capf' backend in `message-mode'." "0.35") (defun notmuch-address-complete-at-point (beg end orig) "Provide a completion table for email address completion candidates. This function is intended to be hooked into `message-completion-alist' with an appropriate regular expression matching message headers consisting of email recipients. It returns a completion table as is expected for functions listed in `completion-at-point-functions'." (setq-local completion-styles '(substring partial-completion) completion-ignore-case t) (list beg end (completion-table-dynamic (lambda (orig) (notmuch-address-options orig))) :exclusive 'no)) (defun notmuch-address-completing-read (beg end orig) "Choose email address completion candidates using `completing-read'." (let* ((options (with-temp-message "Looking for completion candidates..." (notmuch-address-options orig))) (num-options (length options)) (chosen (cond ((eq num-options 0) nil) ((eq num-options 1) (car options)) (t (funcall notmuch-address-selection-function (format "Address (%s matches): " num-options) options orig))))) (if chosen (progn (push chosen notmuch-address-history) (delete-region beg end) (insert chosen) (run-hook-with-args 'notmuch-address-post-completion-functions chosen)) (message "No matches.") (ding)))) (defun notmuch-address-expand-name () ;; nil =20=20 (cond (notmuch-address-command (let* ((end (point)) (beg (save-excursion (re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*") (goto-char (match-end 0)) (point))) (orig (buffer-substring-no-properties beg end)) (completion-ignore-case t)) (cond ((eq notmuch-address-completion-style 'completion-at-point) (notmuch-address-complete-at-point beg end orig)) ((eq notmuch-address-completion-style 'completing-read)=20 (notmuch-address-completing-read beg end orig)) (t nil)))) (t nil)) ) (provide 'patch-notmuch-address) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --=-=-=--