emacs-diffs
[Top][All Lists]
Advanced

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

master 50bab2a9f7a: Eglot: unbreak <host>:<port> spec in C-u M-x eglot (


From: João Távora
Subject: master 50bab2a9f7a: Eglot: unbreak <host>:<port> spec in C-u M-x eglot (bug#67682)
Date: Fri, 8 Dec 2023 14:12:51 -0500 (EST)

branch: master
commit 50bab2a9f7a3a07c0aa24355e1d3cde547be90b9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Eglot: unbreak <host>:<port> spec in C-u M-x eglot (bug#67682)
    
    * lisp/progmodes/eglot.el (eglot--guess-contact): Fix.
---
 lisp/progmodes/eglot.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index d410367f902..608389f1c05 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -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)



reply via email to

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