[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 f1032bf24e: Eglot: don't use "nil" as minibuffer initial input
From: |
Eli Zaretskii |
Subject: |
emacs-29 f1032bf24e: Eglot: don't use "nil" as minibuffer initial input |
Date: |
Sat, 14 Jan 2023 03:13:20 -0500 (EST) |
branch: emacs-29
commit f1032bf24e79cf32341473c5d9f447c4c74f9d2b
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eli Zaretskii <eliz@gnu.org>
Eglot: don't use "nil" as minibuffer initial input
Doing M-x eglot in a buffer for which buffer-file-name is nil, prompts
the user for a major mode to manage by invoking completing-read. The
way completing-read was called would end up with the string "nil" as
the initial minibuffer input, which is not very useful nor is it a
valid input.
* lisp/progmodes/eglot.el (eglot--guess-contact): Tweak prompt for
major mode. (Bug#60379)
Copyright-paperwork-exempt: yes
---
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 6d192d9b33..0082a17130 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -991,6 +991,7 @@ Return (MANAGED-MODE PROJECT CLASS CONTACT LANG-ID). If
INTERACTIVE is
non-nil, maybe prompt user, else error as soon as something can't
be guessed."
(let* ((guessed-mode (if buffer-file-name major-mode))
+ (guessed-mode-name (and guessed-mode (symbol-name guessed-mode)))
(main-mode
(cond
((and interactive
@@ -1000,7 +1001,7 @@ be guessed."
(completing-read
"[eglot] Start a server to manage buffers of what major mode? "
(mapcar #'symbol-name (eglot--all-major-modes)) nil t
- (symbol-name guessed-mode) nil (symbol-name guessed-mode) nil)))
+ guessed-mode-name nil guessed-mode-name nil)))
((not guessed-mode)
(eglot--error "Can't guess mode to manage for `%s'"
(current-buffer)))
(t guessed-mode)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 f1032bf24e: Eglot: don't use "nil" as minibuffer initial input,
Eli Zaretskii <=