From: Philip Kaludercic <philipk@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org,
joaotavora@gmail.com
Subject: Re: Making `eglot-server-programs' a custom variable?
Date: Sun, 13 Nov 2022 00:20:35 +0000 [thread overview]
Message-ID: <87wn7zwvqk.fsf@posteo.net> (raw)
In-Reply-To: <83r0y8meis.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Nov 2022 16:30:19 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org,
>> joaotavora@gmail.com
>> Date: Sat, 12 Nov 2022 13:46:40 +0000
>>
>> >> (I'm not just talking about Eglot right now) If the default value is
>> >> defined in an non-autoloaded variable, you have to load the library to
>> >> access the value -- otherwise it simply wasn't loaded.
>> >>
>> >> The "issue" here is just that loading everything you want to modify
>> >> during initialisation can get slow.
>> >
>> > Whether or not it is necessary to load the library depends on how the
>> > :set function of the defcustom is implemented. I can see several ways
>> > of implementing it that won't require loading the library right away,
>> > and I'm sure you can see those ways as well.
>>
>> Actually no, I am not sure I do.
>
> Any way that stored the changes of the variable's value in a data
> structure whose execution is deferred to when the library is first
> loaded. This includes ` backquoted forms, eval-after-load, mode
> hooks, etc.
>
>> > To me, this says that storing the value in a defcustom hits that
>> > "issue" to which you were alluding, and for which I proposed a
>> > solution of having the defcustom be an add-on to the baseline value.
>>
>> I see. The issue is that if I just set the user option directly, say
>> even before loading the library I overwrite the default value.
>
> Once again, I'm talking about the user option being used to _augment_
> the default value of a variable. Such a user option should by default
> have a nil value, so setting the value of the option doesn't overwrite
> the baseline value of the variable which the option will augment.
Ok.
> I feel there's a misunderstanding here, because I don't see why these
> obvious aspects need to be explained. So let me provide an example as
> a possible clarification.
That might very well be possible.
> Under my proposal, the variable eglot-server-programs remains a
> defvar, and contains the baseline list of the servers. To customize
> the list, users change the value of a separate user option, say,
> eglot-user-server-programs. This user option's value is nil by
> default, and it allows users to specify both additions of servers to
> the baseline value of eglot-server-programs and removal of servers
> from that value.
How would this look like?
> The :set function of eglot-user-server-programs then
> takes care of doing whatever is needed to make sure that the value of
> eglot-server-programs is modified according to
> eglot-user-server-programs's value when Eglot is started.
This I understand, but I don't see how this is preferable to a general
solution that doesn't require explicit support for any user option.
>> >> Maybe I have missed something, if a user option has a `repeat' or
>> >> `alist' type, you can't just say "append this and that value to the end
>> >> of some other value". All you get to modify is the entire list, and all
>> >> you get to store is the entire list.
>> >
>> > That's a job for the :set function of the defcustom.
>>
>> I am not sure I know what you are thinking of, but wouldn't this mean
>> all user options that have already been marked as having a `repeat' or
>> `alist' type, that these would now require an additional :set function?
>
> No, of course not. I didn't mean any changes to the infrastructure
> that we use for Customize and user options in general. See above, I
> hope I now explained what I had in mind.
I suppose it does.
next prev parent reply other threads:[~2022-11-13 0:20 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 20:25 Making `eglot-server-programs' a custom variable? Arash Esbati
2022-11-09 20:49 ` Philip Kaludercic
2022-11-09 22:07 ` Arash Esbati
2022-11-10 17:47 ` Philip Kaludercic
2022-11-10 17:56 ` Stefan Monnier
2022-11-10 18:10 ` Philip Kaludercic
2022-11-10 18:29 ` Stefan Monnier
2022-11-10 19:36 ` Philip Kaludercic
2022-11-12 3:47 ` Jim Porter
2022-11-12 5:16 ` chad
2022-11-12 7:26 ` Philip Kaludercic
2022-11-12 7:34 ` Philip Kaludercic
2022-11-12 7:58 ` Eli Zaretskii
2022-11-12 8:03 ` Philip Kaludercic
2022-11-12 8:25 ` Eli Zaretskii
2022-11-12 8:45 ` Philip Kaludercic
2022-11-12 9:01 ` Eli Zaretskii
2022-11-12 9:40 ` Philip Kaludercic
2022-11-12 10:02 ` Eli Zaretskii
2022-11-12 13:46 ` Philip Kaludercic
2022-11-12 14:30 ` Eli Zaretskii
2022-11-13 0:20 ` Philip Kaludercic [this message]
2022-11-13 6:39 ` Eli Zaretskii
2022-11-13 7:11 ` Philip Kaludercic
2022-11-13 7:43 ` Eli Zaretskii
2022-11-15 17:50 ` Philip Kaludercic
2022-11-15 18:15 ` Eli Zaretskii
2022-11-16 13:05 ` Philip Kaludercic
2022-11-16 13:44 ` Eli Zaretskii
2022-11-16 14:12 ` Philip Kaludercic
2022-11-16 14:51 ` Eli Zaretskii
2022-11-16 17:05 ` Philip Kaludercic
2022-11-10 6:36 ` Eli Zaretskii
2022-11-10 7:56 ` Tim Cross
2022-11-10 8:24 ` Eli Zaretskii
2022-11-10 9:34 ` Tim Cross
2022-11-10 11:16 ` Eli Zaretskii
2022-11-10 13:59 ` Tim Cross
2022-11-10 9:18 ` Arash Esbati
2022-11-10 9:34 ` Eli Zaretskii
2022-11-10 10:25 ` João Távora
2022-11-10 17:04 ` Eli Zaretskii
2022-11-10 17:10 ` Eli Zaretskii
2022-11-10 21:45 ` João Távora
2022-11-11 6:12 ` Yuri Khan
2022-11-11 9:09 ` João Távora
2022-11-12 2:34 ` Brian Cully via Emacs development discussions.
2022-11-12 16:22 ` Michael Albinus
2022-11-11 7:04 ` Eli Zaretskii
2022-11-11 9:12 ` João Távora
2022-11-11 11:53 ` Eli Zaretskii
2022-11-12 14:44 ` Arash Esbati
2022-11-12 14:49 ` Eli Zaretskii
2022-11-12 14:58 ` Arash Esbati
2022-11-10 21:28 ` Augusto Stoffel
2022-11-11 10:05 ` Arash Esbati
2022-11-11 12:05 ` Eli Zaretskii
2022-11-11 12:22 ` Arash Esbati
2022-11-11 12:33 ` Eli Zaretskii
2022-11-11 13:26 ` Augusto Stoffel
2022-11-11 13:48 ` Arash Esbati
2022-11-11 13:54 ` Eli Zaretskii
2022-11-10 10:15 ` João Távora
2022-11-10 11:23 ` Eli Zaretskii
2022-11-10 12:07 ` João Távora
2022-11-10 15:19 ` Eli Zaretskii
2022-11-10 15:35 ` Dmitry Gutov
2022-11-10 16:50 ` Eli Zaretskii
2022-11-10 18:22 ` Dmitry Gutov
2022-11-10 18:31 ` Eli Zaretskii
2022-11-10 15:38 ` João Távora
2022-11-10 16:52 ` Eli Zaretskii
2022-11-10 17:08 ` Eli Zaretskii
2022-11-10 21:13 ` João Távora
2022-11-10 13:57 ` Stefan Monnier
2022-11-10 15:21 ` João Távora
2022-11-10 17:43 ` Stefan Monnier
2022-11-10 22:10 ` João Távora
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=87wn7zwvqk.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=arash@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
--cc=jporterbugs@gmail.com \
/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).