Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / a4 / 0c156eb36ed7c542c95810a200bec9c12b761b
1 Return-Path: <markwalters1009@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 9CE58431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:19 -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.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id Y9P6zR9UJJn0 for <notmuch@notmuchmail.org>;\r
18         Fri, 30 Nov 2012 00:23:19 -0800 (PST)\r
19 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
20  [74.125.82.41])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  08DCD431FAF    for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:18 -0800\r
23  (PST)\r
24 Received: by mail-wg0-f41.google.com with SMTP id ds1so4340809wgb.2\r
25         for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:17 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=GE+siC9KJnmiPylUu9WuR6TIRmrpgoCRJFhx0RwrNP4=;\r
29         b=waYPWb0ay63VhHLdMjybuQBmwTxP+kK2gfjt5dfoamNdf9A52hZe9nETInftRgCCFR\r
30         adVaLH9lkvI1GpvgDnlvnCNG3PY3ccgfErRGGDX8lLTACweT+7wPGSxrokAJOqU1QSzQ\r
31         1FnBaPPMeRQWaQQw8Typ5Y5ciLFlnoDaDA304dPbudk4Ky5dSrg94MzFZq+rJuVxEWdV\r
32         afebV9Loe6cAWys6hW1pSI3X5uKmAw44J5NL39jzoPWS9p9vysT0V2CQG6PjZaBEcUyj\r
33         k2bvFUd234SlN/uLKazJWMSgb95hfHJQ/4DzAqImVDy8wxeGuHpy7xY6B0oqg5B7qWjV\r
34         DA5A==\r
35 Received: by 10.180.92.166 with SMTP id cn6mr661355wib.19.1354263797907;\r
36         Fri, 30 Nov 2012 00:23:17 -0800 (PST)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPS id g2sm5953472wiy.0.2012.11.30.00.23.16\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Fri, 30 Nov 2012 00:23:17 -0800 (PST)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH 1/5] emacs: move tag.el utility functions from lists to\r
44  strings\r
45 Date: Fri, 30 Nov 2012 08:21:27 +0000\r
46 Message-Id: <1354263691-19715-2-git-send-email-markwalters1009@gmail.com>\r
47 X-Mailer: git-send-email 1.7.9.1\r
48 In-Reply-To: <1354263691-19715-1-git-send-email-markwalters1009@gmail.com>\r
49 References: <1354263691-19715-1-git-send-email-markwalters1009@gmail.com>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Fri, 30 Nov 2012 08:23:19 -0000\r
63 \r
64 From: markwalters1009 <markwalters1009@gmail.com>\r
65 \r
66 The query for most of the notmuch-tag.el utility functions was a list\r
67 (or multiple arguments) (but not for the main calling point:\r
68 notmuch-tag). This patch moves them all to take the query as a string\r
69 instead. This makes it easier to add extra parameters in the next\r
70 patch.\r
71 ---\r
72  emacs/notmuch-tag.el |   16 ++++++++--------\r
73  1 files changed, 8 insertions(+), 8 deletions(-)\r
74 \r
75 diff --git a/emacs/notmuch-tag.el b/emacs/notmuch-tag.el\r
76 index 4fce3a9..1f3d8cf 100644\r
77 --- a/emacs/notmuch-tag.el\r
78 +++ b/emacs/notmuch-tag.el\r
79 @@ -55,26 +55,26 @@ the messages that were tagged"\r
80  `notmuch-read-tag-changes' function.")\r
81  \r
82  (defun notmuch-tag-completions (&optional search-terms)\r
83 -  (if (null search-terms)\r
84 -      (setq search-terms (list "*")))\r
85 +  (unless search-terms\r
86 +    (setq search-terms "*"))\r
87    (split-string\r
88     (with-output-to-string\r
89       (with-current-buffer standard-output\r
90 -       (apply 'call-process notmuch-command nil t\r
91 +       (funcall 'call-process notmuch-command nil t\r
92               nil "search" "--output=tags" "--exclude=false" search-terms)))\r
93     "\n+" t))\r
94  \r
95 -(defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
96 +(defun notmuch-select-tag-with-completion (prompt &optional search-terms)\r
97    (let ((tag-list (notmuch-tag-completions search-terms)))\r
98      (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))\r
99  \r
100 -(defun notmuch-read-tag-changes (&optional initial-input &rest search-terms)\r
101 +(defun notmuch-read-tag-changes (&optional initial-input search-terms)\r
102    (let* ((all-tag-list (notmuch-tag-completions))\r
103          (add-tag-list (mapcar (apply-partially 'concat "+") all-tag-list))\r
104          (remove-tag-list (mapcar (apply-partially 'concat "-")\r
105 -                                 (if (null search-terms)\r
106 -                                     all-tag-list\r
107 -                                   (notmuch-tag-completions search-terms))))\r
108 +                                 (if search-terms\r
109 +                                     (notmuch-tag-completions search-terms)\r
110 +                                   all-tag-list)))\r
111          (tag-list (append add-tag-list remove-tag-list))\r
112          (crm-separator " ")\r
113          ;; By default, space is bound to "complete word" function.\r
114 -- \r
115 1.7.9.1\r
116 \r