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 CD146431FCF
\r
6 for <notmuch@notmuchmail.org>; Sat, 7 Apr 2012 17:35:50 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 Grv45H+DCUPc for <notmuch@notmuchmail.org>;
\r
16 Sat, 7 Apr 2012 17:35:49 -0700 (PDT)
\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id B5D05431FBC
\r
20 for <notmuch@notmuchmail.org>; Sat, 7 Apr 2012 17:35:47 -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 B152B66E00E2
\r
23 for <notmuch@notmuchmail.org>; Sat, 7 Apr 2012 17:35:46 -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 C1A9E66E00E6
\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 06BCC92D; 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 5/8] emacs: modify search tag functions to use new notmuch-tag
\r
35 Date: Sat, 7 Apr 2012 17:35:35 -0700
\r
36 Message-Id: <1333845338-22960-6-git-send-email-jrollins@finestructure.net>
\r
37 X-Mailer: git-send-email 1.7.9.1
\r
38 In-Reply-To: <1333845338-22960-5-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 X-BeenThere: notmuch@notmuchmail.org
\r
46 X-Mailman-Version: 2.1.13
\r
48 List-Id: "Use and development of the notmuch mail system."
\r
49 <notmuch.notmuchmail.org>
\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
53 List-Post: <mailto:notmuch@notmuchmail.org>
\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
57 X-List-Received-Date: Sun, 08 Apr 2012 00:35:51 -0000
\r
59 The main change here is to modify argument parsing so as to not force
\r
60 tag-changes to be a list, and to let notmuch-tag handle prompting the
\r
61 user when required. doc strings are also updated and cleaned up.
\r
63 emacs/notmuch.el | 36 +++++++++++++-----------------------
\r
64 1 files changed, 13 insertions(+), 23 deletions(-)
\r
66 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
67 index 9aec96d..a03a526 100644
\r
68 --- a/emacs/notmuch.el
\r
69 +++ b/emacs/notmuch.el
\r
70 @@ -523,13 +523,10 @@ and will also appear in a buffer named \"*Notmuch errors*\"."
\r
71 See `notmuch-search-tag-region' for details."
\r
72 (apply 'notmuch-search-tag-region (point) (point) tag-changes))
\r
74 -(defun notmuch-search-tag-region (beg end &rest tag-changes)
\r
75 - "Change tags for threads in the given region.
\r
77 -TAGS is a list of tag operations for `notmuch-tag'. The tags are
\r
78 -added or removed for all threads in the region from BEG to END."
\r
79 +(defun notmuch-search-tag-region (beg end &optional tag-changes)
\r
80 + "Change tags for threads in the given region."
\r
81 (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))
\r
82 - (apply 'notmuch-tag search-string tag-changes)
\r
83 + (setq tag-changes (funcall 'notmuch-tag search-string tag-changes))
\r
85 (let ((last-line (line-number-at-pos end))
\r
86 (max-line (- (line-number-at-pos (point-max)) 2)))
\r
87 @@ -539,14 +536,14 @@ added or removed for all threads in the region from BEG to END."
\r
88 (notmuch-update-tags (notmuch-search-get-tags) tag-changes))
\r
91 -(defun notmuch-search-tag (&optional initial-input)
\r
92 - "Change tags for the currently selected thread or region."
\r
93 +(defun notmuch-search-tag (&optional tag-changes)
\r
94 + "Change tags for the currently selected thread or region.
\r
96 +See `notmuch-tag' for information on the format of TAG-CHANGES."
\r
98 (let* ((beg (if (region-active-p) (region-beginning) (point)))
\r
99 - (end (if (region-active-p) (region-end) (point)))
\r
100 - (search-string (notmuch-search-find-thread-id-region-search beg end))
\r
101 - (tags (notmuch-read-tag-changes initial-input search-string)))
\r
102 - (apply 'notmuch-search-tag-region beg end tags)))
\r
103 + (end (if (region-active-p) (region-end) (point))))
\r
104 + (funcall 'notmuch-search-tag-region beg end tag-changes)))
\r
106 (defun notmuch-search-add-tag ()
\r
107 "Same as `notmuch-search-tag' but sets initial input to '+'."
\r
108 @@ -790,18 +787,11 @@ non-authors is found, assume that all of the authors match."
\r
109 (goto-char found-target)))
\r
110 (delete-process proc))))
\r
112 -(defun notmuch-search-tag-all (&rest tag-changes)
\r
113 - "Add/remove tags from all matching messages.
\r
114 +(defun notmuch-search-tag-all (&optional tag-changes)
\r
115 + "Add/remove tags from all messages in current search buffer.
\r
117 -This command adds or removes tags from all messages matching the
\r
118 -current search terms. When called interactively, this command
\r
119 -will prompt for tags to be added or removed. Tags prefixed with
\r
120 -'+' will be added and tags prefixed with '-' will be removed.
\r
122 -Each character of the tag name may consist of alphanumeric
\r
123 -characters as well as `_.+-'.
\r
125 - (interactive (notmuch-read-tag-changes))
\r
126 +See `notmuch-tag' for information on the format of TAG-CHANGES."
\r
128 (apply 'notmuch-tag notmuch-search-query-string tag-changes))
\r
130 (defun notmuch-search-buffer-title (query)
\r