From: João Távora Date: Mon, 9 May 2022 00:17:58 +0000 (+0100) Subject: Fix egregious thinko in eglot--uri-to-path X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~46 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46a480aa8882d4febc2f8eea42dbd84dff18c0d3;p=emacs.git 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. --- 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)