[Top][All Lists]

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

Re: Making `eglot-server-programs' a custom variable?

From: Philip Kaludercic
Subject: Re: Making `eglot-server-programs' a custom variable?
Date: Sat, 12 Nov 2022 07:34:28 +0000

Jim Porter <jporterbugs@gmail.com> writes:

> On 11/10/2022 9:47 AM, Philip Kaludercic wrote:
>> Honestly, I think that there should be a command like `add-to-option'
>> that can handle these things automatically and defer loading if
>> possible.  There are plenty of cases where you would either do something
>> like this, or have a ...-user-list that is appended together with some
>> build-in list, and even though the actual problem is shared among all
>> user options.
> Assuming I understand what you mean, I agree that this would be very
> useful. I think it would be super-helpful for there to be a way in the
> Customize interface to indicate that you want to add A, B, C to a
> defcustom list, and/or remove X, Y, Z. For another example where this
> would be helpful, see bug#54977.
> (For people who build their Emacs configs by writing Elisp, this
> probably isn't too big a deal, since they probably know enough to do
> the right thing, but it couldn't hurt to make this easier in Elisp
> too. Although use-package already makes this about as easy as can be,
> since you can do all this in a ':config' block, and it Just Works.)

Just for the sake of completeness, I'd like to mention what setup.el
also provides.

The `:option' macro (which is comparable to `:custom' in use-package)
can take a complex option name.  The default is something like

    (:option c-default-style '((java-mode . "java")
                               (awk-mode  . "awk")
                               (other     . "k&r")))
but you could also use

    (:option (prepend c-default-style) '(other . "k&r"))

to load the variable and then prepend a value to a list.  In retrospect,
I don't like the syntax that much, and the fact that `:option' calls
`custom-load-symbol' unconditionally can really slow down a
configuration.  This last thing is something that an `add-to-option` --
be it a standalone function or an extension of `add-to-list' must avoid IMO.

reply via email to

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