[gnus git] branch master updated: m0-5-52-g655911a =1= shr.el (shr-render-buffer): New command. (shr-visit-file): Use it.

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  655911a3ddc2d88cd510c9df9e7785b2caded32f (commit)
      from  30d91271b594a39ea1bb737bbd684d2dcbac8095 (commit)


- Log -----------------------------------------------------------------
commit 655911a3ddc2d88cd510c9df9e7785b2caded32f
Author: Stefan Monnier <[email protected]>
Date:   Wed Jun 27 22:48:18 2012 +0000

    shr.el (shr-render-buffer): New command.
     (shr-visit-file): Use it.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c2abb1d..db13bb4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-27  Stefan Monnier  <[email protected]>
+
+	* shr.el (shr-render-buffer): New command.
+	(shr-visit-file): Use it.
+
 2012-06-27  Katsumi Yamaoka  <[email protected]>
 
 	* tests/gnustest-nntp.el, tests/gnustest-registry.el:
diff --git a/lisp/shr.el b/lisp/shr.el
index a0cf10d..bf6e57e 100644
--- a/lisp/shr.el
+++ b/lisp/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.

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    5 +++++
 lisp/shr.el    |   16 +++++++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.