aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2014-12-07 20:49:16 +0100
committerLars Magne Ingebrigtsen2014-12-07 20:49:16 +0100
commit007d4c29c273e3c147716a9bf63b1887b1413d40 (patch)
treec435cbcc38732fa907bacbf0f3549f9b30d5d7f7
parentb9ad615e658803846192340d18919f3c7ac9b94e (diff)
downloademacs-007d4c29c273e3c147716a9bf63b1887b1413d40.tar.gz
emacs-007d4c29c273e3c147716a9bf63b1887b1413d40.zip
Make a prefix to `eww-reload' work locally
Fixes: debbugs:19086 * net/eww.el (eww-reload): Take a prefix to work locally (bug#19086).
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/net/eww.el21
3 files changed, 22 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 5a951334373..514d4232914 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -211,6 +211,10 @@ pages visited) is now preserved in the desktop file.
211*** `eww-after-render-hook' is now called after eww has rendered 211*** `eww-after-render-hook' is now called after eww has rendered
212the data in the buffer. 212the data in the buffer.
213 213
214---
215*** The `eww-reload' command now takes a prefix to not reload via
216the net, but just use the local copy of the HTML.
217
214+++ 218+++
215*** The DOM shr and eww uses has been changed to the general Emacs 219*** The DOM shr and eww uses has been changed to the general Emacs
216xml.el/libxml2 DOM, and a new package dom.el has been added to 220xml.el/libxml2 DOM, and a new package dom.el has been added to
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c9e5bd7793a..7ebec5d8d1c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12014-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * net/eww.el (eww-reload): Take a prefix to work locally (bug#19086).
4
12014-12-07 Ivan Shmakov <ivan@siamics.net> 52014-12-07 Ivan Shmakov <ivan@siamics.net>
2 6
3 * net/eww.el (eww-list-histories): Restore the history in the 7 * net/eww.el (eww-list-histories): Restore the history in the
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index f74f0eff38b..6253e4cc9aa 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -763,12 +763,19 @@ appears in a <link> or <a> tag."
763 (eww-browse-url (shr-expand-url best-url (plist-get eww-data :url))) 763 (eww-browse-url (shr-expand-url best-url (plist-get eww-data :url)))
764 (user-error "No `top' for this page")))) 764 (user-error "No `top' for this page"))))
765 765
766(defun eww-reload (&optional encode) 766(defun eww-reload (&optional local encode)
767 "Reload the current page." 767 "Reload the current page.
768 (interactive) 768If LOCAL (the command prefix), don't reload the page from the
769network, but just re-display the HTML already fetched."
770 (interactive "P")
769 (let ((url (plist-get eww-data :url))) 771 (let ((url (plist-get eww-data :url)))
770 (url-retrieve url 'eww-render 772 (if local
771 (list url (point) (current-buffer) encode)))) 773 (if (null (plist-get eww-data :dom))
774 (error "No current HTML data")
775 (eww-display-html 'utf-8 url (plist-get eww-data :dom)
776 (point) (current-buffer)))
777 (url-retrieve url 'eww-render
778 (list url (point) (current-buffer) encode)))))
772 779
773;; Form support. 780;; Form support.
774 781
@@ -1387,8 +1394,8 @@ Differences in #targets are ignored."
1387 "Set character encoding." 1394 "Set character encoding."
1388 (interactive "zUse character set (default utf-8): ") 1395 (interactive "zUse character set (default utf-8): ")
1389 (if (null charset) 1396 (if (null charset)
1390 (eww-reload 'utf-8) 1397 (eww-reload nil 'utf-8)
1391 (eww-reload charset))) 1398 (eww-reload nil charset)))
1392 1399
1393;;; Bookmarks code 1400;;; Bookmarks code
1394 1401