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 840EA431FDA
\r
6 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 09:19:04 -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 LSqPd5cVltuK for <notmuch@notmuchmail.org>;
\r
17 Sat, 28 Jan 2012 09:19:01 -0800 (PST)
\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-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 BD979431FD2
\r
22 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 09:19:00 -0800 (PST)
\r
23 Received: by bke11 with SMTP id 11so176016bke.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 28 Jan 2012 09:18:59 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=from:to:cc:subject:in-reply-to:references:user-agent:date
\r
27 :message-id:mime-version:content-type:content-transfer-encoding;
\r
28 bh=HOkTn2/KsE9BrrqbY9XecSxJjN/Quq7tnsqZCNdiVzs=;
\r
29 b=b0Okv806WPlrafSq7MffoWNVeIi+OZvjyq9AVP2SGQQBc18FUfvsMuH7HyrKgA5zli
\r
30 mgei5JH8Lc9jnFs6JpLnJhGdP6V5B2yGjISBchSBzio0pFcFxjU0ejwPNGfwD+ypKoud
\r
31 G9Pomyvnm5mA1MUDGW5DrmZkDptAvB5OFL8GQ=
\r
32 Received: by 10.204.10.65 with SMTP id o1mr5321645bko.19.1327771137649;
\r
33 Sat, 28 Jan 2012 09:18:57 -0800 (PST)
\r
34 Received: from localhost ([91.144.186.21])
\r
35 by mx.google.com with ESMTPS id ez5sm24395359bkc.15.2012.01.28.09.18.56
\r
36 (version=TLSv1/SSLv3 cipher=OTHER);
\r
37 Sat, 28 Jan 2012 09:18:56 -0800 (PST)
\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
39 To: Jeremy Nickurak <not-much@trk.nickurak.ca>
\r
40 Subject: Re: [PATCH 3/6] emacs: make "+" and "-" tagging operations more
\r
43 <CA+eQo_0Ddb89pRELBsXSrrkC69PGGrm9fwYg5YGU8g59LqACvQ@mail.gmail.com>
\r
44 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
45 <1327725684-5887-3-git-send-email-dmitry.kurochkin@gmail.com>
\r
46 <CA+eQo_0Ddb89pRELBsXSrrkC69PGGrm9fwYg5YGU8g59LqACvQ@mail.gmail.com>
\r
47 User-Agent: Notmuch/0.11+134~g7ddba9d (http://notmuchmail.org) Emacs/23.3.1
\r
48 (x86_64-pc-linux-gnu)
\r
49 Date: Sat, 28 Jan 2012 21:17:47 +0400
\r
50 Message-ID: <87pqe3926c.fsf@gmail.com>
\r
52 Content-Type: text/plain; charset=utf-8
\r
53 Content-Transfer-Encoding: quoted-printable
\r
54 Cc: notmuch@notmuchmail.org
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Sat, 28 Jan 2012 17:19:04 -0000
\r
69 On Sat, 28 Jan 2012 09:49:33 -0700, Jeremy Nickurak <not-much@trk.nickurak.=
\r
71 > Is it safe to assume that any reasonable seperator (comma, space,
\r
72 > semicolon, plus or minus sign, anything) won't show up in a tag name?
\r
75 No. Threre are existing issues with tag names that contain "unexpected"
\r
76 characters. This series does not aim to resolve them and not make it
\r
77 worse. Also see Jani's reply to another patch in the series.
\r
82 [1] id:"CAB+hUn834oJ+XGx-YyYSGxSnzrBYCMvcu4Vd73ws28qTS2riuA@mail.gmail.com"
\r
84 > On Fri, Jan 27, 2012 at 21:41, Dmitry Kurochkin
\r
85 > <dmitry.kurochkin@gmail.com> wrote:
\r
86 > > Before the change, "+" and "-" tagging operations in notmuch-search
\r
87 > > and notmuch-show views accepted only a single tag. =C2=A0The patch makes
\r
88 > > them use the recently added `notmuch-select-tags-with-completion'
\r
89 > > function, which allows to enter multiple tags with "+" and "-"
\r
90 > > prefixes. =C2=A0So after the change, "+" and "-" bindings allow to both=
\r
92 > > and remove multiple tags. =C2=A0The only difference between "+" and "-"=
\r
94 > > the minibuffer initial input ("+" and "-" respectively).
\r
96 > > =C2=A0emacs/notmuch-show.el | =C2=A0 65 +++++++------------
\r
97 > > =C2=A0emacs/notmuch.el =C2=A0 =C2=A0 =C2=A0| =C2=A0165 ++++++++++++++++=
\r
98 +++++++++------------------------
\r
99 > > =C2=A02 files changed, 107 insertions(+), 123 deletions(-)
\r
101 > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
102 > > index 84ac624..03eadfb 100644
\r
103 > > --- a/emacs/notmuch-show.el
\r
104 > > +++ b/emacs/notmuch-show.el
\r
105 > > @@ -38,8 +38,9 @@
\r
107 > > =C2=A0(declare-function notmuch-call-notmuch-process "notmuch" (&rest a=
\r
109 > > =C2=A0(declare-function notmuch-fontify-headers "notmuch" nil)
\r
110 > > -(declare-function notmuch-select-tag-with-completion "notmuch" (prompt=
\r
111 &rest search-terms))
\r
112 > > +(declare-function notmuch-select-tags-with-completion "notmuch" (&opti=
\r
113 onal initial-input &rest search-terms))
\r
114 > > =C2=A0(declare-function notmuch-search-show-thread "notmuch" nil)
\r
115 > > +(declare-function notmuch-update-tags "notmuch" (current-tags changed-=
\r
118 > > =C2=A0(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
\r
119 > > =C2=A0 "Headers that should be shown in a message, in this order.
\r
120 > > @@ -1267,7 +1268,7 @@ Some useful entries are:
\r
122 > > =C2=A0(defun notmuch-show-mark-read ()
\r
123 > > =C2=A0 "Mark the current message as read."
\r
124 > > - =C2=A0(notmuch-show-remove-tag "unread"))
\r
125 > > + =C2=A0(notmuch-show-tag-message "-unread"))
\r
127 > > =C2=A0;; Functions for getting attributes of several messages in the cu=
\r
129 > > =C2=A0;; thread.
\r
130 > > @@ -1470,51 +1471,33 @@ than only the current message."
\r
131 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(message (format "Command '%s'=
\r
132 exited abnormally with code %d"
\r
133 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
\r
134 =C2=A0 =C2=A0 =C2=A0 =C2=A0 shell-command exit-code))))))))
\r
136 > > -(defun notmuch-show-add-tags-worker (current-tags add-tags)
\r
137 > > - =C2=A0"Add to `current-tags' with any tags from `add-tags' not
\r
138 > > -currently present and return the result."
\r
139 > > - =C2=A0(let ((result-tags (copy-sequence current-tags)))
\r
140 > > - =C2=A0 =C2=A0(mapc (lambda (add-tag)
\r
141 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (member add-tag current-ta=
\r
143 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq result-tags (push add=
\r
144 -tag result-tags))))
\r
145 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 add-tags)
\r
146 > > - =C2=A0 =C2=A0(sort result-tags 'string<)))
\r
148 > > -(defun notmuch-show-del-tags-worker (current-tags del-tags)
\r
149 > > - =C2=A0"Remove any tags in `del-tags' from `current-tags' and return
\r
151 > > - =C2=A0(let ((result-tags (copy-sequence current-tags)))
\r
152 > > - =C2=A0 =C2=A0(mapc (lambda (del-tag)
\r
153 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq result-tags (delete del-tag =
\r
155 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 del-tags)
\r
156 > > - =C2=A0 =C2=A0result-tags))
\r
158 > > -(defun notmuch-show-add-tag (&rest toadd)
\r
159 > > - =C2=A0"Add a tag to the current message."
\r
160 > > - =C2=A0(interactive
\r
161 > > - =C2=A0 (list (notmuch-select-tag-with-completion "Tag to add: ")))
\r
162 > > +(defun notmuch-show-tag-message (&rest changed-tags)
\r
163 > > + =C2=A0"Change tags for the current message.
\r
165 > > +`Changed-tags' is a list of tag operations for \"notmuch tag\",
\r
166 > > +i.e. a list of tags to change with '+' and '-' prefixes."
\r
167 > > =C2=A0 (let* ((current-tags (notmuch-show-get-tags))
\r
168 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0(new-tags (notmuch-show-add-tags-worker cu=
\r
169 rrent-tags toadd)))
\r
171 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(new-tags (notmuch-update-tags current-tag=
\r
173 > > =C2=A0 =C2=A0 (unless (equal current-tags new-tags)
\r
174 > > - =C2=A0 =C2=A0 =C2=A0(apply 'notmuch-tag (notmuch-show-get-message-id)
\r
175 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapcar (lambda (s) (concat =
\r
177 > > + =C2=A0 =C2=A0 =C2=A0(apply 'notmuch-tag (notmuch-show-get-message-id)=
\r
179 > > =C2=A0 =C2=A0 =C2=A0 (notmuch-show-set-tags new-tags))))
\r
181 > > -(defun notmuch-show-remove-tag (&rest toremove)
\r
182 > > - =C2=A0"Remove a tag from the current message."
\r
183 > > - =C2=A0(interactive
\r
184 > > - =C2=A0 (list (notmuch-select-tag-with-completion
\r
185 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Tag to remove: " (notmuch-show-get-messa=
\r
187 > > +(defun notmuch-show-tag (&optional initial-input)
\r
188 > > + =C2=A0"Change tags for the current message, read input from the minib=
\r
190 > > + =C2=A0(interactive)
\r
191 > > + =C2=A0(let ((changed-tags (notmuch-select-tags-with-completion
\r
192 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
193 =C2=A0initial-input (notmuch-show-get-message-id))))
\r
194 > > + =C2=A0 =C2=A0(apply 'notmuch-show-tag-message changed-tags)))
\r
196 > > - =C2=A0(let* ((current-tags (notmuch-show-get-tags))
\r
197 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0(new-tags (notmuch-show-del-tags-worker cu=
\r
198 rrent-tags toremove)))
\r
199 > > +(defun notmuch-show-add-tag ()
\r
200 > > + =C2=A0"Same as `notmuch-show-tag' but sets initial input to '+'."
\r
201 > > + =C2=A0(interactive)
\r
202 > > + =C2=A0(notmuch-show-tag "+"))
\r
204 > > - =C2=A0 =C2=A0(unless (equal current-tags new-tags)
\r
205 > > - =C2=A0 =C2=A0 =C2=A0(apply 'notmuch-tag (notmuch-show-get-message-id)
\r
206 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapcar (lambda (s) (concat =
\r
208 > > - =C2=A0 =C2=A0 =C2=A0(notmuch-show-set-tags new-tags))))
\r
209 > > +(defun notmuch-show-remove-tag ()
\r
210 > > + =C2=A0"Same as `notmuch-show-tag' but sets initial input to '-'."
\r
211 > > + =C2=A0(interactive)
\r
212 > > + =C2=A0(notmuch-show-tag "-"))
\r
214 > > =C2=A0(defun notmuch-show-toggle-headers ()
\r
215 > > =C2=A0 "Toggle the visibility of the current message headers."
\r
216 > > @@ -1559,7 +1542,7 @@ argument, hide all of the messages."
\r
217 > > =C2=A0(defun notmuch-show-archive-thread-internal (show-next)
\r
218 > > =C2=A0 ;; Remove the tag from the current set of messages.
\r
219 > > =C2=A0 (goto-char (point-min))
\r
220 > > - =C2=A0(loop do (notmuch-show-remove-tag "inbox")
\r
221 > > + =C2=A0(loop do (notmuch-show-tag-message "-inbox")
\r
222 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0until (not (notmuch-show-goto-message-next)))
\r
223 > > =C2=A0 ;; Move to the next item in the search results, if any.
\r
224 > > =C2=A0 (let ((parent-buffer notmuch-show-parent-buffer))
\r
225 > > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
226 > > index ff46617..24b0ea3 100644
\r
227 > > --- a/emacs/notmuch.el
\r
228 > > +++ b/emacs/notmuch.el
\r
229 > > @@ -76,38 +76,56 @@ For example:
\r
230 > > =C2=A0(defvar notmuch-query-history nil
\r
231 > > =C2=A0 "Variable to store minibuffer history for notmuch queries")
\r
233 > > -(defun notmuch-tag-completions (&optional prefixes search-terms)
\r
234 > > - =C2=A0(let ((tag-list
\r
235 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0(split-string
\r
236 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (with-output-to-string
\r
237 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (with-current-buffer standard-outp=
\r
239 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (apply 'call-process notmuc=
\r
241 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
242 nil "search-tags" search-terms)))
\r
243 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 "\n+" t)))
\r
244 > > - =C2=A0 =C2=A0(if (null prefixes)
\r
245 > > - =C2=A0 =C2=A0 =C2=A0 tag-list
\r
246 > > - =C2=A0 =C2=A0 =C2=A0(apply #'append
\r
247 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapcar (lambda (tag)
\r
248 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
249 =C2=A0(mapcar (lambda (prefix)
\r
250 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
251 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(concat prefix tag)) prefixes))
\r
252 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
254 > > +(defun notmuch-tag-completions (&optional search-terms)
\r
255 > > + =C2=A0(split-string
\r
256 > > + =C2=A0 (with-output-to-string
\r
257 > > + =C2=A0 =C2=A0 (with-current-buffer standard-output
\r
258 > > + =C2=A0 =C2=A0 =C2=A0 (apply 'call-process notmuch-command nil t
\r
259 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil "search-tags" search-te=
\r
261 > > + =C2=A0 "\n+" t))
\r
263 > > =C2=A0(defun notmuch-select-tag-with-completion (prompt &rest search-te=
\r
265 > > - =C2=A0(let ((tag-list (notmuch-tag-completions nil search-terms)))
\r
266 > > + =C2=A0(let ((tag-list (notmuch-tag-completions search-terms)))
\r
267 > > =C2=A0 =C2=A0 (completing-read prompt tag-list)))
\r
269 > > -(defun notmuch-select-tags-with-completion (prompt &optional prefixes =
\r
270 &rest search-terms)
\r
271 > > - =C2=A0(let ((tag-list (notmuch-tag-completions prefixes search-terms))
\r
272 > > - =C2=A0 =C2=A0 =C2=A0 (crm-separator " ")
\r
273 > > - =C2=A0 =C2=A0 =C2=A0 ;; By default, space is bound to "complete word"=
\r
275 > > - =C2=A0 =C2=A0 =C2=A0 ;; Re-bind it to insert a space instead. =C2=A0N=
\r
277 > > - =C2=A0 =C2=A0 =C2=A0 ;; still does the completion.
\r
278 > > - =C2=A0 =C2=A0 =C2=A0 (crm-local-completion-map
\r
279 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((map (make-sparse-keymap)))
\r
280 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set-keymap-parent map crm-local-co=
\r
282 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(define-key map " " 'self-insert-co=
\r
284 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0map)))
\r
285 > > - =C2=A0 =C2=A0(delete "" (completing-read-multiple prompt tag-list))))
\r
286 > > +(defun notmuch-select-tags-with-completion (&optional initial-input &r=
\r
288 > > + =C2=A0(let* ((add-tag-list (mapcar (apply-partially 'concat "+")
\r
289 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
290 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-tag-completions)))
\r
291 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(remove-tag-list (mapcar (apply-partially =
\r
293 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
294 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-tag-completions search-=
\r
296 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(tag-list (append add-tag-list remove-tag-=
\r
298 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(crm-separator " ")
\r
299 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0;; By default, space is bound to "complete=
\r
301 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Re-bind it to insert a space instead. =
\r
302 =C2=A0Note that <tab>
\r
303 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0;; still does the completion.
\r
304 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(crm-local-completion-map
\r
305 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((map (make-sparse-keymap)))
\r
306 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (set-keymap-parent map crm-local-c=
\r
308 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (define-key map " " 'self-insert-c=
\r
310 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 map)))
\r
311 > > + =C2=A0 =C2=A0(delete "" (completing-read-multiple
\r
312 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Operations (+add -d=
\r
313 rop): notmuch tag " tag-list nil
\r
314 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil initial-input))))
\r
316 > > +(defun notmuch-update-tags (current-tags changed-tags)
\r
317 > > + =C2=A0"Update `current-tags' with `changed-tags' and return the resul=
\r
320 > > +`Changed-tags' is a list of tag operations given to \"notmuch
\r
321 > > +tag\", i.e. a list of changed tags with '+' and '-' prefixes."
\r
322 > > + =C2=A0(let ((result-tags (copy-sequence current-tags)))
\r
323 > > + =C2=A0 =C2=A0(mapc (lambda (changed-tag)
\r
324 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (string=3D changed-tag "")
\r
325 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((op (substring change=
\r
327 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (tag (=
\r
328 substring changed-tag 1)))
\r
329 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cond ((string=3D op=
\r
331 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
332 =C2=A0(unless (member tag result-tags)
\r
333 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
334 =C2=A0 =C2=A0(push tag result-tags)))
\r
335 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
336 ((string=3D op "-")
\r
337 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
338 =C2=A0(setq result-tags (delete tag result-tags)))
\r
339 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
341 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
342 =C2=A0(error "Changed tag must be of the form `+this_tag' or `-that_tag'")=
\r
344 > > + =C2=A0 =C2=A0 =C2=A0 changed-tags)
\r
345 > > + =C2=A0 =C2=A0(sort result-tags 'string<)))
\r
347 > > =C2=A0(defun notmuch-foreach-mime-part (function mm-handle)
\r
348 > > =C2=A0 (cond ((stringp (car mm-handle))
\r
349 > > @@ -447,6 +465,10 @@ Complete list of currently available key bindings:
\r
350 > > =C2=A0 "Return a list of threads for the current region"
\r
351 > > =C2=A0 (notmuch-search-properties-in-region 'notmuch-search-thread-id b=
\r
354 > > +(defun notmuch-search-find-thread-id-region-search (beg end)
\r
355 > > + =C2=A0"Return a search string for threads for the current region"
\r
356 > > + =C2=A0(mapconcat 'identity (notmuch-search-find-thread-id-region beg =
\r
359 > > =C2=A0(defun notmuch-search-find-authors ()
\r
360 > > =C2=A0 "Return the authors for the current thread"
\r
361 > > =C2=A0 (get-text-property (point) 'notmuch-search-authors))
\r
362 > > @@ -590,74 +612,55 @@ the messages that were tagged"
\r
363 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-line 1))
\r
364 > > =C2=A0 =C2=A0 =C2=A0 output)))
\r
366 > > -(defun notmuch-search-add-tag-thread (tag)
\r
367 > > - =C2=A0(notmuch-search-add-tag-region tag (point) (point)))
\r
368 > > +(defun notmuch-search-tag-thread (&rest tags)
\r
369 > > + =C2=A0"Change tags for the currently selected thread.
\r
371 > > -(defun notmuch-search-add-tag-region (tag beg end)
\r
372 > > - =C2=A0(let ((search-id-string (mapconcat 'identity (notmuch-search-fi=
\r
373 nd-thread-id-region beg end) " or ")))
\r
374 > > - =C2=A0 =C2=A0(notmuch-tag search-id-string (concat "+" tag))
\r
375 > > - =C2=A0 =C2=A0(save-excursion
\r
376 > > - =C2=A0 =C2=A0 =C2=A0(let ((last-line (line-number-at-pos end))
\r
377 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (max-line (- (line-number-at-pos (=
\r
379 > > - =C2=A0 =C2=A0 =C2=A0 (goto-char beg)
\r
380 > > - =C2=A0 =C2=A0 =C2=A0 (while (<=3D (line-number-at-pos) (min last-line=
\r
382 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-set-tags (delete-dups (so=
\r
383 rt (cons tag (notmuch-search-get-tags)) 'string<)))
\r
384 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (forward-line))))))
\r
385 > > +See `notmuch-search-tag-region' for details."
\r
386 > > + =C2=A0(apply 'notmuch-search-tag-region (point) (point) tags))
\r
388 > > -(defun notmuch-search-remove-tag-thread (tag)
\r
389 > > - =C2=A0(notmuch-search-remove-tag-region tag (point) (point)))
\r
390 > > +(defun notmuch-search-tag-region (beg end &rest tags)
\r
391 > > + =C2=A0"Change tags for threads in the given region.
\r
393 > > -(defun notmuch-search-remove-tag-region (tag beg end)
\r
394 > > - =C2=A0(let ((search-id-string (mapconcat 'identity (notmuch-search-fi=
\r
395 nd-thread-id-region beg end) " or ")))
\r
396 > > - =C2=A0 =C2=A0(notmuch-tag search-id-string (concat "-" tag))
\r
397 > > +`Tags' is a list of tag operations for \"notmuch tag\", i.e. a
\r
398 > > +list of tags to change with '+' and '-' prefixes. =C2=A0The tags are
\r
399 > > +added or removed for all threads in the region from `beg' to
\r
401 > > + =C2=A0(let ((search-string (notmuch-search-find-thread-id-region-sear=
\r
403 > > + =C2=A0 =C2=A0(apply 'notmuch-tag search-string tags)
\r
404 > > =C2=A0 =C2=A0 (save-excursion
\r
405 > > =C2=A0 =C2=A0 =C2=A0 (let ((last-line (line-number-at-pos end))
\r
406 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(max-line (- (line-number-at-p=
\r
407 os (point-max)) 2)))
\r
408 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char beg)
\r
409 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0(while (<=3D (line-number-at-pos) (min last-=
\r
411 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-set-tags (delete tag (not=
\r
412 much-search-get-tags)))
\r
413 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-set-tags
\r
414 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(notmuch-update-tags (notmuch-searc=
\r
416 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-line))))))
\r
418 > > -(defun notmuch-search-add-tag (tag)
\r
419 > > - =C2=A0"Add a tag to the currently selected thread or region.
\r
421 > > -The tag is added to all messages in the currently selected thread
\r
422 > > -or threads in the current region."
\r
423 > > - =C2=A0(interactive
\r
424 > > - =C2=A0 (list (notmuch-select-tag-with-completion "Tag to add: ")))
\r
425 > > - =C2=A0(save-excursion
\r
426 > > - =C2=A0 =C2=A0(if (region-active-p)
\r
427 > > - =C2=A0 =C2=A0 =C2=A0 (let* ((beg (region-beginning))
\r
428 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end (region-end)))
\r
429 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-add-tag-region tag beg en=
\r
431 > > - =C2=A0 =C2=A0 =C2=A0(notmuch-search-add-tag-thread tag))))
\r
433 > > -(defun notmuch-search-remove-tag (tag)
\r
434 > > - =C2=A0"Remove a tag from the currently selected thread or region.
\r
435 > > +(defun notmuch-search-tag (&optional initial-input)
\r
436 > > + =C2=A0"Change tags for the currently selected thread or region."
\r
437 > > + =C2=A0(interactive)
\r
438 > > + =C2=A0(let* ((beg (if (region-active-p) (region-beginning) (point)))
\r
439 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(end (if (region-active-p) (region-end) (p=
\r
441 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(search-string (notmuch-search-find-thread=
\r
442 -id-region-search beg end))
\r
443 > > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(tags (notmuch-select-tags-with-completion=
\r
444 initial-input search-string)))
\r
445 > > + =C2=A0 =C2=A0(apply 'notmuch-search-tag-region beg end tags)))
\r
447 > > +(defun notmuch-search-add-tag ()
\r
448 > > + =C2=A0"Same as `notmuch-search-tag' but sets initial input to '+'."
\r
449 > > + =C2=A0(interactive)
\r
450 > > + =C2=A0(notmuch-search-tag "+"))
\r
452 > > -The tag is removed from all messages in the currently selected
\r
453 > > -thread or threads in the current region."
\r
454 > > - =C2=A0(interactive
\r
455 > > - =C2=A0 (list (notmuch-select-tag-with-completion
\r
456 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Tag to remove: "
\r
457 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (region-active-p)
\r
458 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapconcat 'identity
\r
459 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
460 =C2=A0 =C2=A0(notmuch-search-find-thread-id-region (region-beginning) (reg=
\r
462 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
\r
464 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-find-thread-id)))))
\r
465 > > - =C2=A0(save-excursion
\r
466 > > - =C2=A0 =C2=A0(if (region-active-p)
\r
467 > > - =C2=A0 =C2=A0 =C2=A0 (let* ((beg (region-beginning))
\r
468 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(end (region-end)))
\r
469 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 (notmuch-search-remove-tag-region tag beg=
\r
471 > > - =C2=A0 =C2=A0 =C2=A0(notmuch-search-remove-tag-thread tag))))
\r
472 > > +(defun notmuch-search-remove-tag ()
\r
473 > > + =C2=A0"Same as `notmuch-search-tag' but sets initial input to '-'."
\r
474 > > + =C2=A0(interactive)
\r
475 > > + =C2=A0(notmuch-search-tag "-"))
\r
477 > > =C2=A0(defun notmuch-search-archive-thread ()
\r
478 > > =C2=A0 "Archive the currently selected thread (remove its \"inbox\" tag=
\r
481 > > =C2=A0This function advances the next thread when finished."
\r
482 > > =C2=A0 (interactive)
\r
483 > > - =C2=A0(notmuch-search-remove-tag-thread "inbox")
\r
484 > > + =C2=A0(notmuch-search-tag-thread "-inbox")
\r
485 > > =C2=A0 (notmuch-search-next-thread))
\r
487 > > =C2=A0(defvar notmuch-search-process-filter-data nil
\r
488 > > @@ -893,9 +896,7 @@ will prompt for tags to be added or removed. Tags p=
\r
490 > > =C2=A0Each character of the tag name may consist of alphanumeric
\r
491 > > =C2=A0characters as well as `_.+-'.
\r
493 > > - =C2=A0(interactive (notmuch-select-tags-with-completion
\r
494 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Operations (+add -d=
\r
495 rop): notmuch tag "
\r
496 > > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '("+" "-")))
\r
497 > > + =C2=A0(interactive (notmuch-select-tags-with-completion))
\r
498 > > =C2=A0 (apply 'notmuch-tag notmuch-search-query-string actions))
\r
500 > > =C2=A0(defun notmuch-search-buffer-title (query)
\r
504 > > _______________________________________________
\r
505 > > notmuch mailing list
\r
506 > > notmuch@notmuchmail.org
\r
507 > > http://notmuchmail.org/mailman/listinfo/notmuch
\r