[Patch v2 4/4] perf-test: initial support for talloc leak report in memory tests
[notmuch-archives.git] / 91 / 0f118993b939fa4278d699c1faeaa62c1c2e76
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
15 Received: from\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
38 Precedence: list\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
49 \r
50 From: David Bremner <bremner@unb.ca>\r
51 \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
55 outside notmuch.\r
56 ---\r
57  notmuch.el |   16 ++++++++++------\r
58  1 files changed, 10 insertions(+), 6 deletions(-)\r
59 \r
60 diff --git a/notmuch.el b/notmuch.el\r
61 index 5925907..f7048d5 100644\r
62 --- a/notmuch.el\r
63 +++ b/notmuch.el\r
64 @@ -949,15 +949,17 @@ All currently available key bindings:\r
65           (lambda()\r
66             (hl-line-mode 1) ))\r
67  \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
71  \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
76 +\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
84      (notmuch-show-mode)\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
87        (erase-buffer)\r
88        (goto-char (point-min))\r
89        (save-excursion\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
95         )\r
96        (run-hooks 'notmuch-show-hook)\r
97 @@ -1146,7 +1150,7 @@ Complete list of currently available key bindings:\r
98    (interactive)\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
104  \r
105  (defun notmuch-search-reply-to-thread ()\r
106 -- \r
107 1.6.5.3\r
108 \r