*** `eww-after-render-hook' is now called after eww has rendered
the data in the buffer.
+---
+*** The `eww-reload' command now takes a prefix to not reload via
+the net, but just use the local copy of the HTML.
+
+++
*** The DOM shr and eww uses has been changed to the general Emacs
xml.el/libxml2 DOM, and a new package dom.el has been added to
+2014-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-reload): Take a prefix to work locally (bug#19086).
+
2014-12-07 Ivan Shmakov <ivan@siamics.net>
* net/eww.el (eww-list-histories): Restore the history in the
(eww-browse-url (shr-expand-url best-url (plist-get eww-data :url)))
(user-error "No `top' for this page"))))
-(defun eww-reload (&optional encode)
- "Reload the current page."
- (interactive)
+(defun eww-reload (&optional local encode)
+ "Reload the current page.
+If LOCAL (the command prefix), don't reload the page from the
+network, but just re-display the HTML already fetched."
+ (interactive "P")
(let ((url (plist-get eww-data :url)))
- (url-retrieve url 'eww-render
- (list url (point) (current-buffer) encode))))
+ (if local
+ (if (null (plist-get eww-data :dom))
+ (error "No current HTML data")
+ (eww-display-html 'utf-8 url (plist-get eww-data :dom)
+ (point) (current-buffer)))
+ (url-retrieve url 'eww-render
+ (list url (point) (current-buffer) encode)))))
;; Form support.
"Set character encoding."
(interactive "zUse character set (default utf-8): ")
(if (null charset)
- (eww-reload 'utf-8)
- (eww-reload charset)))
+ (eww-reload nil 'utf-8)
+ (eww-reload nil charset)))
;;; Bookmarks code