1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 6DFC56DE1452
\r
6 for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 10:44:23 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.098 tagged_above=-999 required=5 tests=[AWL=0.098]
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id LHlEEV5coH3H for <notmuch@notmuchmail.org>;
\r
16 Sat, 24 Oct 2015 10:44:21 -0700 (PDT)
\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 9F07A6DE1034
\r
19 for <notmuch@notmuchmail.org>; Sat, 24 Oct 2015 10:44:21 -0700 (PDT)
\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
21 (envelope-from <bremner@tethera.net>)
\r
22 id 1Zq2q4-0001Im-An; Sat, 24 Oct 2015 17:42:44 +0000
\r
23 Received: (nullmailer pid 32260 invoked by uid 1000); Sat, 24 Oct 2015
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
27 Subject: [PATCH 1/3] emacs: replace use of notmuch-address-message-insinuate
\r
28 Date: Sat, 24 Oct 2015 14:41:22 -0300
\r
29 Message-Id: <1445708484-32189-2-git-send-email-david@tethera.net>
\r
30 X-Mailer: git-send-email 2.6.1
\r
31 In-Reply-To: <1445708484-32189-1-git-send-email-david@tethera.net>
\r
32 References: <1445702019-10638-1-git-send-email-markwalters1009@gmail.com>
\r
33 <1445708484-32189-1-git-send-email-david@tethera.net>
\r
34 X-BeenThere: notmuch@notmuchmail.org
\r
35 X-Mailman-Version: 2.1.20
\r
37 List-Id: "Use and development of the notmuch mail system."
\r
38 <notmuch.notmuchmail.org>
\r
39 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
42 List-Post: <mailto:notmuch@notmuchmail.org>
\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
44 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
46 X-List-Received-Date: Sat, 24 Oct 2015 17:44:23 -0000
\r
48 This allows e.g. Gnus users to load this file without changing
\r
49 message-mode behaviour.
\r
51 This will disable completion for those that did not customize the
\r
52 variable but relied on the existence of a file named "notmuch-addresses"
\r
53 in their path. In the next commit the default behaviour will change to
\r
54 use a "workalike" internal completion mechanism.
\r
56 emacs/notmuch-address.el | 20 +++++---------------
\r
57 emacs/notmuch-mua.el | 7 +++++--
\r
58 2 files changed, 10 insertions(+), 17 deletions(-)
\r
60 diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
\r
61 index fde3c1b..39200ef 100644
\r
62 --- a/emacs/notmuch-address.el
\r
63 +++ b/emacs/notmuch-address.el
\r
68 -(defcustom notmuch-address-command "notmuch-addresses"
\r
69 +(defcustom notmuch-address-command nil
\r
70 "The command which generates possible addresses. It must take a
\r
71 single argument and output a list of possible matches, one per
\r
74 +line. The default value of nil disables address completion."
\r
76 + (const :tag "Disable address completion" nil)
\r
77 + (string :tag "Use external completion command" "notmuch-addresses"))
\r
78 :group 'notmuch-send
\r
79 :group 'notmuch-external)
\r
81 @@ -54,11 +56,6 @@ to know how address selection is made by default."
\r
83 (defvar notmuch-address-history nil)
\r
85 -(defun notmuch-address-message-insinuate ()
\r
86 - (unless (memq notmuch-address-message-alist-member message-completion-alist)
\r
87 - (setq message-completion-alist
\r
88 - (push notmuch-address-message-alist-member message-completion-alist))))
\r
90 (defun notmuch-address-options (original)
\r
91 (process-lines notmuch-address-command original))
\r
93 @@ -109,11 +106,4 @@ to know how address selection is made by default."
\r
94 (not (file-directory-p bin))))
\r
95 (throw 'found-command bin))))))))
\r
97 -;; If we can find the program specified by `notmuch-address-command',
\r
98 -;; insinuate ourselves into `message-mode'.
\r
99 -(when (notmuch-address-locate-command notmuch-address-command)
\r
100 - (notmuch-address-message-insinuate))
\r
104 (provide 'notmuch-address)
\r
105 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
106 index 57465b2..6cc9656 100644
\r
107 --- a/emacs/notmuch-mua.el
\r
108 +++ b/emacs/notmuch-mua.el
\r
109 @@ -269,7 +269,11 @@ Note that these functions use `mail-citation-hook' if that is non-nil."
\r
110 (set-buffer-modified-p nil))
\r
112 (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"
\r
113 - "Notmuch message composition mode. Mostly like `message-mode'")
\r
114 + "Notmuch message composition mode. Mostly like `message-mode'"
\r
115 + (when notmuch-address-command
\r
116 + (unless (memq notmuch-address-message-alist-member message-completion-alist)
\r
117 + (setq message-completion-alist
\r
118 + (push notmuch-address-message-alist-member message-completion-alist)))))
\r
120 (define-key notmuch-message-mode-map (kbd "C-c C-c") #'notmuch-mua-send-and-exit)
\r
121 (define-key notmuch-message-mode-map (kbd "C-c C-s") #'notmuch-mua-send)
\r
122 @@ -296,7 +300,6 @@ OTHER-ARGS are passed through to `message-mail'."
\r
123 (message-hide-headers)
\r
124 (set-buffer-modified-p nil)
\r
125 (notmuch-mua-maybe-set-window-dedicated)
\r
129 (defcustom notmuch-identities nil
\r