all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 74730@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <87wmga7lct.fsf@daniel-mendler.de> (raw)
In-Reply-To: <86ikruhg3q.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Dec 2024 07:57:13 +0200")

Eli Zaretskii <eliz@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@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





  reply	other threads:[~2024-12-08  6:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07 22:02 bug#74730: [PATCH] 30.0.92; eww-browse-with-external-browser and eww-follow-link should use browse-url-with-browser-kind Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08  5:57 ` Eli Zaretskii
2024-12-08  6:13   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-12-08  7:03     ` Eli Zaretskii
2024-12-08  7:27   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 12:02     ` Eli Zaretskii
2024-12-08 13:00       ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-08 13:32         ` Eli Zaretskii
2024-12-08 17:39           ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-12 10:42             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wmga7lct.fsf@daniel-mendler.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74730@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mail@daniel-mendler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.