Re: [PATCH 4/4] test: cope with glass backend file naming variations
[notmuch-archives.git] / bf / 8297dda655e2279d1865ad92e4630574724704
1 Return-Path: <jrollins@finestructure.net>\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 55FD2421189\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:46 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\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 K10-RABCzsly for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 10:05:45 -0800 (PST)\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
18         [131.215.239.19])\r
19         by olra.theworths.org (Postfix) with ESMTP id 965E741ED89\r
20         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:37 -0800 (PST)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id 3C08666E019E\r
23         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:37 -0800 (PST)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com\r
26         [76.174.137.84]) (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 4093166E00F4\r
28         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:32 -0800 (PST)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id E019E514; Tue, 17 Jan 2012 10:05:31 -0800 (PST)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into\r
34         two generally useful functions\r
35 Date: Tue, 17 Jan 2012 10:05:26 -0800\r
36 Message-Id: <1326823531-14549-1-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.7.3\r
38 In-Reply-To: <871uqy19yo.fsf@servo.finestructure.net>\r
39 References: <871uqy19yo.fsf@servo.finestructure.net>\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Tue, 17 Jan 2012 18:05:46 -0000\r
53 \r
54 Brake up notmuch-show-archive-thread-internal into two new functions:\r
55 \r
56 notmuch-show-tag-thread-internal: applies a tag to all messages in\r
57 thread.  If option remove flag is t, tags will be removed instead of\r
58 added.\r
59 \r
60 notmuch-show-next-thread: moves to the next thread in the search\r
61 result.  If given a prefix, will show the next result, otherwise will\r
62 just move to it in the search view.\r
63 \r
64 Two new interactive functions, notmuch-show-{add,remove}-tag-thread,\r
65 are also added.  Together, these provide a better suit of thread\r
66 tagging and navigation tools.\r
67 \r
68 The higher level thread archiving functions are modified to use these\r
69 new functions.\r
70 ---\r
71  emacs/notmuch-show.el |   33 ++++++++++++++++++++++++++-------\r
72  1 files changed, 26 insertions(+), 7 deletions(-)\r
73 \r
74 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
75 index 03c1f6b..3625afd 100644\r
76 --- a/emacs/notmuch-show.el\r
77 +++ b/emacs/notmuch-show.el\r
78 @@ -1421,12 +1421,29 @@ argument, hide all of the messages."\r
79    (interactive)\r
80    (backward-button 1))\r
81  \r
82 -(defun notmuch-show-archive-thread-internal (show-next)\r
83 -  ;; Remove the tag from the current set of messages.\r
84 +(defun notmuch-show-tag-thread-internal (tag &optional remove)\r
85 +  ;; Add tag to the current set of messages.  If the remove switch is\r
86 +  ;; given, tags will be removed instead of added.\r
87    (goto-char (point-min))\r
88 -  (loop do (notmuch-show-remove-tag "inbox")\r
89 -       until (not (notmuch-show-goto-message-next)))\r
90 -  ;; Move to the next item in the search results, if any.\r
91 +  (let ((tag-function 'notmuch-show-add-tag))\r
92 +    (if remove\r
93 +       (setq tag-function 'notmuch-show-remove-tag))\r
94 +    (loop do (funcall tag-function tag)\r
95 +         until (not (notmuch-show-goto-message-next)))))\r
96 +\r
97 +(defun notmuch-show-add-tag-thread (tag)\r
98 +  "Add tag to all messages in the current thread."\r
99 +  (interactive)\r
100 +  (notmuch-show-tag-thread-internal tag))\r
101 +\r
102 +(defun notmuch-show-remove-tag-thread (tag)\r
103 +  "Remove tag from all messages in the current thread."\r
104 +  (interactive)\r
105 +  (notmuch-show-tag-thread-internal tag t))\r
106 +\r
107 +(defun notmuch-show-next-thread (&optional show-next)\r
108 +  "Move to the next item in the search results, if any."\r
109 +  (interactive)\r
110    (let ((parent-buffer notmuch-show-parent-buffer))\r
111      (notmuch-kill-this-buffer)\r
112      (if parent-buffer\r
113 @@ -1448,12 +1465,14 @@ being delivered to the same thread. It does not archive the\r
114  entire thread, but only the messages shown in the current\r
115  buffer."\r
116    (interactive)\r
117 -  (notmuch-show-archive-thread-internal t))\r
118 +  (notmuch-show-remove-tag-thread "inbox")\r
119 +  (notmuch-show-next-thread t))\r
120  \r
121  (defun notmuch-show-archive-thread-then-exit ()\r
122    "Archive each message in thread, then exit back to search results."\r
123    (interactive)\r
124 -  (notmuch-show-archive-thread-internal nil))\r
125 +  (notmuch-show-remove-tag-thread "inbox")\r
126 +  (notmuch-show-next-thread))\r
127  \r
128  (defun notmuch-show-stash-cc ()\r
129    "Copy CC field of current message to kill-ring."\r
130 -- \r
131 1.7.7.3\r
132 \r