[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / c8 / d882b65f7eda895213f1ab392e3d65d595c541
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 589E1429E26\r
6         for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:12:40 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \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 eakC8iZ59Mw2 for <notmuch@notmuchmail.org>;\r
17         Mon, 12 Dec 2011 12:12:39 -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 70E4D429E25\r
22         for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:12:39 -0800 (PST)\r
23 Received: by bkat8 with SMTP id t8so6320477bka.26\r
24         for <notmuch@notmuchmail.org>; Mon, 12 Dec 2011 12:12:38 -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=VqOycFaiHOgoQV2FinP6Eai5AlrIkpl+1aVuieoM894=;\r
29         b=YRZWsztoA3zsH+JN9UKVaKZdinehVhqpDEuzk/yWasCrV4MeJGnchf8VLoxlX2fO8V\r
30         TDOGpBpJ5Rc0csml7viwLADB0Ao3Noj+NwMNpI6NlfCa8JTLvw5i0f0VKYv/mrti9z/p\r
31         IDI1PlDtzpSQHTLaXrtajMg7dH0MLb34phlE4=\r
32 Received: by 10.204.156.208 with SMTP id y16mr10876939bkw.72.1323720757949;\r
33         Mon, 12 Dec 2011 12:12:37 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id q16sm1646883bky.10.2011.12.12.12.12.36\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Mon, 12 Dec 2011 12:12:36 -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 v2] emacs: support "notmuch new" as a notmuch-poll-script\r
41 In-Reply-To: <1323719848-27958-1-git-send-email-jani@nikula.org>\r
42 References: <1323640100-18326-1-git-send-email-jani@nikula.org>\r
43         <1323719848-27958-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:12:01 +0400\r
47 Message-ID: <87obvdblda.fsf@gmail.com>\r
48 MIME-Version: 1.0\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
52 Precedence: list\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:12:40 -0000\r
63 \r
64 Hi Jani.\r
65 \r
66 On Mon, 12 Dec 2011 21:57:28 +0200, Jani Nikula <jani@nikula.org> wrote:\r
67 > Support nil value for notmuch-poll-script to run "notmuch new" instead of\r
68 > an external script, and make this the new default. "notmuch new" is run\r
69 > using the configured notmuch-command.\r
70\r
71 > This allows taking better advantage of the "notmuch new" hooks from emacs\r
72 > without intermediate scripts.\r
73\r
74 > Signed-off-by: Jani Nikula <jani@nikula.org>\r
75 \r
76 Looks good to me.  Few comments regarding documentation below.\r
77 \r
78 > ---\r
79 >  emacs/notmuch.el |   34 ++++++++++++++++++++++++----------\r
80 >  1 files changed, 24 insertions(+), 10 deletions(-)\r
81\r
82 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
83 > index 8936149..5a8ab9d 100644\r
84 > --- a/emacs/notmuch.el\r
85 > +++ b/emacs/notmuch.el\r
86 > @@ -965,28 +965,42 @@ same relative position within the new buffer."\r
87 >      (notmuch-search query oldest-first target-thread target-line continuation)\r
88 >      (goto-char (point-min))))\r
89 >  \r
90 > -(defcustom notmuch-poll-script ""\r
91 > +(defcustom notmuch-poll-script nil\r
92 >    "An external script to incorporate new mail into the notmuch database.\r
93 >  \r
94 > -If this variable is non empty, then it should name a script to be\r
95 > -invoked by `notmuch-search-poll-and-refresh-view' and\r
96 > +This variable controls the action invoked by\r
97 > +`notmuch-search-poll-and-refresh-view' and\r
98 >  `notmuch-hello-poll-and-update' (each have a default keybinding\r
99 > -of 'G'). The script could do any of the following depending on\r
100 > +of 'G') to incorporate new mail into the notmuch database.\r
101 > +\r
102 > +If this variable is non empty, then it should name an external\r
103 \r
104 Please s/non empty/non-empty string/ to make it more clear.\r
105 \r
106 > +script to be run. If set to an empty string, no action is\r
107 > +invoked. Finally, if set to nil (the default), \"notmuch new\" is\r
108 > +run using the command specified by `notmuch-command'.\r
109 > +\r
110 > +The external script could do any of the following depending on\r
111 >  the user's needs:\r
112 >  \r
113 >  1. Invoke a program to transfer mail to the local mail store\r
114 >  2. Invoke \"notmuch new\" to incorporate the new mail\r
115 > -3. Invoke one or more \"notmuch tag\" commands to classify the mail"\r
116 > -  :type 'string\r
117 > +3. Invoke one or more \"notmuch tag\" commands to classify the mail\r
118 > +\r
119 > +Note that the same can be achieved through \"notmuch new\" hooks."\r
120 \r
121 s/though/using/?\r
122 \r
123 Would be nice to mention that using hooks is the recommended way for\r
124 this.\r
125 \r
126 > +  :type '(choice (const :tag "Notmuch new" nil)\r
127 \r
128 Perhaps s/Notmuch/notmuch/ because we are talking about a command here?\r
129 \r
130 Regards,\r
131   Dmitry\r
132 \r
133 > +              (const :tag "Disabled" "")\r
134 > +              (string :tag "Custom script"))\r
135 >    :group 'notmuch)\r
136 >  \r
137 >  (defun notmuch-poll ()\r
138 > -  "Run external script to import mail.\r
139 > +  "Run \"notmuch new\" or an external script to import mail.\r
140 >  \r
141 > -Invokes `notmuch-poll-script' if it is not set to an empty string."\r
142 > +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing\r
143 > +depending on the value of `notmuch-poll-script'."\r
144 >    (interactive)\r
145 > -  (if (not (string= notmuch-poll-script ""))\r
146 > -      (call-process notmuch-poll-script nil nil)))\r
147 > +  (if (stringp notmuch-poll-script)\r
148 > +      (if (not (string= notmuch-poll-script ""))\r
149 > +       (call-process notmuch-poll-script nil nil))\r
150 > +    (call-process notmuch-command nil nil nil "new")))\r
151 >  \r
152 >  (defun notmuch-search-poll-and-refresh-view ()\r
153 >    "Invoke `notmuch-poll' to import mail, then refresh the current view."\r
154 > -- \r
155 > 1.7.5.4\r
156\r
157 > _______________________________________________\r
158 > notmuch mailing list\r
159 > notmuch@notmuchmail.org\r
160 > http://notmuchmail.org/mailman/listinfo/notmuch\r