From d9c09863b905886085af88f972a02405c730b2b2 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 25 Oct 2022 15:18:51 +0200 Subject: [PATCH] Fix eglot defcustom types To: emacs-devel@gnu.org * lisp/progmodes/eglot.el (eglot-autoreconnect): Allow for 'nil'. (eglot-connect-timeout): Allow for 'nil' and add descriptions. (eglot-sync-connect): Split boolean into 'nil' and 't' and add descriptions. (eglot-confirm-server-initiated-edits): Change 'symbol' type to 'const'. --- lisp/progmodes/eglot.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 662c233f30..201fafb671 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -323,13 +323,15 @@ eglot-autoreconnect crashes or network failures. A positive integer number says to only autoreconnect if the previous successful connection attempt lasted more than that many seconds." - :type '(choice (boolean :tag "Whether to inhibit autoreconnection") + :type '(choice (const :tag "Reconnect automatically" t) + (const :tag "Never reconnect" nil) (integer :tag "Number of seconds"))) (defcustom eglot-connect-timeout 30 "Number of seconds before timing out LSP connection attempts. If nil, never time out." - :type 'number) + :type '(choice (number :tag "Number of seconds") + (const :tag "Never time out" nil))) (defcustom eglot-sync-connect 3 "Control blocking of LSP connection attempts. @@ -337,8 +339,9 @@ eglot-sync-connect integer number means block for that many seconds, and then wait for the connection in the background. nil has the same meaning as 0, i.e. don't block at all." - :type '(choice (boolean :tag "Whether to inhibit autoreconnection") - (integer :tag "Number of seconds"))) + :type '(choice (const :tag "Block for `eglot-connect-timeout' seconds" t) + (const :tag "Never block" nil) + (integer :tag "Number of seconds to block"))) (defcustom eglot-autoshutdown nil "If non-nil, shut down server after killing last managed buffer." @@ -363,7 +366,7 @@ eglot-events-buffer-size (defcustom eglot-confirm-server-initiated-edits 'confirm "Non-nil if server-initiated edits should be confirmed with user." :type '(choice (const :tag "Don't show confirmation prompt" nil) - (symbol :tag "Show confirmation prompt" 'confirm))) + (const :tag "Show confirmation prompt" confirm))) (defcustom eglot-extend-to-xref nil "If non-nil, activate Eglot in cross-referenced non-project files." -- 2.38.0.118.g4732897cf0