1 Return-Path: <dmitry.kurochkin@gmail.com>
\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 68A93429E26
\r
6 for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:43 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id V3ixSKzQo5jd for <notmuch@notmuchmail.org>;
\r
17 Mon, 12 Dec 2011 12:53:42 -0800 (PST)
\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com
\r
19 [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 97FD4429E25
\r
22 for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:42 -0800 (PST)
\r
23 Received: by bkat8 with SMTP id t8so6369247bka.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:53:41 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
27 :mime-version:content-type;
\r
28 bh=C0O6HPrBYGZLSh2sAuafVYOk5IWko9eYNLzqjZcGDpo=;
\r
29 b=RgKHxU4bUrhyimduKwxw9Pdfklg/j2hKxb65AYemnegCV3RDU0PqSyykXQxBrlCTbE
\r
30 Hs4f0ChVssrDuD5/JBqT9tGb7vlMgVT6b3R48DMGyycRsDxWVBdyuIseu2kmiA9n5C6u
\r
31 Mt7NY2tOkR0wMBtq3Gw4Dj+Ar2OSA7IEB0Qik=
\r
32 Received: by 10.204.128.197 with SMTP id l5mr11420001bks.58.1323723221183;
\r
33 Mon, 12 Dec 2011 12:53:41 -0800 (PST)
\r
34 Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id
\r
35 fg16sm35036990bkb.16.2011.12.12.12.53.39
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Mon, 12 Dec 2011 12:53:40 -0800 (PST)
\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
39 To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org
\r
40 Subject: Re: [PATCH v3] emacs: support "notmuch new" as a notmuch-poll-script
\r
41 In-Reply-To: <1323723004-32605-1-git-send-email-jani@nikula.org>
\r
42 References: <1323640100-18326-1-git-send-email-jani@nikula.org>
\r
43 <1323723004-32605-1-git-send-email-jani@nikula.org>
\r
44 User-Agent: Notmuch/0.10.2+94~g948b41d (http://notmuchmail.org) Emacs/23.3.1
\r
45 (x86_64-pc-linux-gnu)
\r
46 Date: Tue, 13 Dec 2011 00:53:05 +0400
\r
47 Message-ID: <87liqhbjgu.fsf@gmail.com>
\r
49 Content-Type: text/plain; charset=us-ascii
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Mon, 12 Dec 2011 20:53:43 -0000
\r
64 On Mon, 12 Dec 2011 22:50:04 +0200, Jani Nikula <jani@nikula.org> wrote:
\r
65 > Support nil value for notmuch-poll-script to run "notmuch new" instead of
\r
66 > an external script, and make this the new default. "notmuch new" is run
\r
67 > using the configured notmuch-command.
\r
69 > This allows taking better advantage of the "notmuch new" hooks from emacs
\r
70 > without intermediate scripts.
\r
72 > Signed-off-by: Jani Nikula <jani@nikula.org>
\r
76 > v3: only documentation changes suggested by Austin and Dmitry.
\r
78 > emacs/notmuch.el | 35 +++++++++++++++++++++++++----------
\r
79 > 1 files changed, 25 insertions(+), 10 deletions(-)
\r
81 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
82 > index 8936149..675a110 100644
\r
83 > --- a/emacs/notmuch.el
\r
84 > +++ b/emacs/notmuch.el
\r
85 > @@ -965,28 +965,43 @@ same relative position within the new buffer."
\r
86 > (notmuch-search query oldest-first target-thread target-line continuation)
\r
87 > (goto-char (point-min))))
\r
89 > -(defcustom notmuch-poll-script ""
\r
90 > +(defcustom notmuch-poll-script nil
\r
91 > "An external script to incorporate new mail into the notmuch database.
\r
93 > -If this variable is non empty, then it should name a script to be
\r
94 > -invoked by `notmuch-search-poll-and-refresh-view' and
\r
95 > +This variable controls the action invoked by
\r
96 > +`notmuch-search-poll-and-refresh-view' and
\r
97 > `notmuch-hello-poll-and-update' (each have a default keybinding
\r
98 > -of 'G'). The script could do any of the following depending on
\r
99 > +of 'G') to incorporate new mail into the notmuch database.
\r
101 > +If set to nil (the default), new mail is processed by invoking
\r
102 > +\"notmuch new\". Otherwise, this should be set to a string that
\r
103 > +gives the name of an external script that processes new mail. If
\r
104 > +set to the empty string, no command will be run.
\r
106 I think this should be "an empty string". But I may be mistaking.
\r
112 > +The external script could do any of the following depending on
\r
113 > the user's needs:
\r
115 > 1. Invoke a program to transfer mail to the local mail store
\r
116 > 2. Invoke \"notmuch new\" to incorporate the new mail
\r
117 > -3. Invoke one or more \"notmuch tag\" commands to classify the mail"
\r
119 > +3. Invoke one or more \"notmuch tag\" commands to classify the mail
\r
121 > +Note that the recommended way of achieving the same is using
\r
122 > +\"notmuch new\" hooks."
\r
123 > + :type '(choice (const :tag "notmuch new" nil)
\r
124 > + (const :tag "Disabled" "")
\r
125 > + (string :tag "Custom script"))
\r
128 > (defun notmuch-poll ()
\r
129 > - "Run external script to import mail.
\r
130 > + "Run \"notmuch new\" or an external script to import mail.
\r
132 > -Invokes `notmuch-poll-script' if it is not set to an empty string."
\r
133 > +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing
\r
134 > +depending on the value of `notmuch-poll-script'."
\r
136 > - (if (not (string= notmuch-poll-script ""))
\r
137 > - (call-process notmuch-poll-script nil nil)))
\r
138 > + (if (stringp notmuch-poll-script)
\r
139 > + (if (not (string= notmuch-poll-script ""))
\r
140 > + (call-process notmuch-poll-script nil nil))
\r
141 > + (call-process notmuch-command nil nil nil "new")))
\r
143 > (defun notmuch-search-poll-and-refresh-view ()
\r
144 > "Invoke `notmuch-poll' to import mail, then refresh the current view."
\r
148 > _______________________________________________
\r
149 > notmuch mailing list
\r
150 > notmuch@notmuchmail.org
\r
151 > http://notmuchmail.org/mailman/listinfo/notmuch
\r