[PATCH v3] Emacs: Add address completion mechanism implemented in elisp
[notmuch-archives.git] / d6 / f51d4c836c94b53c26c0455aeb4d3bf8e7dcde
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 08516429E2E\r
6         for <notmuch@notmuchmail.org>; Sun,  6 Nov 2011 01:04:15 -0800 (PST)\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 ODGYoNUVybij for <notmuch@notmuchmail.org>;\r
17         Sun,  6 Nov 2011 01:04:13 -0800 (PST)\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 615A0431FB6\r
22         for <notmuch@notmuchmail.org>; Sun,  6 Nov 2011 01:04:13 -0800 (PST)\r
23 Received: by mail-bw0-f53.google.com with SMTP id q10so1189410bka.26\r
24         for <notmuch@notmuchmail.org>; Sun, 06 Nov 2011 01:04:13 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=gcGjz9eGFYBzxHZqALMY04Uq85BBrXcFd4mWaQtSjxA=;\r
28         b=ThkepYBvTxNMtuwW/0z3IJLZS6G2mTla8d9/Jb0yHP3RyWZErBao1d/IFFRntqdCgq\r
29         cViYAol6t16cVIvL/GF1nscssBkei9uS6g3UwWjxAB/VDpRXz+HvShwaHm0Ce+OjfwU+\r
30         u4RkfZqIO1gvduO4fg/UYmPA1tTGQUW2fcGHA=\r
31 Received: by 10.204.156.141 with SMTP id x13mr16106728bkw.54.1320570253067;\r
32         Sun, 06 Nov 2011 01:04:13 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id o8sm9308883bkd.3.2011.11.06.01.04.12\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Sun, 06 Nov 2011 01:04:12 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 2/4] emacs: improve hidden signatures handling in\r
40         notmuch-show-advance-and-archive\r
41 Date: Sun,  6 Nov 2011 13:03:59 +0400\r
42 Message-Id: <1320570241-30733-2-git-send-email-dmitry.kurochkin@gmail.com>\r
43 X-Mailer: git-send-email 1.7.7.1\r
44 In-Reply-To: <1320570241-30733-1-git-send-email-dmitry.kurochkin@gmail.com>\r
45 References: <87bospvd1v.fsf@gmail.com>\r
46         <1320570241-30733-1-git-send-email-dmitry.kurochkin@gmail.com>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Sun, 06 Nov 2011 09:04:15 -0000\r
60 \r
61 Use `previous-single-char-property-change' instead of going\r
62 through each character by hand and testing it's visibility.  This\r
63 fixes `notmuch-show-advance-and-archive' to work for the last\r
64 message in thread with hidden signature.\r
65 ---\r
66  emacs/notmuch-show.el |   17 +++++++++--------\r
67  1 files changed, 9 insertions(+), 8 deletions(-)\r
68 \r
69 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
70 index 440e089..b70dbfb 100644\r
71 --- a/emacs/notmuch-show.el\r
72 +++ b/emacs/notmuch-show.el\r
73 @@ -1152,17 +1152,18 @@ thread, (remove the \"inbox\" tag from each message). Also kill\r
74  this buffer, and display the next thread from the search from\r
75  which this thread was originally shown."\r
76    (interactive)\r
77 -  (let ((end-of-this-message (notmuch-show-message-bottom)))\r
78 +  (let* ((end-of-this-message (notmuch-show-message-bottom))\r
79 +        (visible-end-of-this-message (1- end-of-this-message)))\r
80 +    (while (invisible-p visible-end-of-this-message)\r
81 +      (setq visible-end-of-this-message\r
82 +           (previous-single-char-property-change visible-end-of-this-message\r
83 +                                                 'invisible)))\r
84      (cond\r
85       ;; Ideally we would test `end-of-this-message' against the result\r
86       ;; of `window-end', but that doesn't account for the fact that\r
87 -     ;; the end of the message might be hidden, so we have to actually\r
88 -     ;; go to the end, walk back over invisible text and then see if\r
89 -     ;; point is visible.\r
90 -     ((save-excursion\r
91 -       (goto-char (- end-of-this-message 1))\r
92 -       (notmuch-show-move-past-invisible-backward)\r
93 -       (> (point) (window-end)))\r
94 +     ;; the end of the message might be hidden.\r
95 +     ((and visible-end-of-this-message\r
96 +          (> visible-end-of-this-message (window-end)))\r
97        ;; The bottom of this message is not visible - scroll.\r
98        (scroll-up nil))\r
99  \r
100 -- \r
101 1.7.7.1\r
102 \r