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 4E15C431FBC
\r
6 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2009 03:53:44 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id 7WhH498xE4P2 for <notmuch@notmuchmail.org>;
\r
11 Sun, 13 Dec 2009 03:53:43 -0800 (PST)
\r
12 Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 644C4431FAE
\r
14 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2009 03:53:41 -0800 (PST)
\r
15 Received: from smtp5-g21.free.fr (localhost [127.0.0.1])
\r
16 by smtp5-g21.free.fr (Postfix) with ESMTP id 50674D4801C
\r
17 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2009 12:53:35 +0100 (CET)
\r
18 Received: from racin (vbo91-2-82-239-207-166.fbx.proxad.net [82.239.207.166])
\r
19 by smtp5-g21.free.fr (Postfix) with ESMTP id 4BE58D480CD
\r
20 for <notmuch@notmuchmail.org>; Sun, 13 Dec 2009 12:53:33 +0100 (CET)
\r
21 From: Matthieu Lemerre <racin@free.fr>
\r
22 To: notmuch@notmuchmail.org
\r
23 Date: Sun, 13 Dec 2009 12:54:09 +0100
\r
24 Message-ID: <87y6l7144e.fsf@free.fr>
\r
26 Content-Type: multipart/mixed; boundary="=-=-="
\r
27 X-Mailman-Approved-At: Sun, 13 Dec 2009 14:31:49 -0800
\r
28 Subject: [notmuch] [PATCH] Support for deletion (patch included)
\r
29 X-BeenThere: notmuch@notmuchmail.org
\r
30 X-Mailman-Version: 2.1.12
\r
32 List-Id: "Use and development of the notmuch mail system."
\r
33 <notmuch.notmuchmail.org>
\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
35 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
37 List-Post: <mailto:notmuch@notmuchmail.org>
\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
41 X-List-Received-Date: Sun, 13 Dec 2009 11:53:44 -0000
\r
46 I forgot the attachment..
\r
50 Content-Type: text/x-diff
\r
51 Content-Disposition: inline; filename=notmuch-deletion.patch
\r
53 diff --git a/notmuch.el b/notmuch.el
\r
54 index 97914f2..f770dd0 100644
\r
57 @@ -991,6 +991,7 @@ matching this search term are shown if non-nil. "
\r
58 (define-key map [mouse-1] 'notmuch-search-show-thread)
\r
59 (define-key map "*" 'notmuch-search-operate-all)
\r
60 (define-key map "a" 'notmuch-search-archive-thread)
\r
61 + (define-key map "d" 'notmuch-search-mark-as-deleted)
\r
62 (define-key map "-" 'notmuch-search-remove-tag)
\r
63 (define-key map "+" 'notmuch-search-add-tag)
\r
64 (define-key map (kbd "RET") 'notmuch-search-show-thread)
\r
65 @@ -999,6 +1000,7 @@ matching this search term are shown if non-nil. "
\r
66 (fset 'notmuch-search-mode-map notmuch-search-mode-map)
\r
68 (defvar notmuch-search-query-string)
\r
69 +(defvar notmuch-search-history nil)
\r
70 (defvar notmuch-search-oldest-first t
\r
71 "Show the oldest mail first in the search-mode")
\r
73 @@ -1210,6 +1212,15 @@ This function advances the next thread when finished."
\r
74 (notmuch-search-remove-tag "inbox")
\r
78 +(defun notmuch-search-mark-as-deleted ()
\r
79 + "Mark the currently selected thread as deleted (set its \"deleted\" tag).
\r
80 +This function advances the next thread when finished."
\r
82 + (notmuch-search-add-tag "deleted")
\r
86 (defun notmuch-search-process-sentinel (proc msg)
\r
87 "Add a message to let user know when \"notmuch search\" exits"
\r
88 (let ((buffer (process-buffer proc))
\r
89 @@ -1284,10 +1295,22 @@ characters as well as `_.+-'.
\r
90 (append action-split (list notmuch-search-query-string) nil))))
\r
93 -(defun notmuch-search (query &optional oldest-first)
\r
94 - "Run \"notmuch search\" with the given query string and display results."
\r
95 - (interactive "sNotmuch search: ")
\r
96 - (let ((buffer (get-buffer-create (concat "*notmuch-search-" query "*"))))
\r
97 +(defun notmuch-search (query &optional oldest-first include-deleted)
\r
98 + "Run \"notmuch search\" with the given query string and display results.
\r
100 +With prefix argument, include deleted items.
\r
102 + (interactive (let* ((prefix current-prefix-arg)
\r
103 + (query (if prefix
\r
104 + (read-string "Notmuch search (including deleted): "
\r
105 + notmuch-search-query-string
\r
106 + 'notmuch-search-history)
\r
107 + (read-string "Notmuch search: " nil
\r
108 + 'notmuch-search-history))))
\r
109 + (list query nil prefix)))
\r
110 + (let ((real-query (if include-deleted query
\r
111 + (concat "not tag:deleted and (" query ")")))
\r
112 + (buffer (get-buffer-create (concat "*notmuch-search-" query "*"))))
\r
113 (switch-to-buffer buffer)
\r
114 (notmuch-search-mode)
\r
115 (set 'notmuch-search-query-string query)
\r
116 @@ -1303,7 +1326,7 @@ characters as well as `_.+-'.
\r
117 (let ((proc (start-process-shell-command
\r
118 "notmuch-search" buffer notmuch-command "search"
\r
119 (if oldest-first "--sort=oldest-first" "--sort=newest-first")
\r
120 - (shell-quote-argument query))))
\r
121 + (shell-quote-argument real-query))))
\r
122 (set-process-sentinel proc 'notmuch-search-process-sentinel)
\r
123 (set-process-filter proc 'notmuch-search-process-filter))))
\r
124 (run-hooks 'notmuch-search-hook)))
\r
125 @@ -1351,7 +1374,6 @@ search."
\r
127 Runs a new search matching only messages that match both the
\r
128 current search results AND the additional query string provided."
\r
129 - (interactive "sFilter search: ")
\r
130 (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query) (concat "( " query " )") query)))
\r
131 (notmuch-search (concat notmuch-search-query-string " and " grouped-query) notmuch-search-oldest-first)))
\r
133 @@ -1391,7 +1413,9 @@ current search results AND that are tagged with the given tag."
\r
135 (fset 'notmuch-folder-mode-map notmuch-folder-mode-map)
\r
137 -(defcustom notmuch-folders (quote (("inbox" . "tag:inbox") ("unread" . "tag:unread")))
\r
138 +(defcustom notmuch-folders (quote (("inbox" . "tag:inbox")
\r
139 + ("unread" . "tag:unread")
\r
140 + ("deleted" . "tag:deleted")))
\r
141 "List of searches for the notmuch folder view"
\r
142 :type '(alist :key-type (string) :value-type (string))
\r