1 Return-Path: <jani@nikula.org>
\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 2F7CF431FDA
\r
6 for <notmuch@notmuchmail.org>; Thu, 6 Sep 2012 08:33:06 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[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 6GDO5JZTcUZB for <notmuch@notmuchmail.org>;
\r
17 Thu, 6 Sep 2012 08:33:05 -0700 (PDT)
\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
\r
19 [209.85.217.181]) (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 31D26431FAE
\r
22 for <notmuch@notmuchmail.org>; Thu, 6 Sep 2012 08:33:05 -0700 (PDT)
\r
23 Received: by mail-lb0-f181.google.com with SMTP id gk1so1344042lbb.26
\r
24 for <notmuch@notmuchmail.org>; Thu, 06 Sep 2012 08:33:04 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
\r
28 :in-reply-to:references:x-gm-message-state;
\r
29 bh=NAotDv459hN0jsIRemhOkbS9fpnJEIKpiGQ01BiMWyI=;
\r
30 b=e6/Bmbmr+tB/1CMP74D7L2yQcqd9dlGD2+9lUPOtJ3OAj9oohxSbFDCcVW7lQBboBB
\r
31 5McEjlgWXLPQBetiamjQpINFVMnn/VPQsNne40yCZngDFzaeq9FAoNRezh8mdHowUCvT
\r
32 WfgR8V9Q+NU6EGwzy6n5QbO57o2rXAznOpqOyJjCZkHD9VwIMLvGb+8MKEKFfZ4pKDPJ
\r
33 ZCMIVRnoQEUQr73MJtzOGudbIZ3LMLYF/+wvuUeivig3tXEdI+U5ztsFQvi9Hvw90knA
\r
34 qwtf+KyR0sKrNsTBhBWGdnRr/3TboVTLKR17lPXRwiMA/NyRxZI7zCoqH3pclD3VQm+D
\r
36 Received: by 10.112.86.232 with SMTP id s8mr1017437lbz.117.1346945584739;
\r
37 Thu, 06 Sep 2012 08:33:04 -0700 (PDT)
\r
38 Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id p7sm488542lbg.17.2012.09.06.08.33.03
\r
41 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:33:04 -0700 (PDT)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v2 6/6] emacs: add support for reversing
\r
45 notmuch-show-mark-read tag changes
\r
46 Date: Thu, 6 Sep 2012 18:32:42 +0300
\r
48 <8377ff5c19587cc90bbde9e603ae4f5c3d62d086.1346945257.git.jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.7.9.5
\r
50 In-Reply-To: <cover.1346945257.git.jani@nikula.org>
\r
51 References: <cover.1346945257.git.jani@nikula.org>
\r
52 In-Reply-To: <cover.1346945257.git.jani@nikula.org>
\r
53 References: <cover.1346945257.git.jani@nikula.org>
\r
55 ALoCoQkL/MvFQ4n5OEBFZlQOePsSxESxL0FLCBLD2fGjvf68SrpNt4oVVCaKB41u3BSanPlFc8FL
\r
56 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Thu, 06 Sep 2012 15:33:06 -0000
\r
71 Since marking a message as read can now be a user customized set of
\r
72 tag changes, make reversing this easier. Allow a prefix argument to
\r
73 notmuch-show-mark-read to reverse the marking as read, similar to the
\r
74 unarchiving in notmuch-show-archive-message.
\r
76 While at it, update the relevant documentation to match that of other
\r
77 automatic tagging (i.e. archive and reply).
\r
79 emacs/notmuch-show.el | 25 ++++++++++++++++++++-----
\r
80 1 file changed, 20 insertions(+), 5 deletions(-)
\r
82 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
83 index e701aec..1c1cf9c 100644
\r
84 --- a/emacs/notmuch-show.el
\r
85 +++ b/emacs/notmuch-show.el
\r
86 @@ -184,8 +184,15 @@ provided with an MLA argument nor `completing-read' input."
\r
87 :group 'notmuch-show)
\r
89 (defcustom notmuch-show-mark-read-tags '("-unread")
\r
90 - "List of tags to apply when message is read, ie. shown in notmuch-show
\r
92 + "List of tag changes to apply to a message when it is marked as read.
\r
94 +Tags starting with \"+\" (or not starting with either \"+\" or
\r
95 +\"-\") in the list will be added, and tags starting with \"-\"
\r
96 +will be removed from the message being marked as read.
\r
98 +For example, if you wanted to remove an \"unread\" tag and add a
\r
99 +\"read\" tag (which would make little sense), you would set:
\r
100 + (\"-unread\" \"+read\")"
\r
101 :type '(repeat string)
\r
102 :group 'notmuch-show)
\r
104 @@ -1390,10 +1397,18 @@ current thread."
\r
105 "Are the headers of the current message visible?"
\r
106 (notmuch-show-get-prop :headers-visible))
\r
108 -(defun notmuch-show-mark-read ()
\r
109 - "Apply `notmuch-show-mark-read-tags' to the message."
\r
110 +(defun notmuch-show-mark-read (&optional unread)
\r
111 + "Mark the current message as read.
\r
113 +Mark the current message as read by applying the tag changes in
\r
114 +`notmuch-show-mark-read-tags' to it (remove the \"unread\" tag by
\r
115 +default). If a prefix argument is given, the message will be
\r
116 +marked as unread, i.e. the tag changes in
\r
117 +`notmuch-show-mark-read-tags' will be reversed."
\r
118 + (interactive "P")
\r
119 (when notmuch-show-mark-read-tags
\r
120 - (apply 'notmuch-show-tag-message notmuch-show-mark-read-tags)))
\r
121 + (apply 'notmuch-show-tag-message
\r
122 + (notmuch-tag-change-list notmuch-show-mark-read-tags unread))))
\r
124 ;; Functions for getting attributes of several messages in the current
\r