1 Return-Path: <m.walters@qmul.ac.uk>
\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 174EF431FAF
\r
6 for <notmuch@notmuchmail.org>; Sun, 13 Oct 2013 00:25:28 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 i3oz49iX-oXy for <notmuch@notmuchmail.org>;
\r
17 Sun, 13 Oct 2013 00:25:22 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\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 F1D6E431FAE
\r
22 for <notmuch@notmuchmail.org>; Sun, 13 Oct 2013 00:25:21 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1VVG33-0001rM-9g; Sun, 13 Oct 2013 08:25:09 +0100
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1VVG32-0007PV-Po; Sun, 13 Oct 2013 08:25:09 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: Re: [PATCH 1/2] emacs: show: use interactive instead of
\r
35 In-Reply-To: <20131013033157.GE10539@mit.edu>
\r
36 References: <1381348886-5673-1-git-send-email-markwalters1009@gmail.com>
\r
37 <1381348886-5673-2-git-send-email-markwalters1009@gmail.com>
\r
38 <20131013033157.GE10539@mit.edu>
\r
39 User-Agent: Notmuch/0.15.2+334~gafd5c6a (http://notmuchmail.org) Emacs/23.4.1
\r
40 (x86_64-pc-linux-gnu)
\r
41 Date: Sun, 13 Oct 2013 08:25:07 +0100
\r
42 Message-ID: <8761t13a5o.fsf@qmul.ac.uk>
\r
44 Content-Type: text/plain; charset=us-ascii
\r
45 X-Sender-Host-Address: 93.97.24.31
\r
46 X-QM-SPAM-Info: Sender has good ham record. :)
\r
47 X-QM-Body-MD5: 2a58f6129c5f8acb60553aee6a715217 (of first 20000 bytes)
\r
48 X-SpamAssassin-Score: 0.0
\r
49 X-SpamAssassin-SpamBar: /
\r
50 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
52 spam. We require at least 5.0 points to mark a message as spam.
\r
53 This message scored 0.0 points. Summary of the scoring:
\r
54 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
55 provider * (markwalters1009[at]gmail.com)
\r
56 * 0.0 AWL AWL: From: address is in the auto white-list
\r
57 X-QM-Scan-Virus: ClamAV says the message is clean
\r
58 Cc: notmuch@notmuchmail.org
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sun, 13 Oct 2013 07:25:28 -0000
\r
74 On Sun, 13 Oct 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
75 > Code looks good. Two minor comments below.
\r
79 > Quoth Mark Walters on Oct 09 at 9:01 pm:
\r
80 >> Currently notmuch-show looks at the prefix-arg directly via
\r
81 >> current-prefix-arg. This changes it to use the interactive
\r
84 >> emacs/notmuch-show.el | 12 +++++++-----
\r
85 >> emacs/notmuch.el | 5 +++--
\r
86 >> 2 files changed, 10 insertions(+), 7 deletions(-)
\r
88 >> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
89 >> index 5d7e24b..15f9ce6 100644
\r
90 >> --- a/emacs/notmuch-show.el
\r
91 >> +++ b/emacs/notmuch-show.el
\r
92 >> @@ -1080,15 +1080,17 @@ buttons for a corresponding notmuch search."
\r
93 >> (make-text-button (first link) (second link)
\r
94 >> :type 'notmuch-button-type
\r
95 >> 'action `(lambda (arg)
\r
96 >> - (notmuch-show ,(third link)))
\r
97 >> + (notmuch-show ,(third link) current-prefix-arg))
\r
99 > Hmm. Does this work? Can you activate the button with C-u RET?
\r
101 This does work: you can activate the button with C-u RET and it does
\r
102 elide the resulting the thread. (This is identical to the current
\r
108 >> 'help-echo "Mouse-1, RET: search for this message"
\r
109 >> 'face goto-address-mail-face)))))
\r
112 >> -(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name)
\r
113 >> +(defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-context buffer-name)
\r
114 >> "Run \"notmuch show\" with the given thread ID and display results.
\r
116 >> +The optional ELIDE-TOGGLE inverts the default elide behaviour.
\r
118 > "ELIDE-TOGGLE, if non-nil, inverts the default elide behavior."?
\r
122 Thanks for the review
\r
128 >> The optional PARENT-BUFFER is the notmuch-search buffer from
\r
129 >> which this notmuch-show command was executed, (so that the
\r
130 >> next thread from that buffer can be show when done with this
\r
131 >> @@ -1102,7 +1104,7 @@ The optional BUFFER-NAME provides the name of the buffer in
\r
132 >> which the message thread is shown. If it is nil (which occurs
\r
133 >> when the command is called interactively) the argument to the
\r
134 >> function is used."
\r
135 >> - (interactive "sNotmuch show: ")
\r
136 >> + (interactive "sNotmuch show: \nP")
\r
137 >> (let ((buffer-name (generate-new-buffer-name
\r
139 >> (concat "*notmuch-" thread-id "*")))))
\r
140 >> @@ -1112,9 +1114,9 @@ function is used."
\r
141 >> (setq notmuch-show-process-crypto notmuch-crypto-process-mime)
\r
142 >> ;; Set the default value for
\r
143 >> ;; `notmuch-show-elide-non-matching-messages' in this buffer. If
\r
144 >> - ;; there is a prefix argument, invert the default.
\r
145 >> + ;; elide-toggle is set, invert the default.
\r
146 >> (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages)
\r
147 >> - (if current-prefix-arg
\r
148 >> + (if elide-toggle
\r
149 >> (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages)))
\r
151 >> (setq notmuch-show-thread-id thread-id
\r
152 >> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
153 >> index 0ff248b..7124d0a 100644
\r
154 >> --- a/emacs/notmuch.el
\r
155 >> +++ b/emacs/notmuch.el
\r
156 >> @@ -486,13 +486,14 @@ If BARE is set then do not prefix with \"thread:\""
\r
157 >> "Return a list of authors for the current region"
\r
158 >> (notmuch-search-properties-in-region :subject beg end))
\r
160 >> -(defun notmuch-search-show-thread ()
\r
161 >> +(defun notmuch-search-show-thread (&optional elide-toggle)
\r
162 >> "Display the currently selected thread."
\r
164 >> + (interactive "P")
\r
165 >> (let ((thread-id (notmuch-search-find-thread-id))
\r
166 >> (subject (notmuch-search-find-subject)))
\r
167 >> (if (> (length thread-id) 0)
\r
168 >> (notmuch-show thread-id
\r
170 >> (current-buffer)
\r
171 >> notmuch-search-query-string
\r
172 >> ;; Name the buffer based on the subject.
\r