20

Emacs 24.4 came with native eww browser. What is the proper way to use eww as a renderer for mu4e messages?

18

eww is basically an interactive wrapper around the shr package, which renders HTML as Emacs text (the actual HTML parsing is done by the libxml package). You can use it in mu4e by setting mu4e-html2text-command to a simple custom function:

(defun my-render-html-message ()
  (let ((dom (libxml-parse-html-region (point-min) (point-max))))
    (erase-buffer)
    (shr-insert-document dom)
    (goto-char (point-min))))

(setq mu4e-html2text-command 'my-render-html-message)

The git version of mu4e includes this built-in as mu4e-shr2text, and it can be set like so:

(require 'mu4e-contrib) 
(setq mu4e-html2text-command 'mu4e-shr2text) 
  • 2
    mu4e-shr2text do not display images :( – shackra Dec 10 '14 at 19:58
  • @shackra For displaying html that comes from e-mail that's actually a good thing. I'm not sure if there's a key for toggling that, but even with that it should default to not showing images. That's, of course, regarding loading images from remote URIs, local images should be shown by default. – nert Oct 9 '17 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.