aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2013-12-01 14:11:36 +0100
committerLars Magne Ingebrigtsen2013-12-01 14:11:36 +0100
commitab6dea82bfc48652f130e193fe434deba54306b1 (patch)
tree3142f9d64b2b0204499846fa4bdbfd7ff391033c
parent3e9876dedcdf05aa9e4b99a78108095cb6c3380e (diff)
downloademacs-ab6dea82bfc48652f130e193fe434deba54306b1.tar.gz
emacs-ab6dea82bfc48652f130e193fe434deba54306b1.zip
(eww-current-dom): New variable used to save the current DOM.
Rewritten from a short patch by T.V. Raman.
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/net/eww.el5
2 files changed, 6 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 469bd37ec8a..e9c8b528f65 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
2 2
3 * net/eww.el (eww-restore-history): Update the window title after 3 * net/eww.el (eww-restore-history): Update the window title after
4 moving in the history. 4 moving in the history.
5 (eww-current-dom): New variable used to save the current DOM.
5 6
62013-12-01 Dmitry Gutov <dgutov@yandex.ru> 72013-12-01 Dmitry Gutov <dgutov@yandex.ru>
7 8
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 28ef237b612..70fd5641756 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -89,6 +89,7 @@
89 :group 'eww) 89 :group 'eww)
90 90
91(defvar eww-current-url nil) 91(defvar eww-current-url nil)
92(defvar eww-current-dom nil)
92(defvar eww-current-title "" 93(defvar eww-current-title ""
93 "Title of current page.") 94 "Title of current page.")
94(defvar eww-history nil) 95(defvar eww-history nil)
@@ -219,6 +220,7 @@ word(s) will be searched for via `eww-search-prefix'."
219 'base (list (cons 'href url)) 220 'base (list (cons 'href url))
220 (libxml-parse-html-region (point) (point-max))))) 221 (libxml-parse-html-region (point) (point-max)))))
221 (eww-setup-buffer) 222 (eww-setup-buffer)
223 (setq eww-current-dom document)
222 (let ((inhibit-read-only t) 224 (let ((inhibit-read-only t)
223 (after-change-functions nil) 225 (after-change-functions nil)
224 (shr-width nil) 226 (shr-width nil)
@@ -378,6 +380,7 @@ word(s) will be searched for via `eww-search-prefix'."
378\\{eww-mode-map}" 380\\{eww-mode-map}"
379 ;; FIXME? This seems a strange default. 381 ;; FIXME? This seems a strange default.
380 (set (make-local-variable 'eww-current-url) 'author) 382 (set (make-local-variable 'eww-current-url) 'author)
383 (set (make-local-variable 'eww-current-dom) nil)
381 (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) 384 (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)
382 (set (make-local-variable 'after-change-functions) 'eww-process-text-input) 385 (set (make-local-variable 'after-change-functions) 'eww-process-text-input)
383 (set (make-local-variable 'eww-history) nil) 386 (set (make-local-variable 'eww-history) nil)
@@ -390,6 +393,7 @@ word(s) will be searched for via `eww-search-prefix'."
390 (push (list :url eww-current-url 393 (push (list :url eww-current-url
391 :title eww-current-title 394 :title eww-current-title
392 :point (point) 395 :point (point)
396 :dom eww-current-dom
393 :text (buffer-string)) 397 :text (buffer-string))
394 eww-history)) 398 eww-history))
395 399
@@ -429,6 +433,7 @@ word(s) will be searched for via `eww-search-prefix'."
429 (let ((inhibit-read-only t)) 433 (let ((inhibit-read-only t))
430 (erase-buffer) 434 (erase-buffer)
431 (insert (plist-get elem :text)) 435 (insert (plist-get elem :text))
436 (setq eww-current-dom (plist-get elem :dom))
432 (goto-char (plist-get elem :point)) 437 (goto-char (plist-get elem :point))
433 (setq eww-current-url (plist-get elem :url) 438 (setq eww-current-url (plist-get elem :url)
434 eww-current-title (plist-get elem :title)) 439 eww-current-title (plist-get elem :title))