GNU bug report logs - #61868
29.0.60; Eglot: setting "workspace" configurations should be easier

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Tue, 28 Feb 2023 12:51:01 UTC

Severity: normal

Found in version 29.0.60

Full log


Message #17 received at 61868 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 61868 <at> debbugs.gnu.org
Subject: Re: bug#61868: 29.0.60; Eglot: setting "workspace" configurations
 should be easier
Date: Wed, 01 Mar 2023 02:02:00 +0000
Augusto Stoffel <arstoffel <at> gmail.com> writes:

> I see this differently.  Emacs doesn't have deeply nested namespaces for
> variables and user options.  It's all pretty flat, so there is almost
> surely never going to be a variable that is nearly as tricky to set.

Oh but no :-) there are even scary DSLs in Emacs variables.  See
project-kill-buffer-conditions for example.  And customize-variable
groks it.

In effect you want something like customize-variable, but different UI
and with support for saving to .dir-locals.el.  I sympathize with the
idea, I really do, for two distinct reasons:

* I agree learning about dir-locals.el and its relation to a project's
configuration is confusing for newcomers

* I personally get extremely confused, even intimidated, by the Custom
  UI.

So if this UI appears elsewhere, like a separate package, Eglot can take
advantage. But I'm afraid I don't like the idea of starting this in
Eglot, so it's probably not going to happen as long as I am maintainer.

> [ Incidentally, when I suggested to allow such syntax:
>
>        ((python-mode
>        . ((eglot-workspace-configuration
>            . (("pylsp.plugins.jedi_completion.include_params" . t)
>               ("pylsp.plugins.jedi_completion.fuzzy" . t)
>               ("pylsp.plugins.pylint.enabled" . :json-false))))))
>
>    you said it was un-Lispy or something, but I really think it's rather
>    the opposite.  Emacs has flat names pretty much like the above. ]

It's indeed un-Lispy, but it's not very hard to write a helper function
to turn that into a plist, is it?

>>   (defun eglot-edit-workspace-configuration () (interactive)
>>     (find-file (expand-file-name ".dir-locals.el" (project-root (project-current)))))
>>
>> My bet is that that two-liner would go a long way.
>
> No, this is not enough.  At the very least I need a history variable to
> look at the previous configurations.  This feature has to be a thing on
> top of of `eglot-show-workspace-configuration'.

That idea is the best I can offer for now.  You'd have undo for history,
which is not bad.  And Git, since it's a file after all.

João




This bug report was last modified 2 years and 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.