On Friday Feb 07 2014, doa379 <[email protected]> wrote:
> Hi,
>
> I'm using the function defined here:
>
> ;;; message view action
> (defun mu4e-msgv-action-view-in-browser (msg)
> "View the body of the message in a web browser."
> (interactive)
> (let ((html (mu4e-msg-field (mu4e-message-at-point t) :body-html))
> (tmpfile (format "%s/%d.html" temporary-file-directory (random))))
> (unless html (error "No html part for this message"))
> (with-temp-file tmpfile
> (insert
> "<html>"
> "<head><meta http-equiv=\"content-type\""
> "content=\"text/html;charset=UTF-8\">"
> html))
> (browse-url (concat "file://" tmpfile))))
> (add-to-list 'mu4e-view-actions
> '("View in browser" . mu4e-msgv-action-view-in-browser) t)
>
>
> http://www.emacswiki.org/emacs/mu4e
EmacsWiki is quite useful, but sadly also contains a lot of outdated
information; provided your using a fairly recent mu4e version, there's
actually a pre-cooked version of this as part of mu4e (and it's
described in the manual).
> Unfortunately, how do I invoke it? Is this function bound by the key
> binding '.'? If I do this the email reloads in it's raw HTML glory as plain
> text in the active emacs buffer.
(add-to-list 'mu4e-view-actions
'("ViewBrowser" . mu4e-action-view-in-browser) t)
and set `browse-url-generic-program' to your favorite browser.
Cheers,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:[email protected] w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
--
You received this message because you are subscribed to the Google Groups
"mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.