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 8CDD7431FBF
\r
6 for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 17:31:00 -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 U7SUFW4G8qA7 for <notmuch@notmuchmail.org>;
\r
16 Tue, 11 Feb 2014 17:30:53 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 0338B431FBD
\r
22 for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 17:30:52 -0800 (PST)
\r
23 X-AuditID: 12074425-f79906d000000cf9-f9-52facecc1d8c
\r
24 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id 6D.E9.03321.CCECAF25; Tue, 11 Feb 2014 20:30:52 -0500 (EST)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s1C1UoBY027104;
\r
31 Tue, 11 Feb 2014 20:30:51 -0500
\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
33 (authenticated bits=0)
\r
34 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
35 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s1C1Unj9005196
\r
36 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
\r
37 Tue, 11 Feb 2014 20:30:50 -0500
\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)
\r
39 (envelope-from <amdragon@mit.edu>)
\r
40 id 1WDOf2-0003RE-Vp; Tue, 11 Feb 2014 20:30:49 -0500
\r
41 From: Austin Clements <amdragon@MIT.EDU>
\r
42 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
\r
43 Subject: Re: [PATCH 6/7] emacs: search: use orig-tags in search
\r
44 In-Reply-To: <1390087855-26194-7-git-send-email-markwalters1009@gmail.com>
\r
45 References: <1390087855-26194-1-git-send-email-markwalters1009@gmail.com>
\r
46 <1390087855-26194-7-git-send-email-markwalters1009@gmail.com>
\r
47 User-Agent: Notmuch/0.17~rc2+14~g06f47e0 (http://notmuchmail.org) Emacs/23.4.1
\r
49 Date: Tue, 11 Feb 2014 20:30:48 -0500
\r
50 Message-ID: <87lhxhm81j.fsf@awakening.csail.mit.edu>
\r
52 Content-Type: text/plain; charset=us-ascii
\r
53 X-Brightmail-Tracker:
\r
54 H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsUixG6nonvm3K8gg+2fWS1Wz+WxuH5zJrMD
\r
55 k8fOWXfZPZ6tusUcwBTFZZOSmpNZllqkb5fAlfH/YhtrwUuhiv99f9gbGHv5uxg5OSQETCTO
\r
56 N7xmgrDFJC7cW8/WxcjFISQwm0ni998vTBDORkaJ/ivPWCGc00wSC15MZIZwljBKbJ+5lxWk
\r
57 n01AQ2Lb/uWMILaIgKvE02+fmUFsYQF7iTc7JwPN5eDgFPCSOLqlAqK3nVHi4NunYDWiAkkS
\r
58 p6f+ZgWpYRFQlfhx0AIkzAt03rN/x9ggbEGJkzOfsIDYzAJaEjf+vWSawCgwC0lqFpLUAkam
\r
59 VYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZJXqpKaWbGMEB6aK6g3HCIaVDjAIcjEo8vIKL
\r
60 fgUJsSaWFVfmHmKU5GBSEuUNOAYU4kvKT6nMSCzOiC8qzUktPsQowcGsJMKrfwIox5uSWFmV
\r
61 WpQPk5LmYFES5621AEoJpCeWpGanphakFsFkZTg4lCR4f54BygoWpaanVqRl5pQgpJk4OEGG
\r
62 8wAN/3MKZHhxQWJucWY6RP4Uo6KUOK/WWZDRIImM0jy4XljCeMUoDvSKMK8myAoeYLKB634F
\r
63 NJgJaHB/NtjgkkSElFQDI29H294ZSbOsPp1liWcO9ZlZcCyzSof9H2/3hlJ2O5PZ2y9ees/S
\r
64 I2o06eKzHIuqWsb78ucrw31XlpqbP35wwPHMQvEzUQe2zP9zwHubVcseq/YHpVwv3+2q8oub
\r
65 plI/Uavr3VVXnU1Jwh7m6e8KjCs2HI6NLOp7vq0/7VdQWIfo2XjpgqStSizFGYmGWsxFxYkA
\r
67 X-BeenThere: notmuch@notmuchmail.org
\r
68 X-Mailman-Version: 2.1.13
\r
70 List-Id: "Use and development of the notmuch mail system."
\r
71 <notmuch.notmuchmail.org>
\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
75 List-Post: <mailto:notmuch@notmuchmail.org>
\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
78 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
79 X-List-Received-Date: Wed, 12 Feb 2014 01:31:00 -0000
\r
81 On Sat, 18 Jan 2014, Mark Walters <markwalters1009@gmail.com> wrote:
\r
82 > This uses the recent functionality to show the tag changes in the
\r
83 > search buffer. Currently this is only used to show changes the search
\r
84 > buffer makes itself: i.e., it does not make display any changes
\r
85 > reflecting tagging done by other notmuch-buffers.
\r
87 > emacs/notmuch.el | 12 +++++++++---
\r
88 > 1 files changed, 9 insertions(+), 3 deletions(-)
\r
90 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
91 > index 1436e5a..f0ea5d4 100644
\r
92 > --- a/emacs/notmuch.el
\r
93 > +++ b/emacs/notmuch.el
\r
94 > @@ -753,14 +753,20 @@ non-authors is found, assume that all of the authors match."
\r
95 > format-string (notmuch-sanitize (plist-get result :authors))))
\r
97 > ((string-equal field "tags")
\r
98 > - (let ((tags (plist-get result :tags)))
\r
99 > - (insert (format format-string (notmuch-tag-format-tags tags tags)))))))
\r
100 > + (let ((tags (plist-get result :tags))
\r
101 > + (orig-tags (plist-get result :orig-tags)))
\r
102 > + (insert (format format-string (notmuch-tag-format-tags tags orig-tags)))))))
\r
104 > (defun notmuch-search-show-result (result &optional pos)
\r
105 > "Insert RESULT at POS or the end of the buffer if POS is null."
\r
106 > ;; Ignore excluded matches
\r
107 > (unless (= (plist-get result :matched) 0)
\r
108 > - (let ((beg (or pos (point-max))))
\r
109 > + (let ((beg (or pos (point-max)))
\r
110 > + ;; If we are inserting the result for the first time POS
\r
111 > + ;; will be nil and we should set orig-tags.
\r
112 > + (result (if pos
\r
114 > + (plist-put result :orig-tags (plist-get result :tags)))))
\r
116 This seems rather obtuse. I'd prefer a little wrapper that sits between
\r
117 `notmuch-sexp-parse-partial-list' and `notmuch-search-show-result' that
\r
118 adds :orig-tags. The wrapper could also pass (point-max) for pos and
\r
119 pos could be made a required argument. E.g.,
\r
121 (defun notmuch-search-process-result (result)
\r
122 ;; Record original tags of this message
\r
123 (setq result (plist-put result :orig-tags (plist-get result :tags)))
\r
124 ;; Append the result to the search buffer
\r
125 (notmuch-search-show-result result (point-max)))
\r
129 > (dolist (spec notmuch-search-result-format)
\r
133 > _______________________________________________
\r
134 > notmuch mailing list
\r
135 > notmuch@notmuchmail.org
\r
136 > http://notmuchmail.org/mailman/listinfo/notmuch
\r