]> git.eshelyaron.com Git - emacs.git/commit
When navigating through history in EWW, don't keep adding to 'eww-history'
authorJim Porter <jporterbugs@gmail.com>
Sun, 18 Feb 2024 04:49:15 +0000 (20:49 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 7 Mar 2024 08:21:26 +0000 (09:21 +0100)
commitb8dab0837736c4d1b241d5e90430e46846672dc4
tree95244fe358ee4c6ea8003f38da3fbf5e2b363b37
parent3281252c27ea415c65b0b6cf21cb2d9372c0fb62
When navigating through history in EWW, don't keep adding to 'eww-history'

This resolves an issue where navigating back and then forward kept
adding new history entries so you could never hit the "end" (bug#69232).

* lisp/net/eww.el (eww-before-browse-history-function): New option.
(eww-history-position): Add docstring.
(eww-mode-map, eww-context-menu): Use correct predicates for when to
enable back/forward.
(eww-save-history): Save history entry in its original place when
viewing a historical page.
(eww--before-browse): New function...
(eww, eww-follow-link, eww-readable): ... call it.
(eww-render): Don't set 'eww-history-position' here...
(eww--before-browse): ... instead, set it here.
(eww-back-url): Set 'eww-history-position' based on the result of
'eww-save-history'.
(eww-forward-url): Set 'eww-history-position' directly, since
'eww-save-history' no longer adds a new entry in this case.
(eww-delete-future-history, eww-clone-previous-history): New functions.

* test/lisp/net/eww-tests.el: New file.

* etc/NEWS: Announce this change.

(cherry picked from commit 59e470dd5de6e75c4d3bb91c876c8540faf33fdb)
doc/misc/eww.texi
etc/NEWS
lisp/net/eww.el
test/lisp/net/eww-tests.el [new file with mode: 0644]