On Sunday Dec 27 2015, Olli P. wrote:
> I am looking to add this features as well, as there are some messages where
> I know beforehand that they will look much nicer when viewed from the
> browser. I can already do this by opening the message first and then
> calling the action for viewing it in the browser, but I'd like to avoid the
> extra step of having to open the message first and just directly open up
> the message in the browser.
>
> I was digging through the source code of mu4e to figure out how to retrieve
> the body of the message using the :docid or :path fields that are available
> to me from the headers view, but in the end I gave up after unsuccessfully
> trying to shadow the mu4e-view-func with a function of my own in the scope
> of a let. There seems to be a very tight coupling between the message view
> buffer and commands that get sent to the mu process. Is there some way
> around this, or perhaps I should just make my action use the message view
> buffer and automate the opening in the browser part while there?
Let-binding is a bit hard for some of the mu4e-functions, since the
messages come in asynchronously, ie., after we've left the let-bound
area.
You could use the message-view, I suppose, but you do not have the
message body there; you do have the :path (to the raw message), but it
would take a bit of processing to have that show nicely in a
browser. There's some code in toys/mug which can do the latter, but
would require some changes for this particular use-case.
However, the real question is perhaps why we can't have all messages
look nice inside emacs - that should be the goal, I think. It's gotten a
lot better when using 'shr' (see manual) for rendering, but there are
still some error-cases (like airline-emails).
An interesting solution would be to create a email view widget (like the
one in 'mug'), and integrate that in emacs, using the upcoming
xwidget/ffi functionality.
Kind regards,