emacs-diffs
[Top][All Lists]
Advanced

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

feature/eglot2emacs f9cfefcf89 063/120: Guess language-id if manually en


From: João Távora
Subject: feature/eglot2emacs f9cfefcf89 063/120: Guess language-id if manually entering server program
Date: Thu, 20 Oct 2022 07:16:54 -0400 (EDT)

branch: feature/eglot2emacs
commit f9cfefcf89cd5d899bd335e9d7674b84cef952f2
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Guess language-id if manually entering server program
    
    * 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 6d0b66c2a1..a1c5ab01eb 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -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)



reply via email to

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