GNU bug report logs - #74730
[PATCH] 30.0.92; eww-browse-with-external-browser and eww-follow-link should use browse-url-with-browser-kind

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sat, 7 Dec 2024 22:03:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 74730 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 74730 <at> debbugs.gnu.org
Subject: Re: bug#74730: [PATCH] 30.0.92; eww-browse-with-external-browser
 and eww-follow-link should use browse-url-with-browser-kind
Date: Sun, 08 Dec 2024 07:13:54 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Sat, 07 Dec 2024 23:02:09 +0100
>> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> The command `eww-browse-with-external-browser' uses
>> `browse-url-secondary-browser-function'. This makes the command
>> ineffective in the common setup where
>> `browse-url-secondary-browser-function' is set to `eww-browse-url' and
>> `browse-url-browser-function' is set to an external browser.
>
> The doc string of browse-url-secondary-browser-function explicitly
> says not to set it to eww.  So users who do the above are acting
> against the design and the recommended usage, and I'm not sure we
> should support that at all, let alone with a (seemingly)
> backward-incompatible change such as the one you propose.

How can I then use an external browser as the default and Eww as
alternative? I argue that this is a legitimate use case - an external
browser as primary and Eww as secondary browser for distraction-free
reading.

As I wrote, the only place which leads to problems is in
`eww-browse-with-external-browser' - I checked all other places in
Emacs. I argue that the behavior and implementation will be even more
explicit, since `browse-url-with-browser-kind' explicitly supports the
`external' kind. But you are right about the backward compatibility
problem, see below.

>> Fortunately we can use `browse-url-with-browser-kind' instead, which
>> guarantees that an external browser is launched.
>> 
>> Furthermore `eww-follow-link' should use `browse-url-with-browser-kind'
>> if the EXTERNAL prefix argument is non-nil.
>> 
>> I've looked at all other uses of `browse-url-browser-function' and
>> `browse-url-secondary-browser-function' in the Emacs code base and I
>> have not found other problems. Most commands use a prefix argument to
>> switch to the secondary browser, relying on the primary browser by
>> default. The problem is limited to `eww-browse-with-external-browser'
>> and `eww-follow-link'.
>
> What will happen as result of this change to users who customize
> browse-url-secondary-browser-function as its doc string says, and then
> invoke the command eww-browse-with-external-browser?

In this case the change will indeed be backward-incompatible, if
multiple external browsers are used and the secondary browser is
configured to a different one than the one which will be selected by
`browse-url-with-browser-kind'.

The patch can be extended however. I can change it such that the
`browse-url-secondary-browser-function' is checked first if it is indeed
external (via the `browser-kind' property). And only if it is not
external, `browse-url-with-browser-kind' will be used. One could be even
more strict and compare `browse-url-secondary-browser-function' to
`eww-browse-url' and only in this case fall back to
`browse-url-with-browser-kind'.

Daniel




This bug report was last modified 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.