1 Return-Path: <racin@free.fr>
\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 C8925431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 27 Feb 2010 02:34:45 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.691 tagged_above=-999 required=5 tests=[AWL=0.908,
\r
12 BAYES_00=-2.599] autolearn=unavailable
\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 mPnM5VeXFQt1 for <notmuch@notmuchmail.org>;
\r
16 Sat, 27 Feb 2010 02:34:43 -0800 (PST)
\r
17 Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 12C76431FAE
\r
19 for <notmuch@notmuchmail.org>; Sat, 27 Feb 2010 02:34:41 -0800 (PST)
\r
20 Received: from smtp5-g21.free.fr (localhost [127.0.0.1])
\r
21 by smtp5-g21.free.fr (Postfix) with ESMTP id 4614DD4812B;
\r
22 Sat, 27 Feb 2010 11:34:29 +0100 (CET)
\r
23 Received: from zimbra1-e1.priv.proxad.net (zimbra1-e1.priv.proxad.net
\r
25 by smtp5-g21.free.fr (Postfix) with ESMTP id 4376FD480C8;
\r
26 Sat, 27 Feb 2010 11:34:27 +0100 (CET)
\r
27 Date: Sat, 27 Feb 2010 11:34:27 +0100 (CET)
\r
29 To: Carl Worth <cworth@cworth.org>
\r
31 <1673492941.5760781267266866949.JavaMail.root@zimbra1-e1.priv.proxad.net>
\r
33 <1427711643.5760731267266834921.JavaMail.root@zimbra1-e1.priv.proxad.net>
\r
35 Content-Type: multipart/mixed;
\r
36 boundary="----=_Part_211406_2111002656.1267266866945"
\r
37 X-Originating-IP: [82.239.207.166]
\r
38 X-Mailer: Zimbra 5.0 (ZimbraWebClient - FF3.0
\r
39 (Linux)/5.0.15_GA_2815.UBUNTU8_64)
\r
40 X-Authenticated-User: racin@free.fr
\r
41 Cc: notmuch@notmuchmail.org
\r
42 Subject: Re: [notmuch] [PATCH] Support for deletion (patch included)
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Sat, 27 Feb 2010 10:34:45 -0000
\r
57 ------=_Part_211406_2111002656.1267266866945
\r
58 Content-Type: text/plain; charset=utf-8
\r
59 Content-Transfer-Encoding: quoted-printable
\r
61 Here they are; as I don't know how to include them in the body, I put the p=
\r
62 atches as attachments. I hope this=20
\r
63 will be convienient enough for you.
\r
68 ----- racin@free.fr a =C3=A9crit :
\r
70 > Carl: The patch in the mail has problems; apparently I have to
\r
71 > manually add scissorlines to the mail for it
\r
72 > to be processed by git-am. I thought this was automatically added. (I
\r
73 > hate the git UI -- nothing is consistent,
\r
74 > concepts have different names, the definition of scissor lines is as
\r
75 > precise as "A line that mainly consists of scissors (either ">8" or
\r
76 > "8<") and perforation (dash "-") --, but I guess we can get used to it
\r
79 > I'll send you a proper patch as soon as I can. Meanwhile, I'm sure you
\r
80 > have comments on this updated patch!
\r
84 ------=_Part_211406_2111002656.1267266866945
\r
85 Content-Type: text/x-diff;
\r
86 name=0002-Add-support-for-deletion-in-the-emacs-interface.patch
\r
87 Content-Transfer-Encoding: 7bit
\r
88 Content-Disposition: attachment;
\r
89 filename=0002-Add-support-for-deletion-in-the-emacs-interface.patch
\r
91 >From 0073152e3fa7dd11d88de28e87eec7762cdbbbeb Mon Sep 17 00:00:00 2001
\r
92 From: Matthieu Lemerre <racin@free.fr>
\r
93 Date: Thu, 25 Feb 2010 00:25:51 +0100
\r
94 Subject: [PATCH 2/2] Add support for deletion in the emacs interface
\r
96 Add "d" keybinding in notmuch-show and notmuch-summary to delete the current
\r
97 thread. Adds "D" keybinding to delete the current message in notmuch-show.
\r
98 Adds a "deleted" folder. Omit deleted items from searchs if no prefix arg.
\r
99 Adds history management to make searching deleted items more convenient.
\r
102 notmuch.el | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-------
\r
103 1 files changed, 49 insertions(+), 7 deletions(-)
\r
105 diff --git a/notmuch.el b/notmuch.el
\r
106 index 5d7342a..0285573 100644
\r
110 (define-key map "x" 'notmuch-show-archive-thread-then-exit)
\r
111 (define-key map "A" 'notmuch-show-mark-read-then-archive-thread)
\r
112 (define-key map "a" 'notmuch-show-archive-thread)
\r
113 + (define-key map "d" 'notmuch-show-delete-thread)
\r
114 + (define-key map "D" 'notmuch-show-delete-message)
\r
115 (define-key map "p" 'notmuch-show-previous-message)
\r
116 (define-key map "N" 'notmuch-show-mark-read-then-next-open-message)
\r
117 (define-key map "n" 'notmuch-show-next-message)
\r
118 @@ -380,6 +382,23 @@ buffer."
\r
119 (notmuch-show-archive-thread)
\r
120 (kill-this-buffer))
\r
122 +(defun notmuch-show-delete-message ()
\r
123 + "Delete current message (sets its deleted tag)."
\r
125 + (notmuch-show-add-tag "deleted"))
\r
127 +(defun notmuch-show-delete-thread()
\r
128 + "Delete each message in thread."
\r
130 + (notmuch-show-forall-in-thread
\r
131 + (notmuch-show-delete-message)))
\r
133 +(defun notmuch-show-delete-thread-and-exit()
\r
134 + "Delete each message in thread, then exit back to search results."
\r
136 + (notmuch-show-delete-thread)
\r
137 + (kill-this-buffer))
\r
139 (defun notmuch-show-mark-read-then-archive-then-exit ()
\r
140 "Remove unread tags from thread, then archive and exit to search results."
\r
142 @@ -1227,6 +1246,7 @@ matching this search term are shown if non-nil. "
\r
143 (define-key map [mouse-1] 'notmuch-search-show-thread)
\r
144 (define-key map "*" 'notmuch-search-operate-all)
\r
145 (define-key map "a" 'notmuch-search-archive-thread)
\r
146 + (define-key map "d" 'notmuch-search-delete-thread)
\r
147 (define-key map "-" 'notmuch-search-remove-tag)
\r
148 (define-key map "+" 'notmuch-search-add-tag)
\r
149 (define-key map (kbd "RET") 'notmuch-search-show-thread)
\r
150 @@ -1235,6 +1255,7 @@ matching this search term are shown if non-nil. "
\r
151 (fset 'notmuch-search-mode-map notmuch-search-mode-map)
\r
153 (defvar notmuch-search-query-string)
\r
154 +(defvar notmuch-search-history nil)
\r
155 (defvar notmuch-search-oldest-first t
\r
156 "Show the oldest mail first in the search-mode")
\r
158 @@ -1446,6 +1467,13 @@ This function advances the next thread when finished."
\r
159 (notmuch-search-remove-tag "inbox")
\r
162 +(defun notmuch-search-delete-thread ()
\r
163 + "Mark the currently selected thread as deleted (set its \"deleted\" tag).
\r
164 +This function advances the next thread when finished."
\r
166 + (notmuch-search-add-tag "deleted")
\r
169 (defun notmuch-search-process-sentinel (proc msg)
\r
170 "Add a message to let user know when \"notmuch search\" exits"
\r
171 (let ((buffer (process-buffer proc))
\r
172 @@ -1520,10 +1548,22 @@ characters as well as `_.+-'.
\r
173 (append action-split (list notmuch-search-query-string) nil))))
\r
176 -(defun notmuch-search (query &optional oldest-first)
\r
177 - "Run \"notmuch search\" with the given query string and display results."
\r
178 - (interactive "sNotmuch search: ")
\r
179 - (let ((buffer (get-buffer-create (concat "*notmuch-search-" query "*"))))
\r
180 +(defun notmuch-search (query &optional oldest-first include-deleted)
\r
181 + "Run \"notmuch search\" with the given query string and display results.
\r
183 +With prefix argument, include deleted items.
\r
185 + (interactive (let* ((prefix current-prefix-arg)
\r
186 + (query (if prefix
\r
187 + (read-string "Notmuch search (including deleted): "
\r
188 + notmuch-search-query-string
\r
189 + 'notmuch-search-history)
\r
190 + (read-string "Notmuch search: " nil
\r
191 + 'notmuch-search-history))))
\r
192 + (list query nil prefix)))
\r
193 + (let ((real-query (if include-deleted query
\r
194 + (concat "not tag:deleted and (" query ")")))
\r
195 + (buffer (get-buffer-create (concat "*notmuch-search-" query "*"))))
\r
196 (switch-to-buffer buffer)
\r
197 (notmuch-search-mode)
\r
198 (set 'notmuch-search-query-string query)
\r
199 @@ -1539,7 +1579,7 @@ characters as well as `_.+-'.
\r
200 (let ((proc (start-process-shell-command
\r
201 "notmuch-search" buffer notmuch-command "search"
\r
202 (if oldest-first "--sort=oldest-first" "--sort=newest-first")
\r
203 - (shell-quote-argument query))))
\r
204 + (shell-quote-argument real-query))))
\r
205 (set-process-sentinel proc 'notmuch-search-process-sentinel)
\r
206 (set-process-filter proc 'notmuch-search-process-filter))))
\r
207 (run-hooks 'notmuch-search-hook)))
\r
208 @@ -1587,7 +1627,7 @@ search."
\r
210 Runs a new search matching only messages that match both the
\r
211 current search results AND the additional query string provided."
\r
212 - (interactive "sFilter search: ")
\r
213 + (interactive "sFilter search:")
\r
214 (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query) (concat "( " query " )") query)))
\r
215 (notmuch-search (concat notmuch-search-query-string " and " grouped-query) notmuch-search-oldest-first)))
\r
217 @@ -1630,7 +1670,9 @@ current search results AND that are tagged with the given tag."
\r
219 (fset 'notmuch-folder-mode-map notmuch-folder-mode-map)
\r
221 -(defcustom notmuch-folders (quote (("inbox" . "tag:inbox") ("unread" . "tag:unread")))
\r
222 +(defcustom notmuch-folders (quote (("inbox" . "tag:inbox")
\r
223 + ("unread" . "tag:unread")
\r
224 + ("deleted" . "tag:deleted")))
\r
225 "List of searches for the notmuch folder view"
\r
226 :type '(alist :key-type (string) :value-type (string))
\r
232 ------=_Part_211406_2111002656.1267266866945
\r
233 Content-Type: text/x-diff;
\r
234 name=0001-Add-and-use-notmuch-show-forall-in-thread-macro.patch
\r
235 Content-Transfer-Encoding: 7bit
\r
236 Content-Disposition: attachment;
\r
237 filename=0001-Add-and-use-notmuch-show-forall-in-thread-macro.patch
\r
239 >From bdee9558d93bffb97c80632f522288e059deb7c2 Mon Sep 17 00:00:00 2001
\r
240 From: Matthieu Lemerre <racin@free.fr>
\r
241 Date: Thu, 25 Feb 2010 00:24:24 +0100
\r
242 Subject: [PATCH 1/2] Add and use notmuch-show-forall-in-thread macro
\r
244 This macro allows to apply a message-related command to every message
\r
248 notmuch.el | 17 +++++++++++------
\r
249 1 files changed, 11 insertions(+), 6 deletions(-)
\r
251 diff --git a/notmuch.el b/notmuch.el
\r
252 index 6482170..5d7342a 100644
\r
255 @@ -321,17 +321,22 @@ pseudoheader summary"
\r
256 (cons (notmuch-show-get-message-id) nil)))
\r
257 (notmuch-show-set-tags (sort (set-difference tags toremove :test 'string=) 'string<))))))
\r
259 -(defun notmuch-show-archive-thread-maybe-mark-read (markread)
\r
261 +(defmacro notmuch-show-forall-in-thread (&rest body)
\r
262 + "Executes BODY with point in all messages of the current thread."
\r
264 (goto-char (point-min))
\r
265 (while (not (eobp))
\r
267 - (notmuch-show-remove-tag "unread" "inbox")
\r
268 - (notmuch-show-remove-tag "inbox"))
\r
272 (if (not (re-search-forward notmuch-show-message-begin-regexp nil t))
\r
273 - (goto-char (point-max)))))
\r
274 + (goto-char (point-max))))))
\r
276 +(defun notmuch-show-archive-thread-maybe-mark-read (markread)
\r
277 + (notmuch-show-forall-in-thread
\r
279 + (notmuch-show-remove-tag "unread" "inbox")
\r
280 + (notmuch-show-remove-tag "inbox")))
\r
281 (let ((parent-buffer notmuch-show-parent-buffer))
\r
288 ------=_Part_211406_2111002656.1267266866945--
\r