1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

(eww) Reimplement the history functionality

* net/eww.el (eww-back-url): Implement the history by stashing all
the data into a list.
This commit is contained in:
Lars Magne Ingebrigtsen 2013-06-25 16:59:13 +02:00
parent c763842b88
commit e82b099100
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2013-06-25 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/eww.el (eww-back-url): Implement the history by stashing all
the data into a list.
2013-06-25 Stefan Monnier <monnier@iro.umontreal.ca>
* files-x.el (read-file-local-variable-value): Use read-from-minibuffer

View File

@ -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'.