1 Return-Path: <amdragon@mit.edu>
\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 51BCF431E64
\r
6 for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 15:03:20 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 aV2Kvyi+RVyy for <notmuch@notmuchmail.org>;
\r
16 Sun, 29 Jan 2012 15:03:19 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id B6F8D429E4C
\r
20 for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 15:03:19 -0800 (PST)
\r
21 X-AuditID: 12074425-b7f4a6d0000008e0-b3-4f25d0371852
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 40.BD.02272.730D52F4; Sun, 29 Jan 2012 18:03:19 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q0TN3I1x023922;
\r
27 Sun, 29 Jan 2012 18:03:19 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q0TN3HoV022913
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Sun, 29 Jan 2012 18:03:18 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1RrdlV-000086-MR; Sun, 29 Jan 2012 18:02:29 -0500
\r
37 Date: Sun, 29 Jan 2012 18:02:29 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
40 Subject: Re: [PATCH 6/6] emacs: separate history for operations which accept
\r
41 single and multiple tags
\r
42 Message-ID: <20120129230229.GI17991@mit.edu>
\r
43 References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
44 <1327725684-5887-6-git-send-email-dmitry.kurochkin@gmail.com>
\r
46 Content-Type: text/plain; charset=us-ascii
\r
47 Content-Disposition: inline
\r
48 In-Reply-To: <1327725684-5887-6-git-send-email-dmitry.kurochkin@gmail.com>
\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IR4hTV1jW/oOpv0PFR1OLq1n52i+s3ZzI7
\r
52 MHnsnHWX3ePZqlvMAUxRXDYpqTmZZalF+nYJXBkHrl1mLVgiXLHzbwNzA+Mz/i5GTg4JAROJ
\r
53 mw0P2SBsMYkL99YD2VwcQgL7GCUaHl5ignA2MEocbP8KlTnJJHFndwcLhLOEUaJ3xVVmkH4W
\r
54 AVWJf8fXgdlsAhoS2/YvZwSxRQQMJW5dfAUWZxaQlvj2u5kJxBYWSJfoePwRLM4roCNx8eob
\r
55 RoihnYwS8/Z3skMkBCVOznzCAtGsJXHj30ugZg6wQcv/cYCEOQW8JN7PXQY2U1RARWLKyW1s
\r
56 ExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6Fnq5mSV6qSmlmxhBoc3u
\r
57 orqDccIhpUOMAhyMSjy8OytU/YVYE8uKK3MPMUpyMCmJ8racAQrxJeWnVGYkFmfEF5XmpBYf
\r
58 YpTgYFYS4Z2zDCjHm5JYWZValA+TkuZgURLn1dR65yckkJ5YkpqdmlqQWgSTleHgUJLgnXse
\r
59 qFGwKDU9tSItM6cEIc3EwQkynAdo+H6QGt7igsTc4sx0iPwpRkUpcd5GkIQASCKjNA+uF5Z6
\r
60 XjGKA70izNsEUsUDTFtw3a+ABjMBDX7OADa4JBEhJdXAOKVQbMKejVnZcx7Hcczb+e+0+foJ
\r
61 x2z2cCau02pfNLv9l1F3zKp4XrH9k6otHI5OtznyZl/r57YC3SU73i7J2RS1c+nHpO159ops
\r
62 z2uiJJsvr7l/69mhfLPv1TcXLgq3+PZqi45q4da3NyUvq4b1LXmetmHh3snJk5vl1zJEsr2Q
\r
63 C07gL99bIafEUpyRaKjFXFScCAAOml0aGAMAAA==
\r
64 Cc: notmuch@notmuchmail.org
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Sun, 29 Jan 2012 23:03:20 -0000
\r
79 Quoth Dmitry Kurochkin on Jan 28 at 8:41 am:
\r
80 > Some tag-related operations accept a single tag without prefix
\r
81 > (`notmuch-select-tag-with-completion'), others accept multiple tags
\r
82 > prefixed with '+' or '-' (`notmuch-select-tags-with-completion').
\r
83 > Before the change, both functions used a single default minibuffer
\r
84 > history. This is inconvenient because you have to skip options with
\r
85 > incompatible format when going through the history. The patch adds
\r
86 > separate history lists for the two functions. Note that functions
\r
87 > that accept the same input format (e.g. "+", "-", "*") share the
\r
88 > history list as before.
\r
90 > emacs/notmuch.el | 12 ++++++++++--
\r
91 > 1 files changed, 10 insertions(+), 2 deletions(-)
\r
93 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
94 > index 24b0ea3..9813e0a 100644
\r
95 > --- a/emacs/notmuch.el
\r
96 > +++ b/emacs/notmuch.el
\r
97 > @@ -76,6 +76,14 @@ For example:
\r
98 > (defvar notmuch-query-history nil
\r
99 > "Variable to store minibuffer history for notmuch queries")
\r
101 > +(defvar notmuch-select-tag-history nil
\r
102 > + "Variable to store notmuch tag history for
\r
103 > + `notmuch-select-tag-with-completion'.")
\r
105 > +(defvar notmuch-select-tags-history nil
\r
106 > + "Variable to store notmuch tags history for
\r
107 > + `notmuch-select-tags-with-completion'.")
\r
110 Really these are minibuffer or input histories, not "notmuch tag
\r
111 history". Also, the second line shouldn't be indented. (Definitely
\r
112 nits, but if you roll a new version, you might as well fix these.)
\r
114 > (defun notmuch-tag-completions (&optional search-terms)
\r
116 > (with-output-to-string
\r
117 > @@ -86,7 +94,7 @@ For example:
\r
119 > (defun notmuch-select-tag-with-completion (prompt &rest search-terms)
\r
120 > (let ((tag-list (notmuch-tag-completions search-terms)))
\r
121 > - (completing-read prompt tag-list)))
\r
122 > + (completing-read prompt tag-list nil nil nil 'notmuch-select-tag-history)))
\r
124 > (defun notmuch-select-tags-with-completion (&optional initial-input &rest search-terms)
\r
125 > (let* ((add-tag-list (mapcar (apply-partially 'concat "+")
\r
126 > @@ -105,7 +113,7 @@ For example:
\r
128 > (delete "" (completing-read-multiple
\r
129 > "Operations (+add -drop): notmuch tag " tag-list nil
\r
130 > - nil initial-input))))
\r
131 > + nil initial-input 'notmuch-select-tags-history))))
\r
133 > (defun notmuch-update-tags (current-tags changed-tags)
\r
134 > "Update `current-tags' with `changed-tags' and return the result.
\r