From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Sun, 13 Nov 2022 00:20:35 +0000 Message-ID: <87wn7zwvqk.fsf@posteo.net> References: <86fservpri.fsf@gnu.org> <87cz9v97lo.fsf@posteo.net> <86r0yb234t.fsf@gnu.org> <87o7te7lc7.fsf@posteo.net> <83sfioob7s.fsf@gnu.org> <87wn80zjiw.fsf@posteo.net> <83leogo9yw.fsf@gnu.org> <87r0y8zhl9.fsf@posteo.net> <83k040o8an.fsf@gnu.org> <87mt8wzf20.fsf@posteo.net> <83edu8o5gw.fsf@gnu.org> <878rkgz3nj.fsf@posteo.net> <83r0y8meis.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36828"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, joaotavora@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 13 01:21:05 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ou0kA-0009Ln-HZ for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Nov 2022 01:21:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ou0jr-0001kU-Qg; Sat, 12 Nov 2022 19:20:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ou0jp-0001k2-Ss for emacs-devel@gnu.org; Sat, 12 Nov 2022 19:20:41 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ou0jn-0002n6-Tx for emacs-devel@gnu.org; Sat, 12 Nov 2022 19:20:41 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5C66E240027 for ; Sun, 13 Nov 2022 01:20:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668298838; bh=r28SPl6tE5ALtvSvhimxNKd9TmzTS+O1CPmZxO6ebnw=; h=From:To:Cc:Subject:Date:From; b=EIwoc7hv4DNaBvYjtT9ZzyWMmN7A39aSwzzVrwlCO7OzAFatXTXhMwERGJBpHA4W1 fa3GC6oUa8+YrSzkxvVn0VOp2mCIjbftFezxT0PfOUt2A7i7fp4MF3kGuCTYOxqloY byBiWW6kg7+MX2Advy9P22tiqV03BMyEXpB/RmG85B5jeF9O9sLnXvlUW3/dyO32dD 25c73L9cxLTBQsWW3UXLRTew1UMkcTCSFh2OC5khHiM+gUTkr+tJUK+gchDo5uuGae S8AXKshim0412oxb9fymXrZzyh/6E0s+lI33FHFznTEkg6RDQvnrYRcNyP9BCXXIMf XOwie6SvC8cFw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N8tPv0m83z9rxH; Sun, 13 Nov 2022 01:20:35 +0100 (CET) In-Reply-To: <83r0y8meis.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 12 Nov 2022 16:30:19 +0200") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299688 Archived-At: Eli Zaretskii writes: >> From: Philip Kaludercic >> 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.