Re: Bug#812003: emacs24-el: message-mode repeats non-deterministic cryptographic...
[notmuch-archives.git] / d6 / b907055b030a88adc05399362c557d4943bae0
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 A807A4196F0\r
6         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 03:17:05 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\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 7n+jpZ0C9Bf2 for <notmuch@notmuchmail.org>;\r
16         Mon, 26 Apr 2010 03:17:05 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181])\r
19         by olra.theworths.org (Postfix) with ESMTP id BFE14431FC1\r
20         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 03:17:04 -0700 (PDT)\r
21 Received: by wyj26 with SMTP id 26so582548wyj.26\r
22         for <notmuch@notmuchmail.org>; Mon, 26 Apr 2010 03:17:03 -0700 (PDT)\r
23 Received: by 10.216.90.4 with SMTP id d4mr5071881wef.135.1272277023407;\r
24         Mon, 26 Apr 2010 03:17:03 -0700 (PDT)\r
25 Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com\r
26         [83.217.165.81])\r
27         by mx.google.com with ESMTPS id r29sm319738wbv.15.2010.04.26.03.17.02\r
28         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
29         Mon, 26 Apr 2010 03:17:02 -0700 (PDT)\r
30 Received: by ut.hh.sledj.net (Postfix, from userid 1000)\r
31         id B05E9594135; Mon, 26 Apr 2010 11:17:12 +0100 (BST)\r
32 From: David Edmondson <dme@dme.org>\r
33 To: notmuch@notmuchmail.org\r
34 Subject: [PATCH] emacs: Correct message/header/citation/signature hiding\r
35 Date: Mon, 26 Apr 2010 11:17:11 +0100\r
36 Message-Id: <1272277031-32419-1-git-send-email-dme@dme.org>\r
37 X-Mailer: git-send-email 1.7.0\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Mon, 26 Apr 2010 10:17:05 -0000\r
51 \r
52 Set `buffer-invisibility-spec' to `nil' (a list) if it is just `t'\r
53 before inserting any body parts, otherwise removing items from\r
54 `buffer-invisibility-spec' (which is what\r
55 `notmuch-show-headers-visible' and `notmuch-show-message-visible' do)\r
56 is a no-op and has no effect. This caused threads with only matching\r
57 messages to have those messages hidden initially because\r
58 `buffer-invisibility-spec' stayed `t'.\r
59 ---\r
60 \r
61 Carl, we need this fix before 0.3 is released. The bug has always\r
62 existed in the JSON based UI and is now exposed because previously\r
63 there was always a call to `add-to-invisibility-spec' (for the\r
64 headers), which transformed `buffer-invisiliblty-spec' from `t' to a\r
65 list. That doesn't always happen now (only calls to\r
66 `remove-from-invisibility-spec'), so the variable could get left as\r
67 `t'.\r
68 \r
69  emacs/notmuch-show.el |   16 ++++++++++++++++\r
70  1 files changed, 16 insertions(+), 0 deletions(-)\r
71 \r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
73 index f958a30..f9d6c93 100644\r
74 --- a/emacs/notmuch-show.el\r
75 +++ b/emacs/notmuch-show.el\r
76 @@ -382,6 +382,22 @@ current buffer, if possible."\r
77         (headers-invis-spec (notmuch-show-make-symbol "header"))\r
78         (message-invis-spec (notmuch-show-make-symbol "message")))\r
79  \r
80 +    ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise\r
81 +    ;; removing items from `buffer-invisibility-spec' (which is what\r
82 +    ;; `notmuch-show-headers-visible' and\r
83 +    ;; `notmuch-show-message-visible' do) is a no-op and has no\r
84 +    ;; effect. This caused threads with only matching messages to have\r
85 +    ;; those messages hidden initially because\r
86 +    ;; `buffer-invisibility-spec' stayed `t'.\r
87 +    ;;\r
88 +    ;; This needs to be set here (rather than just above the call to\r
89 +    ;; `notmuch-show-headers-visible') because some of the part\r
90 +    ;; rendering or body washing functions\r
91 +    ;; (e.g. `notmuch-wash-text/plain-citations') manipulate\r
92 +    ;; `buffer-invisibility-spec').\r
93 +    (when (eq buffer-invisibility-spec t)\r
94 +      (setq buffer-invisibility-spec nil))\r
95 +\r
96      (setq message-start (point-marker))\r
97  \r
98      (notmuch-show-insert-headerline headers\r
99 -- \r
100 1.7.0\r
101 \r