* shr.el (shr-visit-file): New command.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 17 Mar 2011 16:45:28 +0000 (17:45 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 17 Mar 2011 16:45:28 +0000 (17:45 +0100)
lisp/ChangeLog
lisp/shr.el

index 9c1b883..43ca066 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 2011-03-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * shr.el (shr-visit-file): New command.
+
        * nnimap.el (nnimap-fetch-inbox): Rewrite slightly last patch.
 
 2011-03-17  Bjørn Mork  <bjorn@mork.no>
        * nnimap.el (nnimap-fetch-inbox): Rewrite slightly last patch.
 
 2011-03-17  Bjørn Mork  <bjorn@mork.no>
index c9c5bd5..113137a 100644 (file)
@@ -113,6 +113,15 @@ cid: URL as the argument.")
 
 ;; Public functions and commands.
 
 
 ;; Public functions and commands.
 
+(defun shr-visit-file (file)
+  (interactive "fHTML file name: ")
+  (pop-to-buffer "*html*")
+  (erase-buffer)
+  (shr-insert-document
+   (with-temp-buffer
+     (insert-file-contents file)
+     (libxml-parse-html-region (point-min) (point-max)))))
+
 ;;;###autoload
 (defun shr-insert-document (dom)
   (setq shr-content-cache nil)
 ;;;###autoload
 (defun shr-insert-document (dom)
   (setq shr-content-cache nil)