From 7fd1e7c4a264d74360d79c6cbee3f0e0aceeab5c Mon Sep 17 00:00:00 2001 From: dannyfreeman Date: Thu, 10 Nov 2022 13:05:49 -0500 Subject: [PATCH] Eglot: warn when receiving a non-file scheme URI Addresses bug#58790 * lisp/progmodes/eglot.el (eglot--uri-to-path): Write a message when eglot encounters a non-file scheme URI that Emacs is not capable of handling. --- lisp/progmodes/eglot.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 11bf0884ac..dfa18b885f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1531,6 +1531,13 @@ eglot--uri-to-path (substring retval 1) retval))) (concat remote-prefix normalized)) + ;; `any-handler', has no significant meaning, other than that it + ;; is not one that would be suppressed by `inhibit-file-name-operation'. + ;; We just want to check that a handler exists and has the potential + ;; to handle this URI, not actually dispatch a + ;; file-name-operation right now. + (unless (find-file-name-handler uri 'any-handler) + (eglot--message "Received URI with unexpected scheme: %s" uri)) ;; Leave non-file scheme URIs untouched. ;; Handlers registered with `file-name-handler-alist' can ;; identify these URIs and decide how to handle them. -- 2.38.1