]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: unbreak <host>:<port> spec in C-u M-x eglot (bug#67682)
authorJoão Távora <joaotavora@gmail.com>
Fri, 8 Dec 2023 19:13:55 +0000 (19:13 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Dec 2023 19:12:42 +0000 (20:12 +0100)
* lisp/progmodes/eglot.el (eglot--guess-contact): Fix.

lisp/progmodes/eglot.el

index d410367f9025b66cbea048430990738e9a8cb458..608389f1c05d94b59221fdb5e565e8018c2ef155 100644 (file)
@@ -1280,14 +1280,18 @@ be guessed."
                          (concat "`%s' not found in PATH, but can't form"
                                  " an interactive prompt for to fix %s!")
                          program guess))))))
+         (input (and prompt (read-shell-command prompt
+                                                full-program-invocation
+                                                'eglot-command-history)))
          (contact
-          (or (and prompt
-                   (split-string-and-unquote
-                    (read-shell-command
-                     prompt
-                     full-program-invocation
-                     'eglot-command-history)))
-              guess)))
+          (if input
+              (if (string-match
+                   "^[\s\t]*\\(.*\\):\\([[:digit:]]+\\)[\s\t]*$" input)
+                  ;; <host>:<port> special case (bug#67682)
+                  (list (match-string 1 input)
+                        (string-to-number (match-string 2 input)))
+                (split-string-and-unquote input))
+            guess)))
     (list managed-modes (eglot--current-project) class contact language-ids)))
 
 (defvar eglot-lsp-context)