From 46a480aa8882d4febc2f8eea42dbd84dff18c0d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 9 May 2022 01:17:58 +0100 Subject: [PATCH] Fix egregious thinko in eglot--uri-to-path One shouldn't unhex the URI before parsing it. Just consider a filename with a # character in it. The character is encoded as C%23, after unhexing the file name becomes. /tmp/C#/Program.cs Now, parsing this as the URL will fail completely as the # mean "anchor" in URLs. * eglot.el (eglot--uri-to-path): Fix thinko. --- lisp/progmodes/eglot.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 3a33ad3ec2b..3e3eb3c543a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1440,7 +1440,7 @@ If optional MARKER, return a marker instead" (when (keywordp uri) (setq uri (substring (symbol-name uri) 1))) (let* ((server (eglot-current-server)) (remote-prefix (and server (eglot--trampish-p server))) - (retval (url-filename (url-generic-parse-url (url-unhex-string uri)))) + (retval (url-unhex-string (url-filename (url-generic-parse-url uri)))) ;; Remove the leading "/" for local MS Windows-style paths. (normalized (if (and (not remote-prefix) (eq system-type 'windows-nt) -- 2.39.5