GNU bug report logs - #41133
28.0.50; Respect browse-url user options in shr/eww

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Fri, 8 May 2020 01:19:01 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41133 in the body.
You can then email your comments to 41133 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to larsi <at> gnus.org, tsdh <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Fri, 08 May 2020 01:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
New bug report received and forwarded. Copy sent to larsi <at> gnus.org, tsdh <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Fri, 08 May 2020 01:19:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Respect browse-url user options in shr/eww
Date: Fri, 08 May 2020 02:18:17 +0100
[Message part 1 (text/plain, inline)]
X-Debbugs-Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Tassilo Horn <tsdh <at> gnu.org>
Severity: wishlist
Tags: patch

The commands shr-browse-url and eww-follow-link currently pass mailto
URLs directly to browse-url-mail, which doesn't respect the user options
browse-url-handlers and browse-url-mailto-function.

Can't/shouldn't the commands call browse-url instead?
WDYT of the attached patch that does this?

[0001-Improve-shr-eww-handling-of-mailto-URLs.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
Thanks,

-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Fri, 08 May 2020 06:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, tsdh <at> gnu.org, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Fri, 08 May 2020 09:37:34 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Fri, 08 May 2020 02:18:17 +0100
> Cc: lars ingebrigtsen <larsi <at> gnus.org>, tassilo horn <tsdh <at> gnu.org>
> 
> The commands shr-browse-url and eww-follow-link currently pass mailto
> URLs directly to browse-url-mail, which doesn't respect the user options
> browse-url-handlers and browse-url-mailto-function.
> 
> Can't/shouldn't the commands call browse-url instead?
> WDYT of the attached patch that does this?

This would need a NEWS entry.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Fri, 08 May 2020 07:19:02 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: lars ingebrigtsen <larsi <at> gnus.org>, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Fri, 08 May 2020 09:18:43 +0200
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> X-Debbugs-Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Tassilo Horn <tsdh <at> gnu.org>
> Severity: wishlist
> Tags: patch
>
> The commands shr-browse-url and eww-follow-link currently pass mailto
> URLs directly to browse-url-mail, which doesn't respect the user options
> browse-url-handlers and browse-url-mailto-function.
>
> Can't/shouldn't the commands call browse-url instead?
> WDYT of the attached patch that does this?

Looks good to me (I just looked at the parts calling browse-url), and I
think it won't change any behavior unless the user customizes
browse-url-handlers to catch mailto links with his own function instead
of the default one in browse-url-default-handlers (which in turn just
calls browse-url-mailto-function).

BTW: I didn't know about function-put.  Should that be preferred to put?
I've tested that put/get also work with #'function, so where's the
difference?

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Fri, 08 May 2020 07:24:02 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>, larsi <at> gnus.org,
 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Fri, 08 May 2020 09:23:39 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> Date: Fri, 08 May 2020 02:18:17 +0100
>> Cc: lars ingebrigtsen <larsi <at> gnus.org>, tassilo horn <tsdh <at> gnu.org>
>> 
>> The commands shr-browse-url and eww-follow-link currently pass mailto
>> URLs directly to browse-url-mail, which doesn't respect the user options
>> browse-url-handlers and browse-url-mailto-function.
>> 
>> Can't/shouldn't the commands call browse-url instead?
>> WDYT of the attached patch that does this?
>
> This would need a NEWS entry.

Agreed.

The browse-url-handlers are already there, tho I think I should also add
a new entry for the new browse-url-with-browser-kind command...  Will do
later.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Sat, 09 May 2020 13:28:01 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, tsdh <at> gnu.org, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Sat, 09 May 2020 14:27:27 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> This would need a NEWS entry.

Right.  How's the following?

[0001-Improve-shr-eww-handling-of-mailto-URLs.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
Thanks,

-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Sat, 09 May 2020 13:33:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: lars ingebrigtsen <larsi <at> gnus.org>, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Sat, 09 May 2020 14:32:29 +0100
Tassilo Horn <tsdh <at> gnu.org> writes:

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> X-Debbugs-Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Tassilo Horn <tsdh <at> gnu.org>
>> Severity: wishlist
>> Tags: patch
>>
>> The commands shr-browse-url and eww-follow-link currently pass mailto
>> URLs directly to browse-url-mail, which doesn't respect the user options
>> browse-url-handlers and browse-url-mailto-function.
>>
>> Can't/shouldn't the commands call browse-url instead?
>> WDYT of the attached patch that does this?
>
> Looks good to me (I just looked at the parts calling browse-url), and I
> think it won't change any behavior unless the user customizes
> browse-url-handlers to catch mailto links with his own function instead
> of the default one in browse-url-default-handlers (which in turn just
> calls browse-url-mailto-function).

Thanks.

> BTW: I didn't know about function-put.  Should that be preferred to put?
> I've tested that put/get also work with #'function, so where's the
> difference?

function-put is currently identical to put, but this may change in the
future.  Quoth (info "(elisp) Symbol Plists"):

 -- Function: function-put function property value
     This function sets PROPERTY of FUNCTION to VALUE.  FUNCTION should
     be a symbol.  This function is preferred to calling ‘put’ for
     setting properties of a function, because it will allow us some day
     to implement remapping of old properties to new ones.

See also the commentary in its definition:

  (defalias 'function-put
    ;; We don't want people to just use `put' because we can't conveniently
    ;; hook into `put' to remap old properties to new ones.  But for now, there's
    ;; no such remapping, so we just call `put'.
    #'(lambda (function prop value)
        "Set FUNCTION's property PROP to VALUE.
  The namespace for PROP is shared with symbols.
  So far, FUNCTION can only be a symbol, not a lambda expression."
        (put function prop value)))

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Sat, 09 May 2020 13:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, tsdh <at> gnu.org, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Sat, 09 May 2020 16:42:04 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: 41133 <at> debbugs.gnu.org,  larsi <at> gnus.org,  tsdh <at> gnu.org
> Date: Sat, 09 May 2020 14:27:27 +0100
> 
> > This would need a NEWS entry.
> 
> Right.  How's the following?

Thanks.

> ++++
> +*** The command 'shr-browse-url' now supports custom mailto handlers.
> +Clicking on or otherwise following a 'mailto:' link in a HTML buffer
> +rendered by SHR previously invoked the command 'browse-url-mailto'.
> +This is still the case by default, but which function is invoked can
> +now be customized via the user options 'browse-url-mailto-function'
> +and 'browse-url-handlers'.

I'd rephrase the last sentence like this:

  This is still the case by default, but if you customized
  'browse-url-mailto-function' to call some other function, it will
  now be called instead of the default.

Also, the "+++" means the change is documented in some manual, but no
changes for the manual are part of the patch, so I guess you meant
"---" instead.

> +** EWW
> +
> ++++
> +*** The command 'eww-follow-link' now supports custom mailto handlers.
> +Clicking on or otherwise following a 'mailto:' link in an EWW buffer
> +previously invoked the command 'browse-url-mailto'.  This is still the
> +case by default, but which function is invoked can now be customized
> +via the user options 'browse-url-mailto-function' and
> +'browse-url-handlers'.

Maybe we should point to the SHR entry instead of repeating almost the
same text.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Sun, 10 May 2020 00:07:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, tsdh <at> gnu.org, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Sun, 10 May 2020 01:05:55 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> ++++
>> +*** The command 'shr-browse-url' now supports custom mailto handlers.
>> +Clicking on or otherwise following a 'mailto:' link in a HTML buffer
>> +rendered by SHR previously invoked the command 'browse-url-mailto'.
>> +This is still the case by default, but which function is invoked can
>> +now be customized via the user options 'browse-url-mailto-function'
>> +and 'browse-url-handlers'.
>
> I'd rephrase the last sentence like this:
>
>   This is still the case by default, but if you customized
>   'browse-url-mailto-function' to call some other function, it will
>   now be called instead of the default.

Should it not also mention browse-url-handlers as per the attached?

> Also, the "+++" means the change is documented in some manual, but no
> changes for the manual are part of the patch, so I guess you meant
> "---" instead.

Oops, I misremembered "+++" as meaning "all necessary doc changes made"
instead of just "doc changes made".

>> +** EWW
>> +
>> ++++
>> +*** The command 'eww-follow-link' now supports custom mailto handlers.
>> +Clicking on or otherwise following a 'mailto:' link in an EWW buffer
>> +previously invoked the command 'browse-url-mailto'.  This is still the
>> +case by default, but which function is invoked can now be customized
>> +via the user options 'browse-url-mailto-function' and
>> +'browse-url-handlers'.
>
> Maybe we should point to the SHR entry instead of repeating almost the
> same text.

Sure, how's this?

[0001-Improve-shr-eww-handling-of-mailto-URLs.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
Thanks,

-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Sun, 10 May 2020 13:53:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: larsi <at> gnus.org, tsdh <at> gnu.org, 41133 <at> debbugs.gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Sun, 10 May 2020 16:52:18 +0300
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: 41133 <at> debbugs.gnu.org,  larsi <at> gnus.org,  tsdh <at> gnu.org
> Date: Sun, 10 May 2020 01:05:55 +0100
> 
> Sure, how's this?

LGTM, thanks.




Added tag(s) fixed. Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Fri, 22 May 2020 15:44:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 41133 <at> debbugs.gnu.org and "Basil L. Contovounesios" <contovob <at> tcd.ie> Request was from "Basil L. Contovounesios" <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Fri, 22 May 2020 15:44:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41133; Package emacs. (Fri, 22 May 2020 15:45:02 GMT) Full text and rfc822 format available.

Message #36 received at 41133-done <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41133-done <at> debbugs.gnu.org, larsi <at> gnus.org, tsdh <at> gnu.org
Subject: Re: bug#41133: 28.0.50; Respect browse-url user options in shr/eww
Date: Fri, 22 May 2020 16:43:45 +0100
tags 41133 fixed
close 41133 28.1
quit

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

> LGTM, thanks.

Thanks, pushed to master.

Improve shr/eww handling of mailto URLs
3a7894ecd1 2020-05-22 16:28:20 +0100
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3a7894ecd11c66337e7aea8ade8f47673d290a24

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 20 Jun 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 42 days ago.

Previous Next


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