1 Return-Path: <dme@dme.org>
\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 DCDE1429E2F
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 02:18:59 -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 qmAp1EE7msHW for <notmuch@notmuchmail.org>;
\r
16 Wed, 25 Jan 2012 02:18:59 -0800 (PST)
\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com
\r
18 [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 21214431FBC
\r
21 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 02:18:59 -0800 (PST)
\r
22 Received: by wibhi8 with SMTP id hi8so2341292wib.26
\r
23 for <notmuch@notmuchmail.org>; Wed, 25 Jan 2012 02:18:58 -0800 (PST)
\r
25 Received: by 10.180.86.105 with SMTP id o9mr20415374wiz.4.1327486737928;
\r
26 Wed, 25 Jan 2012 02:18:57 -0800 (PST)
\r
27 Received: from hotblack-desiato.hh.sledj.net
\r
28 (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])
\r
29 by mx.google.com with ESMTPS id cb8sm19042304wib.0.2012.01.25.02.18.56
\r
30 (version=TLSv1/SSLv3 cipher=OTHER);
\r
31 Wed, 25 Jan 2012 02:18:57 -0800 (PST)
\r
32 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
33 id BC7CF9FDC4; Wed, 25 Jan 2012 10:18:55 +0000 (GMT)
\r
34 From: David Edmondson <dme@dme.org>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 2/3] emacs: Allow `notmuch-show-mode' to display only matching
\r
38 Date: Wed, 25 Jan 2012 10:18:48 +0000
\r
39 Message-Id: <1327486729-18052-3-git-send-email-dme@dme.org>
\r
40 X-Mailer: git-send-email 1.7.8.3
\r
41 In-Reply-To: <1327486729-18052-1-git-send-email-dme@dme.org>
\r
42 References: <1327486729-18052-1-git-send-email-dme@dme.org>
\r
44 ALoCoQkH4kosp8yJZzGjTTvvdWVcxZ0NRgLRSC5xOSqjRhYy7vrc1ZnTPjVguR3sMtQMl78b6esT
\r
45 X-BeenThere: notmuch@notmuchmail.org
\r
46 X-Mailman-Version: 2.1.13
\r
48 List-Id: "Use and development of the notmuch mail system."
\r
49 <notmuch.notmuchmail.org>
\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
53 List-Post: <mailto:notmuch@notmuchmail.org>
\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
57 X-List-Received-Date: Wed, 25 Jan 2012 10:19:00 -0000
\r
59 The current behaviour (all messages shown, non-matching collapsed)
\r
60 is retained as the default. Type '!' to switch to showing only
\r
61 the matching messages - non-matching messages are not available.
\r
62 '!' will switch back to showing everything.
\r
64 emacs/notmuch-show.el | 18 +++++++++++++++++-
\r
65 1 files changed, 17 insertions(+), 1 deletions(-)
\r
67 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
68 index ed77474..916b941 100644
\r
69 --- a/emacs/notmuch-show.el
\r
70 +++ b/emacs/notmuch-show.el
\r
71 @@ -134,6 +134,10 @@ indentation."
\r
72 (make-variable-buffer-local 'notmuch-show-process-crypto)
\r
73 (put 'notmuch-show-process-crypto 'permanent-local t)
\r
75 +(defvar notmuch-show-elide-non-matching-messages nil)
\r
76 +(make-variable-buffer-local 'notmuch-show-elide-non-matching-messages)
\r
77 +(put 'notmuch-show-elide-non-matching-messages 'permanent-local t)
\r
79 (defmacro with-current-notmuch-show-message (&rest body)
\r
80 "Evaluate body with current buffer set to the text of current message"
\r
82 @@ -890,11 +894,22 @@ current buffer, if possible."
\r
83 "Not processing cryptographic MIME parts."))
\r
84 (notmuch-show-refresh-view))
\r
86 +(defun notmuch-show-toggle-elide-non-matching ()
\r
87 + "Toggle the display of non-matching messages."
\r
89 + (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))
\r
90 + (message (if notmuch-show-elide-non-matching-messages
\r
91 + "Showing matching messages only."
\r
92 + "Showing all messages."))
\r
93 + (notmuch-show-refresh-view))
\r
95 (defun notmuch-show-insert-tree (tree depth)
\r
96 "Insert the message tree TREE at depth DEPTH in the current thread."
\r
97 (let ((msg (car tree))
\r
98 (replies (cadr tree)))
\r
99 - (notmuch-show-insert-msg msg depth)
\r
100 + (if (or (not notmuch-show-elide-non-matching-messages)
\r
101 + (plist-get msg :match))
\r
102 + (notmuch-show-insert-msg msg depth))
\r
103 (notmuch-show-insert-thread replies (1+ depth))))
\r
105 (defun notmuch-show-insert-thread (thread depth)
\r
106 @@ -1044,6 +1059,7 @@ Refreshes the current view, observing changes in cryptographic preferences."
\r
107 (define-key map (kbd "M-RET") 'notmuch-show-open-or-close-all)
\r
108 (define-key map (kbd "RET") 'notmuch-show-toggle-message)
\r
109 (define-key map "#" 'notmuch-show-print-message)
\r
110 + (define-key map "!" 'notmuch-show-toggle-elide-non-matching)
\r
111 (define-key map "$" 'notmuch-show-toggle-process-crypto)
\r
113 "Keymap for \"notmuch show\" buffers.")
\r