emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 46a480aa88 072/120: Fix egregious thinko in eglot--u


From: João Távora
Subject: feature/eglot2emacs 46a480aa88 072/120: Fix egregious thinko in eglot--uri-to-path
Date: Thu, 20 Oct 2022 07:16:57 -0400 (EDT)

branch: feature/eglot2emacs
commit 46a480aa8882d4febc2f8eea42dbd84dff18c0d3
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    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 3a33ad3ec2..3e3eb3c543 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]