1 Return-Path: <amdragon@mit.edu>
\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 olra.theworths.org (Postfix) with ESMTP id 2F405431FAE
\r
6 for <notmuch@notmuchmail.org>; Thu, 29 Aug 2013 09:26:48 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 1cjdAex7nr5P for <notmuch@notmuchmail.org>;
\r
16 Thu, 29 Aug 2013 09:26:43 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id B772C431E64
\r
20 for <notmuch@notmuchmail.org>; Thu, 29 Aug 2013 09:26:15 -0700 (PDT)
\r
21 X-AuditID: 1209190c-b7fac8e000006335-6e-521f762768d1
\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
23 by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1C.CE.25397.7267F125; Thu, 29 Aug 2013 12:26:15 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
26 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r7TGQ3dj025414;
\r
27 Thu, 29 Aug 2013 12:26:04 -0400
\r
28 Received: from drake.dyndns.org
\r
29 (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [216.15.114.40]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7TGQ1aM014997
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Thu, 29 Aug 2013 12:26:02 -0400
\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
36 (envelope-from <amdragon@mit.edu>)
\r
37 id 1VF52n-0007Wt-2K; Thu, 29 Aug 2013 12:26:01 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 5/9] emacs: Move `notmuch-poll' to notmuch-lib
\r
41 Date: Thu, 29 Aug 2013 12:25:53 -0400
\r
42 Message-Id: <1377793557-28878-6-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.10.4
\r
44 In-Reply-To: <1377793557-28878-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1377793557-28878-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6noqteJh9kcLKN3+L6zZnMDowez1bd
\r
48 Yg5gjOKySUnNySxLLdK3S+DKuDjpPVPBPsWKnf+tGxi3SncxcnJICJhIrNy4ghHCFpO4cG89
\r
49 WxcjF4eQwD5GicdfLzFCOBsZJVb8X8QGUiUkcIdJ4sGOCojEXEaJyeeeg7WzCWhIbNu/HMwW
\r
50 EZCW2Hl3NmsXIwcHs4CaxJ8uFZCwsICdxOpZy5lAbBYBVYn5D9+A2bwCDhLN67tYIa5QlOh+
\r
51 NgFsF6eAo0T/3bcsEHsdJP5cfMo+gZF/ASPDKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl1DvdzM
\r
52 Er3UlNJNjKCQ4ZTk2cH45qDSIUYBDkYlHt6OQPkgIdbEsuLK3EOMkhxMSqK8gSVAIb6k/JTK
\r
53 jMTijPii0pzU4kOMEhzMSiK8bzmBcrwpiZVVqUX5MClpDhYlcd6nT88GCgmkJ5akZqemFqQW
\r
54 wWRlODiUJHjjS4EaBYtS01Mr0jJzShDSTBycIMN5gIaXg9TwFhck5hZnpkPkTzEqSonz5oEk
\r
55 BEASGaV5cL2wmH7FKA70ijCvJEgVDzAdwHW/AhrMBDR4Qr4cyOCSRISUVANj2VUmi40fD9dd
\r
56 NOYPqCuIuf7uxu+TMbnnfgY9vWk0m2ebfMe5q/v8O7n6Xu81Z/r2aFKO4Nmd7UaNDTO97Z+W
\r
57 7t3tynbvgdTn+bNnCwSdfa8/Zfknjd+L1Z5+XLzxVcdsr9qX/Mbn95XIyoak3GeJnl7qWZ0j
\r
58 vHaj40bbvW8PeamE+9+wKk23VGIpzkg01GIuKk4EAOBycoLEAgAA
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Thu, 29 Aug 2013 16:26:48 -0000
\r
74 emacs/notmuch-lib.el | 38 ++++++++++++++++++++++++++++++++++++++
\r
75 emacs/notmuch.el | 38 --------------------------------------
\r
76 2 files changed, 38 insertions(+), 38 deletions(-)
\r
78 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
79 index 4796f17..9754e16 100644
\r
80 --- a/emacs/notmuch-lib.el
\r
81 +++ b/emacs/notmuch-lib.el
\r
82 @@ -76,6 +76,33 @@ search."
\r
84 :group 'notmuch-search)
\r
86 +(defcustom notmuch-poll-script nil
\r
87 + "An external script to incorporate new mail into the notmuch database.
\r
89 +This variable controls the action invoked by
\r
90 +`notmuch-search-poll-and-refresh-view' and
\r
91 +`notmuch-hello-poll-and-update' (each have a default keybinding
\r
92 +of 'G') to incorporate new mail into the notmuch database.
\r
94 +If set to nil (the default), new mail is processed by invoking
\r
95 +\"notmuch new\". Otherwise, this should be set to a string that
\r
96 +gives the name of an external script that processes new mail. If
\r
97 +set to the empty string, no command will be run.
\r
99 +The external script could do any of the following depending on
\r
102 +1. Invoke a program to transfer mail to the local mail store
\r
103 +2. Invoke \"notmuch new\" to incorporate the new mail
\r
104 +3. Invoke one or more \"notmuch tag\" commands to classify the mail
\r
106 +Note that the recommended way of achieving the same is using
\r
107 +\"notmuch new\" hooks."
\r
108 + :type '(choice (const :tag "notmuch new" nil)
\r
109 + (const :tag "Disabled" "")
\r
110 + (string :tag "Custom script"))
\r
111 + :group 'notmuch-external)
\r
115 (defvar notmuch-search-history nil
\r
116 @@ -161,6 +188,17 @@ Otherwise the output will be returned"
\r
117 "Return the user.other_email value (as a list) from the notmuch configuration."
\r
118 (split-string (notmuch-config-get "user.other_email") "\n"))
\r
120 +(defun notmuch-poll ()
\r
121 + "Run \"notmuch new\" or an external script to import mail.
\r
123 +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
\r
124 +depending on the value of `notmuch-poll-script'."
\r
126 + (if (stringp notmuch-poll-script)
\r
127 + (unless (string= notmuch-poll-script "")
\r
128 + (call-process notmuch-poll-script nil nil))
\r
129 + (call-process notmuch-command nil nil nil "new")))
\r
131 (defun notmuch-kill-this-buffer ()
\r
132 "Kill the current buffer."
\r
134 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
135 index 00cf271..82cece8 100644
\r
136 --- a/emacs/notmuch.el
\r
137 +++ b/emacs/notmuch.el
\r
138 @@ -959,44 +959,6 @@ same relative position within the new buffer."
\r
139 (notmuch-search query oldest-first target-thread target-line)
\r
140 (goto-char (point-min))))
\r
142 -(defcustom notmuch-poll-script nil
\r
143 - "An external script to incorporate new mail into the notmuch database.
\r
145 -This variable controls the action invoked by
\r
146 -`notmuch-search-poll-and-refresh-view' and
\r
147 -`notmuch-hello-poll-and-update' (each have a default keybinding
\r
148 -of 'G') to incorporate new mail into the notmuch database.
\r
150 -If set to nil (the default), new mail is processed by invoking
\r
151 -\"notmuch new\". Otherwise, this should be set to a string that
\r
152 -gives the name of an external script that processes new mail. If
\r
153 -set to the empty string, no command will be run.
\r
155 -The external script could do any of the following depending on
\r
158 -1. Invoke a program to transfer mail to the local mail store
\r
159 -2. Invoke \"notmuch new\" to incorporate the new mail
\r
160 -3. Invoke one or more \"notmuch tag\" commands to classify the mail
\r
162 -Note that the recommended way of achieving the same is using
\r
163 -\"notmuch new\" hooks."
\r
164 - :type '(choice (const :tag "notmuch new" nil)
\r
165 - (const :tag "Disabled" "")
\r
166 - (string :tag "Custom script"))
\r
167 - :group 'notmuch-external)
\r
169 -(defun notmuch-poll ()
\r
170 - "Run \"notmuch new\" or an external script to import mail.
\r
172 -Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
\r
173 -depending on the value of `notmuch-poll-script'."
\r
175 - (if (stringp notmuch-poll-script)
\r
176 - (unless (string= notmuch-poll-script "")
\r
177 - (call-process notmuch-poll-script nil nil))
\r
178 - (call-process notmuch-command nil nil nil "new")))
\r
180 (defun notmuch-search-poll-and-refresh-view ()
\r
181 "Invoke `notmuch-poll' to import mail, then refresh the current view."
\r