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

From: Matthew Bauer <[email-masked]>
Date: Fri, 16 Aug 2019 12:56:38 -0400

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.
---
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index aa31e25fa9..ffc2c766a2 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -801,8 +801,9 @@ as ARGS."
   (interactive (browse-url-interactive-arg "URL: "))
   (unless (called-interactively-p 'interactive)
     (setq args (or args (list browse-url-new-window-flag))))
-  (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)))
     (setq url (expand-file-name url)))
   (let ((process-environment (copy-sequence process-environment))
 	(function (or (and (string-match "\\`mailto:" url)