From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Making `eglot-server-programs' a custom variable? Date: Thu, 10 Nov 2022 22:10:18 +0000 Message-ID: <87edua8nqt.fsf@gmail.com> References: <86fservpri.fsf@gnu.org> <878rkial85.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20183"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Arash Esbati , Eli Zaretskii , Tim Cross , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 10 23:09:48 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 1otFk4-00050c-1A for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Nov 2022 23:09:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otFjT-0001NN-Ko; Thu, 10 Nov 2022 17:09:11 -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 1otFjQ-0001JB-07 for emacs-devel@gnu.org; Thu, 10 Nov 2022 17:09:09 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otFjO-0007ha-7j; Thu, 10 Nov 2022 17:09:07 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id cl5so4161992wrb.9; Thu, 10 Nov 2022 14:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3M1S7p2MnY9YL5cRcfG7KRvkkjs6okXi1YrIJEgneOo=; b=Zv2uGGAXpKGaHob4n2q3/bSsOvy1zTnUBt19VqQFuVsWLoHE93j5CnuYSqmY7E3u16 rgZQPFJxyuVROyqScCK0InjYpcj7lyH7mPMrbRbPu5zJye7kp012GMfTIRXRssGIl254 MRIVHJRXNM+CAt4hv6Alsubx+RN0mvVVVAOEgFXNSYNvD2noe62//h1dexXWjSnIBWDi GapEQsA6scZXHVBtqnQQlka3H1vP5u2LdPJ2T48BTS/6LMnkIXGBWMgSBI5vt12LjeR6 mglkdLBXrSgWO3nYcXmSAfrJCPrzYJn5LEQJ2gke7GbQ/FAaja0WciVWdCL7tzKeuJ8C xkvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3M1S7p2MnY9YL5cRcfG7KRvkkjs6okXi1YrIJEgneOo=; b=Hs5PTSgOg01iPzTUNNs3TyH/kq5EoytJflRcQ46wREI8Q3pWFigcnwDRlNjf4KrhH4 AU9cMbCZKoF0ry7Le14TfufuK5J7XTwvSnJpNFoR5Z/naS7UZLqNHX3owLlXPUwiMgBj CuXSBrtoUP0UiA5EkdbG0OPqpW+hP2CiOBQFhejfw5++IpoPxntK0+XFaN509/L5udy6 nIQRBzKqEIS+M/XC7E2YthZ6AoUmVO04oBaJ7usnDzBzkWXFF30L77dw+PX0SQmIlk75 f5rB91XcXtFLKUv/d5bylhWuOTH6QtBlzEpyKZtuD5mwsWC7YvIBiGNAOFqIpcZ0omBs sFPg== X-Gm-Message-State: ACrzQf14VDxn8Wg4MIdXUJ6Q87fjPa0SQIEGL+mdX5AK/5sz0jb8bCF4 m+hJjx2HvREUEgJOxXT9ZZ4hC4K0Z/A= X-Google-Smtp-Source: AMsMyM5z36+5vebXhPhFYwmuVdbllTFmlDhic/1Qtf5iEu/x0ciq6APGi2/fS1/FnhknfbYGz2rFWg== X-Received: by 2002:adf:f051:0:b0:236:70db:20d9 with SMTP id t17-20020adff051000000b0023670db20d9mr42847089wro.91.1668118143666; Thu, 10 Nov 2022 14:09:03 -0800 (PST) Original-Received: from krug (87-196-81-1.net.novis.pt. [87.196.81.1]) by smtp.gmail.com with ESMTPSA id g10-20020adff40a000000b0022e035a4e93sm231297wro.87.2022.11.10.14.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 14:09:03 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 10 Nov 2022 12:43:09 -0500") Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42c.google.com 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, FREEMAIL_FROM=0.001, 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:299524 Archived-At: Stefan Monnier writes: >> Why? This is in a user's init file. I can more or less see that >> argument for inter-library dependencies. But here, w-e-a-load is >> exactly what's needed. I use it all the time in my config. > > I have 4 uses of it in my ~75kB init file. Heh, I have it in almost every one of my ~75-750 small elisp files, each one more or less dedicated to configuring a package that I may or may not use for 7500 years. > That doesn't mean we have to find a way to avoid its use, just that it > would be nice to find such a way. I think with-eval-after-load sits nicely at the intersection of lazy autoloads and user Elisp snippets. Is there another tool that does this? use-package, maybe? But won't that use the same thing underneath? Anyway I tend to prefer things that do one thing well and don't make me learn new DSLs. with-eval-after-load hasn't let me down. > "Choose an LSP server" seems to me like a very poor way to customize the > behavior of the server. > > IOW the design of the LSP protocol is not "Emacs-y" enough :-) Ah. Yes. You're probably right about that, how could you not be ;-) ? I also think it's more about these servers using different backend strategies themselves. Last I looked at the C++ server landscape, all of them provided more or less the same, but consuming different amount resources. There's also lots of forking going on. I think this is good. >>> Maybe to reduce the problem we should allow multiple entries per >>> major mode and use the first that works, without needing to go through >>> `eglot-alternatives`? >> >> Again, why? Why add more semantics to an already complicated variable >> when the functional eglot-alternatives plugin works fine? Furthermore, >> I'd like to this particular configuration for a future >> multiple-simultaneous-server-in-one-mode idea. > > I'm just suggesting directions. I don't claim they're the right answer. > My impression is that this variable is currently both "too complex" and > "not flexible enough". Don't get me wrong, it's good enough for now. > > But no, I don't have a good replacement to suggest. My gut just tells > me that there is a better arrangement. It's not a very pretty variable, I admit, but it's good enough for now and could be a lot worse :-) I once thought it would be a good idea to have a buffer-local variable eglot-server-program (singular) that major-modes could set as a stronger suggestion of what to use. So a future smc++-mode could be based entirely on tree-sitter for syntax-highlighting and some good C++ server for everything else, including some LSP-backed smc++-frob-kittens command that isn't in eglot.el. The "good C++ server" would be set in eglot-server-program, called from smc++-mode. Maybe that "good server" would even be bundled with the smc++-mode package so that M-x smc++-mode would probably start Eglot by default. Can you ask your gut if this is an acceptable arrangement? Jo=C3=A3o