]> git.eshelyaron.com Git - emacs.git/commitdiff
Guess language-id if manually entering server program
authorJoão Távora <joaotavora@gmail.com>
Mon, 4 Apr 2022 09:41:29 +0000 (10:41 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 4 Apr 2022 09:41:55 +0000 (10:41 +0100)
* eglot.el (eglot--guess-contact): Default language-id to educated
guess when eglot--lookup-mode returns nil.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/837

lisp/progmodes/eglot.el

index 6d0b66c2a1463a45792235508c6197db3434b84b..a1c5ab01eb617d7e91b3a2eb959035c87326d839 100644 (file)
@@ -904,7 +904,8 @@ be guessed."
             (eglot--error "Can't guess mode to manage for `%s'" (current-buffer)))
            (t guessed-mode)))
          (lang-id-and-guess (eglot--lookup-mode guessed-mode))
-         (language-id (car lang-id-and-guess))
+         (language-id (or (car lang-id-and-guess)
+                          (string-remove-suffix "-mode" (symbol-name guessed-mode))))
          (guess (cdr lang-id-and-guess))
          (guess (if (functionp guess)
                     (funcall guess interactive)