GNU bug report logs -
#59338
29.0.50; Commit 1a2d603bb3 breaks Eglot on Windows
Previous Next
Reported by: Arash Esbati <arash <at> gnu.org>
Date: Thu, 17 Nov 2022 16:52:01 UTC
Severity: normal
Merged with 59565
Found in version 29.0.50
Done: João Távora <joaotavora <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
Augusto Stoffel <arstoffel <at> gmail.com> writes:
> On Thu, 17 Nov 2022 at 19:06, Eli Zaretskii wrote:
>
>> Both are wrong, right? The correct URL should AFAIU be
>>
>> file:///d:/digestif-test/tikz-test.tex
>>
>> IOW, the problem is that the URL is being run through url-encode-url,
>> which doesn't support file:// URLs on Windows properly.
>
> While we are at it, note that
>
> (url-filename
> (url-generic-parse-url "file:///d:/digestif-test/tikz-test.tex"))
> => "/d:/digestif-test/tikz-test.tex"
>
> is not the right file name under Windows. Eglot treats this special
> case correctly, but every package that deals with file URLs has to
> repeat the work. So there should be a helper function in Emacs for
> this.
With the original problem: we're now getting a false positive in
eglot when checking for URLs being passed to `eglot--path-to-uri` when
the path is a windows path.
Is there something we can do to detect a windows path and continue
treating it as a path like we were before this change?
```
(defun eglot--path-to-uri (path)
"URIfy PATH."
(let ((truepath (file-truename path)))
(if (and (url-type (url-generic-parse-url truepath))
(NOT_WINDOWS_PATH truepath) ;; what would this be?
)
;; ... blah blah blah
```
If there is no function available already, it may be enough to check if
the return value of `url-type` is not 1 character. Looking at this list
of what I believe are official URI schemes, all of them have at least
two characters:
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
--
Danny Freeman
This bug report was last modified 2 years and 231 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.