mu4e: make it easy to use shr for viewing rich text message

new emacs versions have the shr html renderer; we can use it to render
rich text messages. And some snippet to do so, and document it.
This commit is contained in:
djcb
2014-11-01 12:41:55 +02:00
parent 64738b8d4f
commit 80b4c17edc
3 changed files with 58 additions and 19 deletions

View File

@ -39,6 +39,19 @@
(mu4e-headers-mark-all-unread-read)
(mu4e-mark-execute-all t))
;;;
(defun mu4e-shr2text ()
"Html to text using the shr engine; this can be used in
`mu4e-html2text-command' in a new enough emacs. Based on code by
Titus von der Malsburg."
(interactive)
(let ((dom (libxml-parse-html-region (point-min) (point-max))))
(erase-buffer)
(shr-insert-document dom)
(goto-char (point-min))))
;;; Bookmark handlers
;;
;; Allow bookmarking a mu4e buffer in regular emacs bookmarks.