]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
emacs: show: implement lazy hidden part handling
authorMark Walters <markwalters1009@gmail.com>
Mon, 10 Jun 2013 04:57:13 +0000 (05:57 +0100)
committerDavid Bremner <bremner@debian.org>
Wed, 12 Jun 2013 15:07:19 +0000 (00:07 +0900)
This adds the actual code to do the lazy insertion of hidden parts.

We use a memory inefficient but simple method: when we come to insert
the part if it is hidden we just store all of the arguments to the
part insertion function as a button property. This means when we want
to show the part we can just resume where we left off.

One thing is that we can't tell if a lazy part will produce text until
we try to render it so when unhiding a part we check to see if it
rendered; if not we invoke the default part handler (e.g. an external
viewer).

Also, we would like to insert the lazy part at the start of the line
after the part button. But if this line has some text properties
(e.g. the colours for a following message header) then the lazy part
gets these properties. Thus we start at the end of the part button
line, insert a newline, insert the lazy part, and then delete the
extra newline at the end of the part.


No differences found