[PATCH v5 11/12] emacs: s/tags/tag-changes/ for arguments of tagging functions
[notmuch-archives.git] / c2 / 622feb6872c55c51858f938d9eb9a0a2438be9
1 Return-Path: <dmitry.kurochkin@gmail.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 BD531431FC2\r
6         for <notmuch@notmuchmail.org>; Sat,  4 Feb 2012 23:16:08 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id FFmF-tsvDLJe for <notmuch@notmuchmail.org>;\r
17         Sat,  4 Feb 2012 23:16:06 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id A2FD7431FC4\r
22         for <notmuch@notmuchmail.org>; Sat,  4 Feb 2012 23:15:39 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so4650313bke.26\r
24         for <notmuch@notmuchmail.org>; Sat, 04 Feb 2012 23:15:39 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=TAubTr4gbiCVM8HNPZoWd5Q8YeRAK8hdeHzxcZIAnBg=;\r
28         b=F3RsAkNkQxBZ1J8ZcDrh+62SZydGerwwDKCRO2pNQzfj9loKZxjpUG5UGJUu9J3CsU\r
29         s4nHWtEoYzDk/Sku6IG91/I131ZYne4GOd7DmEEtQcUYK2hxbnKp6EbA2cC13+Fttvrp\r
30         TVaLlmCHhUOyqiyVywRK2Y9BjXJXImoUe44qE=\r
31 Received: by 10.204.145.82 with SMTP id c18mr6082589bkv.121.1328426139333;\r
32         Sat, 04 Feb 2012 23:15:39 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ew13sm33069517bkb.1.2012.02.04.23.15.38\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Sat, 04 Feb 2012 23:15:38 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v5 11/12] emacs: s/tags/tag-changes/ for arguments of tagging\r
40         functions\r
41 Date: Sun,  5 Feb 2012 11:13:52 +0400\r
42 Message-Id: <1328426033-21480-12-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.9\r
44 In-Reply-To: <1328426033-21480-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46         <1328426033-21480-1-git-send-email-dmitry.kurochkin@gmail.com>\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, 05 Feb 2012 07:16:09 -0000\r
60 \r
61 This makes the argument names more consistent and clear.  The\r
62 following functions changed: `notmuch-tag',\r
63 `notmuch-search-tag-thread', `notmuch-search-tag-region' and\r
64 `notmuch-search-tag-all'.\r
65 ---\r
66  emacs/notmuch.el |   33 +++++++++++++++++----------------\r
67  1 files changed, 17 insertions(+), 16 deletions(-)\r
68 \r
69 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
70 index 0ffdf9c..8250961 100644\r
71 --- a/emacs/notmuch.el\r
72 +++ b/emacs/notmuch.el\r
73 @@ -537,25 +537,26 @@ and will also appear in a buffer named \"*Notmuch errors*\"."\r
74             (error (buffer-substring beg end))\r
75             ))))))\r
76  \r
77 -(defun notmuch-tag (query &rest tags)\r
78 -  "Add/remove tags in TAGS to messages matching QUERY.\r
79 +(defun notmuch-tag (query &rest tag-changes)\r
80 +  "Add/remove tags in TAG-CHANGES to messages matching QUERY.\r
81  \r
82 -TAGS should be a list of strings of the form \"+TAG\" or \"-TAG\" and\r
83 -QUERY should be a string containing the search-query.\r
84 +TAG-CHANGES should be a list of strings of the form \"+tag\" or\r
85 +\"-tag\" and QUERY should be a string containing the\r
86 +search-query.\r
87  \r
88  Note: Other code should always use this function alter tags of\r
89  messages instead of running (notmuch-call-notmuch-process \"tag\" ..)\r
90  directly, so that hooks specified in notmuch-before-tag-hook and\r
91  notmuch-after-tag-hook will be run."\r
92    ;; Perform some validation\r
93 -  (mapc (lambda (tag)\r
94 -         (unless (string-match-p "^[-+]\\S-+$" tag)\r
95 +  (mapc (lambda (tag-change)\r
96 +         (unless (string-match-p "^[-+]\\S-+$" tag-change)\r
97             (error "Tag must be of the form `+this_tag' or `-that_tag'")))\r
98 -       tags)\r
99 -  (unless (null tags)\r
100 +       tag-changes)\r
101 +  (unless (null tag-changes)\r
102      (run-hooks 'notmuch-before-tag-hook)\r
103      (apply 'notmuch-call-notmuch-process "tag"\r
104 -          (append tags (list "--" query)))\r
105 +          (append tag-changes (list "--" query)))\r
106      (run-hooks 'notmuch-after-tag-hook)))\r
107  \r
108  (defcustom notmuch-before-tag-hook nil\r
109 @@ -615,26 +616,26 @@ the messages that were tagged"\r
110         (forward-line 1))\r
111        output)))\r
112  \r
113 -(defun notmuch-search-tag-thread (&rest tags)\r
114 +(defun notmuch-search-tag-thread (&rest tag-changes)\r
115    "Change tags for the currently selected thread.\r
116  \r
117  See `notmuch-search-tag-region' for details."\r
118 -  (apply 'notmuch-search-tag-region (point) (point) tags))\r
119 +  (apply 'notmuch-search-tag-region (point) (point) tag-changes))\r
120  \r
121 -(defun notmuch-search-tag-region (beg end &rest tags)\r
122 +(defun notmuch-search-tag-region (beg end &rest tag-changes)\r
123    "Change tags for threads in the given region.\r
124  \r
125  TAGS is a list of tag operations for `notmuch-tag'.  The tags are\r
126  added or removed for all threads in the region from BEG to END."\r
127    (let ((search-string (notmuch-search-find-thread-id-region-search beg end)))\r
128 -    (apply 'notmuch-tag search-string tags)\r
129 +    (apply 'notmuch-tag search-string tag-changes)\r
130      (save-excursion\r
131        (let ((last-line (line-number-at-pos end))\r
132             (max-line (- (line-number-at-pos (point-max)) 2)))\r
133         (goto-char beg)\r
134         (while (<= (line-number-at-pos) (min last-line max-line))\r
135           (notmuch-search-set-tags\r
136 -          (notmuch-update-tags (notmuch-search-get-tags) tags))\r
137 +          (notmuch-update-tags (notmuch-search-get-tags) tag-changes))\r
138           (forward-line))))))\r
139  \r
140  (defun notmuch-search-tag (&optional initial-input)\r
141 @@ -885,7 +886,7 @@ non-authors is found, assume that all of the authors match."\r
142               (goto-char found-target)))\r
143        (delete-process proc))))\r
144  \r
145 -(defun notmuch-search-tag-all (&rest actions)\r
146 +(defun notmuch-search-tag-all (&rest tag-changes)\r
147    "Add/remove tags from all matching messages.\r
148  \r
149  This command adds or removes tags from all messages matching the\r
150 @@ -897,7 +898,7 @@ Each character of the tag name may consist of alphanumeric\r
151  characters as well as `_.+-'.\r
152  "\r
153    (interactive (notmuch-read-tag-changes))\r
154 -  (apply 'notmuch-tag notmuch-search-query-string actions))\r
155 +  (apply 'notmuch-tag notmuch-search-query-string tag-changes))\r
156  \r
157  (defun notmuch-search-buffer-title (query)\r
158    "Returns the title for a buffer with notmuch search results."\r
159 -- \r
160 1.7.9\r
161 \r