[PATCH (draft) 0/2] Allow emacs to toggle display of all parts including multipart

Jani Nikula jani at nikula.org
Sun Dec 2 11:48:00 PST 2012


On Thu, 25 Oct 2012, Mark Walters <markwalters1009 at gmail.com> wrote:
> This patch series adds a function to toggle the display of any emacs
> part in the show buffer. This is particularly useful for
> multipart/alternative where the parts have different information.

I didn't look at the code, but I tried it. And I like it. There are some
annoyances and some things I'll still want to customize for myself, but
I really like it.

> The first patch binds this toggle to 't' on the part button. This
> patch works by itself.

I'd like to rebind RET to do the toggle by default. I don't think it's
very useful to be able to save multipart/alternative parts by default.

> The second patch makes it that "viewing" (ie v on the part-button) a
> "not shown" part displays the part in the buffer. Note this is not a
> toggle since having displayed the part in the buffer the user may wish
> to view the part externally (eg if it is a text/html part).
>
> Caveats: 
> 	 the patches work by reloading the whole buffer: this may mean
> 	 extra messages appear in the thread. This is not ideal but is
> 	 the same as toggling indentation etc.

It's all right.

> 	 the reload saves state as normal but this means the view
> 	 returns to the top of the current message. Since we know
> 	 exactly where the user was (ie on the button) this should be
> 	 restored.

This is annoying, and should be fixed eventually (but this can come
afterwards). One option would be to just take a line count from the
beginning of the message to the button, and return point to the button
after refresh. This should work even if new messages show up.

> 	 for technical reasons the "view" part functionality in the
> 	 second patch only works for view called explicitly: not if
> 	 the user has customised the default action to be view and
> 	 calls that. This is easy to fix but the most natural way
> 	 would break existing customisation of this action.
>
> 	 reloading the buffer without keeping state does not currently
> 	 reset the toggled parts. Again this is easy to fix but lets
> 	 see if people like the general approach first.

IMHO can be fixed later.

One more wishlist item, which also doesn't need to be part of this
series, or by you: I'd like to be able to specify *which*
multipart/alternative parts should be displayed in addition to
preferred. A list of (regexps matching) mime types to always open,
whether they're preferred or not. I've previously sent patches to this
effect, but they were never merged (I can repost if you want).

BR,
Jani.


>
> Best wishes
>
> Mark
>
>
> Mark Walters (2):
>   emacs: allow the user to toggle the visibility of
>     multipart/alternative parts
>   emacs: show: make "view part" show hidden parts
>
>  emacs/notmuch-show.el |   53 ++++++++++++++++++++++++++++++++++++++++--------
>  1 files changed, 44 insertions(+), 9 deletions(-)
>
> -- 
> 1.7.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list