unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>,
	 Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: eglot.el defcustomʼs
Date: Tue, 25 Oct 2022 15:24:12 +0200	[thread overview]
Message-ID: <87tu3sniir.fsf@gmail.com> (raw)
In-Reply-To: <874jvsozbq.fsf@gmail.com> (Robert Pluim's message of "Tue, 25 Oct 2022 14:35:53 +0200")

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

>>>>> On Tue, 25 Oct 2022 14:35:53 +0200, Robert Pluim <rpluim@gmail.com> said:

    Robert> Iʼm not sure what the interaction is between :version in defcustomʼs
    Robert> and eglot being a :core package, which is why I asked. Maybe Stefan
    Robert> can enlighten us?

Anyway, whilst Iʼm looking at defcustomʼs anyway, how about the
attached?

Robert
-- 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-eglot-defcustom-types.patch --]
[-- Type: text/x-diff, Size: 2680 bytes --]

From d9c09863b905886085af88f972a02405c730b2b2 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
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


  reply	other threads:[~2022-10-25 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 12:21 eglot.el defcustomʼs Robert Pluim
2022-10-25 12:26 ` João Távora
2022-10-25 12:35   ` Robert Pluim
2022-10-25 13:24     ` Robert Pluim [this message]
2022-10-25 14:03       ` João Távora
2022-10-25 14:22         ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu3sniir.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).