Subject: bug#37056: 26.1; file-name-absolute-p does not recognize "man:" urls

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 23 Aug 2019 06:02:05 +0200

Matthew Bauer <[email-masked]> writes:

> file-name-absolute-p does not recognize URLs like
> "man:systemd-timesyncd.service(8)" as absolute. For instance, try this:
>
>> (file-name-absolute-p "man:systemd-timesyncd.service(8)")
> nil
>
> This should be considered an absolute URL, and not be relativized. This
> interferes with browse-url where this is done:
>
>> (when (and url-handler-mode (not (file-name-absolute-p url)))
>>   (setq url (expand-file-name url)))
>
> so "man:systemd-timesyncd.service(8)" becomes:
>
>> (expand-file-name "man:systemd-timesyncd.service(8)")
> "/home/USER/man:systemd-timesyncd.service(8)"
>
> Below is diff to update browse-url function to handle this.

[...]

> -  (when (and url-handler-mode (not (file-name-absolute-p url)))
> +  (when (and url-handler-mode
> +             (not (file-name-absolute-p url))
> +             (not (string-match "\\`[a-z]+:" url)))

Makes sense.  The patch was mangled by Gmail during transport (as
usual), so I had to apply it manually.  In the future, attaching patches
as attachments is probably the best thing if Gmail can't be avoided.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no