[PATCH 2/4] emacs: add function notmuch-address--message-insinuated

Subject: [PATCH 2/4] emacs: add function notmuch-address--message-insinuated

Date: Wed, 2 Sep 2015 17:34:40 +0300

To: notmuch@notmuchmail.org

Cc: tomi.ollila@iki.fi

From: Tomi Ollila


This function is currently used in notmuch-address-message-insinuate
(to not enable address completion if it is already enabled). In near future
this will be called in other functions to know whether address completion
can be used there, too.
---

Since id:1440619626-18768-1-git-send-email-tomi.ollila@iki.fi
  - changed defsubst to defun

 emacs/notmuch-address.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index fde3c1b2b861..8982a415ce11 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -54,8 +54,11 @@ (defvar notmuch-address-message-alist-member
 
 (defvar notmuch-address-history nil)
 
+(defun notmuch-address--message-insinuated ()
+  (memq notmuch-address-message-alist-member message-completion-alist))
+
 (defun notmuch-address-message-insinuate ()
-  (unless (memq notmuch-address-message-alist-member message-completion-alist)
+  (unless (notmuch-address--message-insinuated)
     (setq message-completion-alist
 	  (push notmuch-address-message-alist-member message-completion-alist))))
 
-- 
2.0.0


Thread: