[PATCH v4 6/7] On deletion, replace with ghost when other active messages in thread
[notmuch-archives.git] / 2b / 27cf7cbae07f3a00014ec47d485e3951bafe80
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 4FD76429E2E\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:35 -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 bM96lt0I9cyD for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 10:05:34 -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 C64C8429E3B\r
20         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:34 -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 68B4D66E0196\r
23         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 10:05:34 -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 A34BE66E0192\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 E7F0652D; 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 3/6] emacs: add message archiving functions\r
34 Date: Tue, 17 Jan 2012 10:05:28 -0800\r
35 Message-Id: <1326823531-14549-3-git-send-email-jrollins@finestructure.net>\r
36 X-Mailer: git-send-email 1.7.7.3\r
37 In-Reply-To: <1326823531-14549-2-git-send-email-jrollins@finestructure.net>\r
38 References: <871uqy19yo.fsf@servo.finestructure.net>\r
39         <1326823531-14549-1-git-send-email-jrollins@finestructure.net>\r
40         <1326823531-14549-2-git-send-email-jrollins@finestructure.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Tue, 17 Jan 2012 18:05:35 -0000\r
54 \r
55 This adds two new message archiving functions that parallel the thread\r
56 archiving functions: notmuch-show-archive-message{,-then-next}.  The\r
57 former also takes a prefix argument to unarchive the message (ie. put\r
58 back in inbox).\r
59 ---\r
60  emacs/notmuch-show.el |   17 +++++++++++++++++\r
61  1 files changed, 17 insertions(+), 0 deletions(-)\r
62 \r
63 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
64 index ee9ef62..207949c 100644\r
65 --- a/emacs/notmuch-show.el\r
66 +++ b/emacs/notmuch-show.el\r
67 @@ -1485,6 +1485,23 @@ buffer."\r
68    (notmuch-show-archive-thread)\r
69    (notmuch-show-next-thread))\r
70  \r
71 +(defun notmuch-show-archive-message (&optional unarchive)\r
72 +  "Archive the current message.\r
73 +\r
74 +If a prefix argument is given, the message will be\r
75 +\"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
76 +removed)."\r
77 +  (interactive)\r
78 +  (if unarchive\r
79 +      (notmuch-show-add-tag "inbox")\r
80 +    (notmuch-show-remove-tag "inbox")))\r
81 +\r
82 +(defun notmuch-show-archive-message-then-next ()\r
83 +  "Archive the current message, then show next thread from search."\r
84 +  (interactive)\r
85 +  (notmuch-show-archive-message)\r
86 +  (notmuch-show-next-open-message))\r
87 +\r
88  (defun notmuch-show-stash-cc ()\r
89    "Copy CC field of current message to kill-ring."\r
90    (interactive)\r
91 -- \r
92 1.7.7.3\r
93 \r