unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: Yuan Fu <casouri@gmail.com>,
	Stephen Leake <stephen_leake@stephe-leake.org>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Explain a bit more on how to configure language server in Eglot's manual
Date: Thu, 9 Mar 2023 09:43:05 +0000	[thread overview]
Message-ID: <CALDnm52VgszyoP_kiWU3X1Kb89GXGJssYLFdwMqbiiYh5Tj_8w@mail.gmail.com> (raw)
In-Reply-To: <87ttyv2cug.fsf@gmail.com>

On Wed, Mar 8, 2023 at 8:43 PM Augusto Stoffel <arstoffel@gmail.com> wrote:

> Of course you would need to combine it with split-string (and a
> dolist or seq-reduce to process a list of those dotted names).

:-)  and the kitchen sink to handle all the quirks...  I Yuri is just
right, there are too many problems in the general case, but in the LSP
case it's more tame, which explains why other editors manage to use
it al all.

> >> Speaking of bloat, and I know I shouldn't insist, but a basic version of
> >> the savable eglot-show-workspace-configuration barely adds 30 LOC.
> >
> > Your code has at least two big problems:
> >
> > * it takes the current value from one place and
> >   potentially saves it in another place.  This is asking
> >   for trouble.  I know you favour the 'nil' method exclusively
> >   for setting e-w-configuration, but it's not the only supported
> >   methods and there are configurations out in the wild that
> >   we can't break. Also note the that per-file or per-sub-hierarchy
> >   workspace configurations _are_supported by LSP (the scopeUri
> >   argument to the workspace/configuration server request).
>
> Right, this is a problem.  It's missing the part that will “not confuse
> the other 10% [of users] to death”, as you said.
>
> > * it doesn't take into account dir-local-set-class-variables
>
> This too.  Neither the possibility of e-w-c being a function.

Or the possibility of it being an '(eval ...)' form.  I think
that should make it 20% (I found a lot of eval when perusing
GitHub for .dir-locals.el examples).

> > These are exactly the type of edge cases that I don't want
> > to handle in Eglot.  In other words, Emacs has many variable
> > setting methods and making an Eglot function to oversimplify
> > them, even if it happens to work for an estimated majority of
> > cases, is a bad idea, simply because it will break a minority.
>
> Fair enough, but it seems that this multiplicity of methods basically
> precludes one from making a helper tool for configurations.

Of course not.  Just target the 90% and bail out for the 10%.
Usually, if a user has used dir-locals-set-class-variables,
probably has no trouble with editing dir-locals.

> > So I urge you to generalize your code and propose it here
> > in a new :core ELPA package.
>
> If you provide a function that receives a new configuration value and
> stores it back in the right place, then this package becomes trivial.

I think you misunderstood me.  i was proposing that you work
on that generic variable editing facility, and open up an API
for packages like Eglot to take advantage.  Start working
on it in, say, lisp/files-x.el and then later on we could
consider making it a :core ELPA package.

> If you don't, then this package is completely entangled with Eglot's
> logic for reading configs.  In either case this doesn't seem to make a
> lot of sense as a separate package.

I read your code and I even here I don't agree :-) There are
a couple of '--' references in there, but this is easy to overcome. And
Eglot cannot change that logic without breaking backward compatibility
so you're adhering to a published interface.  So even an
"eglot-edit-wconf" library would make sense as a GNU ELPA package.

João



  reply	other threads:[~2023-03-09  9:43 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05  4:45 Explain a bit more on how to configure language server in Eglot's manual Yuan Fu
2023-03-05 22:36 ` [SPAM UNSURE] " Stephen Leake
2023-03-06  0:16   ` João Távora
2023-03-06 22:28     ` Yuan Fu
2023-03-07 11:59       ` João Távora
2023-03-08 13:27         ` Augusto Stoffel
2023-03-08 13:54           ` João Távora
2023-03-08 15:01             ` Augusto Stoffel
2023-03-08 19:43               ` João Távora
2023-03-08 20:43                 ` Augusto Stoffel
2023-03-09  9:43                   ` João Távora [this message]
2023-03-08 23:19                 ` Yuan Fu
2023-03-09  8:18                   ` Augusto Stoffel
2023-03-09 17:20                     ` Juri Linkov
2023-03-10  6:26                       ` Yuan Fu
2023-03-10  7:59                         ` João Távora
2023-03-09 17:40                     ` João Távora
2023-03-09 18:05                       ` Juri Linkov
2023-03-09 18:32                         ` Augusto Stoffel
2023-03-09  8:28                 ` Explain a bit more on how to configure language server in Eglot's manual' Augusto Stoffel
2023-03-08 15:24             ` Explain a bit more on how to configure language server in Eglot's manual Yuri Khan
2023-03-08 15:27               ` João Távora
2023-03-08 15:52                 ` Yuri Khan
2023-03-08 16:03                   ` João Távora
2023-03-09 11:18         ` [SPAM UNSURE] " João Távora
2023-03-10  6:23           ` Yuan Fu
2023-03-14 18:09             ` Michael Eliachevitch
2023-03-14 18:53               ` João Távora
2023-03-14 22:27                 ` [PATCH] " Michael Eliachevitch
2023-03-15 11:49                   ` Michael Eliachevitch
2023-03-15 12:35                   ` Eli Zaretskii
2023-03-15 12:52                     ` Michael Eliachevitch
2023-03-15 18:54                       ` João Távora
2023-03-15 19:26                         ` Michael Eliachevitch
2023-03-16  0:09                           ` João Távora
2023-03-06 10:34 ` Augusto Stoffel
2023-03-06 10:51   ` João Távora
2023-03-06 11:00     ` Augusto Stoffel
2023-03-06 11:13       ` João Távora
2023-03-06 11:30         ` Pedro Andres Aranda Gutierrez
2023-03-06 11:46           ` João Távora
2023-03-06 13:08             ` Augusto Stoffel
2023-03-06 13:50               ` João Távora
2023-03-06 16:10                 ` Augusto Stoffel
2023-03-06 16:25                   ` João Távora
2023-03-06 18:18                     ` Augusto Stoffel
2023-03-06 18:32                       ` João Távora
2023-03-06 20:16                         ` Pedro Andres Aranda Gutierrez
2023-03-06 21:13                         ` Augusto Stoffel
2023-03-06 21:38                           ` João Távora
2023-03-06 13:01         ` Augusto Stoffel
  -- strict thread matches above, loose matches on Subject: below --
2023-03-12 12:09 Pedro Andres Aranda Gutierrez
2023-03-12 19:52 ` 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=CALDnm52VgszyoP_kiWU3X1Kb89GXGJssYLFdwMqbiiYh5Tj_8w@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=arstoffel@gmail.com \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /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).