Created
December 22, 2013 17:51
-
-
Save rberenguel/8086049 to your computer and use it in GitHub Desktop.
Small emacs lisp snippet to open email as HTML in default browser. Found it somewhere over the net, but it is so awesome I need to save it for posterity. In a summary buffer use v h (think of it as "view html") to switch to HTML view. It works by generating a temporary file and stripping the html part of the current message into it.
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
(defun my-gnus-summary-view-html-alternative () | |
"Display the HTML part of the current multipart/alternative MIME message | |
in current default browser." | |
(interactive) | |
(save-current-buffer | |
(gnus-summary-show-article) | |
(set-buffer gnus-article-buffer) | |
(let ((file (make-temp-file "html-message-" nil ".html")) | |
(handle (nth 3 (assq 1 gnus-article-mime-handle-alist)))) | |
(mm-save-part-to-file handle file) | |
(browse-url (concat "file://" file))))) | |
(define-key gnus-summary-mode-map "vh" | |
'my-gnus-summary-view-html-alternative) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment