Re: [PATCH v4 09/16] index encrypted parts when asked.
[notmuch-archives.git] / d1 / 8ad00f66e7458c2f495948a0376885b4d7a8e9
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 EE11B41ED6A\r
6         for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:57 -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 J8gEkwBJ9Xds for <notmuch@notmuchmail.org>;\r
17         Wed, 29 Jun 2011 12:42:57 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.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 1260141ED66\r
22         for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
23 Received: by mail-bw0-f53.google.com with SMTP id 12so1456477bwg.26\r
24         for <notmuch@notmuchmail.org>; Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=zrHA+ifthfgHP+Ej3ABOoqO+3pgC7SAtL5YSWWNUxmo=;\r
28         b=U1sEgesQUQKD0WqZ3mtHE+9cTh4PG6NgiLDyPEhj3JLkPMhYiRmKw3CkKt0eGppBhC\r
29         WGmukcQOU1InaTo2c6B8o8P9jj6RYsFc6AciZr0cRAiwaAoO80PdVKAi/0O5sqsI4Az3\r
30         kZnk9uII3nCj1Rx1r2sWRTnRMNbSDpC3zSAbU=\r
31 Received: by 10.204.14.12 with SMTP id e12mr1045148bka.210.1309376575632;\r
32         Wed, 29 Jun 2011 12:42:55 -0700 (PDT)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id ek1sm1430878bkb.9.2011.06.29.12.42.54\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Wed, 29 Jun 2011 12:42:54 -0700 (PDT)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 4/6] emacs: improve hidden signatures handling in\r
40         notmuch-show-advance-and-archive\r
41 Date: Wed, 29 Jun 2011 23:42:36 +0400\r
42 Message-Id: <1309376558-26284-4-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.5.4\r
44 In-Reply-To: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <1309376558-26284-1-git-send-email-dmitry.kurochkin@gmail.com>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Wed, 29 Jun 2011 19:42:58 -0000\r
59 \r
60 Use `previous-single-char-property-change' instead of going\r
61 through each character by hand and testing it's visibility.  This\r
62 fixes `notmuch-show-advance-and-archive' to work for the last\r
63 message in thread with hidden signature.\r
64 ---\r
65  emacs/notmuch-show.el |   17 +++++++++--------\r
66  1 files changed, 9 insertions(+), 8 deletions(-)\r
67 \r
68 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
69 index 6685717..ad3cc7b 100644\r
70 --- a/emacs/notmuch-show.el\r
71 +++ b/emacs/notmuch-show.el\r
72 @@ -1113,17 +1113,18 @@ thread, (remove the \"inbox\" tag from each message). Also kill\r
73  this buffer, and display the next thread from the search from\r
74  which this thread was originally shown."\r
75    (interactive)\r
76 -  (let ((end-of-this-message (notmuch-show-message-bottom)))\r
77 +  (let* ((end-of-this-message (notmuch-show-message-bottom))\r
78 +        (visible-end-of-this-message (1- end-of-this-message)))\r
79 +    (while (invisible-p visible-end-of-this-message)\r
80 +      (setq visible-end-of-this-message\r
81 +           (previous-single-char-property-change visible-end-of-this-message\r
82 +                                                 'invisible)))\r
83      (cond\r
84       ;; Ideally we would test `end-of-this-message' against the result\r
85       ;; of `window-end', but that doesn't account for the fact that\r
86 -     ;; the end of the message might be hidden, so we have to actually\r
87 -     ;; go to the end, walk back over invisible text and then see if\r
88 -     ;; point is visible.\r
89 -     ((save-excursion\r
90 -       (goto-char (- end-of-this-message 1))\r
91 -       (notmuch-show-move-past-invisible-backward)\r
92 -       (> (point) (window-end)))\r
93 +     ;; the end of the message might be hidden.\r
94 +     ((and visible-end-of-this-message\r
95 +          (> visible-end-of-this-message (window-end)))\r
96        ;; The bottom of this message is not visible - scroll.\r
97        (scroll-up nil))\r
98  \r
99 -- \r
100 1.7.5.4\r
101 \r