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

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

Date: Thu, 09 Aug 2012 13:52:47 -0700

To: Mark Walters, Jani Nikula, notmuch@notmuchmail.org

Cc:

From: Jameson Graef Rollins


On Mon, Jun 18 2012, Mark Walters <markwalters1009@gmail.com> wrote:
> I agree with this cycling approach but I think it needs to be per
> message rather than per buffer. I attach a rather hacky attempt at this
> below: on minimal testing it seems to work. But the lisp is really a bit
> gross. In particular  I have no idea if I should be escaping the message
> ids (so this could break in unfortunate/insecure ways)

Thanks to broken Apple mail clients, I'm getting more and more messages
that have attachments hidden in multipart/"alternatives" to text/plain
parts.  So I would really like to revive this patch.

I just tested it and it still applies to current master, and actually
seems to work great.  'W' cycles through which part is displayed in the
current message.  Pretty much exactly what I want.

Mark seems to think this patch is less than ideal.  One issue is that
it's trying to store a setting for a single displayed message in a
variable of full buffer scope.  So he's storing a list of message ids
there:

> +(defvar notmuch-show-message-multipart/alternative nil)
> +(make-variable-buffer-local 'notmuch-show-message-multipart/alternative)
> +(put 'notmuch-show-message-multipart/alternative 'permanent-local t)
...
> +	    (lax-plist-put notmuch-show-message-multipart/alternative (plist-get msg :id) 0)))

I can see that might get a little hairy.  Can any elisp experts out
there think of a better way to do this?  (actually, this is making me
again want a show mode that only displays one message at a time (which I
guess means I need to try pick again)).

jamie.
part-000.sig (application/pgp-signature)

Thread: