1 Return-Path: <dmitry.kurochkin@gmail.com>
\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 9EE65429E3D
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:30 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 h8Iumt2vjYr7 for <notmuch@notmuchmail.org>;
\r
17 Wed, 25 May 2011 15:10:29 -0700 (PDT)
\r
18 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com
\r
19 [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 137B4429E44
\r
22 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:24 -0700 (PDT)
\r
23 Received: by mail-fx0-f53.google.com with SMTP id 8so217139fxm.26
\r
24 for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:24 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer
\r
27 :in-reply-to:references;
\r
28 bh=7PGK3epIXMCCuCcfGgt9UJZt88pE4ZDA1Fb6TWufGFc=;
\r
29 b=B1AUaDAQsEp+pFw6r+d9IICIFnyBdxwNccwRE+NuZMqkIe1rl96nL9juVbfGoiSxe/
\r
30 Hf9hGTlrdKpiJwU8bskUcUg2/+3uZfMJXhrp3758R5VMDDAr+biYDP7FwNaJ6xoQpOAP
\r
31 XtLnx+WEiCZZIuAZolSvq/H57Jv3xQx6Pto5k=
\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
33 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
34 b=UXNf/7Jf0NOldeqzYEN7guJlI4E2vmsglajVrgGc/ZXJvYlcqO+m9VmNTtac/suBkr
\r
35 lmTuzNxwVcX+2PQr0uRalJV0GopblRUA9vrxgXV6wT7pxOLBiicKQ2Zw14TRX9GfCene
\r
36 ms8wY9p4BWFa3v5H/ovFHohbvam/dYiLqPhE4=
\r
37 Received: by 10.223.57.5 with SMTP id a5mr106251fah.90.1306361424751;
\r
38 Wed, 25 May 2011 15:10:24 -0700 (PDT)
\r
39 Received: from localhost ([91.144.186.21])
\r
40 by mx.google.com with ESMTPS id b25sm31705fab.4.2011.05.25.15.10.23
\r
41 (version=TLSv1/SSLv3 cipher=OTHER);
\r
42 Wed, 25 May 2011 15:10:24 -0700 (PDT)
\r
43 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
44 To: notmuch@notmuchmail.org
\r
45 Subject: [PATCH 5/5] Simplify message and headers visibility code in
\r
47 Date: Thu, 26 May 2011 02:10:16 +0400
\r
48 Message-Id: <1306361416-5019-6-git-send-email-dmitry.kurochkin@gmail.com>
\r
49 X-Mailer: git-send-email 1.7.5.1
\r
50 In-Reply-To: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
51 References: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
52 X-BeenThere: notmuch@notmuchmail.org
\r
53 X-Mailman-Version: 2.1.13
\r
55 List-Id: "Use and development of the notmuch mail system."
\r
56 <notmuch.notmuchmail.org>
\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
58 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
60 List-Post: <mailto:notmuch@notmuchmail.org>
\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
64 X-List-Received-Date: Wed, 25 May 2011 22:10:30 -0000
\r
66 Before the change, headers and message visibility functions took
\r
67 extra care to correctly set `buffer-invisibility-spec'. This was
\r
68 needed because headers overlay `invisible' property had only
\r
69 headers' invisibility spec. So visibility of headers was
\r
70 determined only by the headers invisibility spec. The patch sets
\r
71 headers overlay `invisible' property a list with both the headers
\r
72 and the message invisibility spec. This makes headers invisible
\r
73 if either of them is added to the `buffer-invisibility-spec' and
\r
74 allows to simplify the code.
\r
76 emacs/notmuch-show.el | 18 +++++-------------
\r
77 1 files changed, 5 insertions(+), 13 deletions(-)
\r
79 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
80 index e1846bc..2f7154e 100644
\r
81 --- a/emacs/notmuch-show.el
\r
82 +++ b/emacs/notmuch-show.el
\r
83 @@ -733,8 +733,9 @@ current buffer, if possible."
\r
85 (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end))
\r
87 - (let ((headers-overlay (make-overlay headers-start headers-end)))
\r
88 - (overlay-put headers-overlay 'invisible headers-invis-spec)
\r
89 + (let ((headers-overlay (make-overlay headers-start headers-end))
\r
90 + (invis-specs (list headers-invis-spec message-invis-spec)))
\r
91 + (overlay-put headers-overlay 'invisible invis-specs)
\r
92 (overlay-put headers-overlay 'priority 10))
\r
93 (overlay-put (make-overlay body-start body-end) 'invisible message-invis-spec)
\r
95 @@ -974,20 +975,11 @@ All currently available key bindings:
\r
96 (add-to-invisibility-spec spec))))
\r
98 (defun notmuch-show-message-visible (props visible-p)
\r
100 - ;; When making the message visible, the headers may or not be
\r
101 - ;; visible. So we check that property separately.
\r
102 - (let ((headers-visible (plist-get props :headers-visible)))
\r
103 - (notmuch-show-element-visible props headers-visible :headers-invis-spec)
\r
104 - (notmuch-show-element-visible props t :message-invis-spec))
\r
105 - (notmuch-show-element-visible props nil :headers-invis-spec)
\r
106 - (notmuch-show-element-visible props nil :message-invis-spec))
\r
108 + (notmuch-show-element-visible props visible-p :message-invis-spec)
\r
109 (notmuch-show-set-prop :message-visible visible-p props))
\r
111 (defun notmuch-show-headers-visible (props visible-p)
\r
112 - (if (plist-get props :message-visible)
\r
113 - (notmuch-show-element-visible props visible-p :headers-invis-spec))
\r
114 + (notmuch-show-element-visible props visible-p :headers-invis-spec)
\r
115 (notmuch-show-set-prop :headers-visible visible-p props))
\r
117 ;; Functions for setting and getting attributes of the current
\r