1 Return-Path: <bremner@pivot.cs.unb.ca>
\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 9313D431FAE
\r
6 for <notmuch@notmuchmail.org>; Fri, 4 Dec 2009 18:26:59 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id jK+er6KzC7TV for <notmuch@notmuchmail.org>;
\r
11 Fri, 4 Dec 2009 18:26:58 -0800 (PST)
\r
12 Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 430DA431FC7
\r
14 for <notmuch@notmuchmail.org>; Fri, 4 Dec 2009 18:26:57 -0800 (PST)
\r
16 fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net
\r
17 ([142.167.182.194] helo=localhost)
\r
18 by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)
\r
19 (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)
\r
20 id 1NGkMK-0000bN-Q5; Fri, 04 Dec 2009 22:26:56 -0400
\r
21 Received: from bremner by localhost with local (Exim 4.69)
\r
22 (envelope-from <bremner@pivot.cs.unb.ca>)
\r
23 id 1NGkMF-0008FI-3A; Fri, 04 Dec 2009 22:26:51 -0400
\r
24 From: david@tethera.net
\r
25 To: notmuch@notmuchmail.org
\r
26 Date: Fri, 4 Dec 2009 22:26:37 -0400
\r
27 Message-Id: <1259979997-31544-3-git-send-email-david@tethera.net>
\r
28 X-Mailer: git-send-email 1.6.5.3
\r
29 In-Reply-To: <1259979997-31544-2-git-send-email-david@tethera.net>
\r
30 References: <1259979997-31544-1-git-send-email-david@tethera.net>
\r
31 <1259979997-31544-2-git-send-email-david@tethera.net>
\r
32 X-Sender-Verified: bremner@pivot.cs.unb.ca
\r
33 Cc: David Bremner <bremner@unb.ca>
\r
34 Subject: [notmuch] [PATCH 2/2] notmuch-show: add optional argument for query
\r
35 context instead of using global binding notmuch-search-query-string
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.12
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Sat, 05 Dec 2009 02:26:59 -0000
\r
50 From: David Bremner <bremner@unb.ca>
\r
52 Also modify the one call to notmuch-show in notmuch.el. This makes
\r
53 the call (notmuch-show thread-id) will work when there is no binding
\r
54 for notmuch-search-query-string; e.g. when called from user code
\r
57 notmuch.el | 16 ++++++++++------
\r
58 1 files changed, 10 insertions(+), 6 deletions(-)
\r
60 diff --git a/notmuch.el b/notmuch.el
\r
61 index 5925907..f7048d5 100644
\r
64 @@ -949,15 +949,17 @@ All currently available key bindings:
\r
68 -(defun notmuch-show (thread-id &optional parent-buffer)
\r
69 +(defun notmuch-show (thread-id &optional parent-buffer query-context)
\r
70 "Run \"notmuch show\" with the given thread ID and display results.
\r
72 The optional PARENT-BUFFER is the notmuch-search buffer from
\r
73 which this notmuch-show command was executed, (so that the next
\r
74 -thread from that buffer can be show when done with this one)."
\r
75 +thread from that buffer can be show when done with this one).
\r
77 +The optional QUERY-CONTEXT is a notmuch search term. Only messages from the thread
\r
78 +matching this search term are shown if non-nil. "
\r
79 (interactive "sNotmuch show: ")
\r
80 - (let ((query notmuch-search-query-string)
\r
81 - (buffer (get-buffer-create (concat "*notmuch-show-" thread-id "*"))))
\r
82 + (let ((buffer (get-buffer-create (concat "*notmuch-show-" thread-id "*"))))
\r
83 (switch-to-buffer buffer)
\r
85 (set (make-local-variable 'notmuch-show-parent-buffer) parent-buffer)
\r
86 @@ -969,7 +971,9 @@ thread from that buffer can be show when done with this one)."
\r
88 (goto-char (point-min))
\r
90 - (call-process notmuch-command nil t nil "show" "--entire-thread" thread-id "and (" query ")")
\r
91 + (let* ((basic-args (list notmuch-command nil t nil "show" "--entire-thread" thread-id))
\r
92 + (args (if query-context (append basic-args (list "and (" query-context ")")) basic-args)))
\r
93 + (apply 'call-process args))
\r
94 (notmuch-show-markup-messages)
\r
96 (run-hooks 'notmuch-show-hook)
\r
97 @@ -1146,7 +1150,7 @@ Complete list of currently available key bindings:
\r
99 (let ((thread-id (notmuch-search-find-thread-id)))
\r
100 (if (> (length thread-id) 0)
\r
101 - (notmuch-show thread-id (current-buffer))
\r
102 + (notmuch-show thread-id (current-buffer) notmuch-search-query-string)
\r
103 (error "End of search results"))))
\r
105 (defun notmuch-search-reply-to-thread ()
\r