Re: [PATCH v4 08/16] reorganize indexing of multipart/signed and multipart/encrypted
[notmuch-archives.git] / 8d / 57fcf347730457deece7ac9997e138b47be23b
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 71A04431FDE\r
6         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:10 -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 pcG8IrppLR5i for <notmuch@notmuchmail.org>;\r
16         Sat, 14 Apr 2012 11:53:08 -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 DD057431FC9\r
20         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:05 -0700 (PDT)\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
22         by earth-doxen-postvirus (Postfix) with ESMTP id 8EAC966E00E4\r
23         for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:03 -0700 (PDT)\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
25 Received: from finestructure.net (unknown [76.89.193.65])\r
26         (Authenticated sender: jrollins)\r
27         by earth-doxen-submit (Postfix) with ESMTP id 7AEBE66E00A7\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 2E589620; 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 3/5] emacs: modify search tag functions to use new notmuch-tag\r
34         interface\r
35 Date: Sat, 14 Apr 2012 11:52:52 -0700\r
36 Message-Id: <1334429574-12918-4-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.9.5\r
38 In-Reply-To: <1334429574-12918-3-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 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Sat, 14 Apr 2012 18:53:10 -0000\r
56 \r
57 The main change here is to modify argument parsing so as to not force\r
58 tag-changes to be a list, and to let notmuch-tag handle prompting the\r
59 user when required.  doc strings are also updated and cleaned up.\r
60 ---\r
61  emacs/notmuch.el |   36 +++++++++++++-----------------------\r
62  1 file changed, 13 insertions(+), 23 deletions(-)\r
63 \r
64 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
65 index 9aec96d..a03a526 100644\r
66 --- a/emacs/notmuch.el\r
67 +++ b/emacs/notmuch.el\r
68 @@ -523,13 +523,10 @@ and will also appear in a buffer named \"*Notmuch errors*\"."\r
69  See `notmuch-search-tag-region' for details."\r
70    (apply 'notmuch-search-tag-region (point) (point) tag-changes))\r
71  \r
72 -(defun notmuch-search-tag-region (beg end &rest tag-changes)\r
73 -  "Change tags for threads in the given region.\r
74 -\r
75 -TAGS is a list of tag operations for `notmuch-tag'.  The tags are\r
76 -added or removed for all threads in the region from BEG to END."\r
77 +(defun notmuch-search-tag-region (beg end &optional tag-changes)\r
78 +  "Change tags for threads in the given region."\r
79    (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))\r
80 -    (apply 'notmuch-tag search-string tag-changes)\r
81 +    (setq tag-changes (funcall 'notmuch-tag search-string tag-changes))\r
82      (save-excursion\r
83        (let ((last-line (line-number-at-pos end))\r
84             (max-line (- (line-number-at-pos (point-max)) 2)))\r
85 @@ -539,14 +536,14 @@ added or removed for all threads in the region from BEG to END."\r
86            (notmuch-update-tags (notmuch-search-get-tags) tag-changes))\r
87           (forward-line))))))\r
88  \r
89 -(defun notmuch-search-tag (&optional initial-input)\r
90 -  "Change tags for the currently selected thread or region."\r
91 +(defun notmuch-search-tag (&optional tag-changes)\r
92 +  "Change tags for the currently selected thread or region.\r
93 +\r
94 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
95    (interactive)\r
96    (let* ((beg (if (region-active-p) (region-beginning) (point)))\r
97 -        (end (if (region-active-p) (region-end) (point)))\r
98 -        (search-string (notmuch-search-find-thread-id-region-search beg end))\r
99 -        (tags (notmuch-read-tag-changes initial-input search-string)))\r
100 -    (apply 'notmuch-search-tag-region beg end tags)))\r
101 +        (end (if (region-active-p) (region-end) (point))))\r
102 +    (funcall 'notmuch-search-tag-region beg end tag-changes)))\r
103  \r
104  (defun notmuch-search-add-tag ()\r
105    "Same as `notmuch-search-tag' but sets initial input to '+'."\r
106 @@ -790,18 +787,11 @@ non-authors is found, assume that all of the authors match."\r
107               (goto-char found-target)))\r
108        (delete-process proc))))\r
109  \r
110 -(defun notmuch-search-tag-all (&rest tag-changes)\r
111 -  "Add/remove tags from all matching messages.\r
112 +(defun notmuch-search-tag-all (&optional tag-changes)\r
113 +  "Add/remove tags from all messages in current search buffer.\r
114  \r
115 -This command adds or removes tags from all messages matching the\r
116 -current search terms. When called interactively, this command\r
117 -will prompt for tags to be added or removed. Tags prefixed with\r
118 -'+' will be added and tags prefixed with '-' will be removed.\r
119 -\r
120 -Each character of the tag name may consist of alphanumeric\r
121 -characters as well as `_.+-'.\r
122 -"\r
123 -  (interactive (notmuch-read-tag-changes))\r
124 +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
125 +  (interactive)\r
126    (apply 'notmuch-tag notmuch-search-query-string tag-changes))\r
127  \r
128  (defun notmuch-search-buffer-title (query)\r
129 -- \r
130 1.7.9.5\r
131 \r