From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2DT1L1R7qF96AgAA0tVLHw (envelope-from ) for ; Sun, 08 Nov 2020 23:12:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wCnRK1R7qF/rGwAA1q6Kng (envelope-from ) for ; Sun, 08 Nov 2020 23:12:20 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 719499400D3 for ; Sun, 8 Nov 2020 23:12:20 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0183C28C01; Sun, 8 Nov 2020 18:12:02 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 7ABE727106 for ; Sun, 8 Nov 2020 18:11:53 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 0AFCD160CB for ; Mon, 9 Nov 2020 00:11:51 +0100 (CET) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id HXZycCgtlD5j for ; Mon, 9 Nov 2020 00:11:50 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (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 mail.hostpark.net (Postfix) with ESMTPSA id C4D9C160CE for ; Mon, 9 Nov 2020 00:11:50 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH 1/3] emacs: notmuch-address-setup: cosmetics Date: Mon, 9 Nov 2020 00:11:48 +0100 Message-Id: <20201108231150.5419-2-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201108231150.5419-1-jonas@bernoul.li> References: <20201108231150.5419-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: 6CFSJVJQW2K2GZ3DKCNMQAFIQ7HKK3QX X-Message-ID-Hash: 6CFSJVJQW2K2GZ3DKCNMQAFIQ7HKK3QX X-MailFrom: jonas@bernoul.li 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; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -0.01 X-TUID: fz07mcIB4j9c --- emacs/notmuch-address.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 8a6d299c..3518beef 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -21,6 +21,8 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) + (require 'message) (require 'notmuch-parser) (require 'notmuch-lib) @@ -154,15 +156,12 @@ (defcustom notmuch-address-use-company t :group 'notmuch-address) (defun notmuch-address-setup () - (let* ((setup-company (and notmuch-address-use-company - (require 'company nil t))) - (pair (cons notmuch-address-completion-headers-regexp - #'notmuch-address-expand-name))) - (when setup-company - (notmuch-company-setup)) - (unless (member pair message-completion-alist) - (setq message-completion-alist - (push pair message-completion-alist))))) + (when (and notmuch-address-use-company + (require 'company nil t)) + (notmuch-company-setup)) + (cl-pushnew (cons notmuch-address-completion-headers-regexp + #'notmuch-address-expand-name) + message-completion-alist :test #'equal)) (defun notmuch-address-toggle-internal-completion () "Toggle use of internal completion for current buffer. -- 2.29.1