1 Return-Path: <pieter@praet.org>
\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 5AAFF429E26
\r
6 for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:33:12 -0800 (PST)
\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 3C6gv4Qe7pFg for <notmuch@notmuchmail.org>;
\r
16 Thu, 12 Jan 2012 09:33:11 -0800 (PST)
\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
\r
18 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 7EB72429E25
\r
21 for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:33:11 -0800 (PST)
\r
22 Received: by werm12 with SMTP id m12so1815017wer.26
\r
23 for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:33:10 -0800 (PST)
\r
24 Received: by 10.216.139.195 with SMTP id c45mr512546wej.18.1326389590158;
\r
25 Thu, 12 Jan 2012 09:33:10 -0800 (PST)
\r
26 Received: from localhost ([109.131.126.209])
\r
27 by mx.google.com with ESMTPS id ga4sm6549922wbb.4.2012.01.12.09.33.08
\r
28 (version=TLSv1/SSLv3 cipher=OTHER);
\r
29 Thu, 12 Jan 2012 09:33:09 -0800 (PST)
\r
30 From: Pieter Praet <pieter@praet.org>
\r
31 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
32 Subject: Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script
\r
33 In-Reply-To: <1323723004-32605-1-git-send-email-jani@nikula.org>
\r
34 References: <1323640100-18326-1-git-send-email-jani@nikula.org>
\r
35 <1323723004-32605-1-git-send-email-jani@nikula.org>
\r
36 User-Agent: Notmuch/0.10.2+115~gadd29f6 (http://notmuchmail.org) Emacs/23.3.1
\r
37 (x86_64-unknown-linux-gnu)
\r
38 Date: Thu, 12 Jan 2012 18:31:25 +0100
\r
39 Message-ID: <87vcogketu.fsf@praet.org>
\r
41 Content-Type: text/plain; charset=us-ascii
\r
42 X-BeenThere: notmuch@notmuchmail.org
\r
43 X-Mailman-Version: 2.1.13
\r
45 List-Id: "Use and development of the notmuch mail system."
\r
46 <notmuch.notmuchmail.org>
\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
50 List-Post: <mailto:notmuch@notmuchmail.org>
\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
53 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
54 X-List-Received-Date: Thu, 12 Jan 2012 17:33:12 -0000
\r
56 On Mon, 12 Dec 2011 22:50:04 +0200, Jani Nikula <jani@nikula.org> wrote:
\r
57 > Support nil value for notmuch-poll-script to run "notmuch new" instead of
\r
58 > an external script, and make this the new default. "notmuch new" is run
\r
59 > using the configured notmuch-command.
\r
61 > This allows taking better advantage of the "notmuch new" hooks from emacs
\r
62 > without intermediate scripts.
\r
64 > Signed-off-by: Jani Nikula <jani@nikula.org>
\r
68 > v3: only documentation changes suggested by Austin and Dmitry.
\r
70 > emacs/notmuch.el | 35 +++++++++++++++++++++++++----------
\r
71 > 1 files changed, 25 insertions(+), 10 deletions(-)
\r
73 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
74 > index 8936149..675a110 100644
\r
75 > --- a/emacs/notmuch.el
\r
76 > +++ b/emacs/notmuch.el
\r
77 > @@ -965,28 +965,43 @@ same relative position within the new buffer."
\r
78 > (notmuch-search query oldest-first target-thread target-line continuation)
\r
79 > (goto-char (point-min))))
\r
81 > -(defcustom notmuch-poll-script ""
\r
82 > +(defcustom notmuch-poll-script nil
\r
83 > "An external script to incorporate new mail into the notmuch database.
\r
85 > -If this variable is non empty, then it should name a script to be
\r
86 > -invoked by `notmuch-search-poll-and-refresh-view' and
\r
87 > +This variable controls the action invoked by
\r
88 > +`notmuch-search-poll-and-refresh-view' and
\r
89 > `notmuch-hello-poll-and-update' (each have a default keybinding
\r
90 > -of 'G'). The script could do any of the following depending on
\r
91 > +of 'G') to incorporate new mail into the notmuch database.
\r
93 > +If set to nil (the default), new mail is processed by invoking
\r
94 > +\"notmuch new\". Otherwise, this should be set to a string that
\r
95 > +gives the name of an external script that processes new mail. If
\r
96 > +set to the empty string, no command will be run.
\r
98 > +The external script could do any of the following depending on
\r
101 > 1. Invoke a program to transfer mail to the local mail store
\r
102 > 2. Invoke \"notmuch new\" to incorporate the new mail
\r
103 > -3. Invoke one or more \"notmuch tag\" commands to classify the mail"
\r
105 > +3. Invoke one or more \"notmuch tag\" commands to classify the mail
\r
107 > +Note that the recommended way of achieving the same is using
\r
108 > +\"notmuch new\" hooks."
\r
109 > + :type '(choice (const :tag "notmuch new" nil)
\r
110 > + (const :tag "Disabled" "")
\r
111 > + (string :tag "Custom script"))
\r
114 > (defun notmuch-poll ()
\r
115 > - "Run external script to import mail.
\r
116 > + "Run \"notmuch new\" or an external script to import mail.
\r
118 > -Invokes `notmuch-poll-script' if it is not set to an empty string."
\r
119 > +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
\r
120 > +depending on the value of `notmuch-poll-script'."
\r
122 > - (if (not (string= notmuch-poll-script ""))
\r
123 > - (call-process notmuch-poll-script nil nil)))
\r
124 > + (if (stringp notmuch-poll-script)
\r
125 > + (if (not (string= notmuch-poll-script ""))
\r
126 > + (call-process notmuch-poll-script nil nil))
\r
127 > + (call-process notmuch-command nil nil nil "new")))
\r
129 Since it seems to be bikeshedding-season:
\r
131 When `(if (not's don't have an `else'-part, use `unless' instead ?
\r
136 > (defun notmuch-search-poll-and-refresh-view ()
\r
137 > "Invoke `notmuch-poll' to import mail, then refresh the current view."
\r
141 > _______________________________________________
\r
142 > notmuch mailing list
\r
143 > notmuch@notmuchmail.org
\r
144 > http://notmuchmail.org/mailman/listinfo/notmuch
\r
147 Nicely complements the new hooks (for which thanks) !
\r