From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: <87wmga7lct.fsf@daniel-mendler.de> References: <87frmz40f2.fsf@daniel-mendler.de> <86ikruhg3q.fsf@gnu.org> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40017"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74730@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 08 07:17:11 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 1tKAbP-000AIQ-0B for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Dec 2024 07:17:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKAbI-0001lZ-L4; Sun, 08 Dec 2024 01:17:04 -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 1tKAbH-0001lO-4K for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 01:17:03 -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 1tKAbG-0001n4-QW for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 01:17:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=pitGgrZr76MAF+QZbqxJuaVOpN89G7YCnmmlfR+RVAQ=; b=F6L2d5K4tQ79h6VS/kIyqgMzRi28MlhPb7eyqEQw+z++seapLfyjpfAqUoJ7teBG8uWvcFOXFj2GBuibaE2QpaQnCtVguvfqbV5hKAPfXJcMzDJqJ2bCG4pcm97WMNIF8isI1Z1oV2OOyvHldixSqIJcPO8SNrgc7HR0WEB2UBWgNxayK1fTZHR0D4EvFGEVcLw14PErm/AZXKBmwxy9PrQkFL8cKnRmBCSCdlvZKywjd3UgqR5sdYtHtCRBEDxZJM8xpJuAgMCZXSnSPZatg494VFp5xxgf/3LeEeWCCpiB2Uu13rwYXgM4oLdasXDKCUupyVw9kfgrXUGX6cpgvw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKAbG-0005Hl-KV for bug-gnu-emacs@gnu.org; Sun, 08 Dec 2024 01:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Dec 2024 06:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74730-submit@debbugs.gnu.org id=B74730.173363857520236 (code B ref 74730); Sun, 08 Dec 2024 06:17:02 +0000 Original-Received: (at 74730) by debbugs.gnu.org; 8 Dec 2024 06:16:15 +0000 Original-Received: from localhost ([127.0.0.1]:49404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKAaV-0005GJ-8Q for submit@debbugs.gnu.org; Sun, 08 Dec 2024 01:16:15 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:58575 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKAaT-0005G4-Ap for 74730@debbugs.gnu.org; Sun, 08 Dec 2024 01:16:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=pitGgrZr76MAF+QZbqxJuaVOpN89G7YCnmmlfR+RVAQ=; b=BqR/Fo9GLtkkKV8NZtOezDCTN0 EIUDxFOIaceaaBER6xUPBkZD1lfHW9totMiW1JrEnbfnfynMluL+YCfdnabBucdN5bPrfjZULCwIl cHkxAWzc7N2TexJVfmqLOQNgfHO9Sl2rsm66VDl6Z30W5rydahKL4bKShuE5l1egRvlk=; In-Reply-To: <86ikruhg3q.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 08 Dec 2024 07:57:13 +0200") 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:296615 Archived-At: Eli Zaretskii 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" >> >> 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