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

From: James Thomas <[email-masked]>
Date: Fri, 01 Mar 2024 17:26:54 +0530

James Thomas wrote:

> I'm using it with the following:

It had a small error; corrected version:

--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
	    (cl-position-if
	     (lambda (elt) (equal (plist-get elt :url) (eww-current-url)))
	     eww-history :from-end))
           eww-history))))

(setq eww-before-browse-function #'eww-clone-previous-history-upto-first)

--8<---------------cut here---------------end--------------->8---

Regards,
James