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 1AD43429E39
\r
6 for <notmuch@notmuchmail.org>; Tue, 3 Sep 2013 14:45: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 HnbrR7EOqqMo for <notmuch@notmuchmail.org>;
\r
16 Tue, 3 Sep 2013 14:45:40 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id 4B4BC431FDA
\r
20 for <notmuch@notmuchmail.org>; Tue, 3 Sep 2013 14:45:33 -0700 (PDT)
\r
21 X-AuditID: 12074423-b7f168e00000095a-8d-5226587b6c3c
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 52.0E.02394.B7856225; Tue, 3 Sep 2013 17:45:31 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r83LjUdR023523;
\r
27 Tue, 3 Sep 2013 17:45:30 -0400
\r
28 Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r83LjRHv026855
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 3 Sep 2013 17:45:28 -0400
\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1VGyPe-0004xz-UJ; Tue, 03 Sep 2013 17:45:26 -0400
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v2 5/9] emacs: Move `notmuch-poll' to notmuch-lib
\r
40 Date: Tue, 3 Sep 2013 17:45:21 -0400
\r
41 Message-Id: <1378244725-18846-6-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.10.4
\r
43 In-Reply-To: <1378244725-18846-1-git-send-email-amdragon@mit.edu>
\r
44 References: <1378244725-18846-1-git-send-email-amdragon@mit.edu>
\r
45 X-Brightmail-Tracker:
\r
46 H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsUixCmqrVsdoRZksOaytUXTdGeL1XN5LK7f
\r
47 nMnswOyxc9Zddo9b91+zezxbdYs5gDmKyyYlNSezLLVI3y6BK+PipPdMBfsUK3b+t25g3Crd
\r
48 xcjJISFgIrHpficzhC0mceHeerYuRi4OIYF9jBJNq46zgCSEBDYwSsz/aQWROMwk0fR5MSuE
\r
49 M5dR4tezT2BVbAIaEtv2L2cEsUUEpCV23p3NCmIzC0RLHLk8gw3EFhZwlHj9Zjk7iM0ioCrx
\r
50 e8Y0sBpeAQeJY73zmSDOUJTofjYBrJ4TqL53wSJ2iCscJJpWXmafwMi/gJFhFaNsSm6Vbm5i
\r
51 Zk5xarJucXJiXl5qka6ZXm5miV5qSukmRlBgsbso72D8c1DpEKMAB6MSDy/DI9UgIdbEsuLK
\r
52 3EOMkhxMSqK8R0LVgoT4kvJTKjMSizPii0pzUosPMUpwMCuJ8Cb4AOV4UxIrq1KL8mFS0hws
\r
53 SuK8z56eDRQSSE8sSc1OTS1ILYLJynBwKEnwlocDNQoWpaanVqRl5pQgpJk4OEGG8wANXwNS
\r
54 w1tckJhbnJkOkT/FqCglzpsOkhAASWSU5sH1wiL/FaM40CvCvD0gVTzApAHX/QpoMBPQ4LTP
\r
55 qiCDSxIRUlINjPuybjY9f+zH6rHX3jHIcs3Dl96dZgk39cQkiwQnZMjPuzFj956yrL23D/XM
\r
56 3BdZpPHai4Fzfs+pZYumz/M7uND6wrf1jDse3dK7GPR2wlfbx9xz5lfU3lu15C+veFHr9pM+
\r
57 HebXCtVqGf1mMT7Znrot2UDwknhElNP5lXt1le/nLjWbZ5Z+xlqJpTgj0VCLuag4EQAWfYHA
\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: Tue, 03 Sep 2013 21:45: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