From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69232: 30.0.50; [PATCH] EWW history navigation gets caught in a loop Date: Fri, 01 Mar 2024 09:26:41 +0200 Message-ID: <86wmqmquoe.fsf@gnu.org> References: <8013cc7e-d5de-b793-261f-4b34fbdf360e@gmail.com> <864je4r6ug.fsf@gnu.org> <86y1bc1vn1.fsf@gnu.org> <557131a7-d400-cba5-2b0e-7ec99e8d7fc2@gmail.com> <86sf1k1fss.fsf@gnu.org> <969e4621-fd6f-48cb-2aef-d265971dd56a@gmail.com> <87r0h2x816.fsf@outlook.com> <8634tiymd4.fsf@gnu.org> <87cyslxziy.fsf@gmx.net> <86frxhxezx.fsf@gnu.org> <3f0da1b2-e256-6124-4d6a-47c922ccd64f@gmail.com> <86bk84wci4.fsf@gnu.org> <7b67c305-1e41-9db2-55d3-f74f1ac302a6@gmail.com> <10a0d839-24f6-b521-1504-a5ca568b3dcc@gmail.com> <86plwfsqey.fsf@gnu.org> <77426857-4d81-29da-9b1a-70931393215e@gmail.com> <878r32u9ut.fsf@gmx.net> <99e36690-ffbe-f373-50d2-32c92717a560@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28631"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69232@debbugs.gnu.org, jimjoe@gmx.net To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 01 08:28:01 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rfxJI-0007G5-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Mar 2024 08:28:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfxIv-0000JJ-DN; Fri, 01 Mar 2024 02:27:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfxIt-0000Ia-71 for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 02:27:35 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rfxIs-0007E1-VF for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 02:27:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rfxJJ-0008Pz-Uz for bug-gnu-emacs@gnu.org; Fri, 01 Mar 2024 02:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Mar 2024 07:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69232 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69232-submit@debbugs.gnu.org id=B69232.170927804032315 (code B ref 69232); Fri, 01 Mar 2024 07:28:01 +0000 Original-Received: (at 69232) by debbugs.gnu.org; 1 Mar 2024 07:27:20 +0000 Original-Received: from localhost ([127.0.0.1]:35959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfxIe-0008P9-AG for submit@debbugs.gnu.org; Fri, 01 Mar 2024 02:27:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfxIb-0008Ou-A8 for 69232@debbugs.gnu.org; Fri, 01 Mar 2024 02:27:18 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfxI3-00079Z-S8; Fri, 01 Mar 2024 02:26:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g1PV7XqqeXNOTeQL5YwkHcIzuyfcpKGf/MgcIXG3U38=; b=i3b7Zj8ds8Gh aqdCAf5iRxNQorFgiAhGMiD5oyzgv0mEJ5F1lcBsEI7kc3ReUt8f6M5qw4beOvFUrMw9fmp7oXsBi 9TdO1aCqf4Y8uQZ/qvI0nddWMJrSwLDovQxQUPBtr+/T8+KohuYU3LfK5M8bWn3jU/EjVIB04SvpN Fnq9WqffxYW45Gdca6+tWq9AwciE1eXwKKIXVwV2V3kDLjVj1kjnTTXDYok4RIANn208P1gYk2Wmn 72K+Fi4fRaD9xUI4F0r7HVKd8aUI5gAWKOWLnxF8sxbmZK86JwwO/68yGFtjK1zjz7OZBCurX1kWU usF/nHAt4fYu2jHgLwTDTQ==; In-Reply-To: <99e36690-ffbe-f373-50d2-32c92717a560@gmail.com> (message from Jim Porter on Thu, 29 Feb 2024 18:10:19 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280845 Archived-At: > Date: Thu, 29 Feb 2024 18:10:19 -0800 > From: Jim Porter > Cc: Eli Zaretskii , 69232@debbugs.gnu.org > > 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? Thanks. I have a usability comment below. > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -1004,6 +1004,18 @@ When invoked with the prefix argument ('C-u'), > This is useful for continuing reading the URL in the current buffer > when the new URL is fetched. > > +--- > +*** History navigation in EWW now works like other browsers. > +Previously, when navigating back and forward through page history, EWW > +would add a duplicate entry to the end of the history list each time. > +This made it impossible to navigate to the "end" of the history list. > +Now, navigating through history in EWW simply changes your position in > +the history list, allowing you to reach the end as expected. In > +addition, when navigating to a new page from a historical one, EWW "historical" here should be in quotes (and perhaps explained in parentheses), otherwise people might misinterpret or fail to understand what it alludes to. > +(defcustom eww-before-browse-function #'eww-clear-future-history > + "A function to call before browsing to a new page. > +By default, this removes any entries in the history that come after the > +current page (see `eww-clear-future-history')." The doc string should describe the known possible values of the option. Now for the usability issue: It's okay to have this is a variable (to allow future extensions, which might be unrelated to history), but having a function for user option, and one that is more general than being about history traversal, is not the best ides: it makes customization harder for users who are not Lisp programmers. Therefore, I suggest a history-specific defcustom, whose possible values could be 'clear', 'clone', and 'add', and whose effect will be to call the corresponding function via eww-before-browse-function. The defcustom could also have a user-defined function value to allow additional functions, of course.