]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus/shr.el (shr-render-buffer): New command.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 27 Jun 2012 14:40:22 +0000 (10:40 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 27 Jun 2012 14:40:22 +0000 (10:40 -0400)
(shr-visit-file): Use it.

lisp/gnus/ChangeLog
lisp/gnus/shr.el

index 19747f0b6214a6b2ded604d8cc3c24803e37f4fe..e1d3b87beb59e448347064970d82a7f388a6c351 100644 (file)
@@ -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:
index a0cf10daaaf41fd887f3ecdbd38ecdb387b71a3d..bf6e57e8d79306214ef1ab12bfa106b8be5fcf8e 100644 (file)
@@ -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.