Created
January 5, 2013 07:11
-
-
Save syl20bnr/4460279 to your computer and use it in GitHub Desktop.
Open the message at point in the default external browser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; adapted from https://groups.google.com/d/topic/mu-discuss/ZXB72TR5GL0/discussion | |
(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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment