GNU bug report logs - #79290
30.2; eglot-alternatives doesn't support re-use of same program with different subcommands

Previous Next

Package: emacs;

Reported by: Doug Davis <ddavis <at> ddavis.io>

Date: Fri, 22 Aug 2025 15:39:02 UTC

Severity: normal

Found in version 30.2

Full log


View this message in rfc822 format

From: Philip Kaludercic <philipk <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: felician.nemeth <at> gmail.com, ddavis <at> ddavis.io, João Távora <joaotavora <at> gmail.com>, 79290 <at> debbugs.gnu.org
Subject: bug#79290: 30.2; eglot-alternatives doesn't support re-use of same program with different subcommands
Date: Sun, 24 Aug 2025 21:16:47 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: João Távora <joaotavora <at> gmail.com>
>> Date: Sun, 24 Aug 2025 13:40:41 +0100
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, 79290 <at> debbugs.gnu.org
>> 
>> On Sat, Aug 23, 2025 at 6:38 PM Doug Davis <ddavis <at> ddavis.io> wrote:
>> 
>>  >> an invocation of M-x eglot will fail to show the second instance of
>>  >> using uv in the resulting list that appears to be passed on to
>>  >> `completing-read'. (Notice the repeated use of `uv run`
>>  >> https://docs.astral.sh/uv/reference/cli/#uv-run)
>>  >>
>>  >> more info: the benefit of using `uv run` unloads the burden of using
>>  >> emacs to property setup a virtual environment; uv automatically handles
>>  >> running the correct installation of the invoked subcommand.
>>  >
>>  > João, any comments or suggestions?
>> 
>> No many:
>> 
>> I run python servers myself and find that a simple handrolled "virtual
>> environment" helper that sets exec-path, process-environment, and PATH
>> works fine 99% of the time (if not 100% of the time) for my python programming
>> needs, admittedly not very complex.  This includes eglot. Attached my 50-line
>> zenv.el in case is useful to anyone, though not  related to  this issue.
>>  
>>  Below is a patch on master that resolves
>> 
>>    ("server-program" "arg1" "arg2")
>> 
>>  to appear as
>> 
>>    "server-program arg1 arg2"
>> 
>>  in the completing read; just an idea
>> 
>> I don't fully understand the issue, but I don't have anything against 
>> these quality-of-life patches if, and this is a big IF, they are small and 
>> very well tested. I'm thinking about C-u M-x eglot, and other interactive 
>> scenarios. eglot-server-program's syntax is crammed to the max
>> already.  Related to this, Philip K. had a good idea about eglot-alternatives,
>> to make it "less functional", but I can't remember what it was exactly.
>
> Philip, do you remember?

The best I could find in my backlog was this message
yhetil.org/emacs-devel/87o6zc86dk.fsf <at> posteo.net/.  This was an attempt
to move the contents of `eglot-server-programs' out of Eglot and into
their related major-modes.  I never completed it (which reminds me once
more that I should maintain a list of these kinds of initiatives
somewhere), but João mentioned that he found the usage of arrays to
denote alternative commands to start the LSP servers interesting, as
opposed to injecting `eglot-alternatives' calls using quasi-quoting.  My
idea here was just to allow configuring the variable without having to
load eglot.el.  I didn't have the time to follow up on the entire bug
report to evaluate how relevant this hack is to the bug report at hand.




This bug report was last modified 26 days ago.

Previous Next


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