Subject: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server

From: Eli Zaretskii <[email-masked]>
Date: Wed, 23 Nov 2022 15:33:58 +0200

> From: João Távora <[email-masked]>
> Date: Wed, 23 Nov 2022 12:36:37 +0000
> Cc: Danny Freeman <[email-masked]>, Felician Nemeth <[email-masked]>, 
> 	[email-masked], Stefan Kangas <[email-masked]>, 
> 	Dmitry Gutov <[email-masked]>, Eli Zaretskii <[email-masked]>, 
> 	Michael Albinus <[email-masked]>
> 
> Yes,I think I follow.  To be clear I think the problem is somewhere in 
> 
> (defun eglot--path-to-uri (path)
>   "URIfy PATH."
>   (let ((truepath (file-truename path)))
>     (if (url-type (url-generic-parse-url truepath))
>         ;; Path is already a URI, so forward it to the LSP server
>         ;; untouched.  The server should be able to handle it, since
>         ;; it provided this URI to clients in the first place.
>         truepath
>       ...)
> 
> So either url-generic-parse-url and url-type is fixed in url-parse.el, or 
> we must add some Windows-specific guards in eglot.el.  Or likely
> both, since url-parse.el is not a :core ELPA package.
> 
> Richard/Danny, can you perhaps come up with some patch?

>From where I stand, the solution was already proposed here:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59338#53

You said you wanted to augment it with something that didn't depend on
url-parse.el, because it wasn't in Emacs < 29, but I don't think I
understand the concern, since AFAICT url-parse.el is in all versions of
Emacs since at least Emacs 23.  So what am I missing?

In any case, I suggest that a solution be based on the patch shown in that
bug#59338 discussion.