如何将eww用作mu4e的渲染器?


20

Emacs 24.4带有本机eww浏览器。将eww用作mu4e消息的呈现器的正确方法是什么?

Answers:


18

eww基本上是包装周围的交互式包装shr,将HTML呈现为Emacs文本(实际的HTML解析由libxml包装完成)。您可以mu4e通过设置mu4e-html2text-command为简单的自定义函数来使用它:

(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)

的git版本mu4e包括内置的,mu4e-shr2text可以这样设置:

(require 'mu4e-contrib) 
(setq mu4e-html2text-command 'mu4e-shr2text) 

2
mu4e-shr2text不显示图像:(
shackra

@shackra用于显示来自电子邮件的html,这实际上是一件好事。我不确定是否有切换该键的键,但是即使有它也应该默认不显示图像。当然,关于从远程URI加载图像,默认情况下应显示本地图像。
nert
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.