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

Previous Next

Package: emacs;

Reported by: Matthew Bauer <mjbauer95 <at> gmail.com>

Date: Fri, 16 Aug 2019 16:57:01 UTC

Severity: minor

Tags: fixed

Found in version 26.1

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> mouse.gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Matthew Bauer <mjbauer95 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; file-name-absolute-p does not recognize "man:" urls
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)




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

Previous Next


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