[PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned CHAR
[notmuch-archives.git] / a5 / 6b3ef3eae93104b82f722afb5e8783008402f3
1 Return-Path: <pieter@praet.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 27F3E431FD0\r
6         for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 01:25:52 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 dw4Hcfb8Z8D3 for <notmuch@notmuchmail.org>;\r
16         Mon,  4 Jul 2011 01:25:51 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 403A7431FB6\r
21         for <notmuch@notmuchmail.org>; Mon,  4 Jul 2011 01:25:51 -0700 (PDT)\r
22 Received: by wyh22 with SMTP id 22so3782485wyh.26\r
23         for <notmuch@notmuchmail.org>; Mon, 04 Jul 2011 01:25:50 -0700 (PDT)\r
24 Received: by 10.227.28.206 with SMTP id n14mr5246859wbc.4.1309767949858;\r
25         Mon, 04 Jul 2011 01:25:49 -0700 (PDT)\r
26 Received: from localhost ([109.131.160.67])\r
27         by mx.google.com with ESMTPS id fp5sm3057841wbb.49.2011.07.04.01.25.47\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Mon, 04 Jul 2011 01:25:48 -0700 (PDT)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
32 Subject: Re: [PATCH 2/2] emacs: skip forward to visible text in\r
33         notmuch-show-message-extent\r
34 In-Reply-To: <1309667286-10357-2-git-send-email-dmitry.kurochkin@gmail.com>\r
35 References: <1309667286-10357-1-git-send-email-dmitry.kurochkin@gmail.com>\r
36         <1309667286-10357-2-git-send-email-dmitry.kurochkin@gmail.com>\r
37 User-Agent: Notmuch/0.5-326-ga5de9f3 (http://notmuchmail.org) Emacs/23.1.50.1\r
38         (x86_64-pc-linux-gnu)\r
39 Date: Mon, 04 Jul 2011 10:25:46 +0200\r
40 Message-ID: <87wrfy4flh.fsf@praet.org>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=us-ascii\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 04 Jul 2011 08:25:52 -0000\r
56 \r
57 On Sun,  3 Jul 2011 08:28:06 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
58 > The patch rewrites `notmuch-show-message-extent' to be more\r
59 > robust.  The main goal is to make it work as expected if point is\r
60 > invisible.  Besides, there are no more point movements and\r
61 > property search functions are used instead manual loops.  The\r
62 > comment regarding properties strangeness is removed since there\r
63 > is no strangeness here: property ranges (as well as overlay, and\r
64 > many others, I believe) are given as [begin, end), not [begin,\r
65 > end].\r
66 > ---\r
67 >  emacs/notmuch-show.el |   19 +++++++++++--------\r
68 >  1 files changed, 11 insertions(+), 8 deletions(-)\r
69\r
70 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
71 > index f96743b..cf8b405 100644\r
72 > --- a/emacs/notmuch-show.el\r
73 > +++ b/emacs/notmuch-show.el\r
74 > @@ -933,15 +933,18 @@ All currently available key bindings:\r
75 >  \r
76 >  ;; Movement related functions.\r
77 >  \r
78 > -;; There's some strangeness here where a text property applied to a\r
79 > -;; region a->b is not found when point is at b. We walk backwards\r
80 > -;; until finding the property.\r
81 >  (defun notmuch-show-message-extent ()\r
82 > -  (let (r)\r
83 > -    (save-excursion\r
84 > -      (while (not (setq r (get-text-property (point) :notmuch-message-extent)))\r
85 > -     (backward-char)))\r
86 > -    r))\r
87 > +  (let ((p (point)))\r
88 > +    ;; if point is invisible, skip forward to visible text\r
89 > +    (while (invisible-p p)\r
90 > +      (setq p (next-single-char-property-change p 'invisible)))\r
91 > +    ;; if no visible text found, use the point\r
92 > +    (or p (setq p (point)))\r
93 > +    (or (get-text-property p :notmuch-message-extent)\r
94 > +     ;; if there is no text property, skip to the previous message\r
95 > +     (and (setq p (previous-single-char-property-change\r
96 > +                   p :notmuch-message-extent))\r
97 > +          (get-text-property p :notmuch-message-extent)))))\r
98 >  \r
99 >  (defun notmuch-show-message-top ()\r
100 >    (car (notmuch-show-message-extent)))\r
101 > -- \r
102 > 1.7.5.4\r
103\r
104 > _______________________________________________\r
105 > notmuch mailing list\r
106 > notmuch@notmuchmail.org\r
107 > http://notmuchmail.org/mailman/listinfo/notmuch\r
108 \r
109 Signed-off-by: Pieter Praet <pieter@praet.org>\r
110 \r
111 Though it's worth noting that (as a previous test of yours [1] demonstrates),\r
112 it doesn't work consistently when the previous message has a text/html part:\r
113 complains with "No URL at point".\r
114 \r
115 Peace\r
116 \r
117 \r
118 -- \r
119 Pieter\r
120 \r
121 [1] id:"1309752441-10651-4-git-send-email-dmitry.kurochkin@gmail.com"\r