From cc8bbf69ffbafc99296e5ccce17d39ea945cde63 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Wed, 13 May 2020 20:06:35 -0400 Subject: [PATCH] Prompt for executable if supplied name does not exist * eglot.el (eglot--guess-contact): Interpret a list containing a single string as an executable when forming the interactive prompt. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/474 GitHub-reference: fix https://github.com/joaotavora/eglot/issues/478 --- lisp/progmodes/eglot.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 112959b3564..8a1d162c6d9 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -704,7 +704,11 @@ be guessed." (prog1 (car guess) (setq guess (cdr guess)))) 'eglot-lsp-server)) (program (and (listp guess) - (stringp (car guess)) (stringp (cadr guess)) (car guess))) + (stringp (car guess)) + ;; A second element might be the port of a (host, port) + ;; pair, but in that case it is not a string. + (or (null (cdr guess)) (stringp (cadr guess))) + (car guess))) (base-prompt (and interactive "Enter program to execute (or :): ")) -- 2.39.2