bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69232: 30.0.50; [PATCH] EWW history navigation gets caught in a loop


From: James Thomas
Subject: bug#69232: 30.0.50; [PATCH] EWW history navigation gets caught in a loop
Date: Fri, 01 Mar 2024 14:20:23 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]