我知道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
load-library
RETshr
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-syncly 的 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)))))