[PATCH 4/7] man: document existing top level options
[notmuch-archives.git] / 02 / ba944aeceabe4ede874bfc4e0c9046e52c060b
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 CAAEF431FD0\r
6         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:08 -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 E+OSpVY-GIdW for <notmuch@notmuchmail.org>;\r
16         Sat, 14 Apr 2012 11:53:05 -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 9ABB6431FAE\r
20         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:05 -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 591982E50D6C\r
23         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:03 -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 8CB492E50D6E\r
28         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:01 -0700 (PDT)\r
29 Received: by finestructure.net (Postfix, from userid 1000)\r
30         id 319AC698; Sat, 14 Apr 2012 11:53:01 -0700 (PDT)\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>\r
33 Subject: [PATCH 4/5] emacs: modify show tag functions to use new notmuch-tag\r
34         interface\r
35 Date: Sat, 14 Apr 2012 11:52:53 -0700\r
36 Message-Id: <1334429574-12918-5-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.9.5\r
38 In-Reply-To: <1334429574-12918-4-git-send-email-jrollins@finestructure.net>\r
39 References: <1333845338-22960-1-git-send-email-jrollins@finestructure.net>\r
40         <1334429574-12918-1-git-send-email-jrollins@finestructure.net>\r
41         <1334429574-12918-2-git-send-email-jrollins@finestructure.net>\r
42         <1334429574-12918-3-git-send-email-jrollins@finestructure.net>\r
43         <1334429574-12918-4-git-send-email-jrollins@finestructure.net>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Sat, 14 Apr 2012 18:53:09 -0000\r
57 \r
58 The main change here is to modify argument parsing so as to not force\r
59 tag-changes to be a list, and to let notmuch-tag handle prompting the\r
60 user when required.  doc strings are also updated and cleaned up.\r
61 ---\r
62  emacs/notmuch-show.el |   26 +++++++++++++++-----------\r
63  1 file changed, 15 insertions(+), 11 deletions(-)\r
64 \r
65 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
66 index a4c313d..69bca02 100644\r
67 --- a/emacs/notmuch-show.el\r
68 +++ b/emacs/notmuch-show.el\r
69 @@ -1641,22 +1641,26 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
70    (let* ((current-tags (notmuch-show-get-tags))\r
71          (new-tags (notmuch-update-tags current-tags tag-changes)))\r
72      (unless (equal current-tags new-tags)\r
73 -      (apply 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
74 +      (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
75        (notmuch-show-set-tags new-tags))))\r
76  \r
77 -(defun notmuch-show-tag (&optional initial-input)\r
78 -  "Change tags for the current message, read input from the minibuffer."\r
79 +(defun notmuch-show-tag (&optional tag-changes)\r
80 +  "Change tags for the current message.\r
81 +\r
82 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
83    (interactive)\r
84 -  (let ((tag-changes (notmuch-read-tag-changes\r
85 -                     initial-input (notmuch-show-get-message-id))))\r
86 -    (apply 'notmuch-show-tag-message tag-changes)))\r
87 +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes))\r
88 +  (let* ((current-tags (notmuch-show-get-tags))\r
89 +        (new-tags (notmuch-update-tags current-tags tag-changes)))\r
90 +    (unless (equal current-tags new-tags)\r
91 +      (notmuch-show-set-tags new-tags))))\r
92  \r
93 -(defun notmuch-show-tag-all (&rest tag-changes)\r
94 -  "Change tags for all messages in the current buffer.\r
95 +(defun notmuch-show-tag-all (&optional tag-changes)\r
96 +  "Change tags for all messages in the current show buffer.\r
97  \r
98 -TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
99 -  (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))\r
100 -  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
101 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
102 +  (interactive)\r
103 +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes))\r
104    (notmuch-show-mapc\r
105     (lambda ()\r
106       (let* ((current-tags (notmuch-show-get-tags))\r
107 -- \r
108 1.7.9.5\r
109 \r