From e82b0991003249cbd21f47ec98227d5cb8c7a81f Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 25 Jun 2013 16:59:13 +0200 Subject: [PATCH] (eww) Reimplement the history functionality * net/eww.el (eww-back-url): Implement the history by stashing all the data into a list. --- lisp/ChangeLog | 5 +++++ lisp/net/eww.el | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 864822bed20..fc57dc2b163 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-06-25 Lars Magne Ingebrigtsen + + * net/eww.el (eww-back-url): Implement the history by stashing all + the data into a list. + 2013-06-25 Stefan Monnier * files-x.el (read-file-local-variable-value): Use read-from-minibuffer diff --git a/lisp/net/eww.el b/lisp/net/eww.el index d573f095bbd..4663e25e6c9 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -339,7 +339,9 @@ word(s) will be searched for via `eww-search-prefix'." (defun eww-browse-url (url &optional new-window) (when (and (equal major-mode 'eww-mode) eww-current-url) - (push (list eww-current-url (point)) + (push (list :url eww-current-url + :point (point) + :text (buffer-string)) eww-history)) (eww url)) @@ -354,8 +356,12 @@ word(s) will be searched for via `eww-search-prefix'." (interactive) (when (zerop (length eww-history)) (error "No previous page")) - (let ((prev (pop eww-history))) - (url-retrieve (car prev) 'eww-render (list (car prev) (cadr prev))))) + (let ((prev (pop eww-history)) + (inhibit-read-only t)) + (erase-buffer) + (insert (plist-get prev :text)) + (goto-char (plist-get prev :point)) + (setq eww-current-url (plist-get prev :url)))) (defun eww-next-url () "Go to the page marked `next'.