GNU bug report logs -
#37056
26.1; file-name-absolute-p does not recognize "man:" urls
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37056 in the body.
You can then email your comments to 37056 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37056
; Package
emacs
.
(Fri, 16 Aug 2019 16:57:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Matthew Bauer <mjbauer95 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 16 Aug 2019 16:57:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#37056
; Package
emacs
.
(Fri, 23 Aug 2019 04:03:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 37056 <at> debbugs.gnu.org (full text, mbox):
Matthew Bauer <mjbauer95 <at> gmail.com> 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
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> mouse.gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 23 Aug 2019 04:03:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 27.1, send any further explanations to
37056 <at> debbugs.gnu.org and Matthew Bauer <mjbauer95 <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> mouse.gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 23 Aug 2019 04:03:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 20 Sep 2019 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 220 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.