Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / b1 / 83bd9a2ef3e54667c72637a6be2947caa8187d
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 7021F431FBC\r
6         for <notmuch@notmuchmail.org>; Sat,  4 Feb 2012 23:15:34 -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 LZreYz5FtQOl for <notmuch@notmuchmail.org>;\r
17         Sat,  4 Feb 2012 23:15:34 -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 C8068431FB6\r
22         for <notmuch@notmuchmail.org>; Sat,  4 Feb 2012 23:15:33 -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:33 -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=rvBPHYFJU6jg74+HtfnvSP6xFCxeTKiQcHH62ZYRpYQ=;\r
28         b=w9CuFzwvgp7d7N3/r+lpocDt+vR0k1YSX/FsdfJvspX8gIGlaC22drjZzpad7ENhMC\r
29         CVsU9Q5KXhy+tCI/dU5reZHjERMCMiEnIxDWAyRRZpK50yToQ0z5ZIdgEFzWiyID3beJ\r
30         reS55G1jav9u47FQcOHY7CtSx0HHh9GopyGCc=\r
31 Received: by 10.204.10.82 with SMTP id o18mr6490933bko.20.1328426133473;\r
32         Sat, 04 Feb 2012 23:15:33 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ga13sm33036975bkc.5.2012.02.04.23.15.32\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Sat, 04 Feb 2012 23:15:32 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v5 08/12] emacs: separate history for operations which accept\r
40         single and multiple tags\r
41 Date: Sun,  5 Feb 2012 11:13:49 +0400\r
42 Message-Id: <1328426033-21480-9-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:15:34 -0000\r
60 \r
61 Some tag-related operations accept a single tag without prefix\r
62 (`notmuch-select-tag-with-completion'), others accept multiple tags\r
63 prefixed with '+' or '-' (`notmuch-read-tag-changes').  Before the\r
64 change, both functions used a single default minibuffer history.  This\r
65 is inconvenient because you have to skip options with incompatible\r
66 format when going through the history.  The patch adds separate\r
67 history lists for the two functions.  Note that functions that accept\r
68 the same input format (e.g. "+", "-", "*") share the history list as\r
69 before.\r
70 ---\r
71  emacs/notmuch.el |   13 +++++++++++--\r
72  1 files changed, 11 insertions(+), 2 deletions(-)\r
73 \r
74 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
75 index 1f351a5..862d9e8 100644\r
76 --- a/emacs/notmuch.el\r
77 +++ b/emacs/notmuch.el\r
78 @@ -76,6 +76,14 @@ For example:\r
79  (defvar notmuch-query-history nil\r
80    "Variable to store minibuffer history for notmuch queries")\r
81  \r
82 +(defvar notmuch-select-tag-history nil\r
83 +  "Variable to store minibuffer history for\r
84 +`notmuch-select-tag-with-completion' function.")\r
85 +\r
86 +(defvar notmuch-read-tag-changes-history nil\r
87 +  "Variable to store minibuffer history for\r
88 +`notmuch-read-tag-changes' function.")\r
89 +\r
90  (defun notmuch-tag-completions (&optional search-terms)\r
91    (split-string\r
92     (with-output-to-string\r
93 @@ -86,7 +94,7 @@ For example:\r
94  \r
95  (defun notmuch-select-tag-with-completion (prompt &rest search-terms)\r
96    (let ((tag-list (notmuch-tag-completions search-terms)))\r
97 -    (completing-read prompt tag-list)))\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    (let* ((all-tag-list (notmuch-tag-completions))\r
102 @@ -106,7 +114,8 @@ For example:\r
103             (define-key map " " 'self-insert-command)\r
104             map)))\r
105      (delete "" (completing-read-multiple "Tags (+add -drop): "\r
106 -               tag-list nil nil initial-input))))\r
107 +               tag-list nil nil initial-input\r
108 +               'notmuch-read-tag-changes-history))))\r
109  \r
110  (defun notmuch-update-tags (tags tag-changes)\r
111    "Return a copy of TAGS with additions and removals from TAG-CHANGES.\r
112 -- \r
113 1.7.9\r
114 \r