Re: notmuch-tree display
[notmuch-archives.git] / a9 / 8e349e2bcbdfc14105ad4573052e2f13853c9d
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 31D9D431E64\r
6         for <notmuch@notmuchmail.org>; Sat,  7 Apr 2012 17:35:52 -0700 (PDT)\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 foj4GZT5+LRF for <notmuch@notmuchmail.org>;\r
16         Sat,  7 Apr 2012 17:35:50 -0700 (PDT)\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 BD296431FD5\r
20         for <notmuch@notmuchmail.org>; Sat,  7 Apr 2012 17:35:47 -0700 (PDT)\r
21 Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by fire-doxen-postvirus (Postfix) with ESMTP id B6E6F328010\r
23         for <notmuch@notmuchmail.org>; Sat,  7 Apr 2012 17:35:46 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
25 Received: from finestructure.net (unknown [76.89.193.65])\r
26         (Authenticated sender: jrollins)\r
27         by fire-doxen-submit (Postfix) with ESMTP id AA036328011\r
28         for <notmuch@notmuchmail.org>; Sat,  7 Apr 2012 17:35:44 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id 0D90E968; Sat,  7 Apr 2012 17:35:43 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH 7/8] emacs: modify show tag functions to use new notmuch-tag\r
34         interface\r
35 Date: Sat,  7 Apr 2012 17:35:37 -0700\r
36 Message-Id: <1333845338-22960-8-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.9.1\r
38 In-Reply-To: <1333845338-22960-7-git-send-email-jrollins@finestructure.net>\r
39 References: <1333354853-25729-1-git-send-email-jrollins@finestructure.net>\r
40         <1333845338-22960-1-git-send-email-jrollins@finestructure.net>\r
41         <1333845338-22960-2-git-send-email-jrollins@finestructure.net>\r
42         <1333845338-22960-3-git-send-email-jrollins@finestructure.net>\r
43         <1333845338-22960-4-git-send-email-jrollins@finestructure.net>\r
44         <1333845338-22960-5-git-send-email-jrollins@finestructure.net>\r
45         <1333845338-22960-6-git-send-email-jrollins@finestructure.net>\r
46         <1333845338-22960-7-git-send-email-jrollins@finestructure.net>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Sun, 08 Apr 2012 00:35:52 -0000\r
60 \r
61 The main change here is to modify argument parsing so as to not force\r
62 tag-changes to be a list, and to let notmuch-tag handle prompting the\r
63 user when required.  doc strings are also updated and cleaned up.\r
64 ---\r
65  emacs/notmuch-show.el |   26 +++++++++++++++-----------\r
66  1 files changed, 15 insertions(+), 11 deletions(-)\r
67 \r
68 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
69 index a4c313d..69bca02 100644\r
70 --- a/emacs/notmuch-show.el\r
71 +++ b/emacs/notmuch-show.el\r
72 @@ -1641,22 +1641,26 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
73    (let* ((current-tags (notmuch-show-get-tags))\r
74          (new-tags (notmuch-update-tags current-tags tag-changes)))\r
75      (unless (equal current-tags new-tags)\r
76 -      (apply 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
77 +      (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
78        (notmuch-show-set-tags new-tags))))\r
79  \r
80 -(defun notmuch-show-tag (&optional initial-input)\r
81 -  "Change tags for the current message, read input from the minibuffer."\r
82 +(defun notmuch-show-tag (&optional tag-changes)\r
83 +  "Change tags for the current message.\r
84 +\r
85 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
86    (interactive)\r
87 -  (let ((tag-changes (notmuch-read-tag-changes\r
88 -                     initial-input (notmuch-show-get-message-id))))\r
89 -    (apply 'notmuch-show-tag-message tag-changes)))\r
90 +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes))\r
91 +  (let* ((current-tags (notmuch-show-get-tags))\r
92 +        (new-tags (notmuch-update-tags current-tags tag-changes)))\r
93 +    (unless (equal current-tags new-tags)\r
94 +      (notmuch-show-set-tags new-tags))))\r
95  \r
96 -(defun notmuch-show-tag-all (&rest tag-changes)\r
97 -  "Change tags for all messages in the current buffer.\r
98 +(defun notmuch-show-tag-all (&optional tag-changes)\r
99 +  "Change tags for all messages in the current show buffer.\r
100  \r
101 -TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
102 -  (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))\r
103 -  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
104 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
105 +  (interactive)\r
106 +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes))\r
107    (notmuch-show-mapc\r
108     (lambda ()\r
109       (let* ((current-tags (notmuch-show-get-tags))\r
110 -- \r
111 1.7.9.1\r
112 \r