1 Return-Path: <jan@ryngle.com>
\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 28E40431FBC
\r
6 for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 20:05: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 eE1VO8el3woL for <notmuch@notmuchmail.org>;
\r
11 Tue, 24 Nov 2009 20:05:43 -0800 (PST)
\r
12 Received: from mail-fx0-f214.google.com (mail-fx0-f214.google.com
\r
14 by olra.theworths.org (Postfix) with ESMTP id 9E3A9431FAE
\r
15 for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 20:05:43 -0800 (PST)
\r
16 Received: by fxm6 with SMTP id 6so7558174fxm.0
\r
17 for <notmuch@notmuchmail.org>; Tue, 24 Nov 2009 20:05:42 -0800 (PST)
\r
18 Received: by 10.103.78.38 with SMTP id f38mr3145143mul.72.1259121942518;
\r
19 Tue, 24 Nov 2009 20:05:42 -0800 (PST)
\r
20 Received: from x61s.janakj (r2c34.net.upc.cz [62.245.66.34])
\r
21 by mx.google.com with ESMTPS id j2sm726727mue.5.2009.11.24.20.05.41
\r
22 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
23 Tue, 24 Nov 2009 20:05:41 -0800 (PST)
\r
24 Received: by x61s.janakj (Postfix, from userid 1000)
\r
25 id BFC5D440651; Wed, 25 Nov 2009 05:05:39 +0100 (CET)
\r
26 From: Jan Janak <jan@ryngle.com>
\r
27 To: notmuch@notmuchmail.org
\r
28 Date: Wed, 25 Nov 2009 05:05:39 +0100
\r
29 Message-Id: <1259121939-23040-1-git-send-email-jan@ryngle.com>
\r
30 X-Mailer: git-send-email 1.6.3.3
\r
31 In-Reply-To: <1258935056-9746-3-git-send-email-jan@ryngle.com>
\r
32 References: <1258935056-9746-3-git-send-email-jan@ryngle.com>
\r
33 Subject: [notmuch] [PATCH] notmuch.el: When removing tags,
\r
34 offer only those a msg/thread has set.
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.12
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Wed, 25 Nov 2009 04:05:44 -0000
\r
49 When removing a tag from a message or thread, build a completion buffer
\r
50 which contains only tags that the message or thread has really set.
\r
52 Signed-off-by: Jan Janak <jan@ryngle.com>
\r
54 notmuch.el | 8 ++++----
\r
55 1 files changed, 4 insertions(+), 4 deletions(-)
\r
57 diff --git a/notmuch.el b/notmuch.el
\r
58 index a9f534b..9594f63 100644
\r
61 @@ -137,11 +137,11 @@ within the current window."
\r
62 (or (memq prop buffer-invisibility-spec)
\r
63 (assq prop buffer-invisibility-spec)))))
\r
65 -(defun notmuch-select-tag-with-completion (prompt)
\r
66 +(defun notmuch-select-tag-with-completion (prompt &rest search-terms)
\r
68 (with-output-to-string
\r
69 (with-current-buffer standard-output
\r
70 - (call-process notmuch-command nil t nil "search-tags")))))
\r
71 + (apply 'call-process notmuch-command nil t nil "search-tags" search-terms)))))
\r
72 (completing-read prompt (split-string tag-list "\n+" t) nil nil nil)))
\r
74 (defun notmuch-show-next-line ()
\r
75 @@ -218,7 +218,7 @@ Unlike builtin `next-line' this version accepts no arguments."
\r
76 (defun notmuch-show-remove-tag (&rest toremove)
\r
77 "Remove a tag from the current message."
\r
79 - (list (notmuch-select-tag-with-completion "Tag to remove: ")))
\r
80 + (list (notmuch-select-tag-with-completion "Tag to remove: " (notmuch-show-get-message-id))))
\r
81 (let ((tags (notmuch-show-get-tags)))
\r
82 (if (intersection tags toremove :test 'string=)
\r
84 @@ -968,7 +968,7 @@ and will also appear in a buffer named \"*Notmuch errors*\"."
\r
86 (defun notmuch-search-remove-tag (tag)
\r
88 - (list (notmuch-select-tag-with-completion "Tag to remove: ")))
\r
89 + (list (notmuch-select-tag-with-completion "Tag to remove: " (notmuch-search-find-thread-id))))
\r
90 (notmuch-call-notmuch-process "tag" (concat "-" tag) (notmuch-search-find-thread-id))
\r
91 (notmuch-search-set-tags (delete tag (notmuch-search-get-tags))))
\r