diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-27 10:40:22 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-27 10:40:22 -0400 |
commit | 7b953864bad04a37e9cc0e0de4328caf1b4c400e (patch) | |
tree | bfc7e911f4c4ac6cb6a1bc064c48a20c21c8156c /lisp | |
parent | 6e9590e26c31ee3056c5abc347381ee35d49363b (diff) | |
download | emacs-7b953864bad04a37e9cc0e0de4328caf1b4c400e.tar.gz |
* lisp/gnus/shr.el (shr-render-buffer): New command.
(shr-visit-file): Use it.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/gnus/shr.el | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 19747f0b621..e1d3b87beb5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * shr.el (shr-render-buffer): New command. + (shr-visit-file): Use it. + 2012-06-27 Katsumi Yamaoka <yamaoka@jpl.org> * tests/gnustest-nntp.el, tests/gnustest-registry.el: diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index a0cf10daaaf..bf6e57e8d79 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -129,17 +129,23 @@ cid: URL as the argument.") ;; Public functions and commands. -(defun shr-visit-file (file) - "Parse FILE as an HTML document, and render it in a new buffer." - (interactive "fHTML file name: ") +(defun shr-render-buffer (buffer) + "Display the HTML rendering of the current buffer." + (interactive (list (current-buffer))) (pop-to-buffer "*html*") (erase-buffer) (shr-insert-document - (with-temp-buffer - (insert-file-contents file) + (with-current-buffer buffer (libxml-parse-html-region (point-min) (point-max)))) (goto-char (point-min))) +(defun shr-visit-file (file) + "Parse FILE as an HTML document, and render it in a new buffer." + (interactive "fHTML file name: ") + (with-temp-buffer + (insert-file-contents file) + (shr-render-buffer (current-buffer)))) + ;;;###autoload (defun shr-insert-document (dom) "Render the parsed document DOM into the current buffer. |