[PATCH] emacs: add function to toggle display of all multipart/alternative parts

Jani Nikula jani at nikula.org
Mon Jun 18 23:57:17 PDT 2012


On Mon, 18 Jun 2012, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Fri, Jun 15 2012, Jani Nikula <jani at nikula.org> wrote:
>> Add function notmuch-show-toggle-multipart-alternative to make
>> notmuch-show-all-multipart/alternative-parts buffer local, toggle its
>> value in the buffer, and redisplay the thread with either all or
>> preferred alternative parts expanded.
>
> This is a very cool feature.  I haven't looked closely at this but can't
> this mechanism work the same as the other show-mode toggles, like crypto
> or indenting?  I wouldn't think it would require any more extra variable
> stuff than what is used for those other toggles.

I don't know how I missed those - thanks for pointing them out to
me. They seem to do the extra variable stuff at the top level, alongside
the defvar, rather than in the toggle function like I do. I should
rearrange this toggle to be in line with the others.

> Also, the *really* sweet thing would be if the toggle actually cycled
> through display of the alternatives, only displaying one at a time.
> That would be very swank.

It is easy to agree with that. At a glance, it looks like it needs a
bunch more work than the simple toggle in this patch, though. One
difficulty is choosing the parts to cycle, as we may have multiple
messages with different sets of multipart/alternative in the same show
buffer. And the cycle would be buffer local, not "message local".

I think it would be possible to have show/hide buttons for the parts,
and the buttons could add/remove the part type from a buffer local list
of alternative parts to show, and then refresh view. But that too would
affect all messages in the buffer, not just one part of one message.

In short, with my limited elisp skills and even more limited time, I
don't see a nice solution this. That doesn't say anything about the
possible existence of a nice solution, though. ;)


BR,
Jani.


More information about the notmuch mailing list