Re: [PATCH] Fix typo in Message.maildir_flags_to_tags
[notmuch-archives.git] / 27 / 78e962136f03d784e081b35dda24ccc3c5cda7
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 96D32429E3C\r
6         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:18 -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: -0.799\r
10 X-Spam-Level: \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 XSrtvxLc5k3J for <notmuch@notmuchmail.org>;\r
17         Wed, 25 May 2011 15:10:17 -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 E3A89429E3B\r
22         for <notmuch@notmuchmail.org>; Wed, 25 May 2011 15:10:16 -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:16 -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=N2n7BufUgTHwruq8jNqVC16Yb0QuARkoeCKQDRTFzs4=;\r
29         b=UB9rAihNyFdwaCGUzxC9mU2Qe5BRqdVi/Jh2VV29TM+pyWCj4ny4fZYBBY1OV+Iogg\r
30         A48B2IJHQNa5yM2iuIG5O1tfgkyfeEJL/Ra0v5f3oU7jXXawEiWnkX++CJ3TbafokVTF\r
31         N/GCDxfhsKfFx6SEh+nEjqbzuooIStSmZk5p8=\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=Mvq60YAq0n3XjxJqCSehyoNquiv+AZWMi+y3O/ZK/QECA1/Dr/zrWQc1j1czs21E+f\r
35         a0aN+mMSP8d3/McGWuh9bRwuFgwzC94mZLzLzv7WkGjN1GWu3HywQD+z4ngNDsjihBZI\r
36         k7LDM7vagbCAJXwWqLAfv5471vTt9zPuZDL7Q=\r
37 Received: by 10.223.56.24 with SMTP id w24mr93495fag.131.1306361416499;\r
38         Wed, 25 May 2011 15:10:16 -0700 (PDT)\r
39 Received: from localhost ([91.144.186.21])\r
40         by mx.google.com with ESMTPS id q14sm31667faa.27.2011.05.25.15.10.15\r
41         (version=TLSv1/SSLv3 cipher=OTHER);\r
42         Wed, 25 May 2011 15:10:16 -0700 (PDT)\r
43 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH 3/5] Fix hiding a message while some citations are shown in\r
46         notmuch-show view.\r
47 Date: Thu, 26 May 2011 02:10:14 +0400\r
48 Message-Id: <1306361416-5019-4-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
54 Precedence: list\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:18 -0000\r
65 \r
66 Before the change, message and citation invisibility overlays\r
67 conflicted: if some citation is made visible and then the whole\r
68 message is hidden, that citation remained visible.  This happened\r
69 because the citation's overlay has an invisible property which\r
70 takes priority over the message overlay.  The message\r
71 invisibility spec does not affect citation visibility, it is\r
72 determined solely by the citation overlay invisibility spec.\r
73 Hence, if citation is made visible, it is not hidden by message\r
74 invisibility spec.\r
75 \r
76 The patch changes citation overlay invisibility property to be a\r
77 list which contains both the citation and the message\r
78 invisibility specs.  This makes the citation invisible if either\r
79 of them is added to the `buffer-invisibility-spec'.  Note that\r
80 all citation visibility states are "restored" when the message\r
81 hidden and shown again.\r
82 ---\r
83  emacs/notmuch-wash.el |   12 +++++++-----\r
84  1 files changed, 7 insertions(+), 5 deletions(-)\r
85 \r
86 diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
87 index 7d87e85..bd521ba 100644\r
88 --- a/emacs/notmuch-wash.el\r
89 +++ b/emacs/notmuch-wash.el\r
90 @@ -107,7 +107,8 @@ collapse the remaining lines into a button.")\r
91    :supertype 'notmuch-wash-button-invisibility-toggle-type)\r
92  \r
93  (defun notmuch-wash-region-isearch-show (overlay)\r
94 -  (remove-from-invisibility-spec (overlay-get overlay 'invisible)))\r
95 +  (dolist (invis-spec (overlay-get overlay 'invisible))\r
96 +    (remove-from-invisibility-spec invis-spec)))\r
97  \r
98  (defun notmuch-wash-button-label (overlay)\r
99    (let* ((type (overlay-get overlay 'type))\r
100 @@ -118,7 +119,7 @@ collapse the remaining lines into a button.")\r
101          (lines-count (count-lines (overlay-start overlay) (overlay-end overlay))))\r
102      (format label-format lines-count)))\r
103  \r
104 -(defun notmuch-wash-region-to-button (beg end type prefix)\r
105 +(defun notmuch-wash-region-to-button (msg beg end type prefix)\r
106    "Auxilary function to do the actual making of overlays and buttons\r
107  \r
108  BEG and END are buffer locations. TYPE should a string, either\r
109 @@ -131,11 +132,12 @@ insert before the button, probably for indentation."\r
110    ;; since the newly created symbol has no plist.\r
111  \r
112    (let ((overlay (make-overlay beg end))\r
113 +       (message-invis-spec (plist-get msg :message-invis-spec))\r
114         (invis-spec (make-symbol (concat "notmuch-" type "-region")))\r
115         (button-type (intern-soft (concat "notmuch-wash-button-"\r
116                                           type "-toggle-type"))))\r
117      (add-to-invisibility-spec invis-spec)\r
118 -    (overlay-put overlay 'invisible invis-spec)\r
119 +    (overlay-put overlay 'invisible (list invis-spec message-invis-spec))\r
120      (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show)\r
121      (overlay-put overlay 'type type)\r
122      (goto-char (1+ end))\r
123 @@ -166,7 +168,7 @@ insert before the button, probably for indentation."\r
124           (goto-char cite-end)\r
125           (forward-line (- notmuch-wash-citation-lines-suffix))\r
126           (notmuch-wash-region-to-button\r
127 -          hidden-start (point-marker)\r
128 +          msg hidden-start (point-marker)\r
129            "citation" "\n")))))\r
130    (if (and (not (eobp))\r
131            (re-search-forward notmuch-wash-signature-regexp nil t))\r
132 @@ -180,7 +182,7 @@ insert before the button, probably for indentation."\r
133               (set-marker sig-end-marker (point-max))\r
134               (overlay-put (make-overlay sig-start-marker sig-end-marker) 'face 'message-cited-text)\r
135               (notmuch-wash-region-to-button\r
136 -              sig-start-marker sig-end-marker\r
137 +              msg sig-start-marker sig-end-marker\r
138                "signature" "\n"))))))\r
139  \r
140  ;;\r
141 -- \r
142 1.7.5.1\r
143 \r