From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Sat, 12 Nov 2022 12:02:55 +0200 Message-ID: <83edu8o5gw.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21121"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, joaotavora@gmail.com To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 12 11:03:47 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 1otnMZ-0005Hu-Ko for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Nov 2022 11:03:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otnLh-0006uC-W3; Sat, 12 Nov 2022 05:02:54 -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 1otnLf-0006tg-GB for emacs-devel@gnu.org; Sat, 12 Nov 2022 05:02:51 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otnLe-0002uv-Uh; Sat, 12 Nov 2022 05:02:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zDaQnTn53nqYgV/qsCxGNL11wqCM+ksZfR1dXAUfVCk=; b=gPq5PiBLTO9J RpOFbvx8zvpKEnj18qg34hD/uysHZDIl9X9cAnxu3/OukrOoiZ4MK9+fjLdj99BW8LlMEypXiGxdQ qgi4yKjI2Y5c9fMtRS25GcVeeyl8tOiMvWSY2jy2/uZ8BsTZhkLIdqmO+EFBi6YQEVSrbzMHnhri9 ATc6yMuStrRtYrby72KrdNqQOQ620fd30mZ6M8a0tOSAde6VWEUVtKqiNQYfK4kSM4VeBsOlTUBGX LRgR+hVg4l1AFln1nL/vlaxbxA3Cnot4M1dlDOAF5eqnnjTab/JeDI4kmB+HND24bwPnrWMaqGjvx 89u5MPYjzk4I7QVX03YOuw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otnLd-0004Cp-R5; Sat, 12 Nov 2022 05:02:50 -0500 In-Reply-To: <87mt8wzf20.fsf@posteo.net> (message from Philip Kaludercic on Sat, 12 Nov 2022 09:40:23 +0000) 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:299637 Archived-At: > From: Philip Kaludercic > Cc: jporterbugs@gmail.com, arash@gnu.org, emacs-devel@gnu.org, > joaotavora@gmail.com > Date: Sat, 12 Nov 2022 09:40:23 +0000 > > >> > The way to do this is to have a basic value as a defvar, and store the > >> > corrections to that in a defcustom. > >> > >> But in that case you need to load the library to get the default value, > > > > I don't see why. And even if it's so, why is it a problem to load the > > library? > > (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. > >> in which case you might as well store the default value in the > >> defcustom. > > > > But you already explained why storing in a defcustom doesn't solve the > > problem? So why are you suggesting to do that anyway? > > ^^ I am not sure I explained that? You said: > > M-x customize-variable RET image-load-path RET > > My issue here is that while you can modify the list, when saved you will > store the entire modified list, and no the modifications you made on the > base variable. 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. > If you have to load the library to > get the default, writing > > (setopt foo (cons 'bar foo)) > > or > > (setopt foo (cons 'bar foo-default)) > > doesn't make much of a difference to me. Sorry, I don't see the relevance of setopt to what I was trying to suggest. > >> Also, I don't think this helps people who use the Customize > >> interface? > > > > Why doesn't it help? > > 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.