[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74730: [PATCH] 30.0.92; eww-browse-with-external-browser and eww-fol
From: |
Daniel Mendler |
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 18:39:28 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
Updated patch attached.
>> (defcustom browse-url-secondary-browser-function 'browse-url-default-browser
>> "Function used to launch an alternative browser.
>> -This is usually an external browser (that is, not eww or w3m),
>> -used as the secondary browser choice, typically when a prefix
>> -argument is given to a URL-opening command in those modes that
>> -support this (for instance, eww/shr).
>> +
>> +This is browser is used as the secondary browser choice, typically
>> +when a prefix argument is given to a URL-opening command in those
>> +modes that support this (for instance `goto-addr-at-point', eww or shr).
>
> This doc string should explain the assumptions about this and the
> other variable, browse-url-browser-function: that either one or the
> other invokes the external browser, and the other one should then NOT
> do the same. Users should be aware and understand the rules of the
> game here, which are now slightly more complex than they were before,
> so removing the previous assumption without replacing it with anything
> makes the doc string less useful.
I expanded the docstring.
>> (interactive nil eww-mode)
>> - (funcall browse-url-secondary-browser-function
>> + (funcall (if (memq browse-url-secondary-browser-function
>> + '(eww eww-browse-url))
>> + #'browse-url
>> + browse-url-secondary-browser-function)
>
> I think we should allow here (and document) more just 2 literal
> functions hard-coded in this command. Perhaps some special property
> on the function's symbol? Then these two specific functions can be
> supported via the property, and what's more important, users and
> applications could use other functions with the same semantics.
In this case I think it is better to use `browse-url-with-browser-kind'
as I had initially suggested. This will be better than introducing yet
another property only for this purpose.
>> (defun eww-follow-link (&optional external mouse-event)
>> "Browse the URL under point.
>> If EXTERNAL is single prefix, browse the URL using
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> What does this mean? does it mean that EXTERNAL is non-nil in
> interactive usage if the command is invoked with C-u? If so, let's
> say that. (Yes, I know that problem came from the original doc
> string.)
I improved the docstring.
>> @@ -2180,7 +2182,7 @@ eww-follow-link
>> ;; and `browse-url-mailto-function'.
>> (browse-url url))
>> ((and (consp external) (<= (car external) 4))
>> - (funcall browse-url-secondary-browser-function url)
>> + (eww-browse-with-external-browser url)
>
> I'm not sure I agree. The call to eww-browse-with-external-browser
> will no longer ensure an external browser is used, after these
> changes. Why not call browse-url-default-browser instead?
Now, it is ensured that the external browser is called.
Daniel
0001-eww-Use-browse-url-with-browser-kind-in-eww-browse-w.patch
Description: Text Data