GNU bug report logs -
#55357
29.0.50; [PATCH] Fix browse-url-emacs on file:// urls
Previous Next
Reported by: Yuan Fu <casouri <at> gmail.com>
Date: Wed, 11 May 2022 07:06:02 UTC
Severity: normal
Tags: moreinfo, patch
Found in version 29.0.50
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#55357: 29.0.50; [PATCH] Fix browse-url-emacs on file:// urls
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 55357 <at> debbugs.gnu.org.
--
55357: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55357
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> On May 11, 2022, at 11:35 AM, Yuan Fu <casouri <at> gmail.com> wrote:
>
>
>
>> On May 11, 2022, at 4:37 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>>> Resent-From: Yuan Fu <casouri <at> gmail.com>
>>> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
>>> Resent-CC: bug-gnu-emacs <at> gnu.org
>>> Resent-Sender: help-debbugs <at> gnu.org
>>> From: Yuan Fu <casouri <at> gmail.com>
>>> Date: Wed, 11 May 2022 00:05:50 -0700
>>>
>>>
>>> [1:text/plain Hide]
>>>
>>>
>>> If you call browse-url-emacs with a file:// url, Emacs does not open the correct file:
>>>
>>> (browse-url-emacs "file://~/a/b") opens /a/b
>>> (browse-url-emacs "file://a/b") opens /b
>>>
>>> Basically unless the path is an absolute path, the first level is chopped because url parses it as host and throws it away. This patch concats the host back. If the path is absolute, host is empty string so it’s ok.
>>
>> I think your URLs lack one or two more slashes. See
>>
>> https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes?
>
> Ah! My bad. Closing.
>
> Yuan
>
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
If you call browse-url-emacs with a file:// url, Emacs does not open the correct file:
(browse-url-emacs "file://~/a/b") opens /a/b
(browse-url-emacs "file://a/b") opens /b
Basically unless the path is an absolute path, the first level is chopped because url parses it as host and throws it away. This patch concats the host back. If the path is absolute, host is empty string so it’s ok.
Yuan
[file-url.patch (application/octet-stream, attachment)]
This bug report was last modified 3 years and 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.