我知道w3m与Emacs的集成,但我很难让它在我的W7 / x64上运行:这里有一个w3m二进制的永久分段错误.
我想知道是否有另一种方法可以在Emacs中显示远程HTML,可能是由Readability / GetPocket等服务完成的初步过滤?我不需要在那里导航所以清除内容将是完美的.
谢谢,
解决方法
trunk / Emacs 24.4:
> M-x eww RET(URL)RET
Emacs 24.1 – 24.3:
> M-x browse-url-emacs RET(URL)RET
> M-x加载库RET shr RET
> M-x shr-render-buffer RET
(defun my-render-url (url) "Render URL as HTML." (interactive "sURL: ") (require 'shr) (let ((buf (save-window-excursion (browse-url-emacs url)))) (shr-render-buffer buf)))
编辑:或者这个,它绝对没有错误处理,但速度要快得多(我将其归因于使用url-retrieve-synchronously的browse-url-emacs,因为这是异步的).随意改进:)
(defun my-render-url (url) "Render URL as HTML." (declare (obsolete eww "24.4")) (interactive "sURL: ") (require 'shr) (url-retrieve url (lambda (&optional status cbargs) (let ((markup (current-buffer))) (delete-region (point-min) (1+ url-http-end-of-headers)) (shr-render-buffer markup) (kill-buffer markup)))))