]> git.eshelyaron.com Git - emacs.git/commitdiff
Prompt for executable if supplied name does not exist
authorDan Davison <dandavison7@gmail.com>
Thu, 14 May 2020 00:06:35 +0000 (20:06 -0400)
committerJoão Távora <joaotavora@gmail.com>
Thu, 14 May 2020 10:45:15 +0000 (11:45 +0100)
* 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

index 112959b356442e2266c8a32de31c7c200789b2ec..8a1d162c6d9ad0f46f0ad22e0023a0515867b7b6 100644 (file)
@@ -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 <host>:<port>): "))