Re: notmuch-tree display
[notmuch-archives.git] / a3 / 00f400a2c25ef61c4c439844b984abb9fffc6d
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 D62DA41ED96\r
6         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 20:56:46 -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 BYvojLrcVwUG for <notmuch@notmuchmail.org>;\r
17         Mon, 30 Jan 2012 20:56:44 -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 A2FAF414B91\r
22         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 20:56:06 -0800 (PST)\r
23 Received: by mail-bk0-f53.google.com with SMTP id 11so2152468bke.26\r
24         for <notmuch@notmuchmail.org>; Mon, 30 Jan 2012 20:56:06 -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=VApMV7kzz+Ak6NA+mwWA7ZOcN9TXp+t5i2+AAhoGtVg=;\r
28         b=gJVnJiAvhNhkSTVWtqLZVo3lUZfPOD7Fum5QS0h6BWbAaGvN49bWDb/+ESlJy+Xnn1\r
29         NTOKC+e9lCICVMUvWLtxFAvsV7DQoip+eLluYOCa6Jn7QrRSOzRZ8ZligtRTfU/4lyX1\r
30         YJNy+iTNudKfbAhMEnGN04Rp+BhuTyrEd0jR4=\r
31 Received: by 10.205.120.132 with SMTP id fy4mr10091368bkc.23.1327985766306;\r
32         Mon, 30 Jan 2012 20:56:06 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id\r
34         fg16sm42427534bkb.16.2012.01.30.20.56.05\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Mon, 30 Jan 2012 20:56:05 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v4 11/12] emacs: s/tags/tag-changes/ for arguments of tagging\r
40         functions\r
41 Date: Tue, 31 Jan 2012 08:54:25 +0400\r
42 Message-Id: <1327985666-29191-12-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.9\r
44 In-Reply-To: <1327985666-29191-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1327901644-15799-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46         <1327985666-29191-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: Tue, 31 Jan 2012 04:56:47 -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 c464c3c..fa62019 100644\r
71 --- a/emacs/notmuch.el\r
72 +++ b/emacs/notmuch.el\r
73 @@ -543,25 +543,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 @@ -621,26 +622,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 @@ -892,7 +893,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 @@ -904,7 +905,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