GNU bug report logs -
#69232
30.0.50; [PATCH] EWW history navigation gets caught in a loop
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Sun, 18 Feb 2024 18:24:16 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Jim Porter wrote:
> On 2/29/2024 5:00 PM, Jim Porter wrote:
>> I already found one issue with reloading messing up history, but
>> that was an easy fix. Once I finish up the other parts of my v3
>> patch, I'll post it here.
>
> I've only lightly tested this so far, but this version adds an
> 'eww-before-browse-function' option which lets you customize how EWW
> manipulates history before browsing to a new page. I've added
> functions for the default behavior ('eww-clear-future-history'), and
> for cloning all the "parent" entries
> ('eww-clone-previous-history')[1]. You can also set it to 'ignore',
> which will just preserve the old entries and add the new page to the
> end (which is the behavior v1 of my patch had).
>
> I've also added more regression tests to make sure this all works as
> expected.
>
> How does this look?
I'm using it with the following:
--8<---------------cut here---------------start------------->8---
(defun eww-clone-previous-history-upto-first ()
"Like `eww-clone-previous-history', but only clone up to the first
occurrence of the current page in the history."
(when (> eww-history-position 1)
(setq eww-history
(append
(cl-subseq
eww-history
(- 0 (cl-position-if
(lambda (elt) (equal (plist-get elt :url) (eww-current-url)))
eww-history :from-end)
1))
eww-history))))
(setq eww-before-browse-function #'eww-clone-previous-history-upto-first)
--8<---------------cut here---------------end--------------->8---
...for getting the behaviour I'd referred to earlier:
> ... so because that might sometimes be too much, (adding to the end)
> only the entire history up to the first occurrence of the source page.
Will report back if I see any problems.
Regards,
James
This bug report was last modified 1 year and 75 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.