1 Return-Path: <tomi.ollila@iki.fi>
\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 F34B9431FAF
\r
6 for <notmuch@notmuchmail.org>; Mon, 10 Jun 2013 08:22:57 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 9swfv9fY-feB for <notmuch@notmuchmail.org>;
\r
16 Mon, 10 Jun 2013 08:22:50 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 61EB5431FAE
\r
19 for <notmuch@notmuchmail.org>; Mon, 10 Jun 2013 08:22:50 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id E58F7100044;
\r
22 Mon, 10 Jun 2013 18:22:45 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org,
\r
25 Austin Clements <aclements@csail.mit.edu>
\r
26 Subject: Re: [PATCH v5 0/6] emacs: show: lazy handling of hidden parts
\r
27 In-Reply-To: <1370840233-23258-1-git-send-email-markwalters1009@gmail.com>
\r
28 References: <1370840233-23258-1-git-send-email-markwalters1009@gmail.com>
\r
29 User-Agent: Notmuch/0.15.2+181~gfb53171 (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Mon, 10 Jun 2013 18:22:45 +0300
\r
35 Message-ID: <m2fvwq6ldm.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Mon, 10 Jun 2013 15:22:58 -0000
\r
52 On Mon, Jun 10 2013, Mark Walters <markwalters1009@gmail.com> wrote:
\r
54 > This is version 5 of this patch set. Version 4 is at
\r
55 > id:1370074547-24677-1-git-send-email-markwalters1009@gmail.com.
\r
57 > This version fixes the two bugs pointed out in Austin's review
\r
58 > id:20130610023952.GC22196@mit.edu.
\r
60 > I decided to add the :notmuch-part text property separately from
\r
61 > create-overlays as they have slightly different regions (one includes
\r
62 > the button one does not) and are applied at slightly different times
\r
63 > (we do not create overlays for lazy parts).
\r
65 > I was not sure whether we created two overlays for hidden lazy parts
\r
66 > in v4 (it might not have done as the part was empty and we do not
\r
67 > create overlays for empty parts) but that is stupidly fragile. Thus we
\r
68 > explicitly do not create overlays for lazy parts until they are
\r
71 > The diff from v4 is below.
\r
73 As far as I understood the code looked good. I also checked lazy
\r
74 rendering by using w3m-standalone as mm-text-html-renderer and by
\r
75 writing a wrapper w3m which appended command line to a file before
\r
76 running w3m and then `tail -f`d the file...
\r
78 ... and w3m was run at the time [text/html (hidden)] was pressed.
\r
88 PS: anyone interested the command lines were:
\r
90 -dump -T text/html -I UTF-8 -O UTF-8
\r
91 -dump -T text/html -I UTF-8 -O UTF-8
\r
92 -dump -T text/html -I iso-8859-1 -O iso-8859-1
\r
94 (based on original encoding, emacs then did conversions when needed)
\r
97 > emacs: show: fake wash parts are handled at insert-bodypart level
\r
98 > emacs: show: move the insertion of the header button to the top level
\r
99 > emacs: show: pass button to create-overlays
\r
100 > emacs: show: modify the way hidden state is recorded.
\r
101 > emacs: show move addition of :notmuch-part to separate function
\r
102 > emacs: show: implement lazy hidden part handling
\r
104 > emacs/notmuch-show.el | 241 ++++++++++++++++++++++++++++++-------------------
\r
105 > 1 files changed, 146 insertions(+), 95 deletions(-)
\r
107 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
108 > index b963859..d030ea3 100644
\r
109 > --- a/emacs/notmuch-show.el
\r
110 > +++ b/emacs/notmuch-show.el
\r
111 > @@ -817,6 +817,27 @@ message at DEPTH in the current thread."
\r
112 > ;; Return true if we created an overlay.
\r
115 > +(defun notmuch-show-record-part-information (part beg end)
\r
116 > + "Store PART as a text property from BEG to END"
\r
118 > + ;; Record part information. Since we already inserted subparts,
\r
119 > + ;; don't override existing :notmuch-part properties.
\r
120 > + (notmuch-map-text-property beg end :notmuch-part
\r
121 > + (lambda (v) (or v part)))
\r
122 > + ;; Make :notmuch-part front sticky and rear non-sticky so it stays
\r
123 > + ;; applied to the beginning of each line when we indent the
\r
124 > + ;; message. Since we're operating on arbitrary renderer output,
\r
125 > + ;; watch out for sticky specs of t, which means all properties are
\r
126 > + ;; front-sticky/rear-nonsticky.
\r
127 > + (notmuch-map-text-property beg end 'front-sticky
\r
128 > + (lambda (v) (if (listp v)
\r
129 > + (pushnew :notmuch-part v)
\r
131 > + (notmuch-map-text-property beg end 'rear-nonsticky
\r
132 > + (lambda (v) (if (listp v)
\r
133 > + (pushnew :notmuch-part v)
\r
136 > (defun notmuch-show-lazy-part (part-args button)
\r
137 > ;; Insert the lazy part after the button for the part. We would just
\r
138 > ;; move to the start of the new line following the button and insert
\r
139 > @@ -843,6 +864,9 @@ message at DEPTH in the current thread."
\r
140 > (indent-rigidly part-beg part-end depth))
\r
141 > (goto-char part-end)
\r
143 > + (notmuch-show-record-part-information (second part-args)
\r
144 > + (button-start button)
\r
146 > ;; Create the overlay. If the lazy-part turned out to be empty/not
\r
147 > ;; showable this returns nil.
\r
148 > (notmuch-show-create-part-overlays button part-beg part-end))))
\r
149 > @@ -876,27 +900,13 @@ If HIDE is non-nil then initially hide this part."
\r
150 > ;; Ensure that the part ends with a carriage return.
\r
153 > - (notmuch-show-create-part-overlays button content-beg (point))
\r
155 > + ;; We do not create the overlay for hidden (lazy) parts until
\r
156 > + ;; they are inserted.
\r
158 > + (notmuch-show-create-part-overlays button content-beg (point))
\r
160 > (notmuch-show-toggle-part-invisibility button)))
\r
161 > - ;; Record part information. Since we already inserted subparts,
\r
162 > - ;; don't override existing :notmuch-part properties.
\r
163 > - (notmuch-map-text-property beg (point) :notmuch-part
\r
164 > - (lambda (v) (or v part)))
\r
165 > - ;; Make :notmuch-part front sticky and rear non-sticky so it stays
\r
166 > - ;; applied to the beginning of each line when we indent the
\r
167 > - ;; message. Since we're operating on arbitrary renderer output,
\r
168 > - ;; watch out for sticky specs of t, which means all properties are
\r
169 > - ;; front-sticky/rear-nonsticky.
\r
170 > - (notmuch-map-text-property beg (point) 'front-sticky
\r
171 > - (lambda (v) (if (listp v)
\r
172 > - (pushnew :notmuch-part v)
\r
174 > - (notmuch-map-text-property beg (point) 'rear-nonsticky
\r
175 > - (lambda (v) (if (listp v)
\r
176 > - (pushnew :notmuch-part v)
\r
178 > + (notmuch-show-record-part-information part beg (point))))
\r
180 > (defun notmuch-show-insert-body (msg body depth)
\r
181 > "Insert the body BODY at depth DEPTH in the current thread."
\r
187 > _______________________________________________
\r
188 > notmuch mailing list
\r
189 > notmuch@notmuchmail.org
\r
190 > http://notmuchmail.org/mailman/listinfo/notmuch
\r