unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
@ 2023-03-23 16:14 牟 桐
  2023-03-23 19:29 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: 牟 桐 @ 2023-03-23 16:14 UTC (permalink / raw)
  To: 62407

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

When I try to open an elixir file with eglot on Windows, eglot will
guess that I want to execute `language_server.sh`.  But on Windows, it
should be `language_server.bat`.

After I change the command manually, everything works fine.

[-- Attachment #2: Type: text/html, Size: 1659 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-23 16:14 bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat` 牟 桐
@ 2023-03-23 19:29 ` Eli Zaretskii
  2023-03-24  2:22   ` 牟 桐
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-23 19:29 UTC (permalink / raw)
  To: 牟 桐; +Cc: 62407

> From: 牟 桐 <mou.tong@outlook.com>
> Date: Thu, 23 Mar 2023 16:14:55 +0000
> 
> 
> When I try to open an elixir file with eglot on Windows, eglot will
> guess that I want to execute `language_server.sh`.  But on Windows, it
> should be `language_server.bat`.

I think it should depend on the shell that Emacs is using, not on the
system type.  What is the value of shell-file-name on that Windows
system?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-23 19:29 ` Eli Zaretskii
@ 2023-03-24  2:22   ` 牟 桐
  2023-03-24  6:35     ` Eli Zaretskii
  2023-03-24  6:57     ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: 牟 桐 @ 2023-03-24  2:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62407@debbugs.gnu.org


> What is the value of shell-file-name on that Windows
> system?

It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
and `cmd.exe`, the eglot's guess stays the same. I guess that is because
eglot had hardcoded the result here:

https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225

``` emacs-lisp-mode
((elixir-mode elixir-ts-mode heex-ts-mode)
 . ("language_server.sh"))
```




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  2:22   ` 牟 桐
@ 2023-03-24  6:35     ` Eli Zaretskii
  2023-03-24  7:18       ` 牟 桐
  2023-03-24  6:57     ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-24  6:35 UTC (permalink / raw)
  To: 牟 桐; +Cc: 62407

> From: 牟 桐 <mou.tong@outlook.com>
> CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 02:22:44 +0000
> 
> 
> > What is the value of shell-file-name on that Windows
> > system?
> 
> It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
> and `cmd.exe`, the eglot's guess stays the same. I guess that is because
> eglot had hardcoded the result here:
> 
> https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225
> 
> ``` emacs-lisp-mode
> ((elixir-mode elixir-ts-mode heex-ts-mode)
>  . ("language_server.sh"))
> ```

I'm not saying that the current code is correct, I'm just saying that
the condition to use language_server.bat should be based on the value
of shell-file-name, not on system-type, because some people use Bash
on Windows as well.

Btw, is language_server.bat part of that server's distribution, or did
you write the batch file yourself?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  2:22   ` 牟 桐
  2023-03-24  6:35     ` Eli Zaretskii
@ 2023-03-24  6:57     ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-24  6:57 UTC (permalink / raw)
  To: 牟 桐; +Cc: 62407

> From: 牟 桐 <mou.tong@outlook.com>
> CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 02:22:44 +0000
> 
> 
> > What is the value of shell-file-name on that Windows
> > system?
> 
> It's `cmdproxy.exe` on Windows, after I changed it to `powershell.exe`
> and `cmd.exe`, the eglot's guess stays the same. I guess that is because
> eglot had hardcoded the result here:
> 
> https://github.com/emacs-mirror/emacs/blob/4566a0c6b825a18e6c065da0543b8b942b7db8df/lisp/progmodes/eglot.el#L224-L225
> 
> ``` emacs-lisp-mode
> ((elixir-mode elixir-ts-mode heex-ts-mode)
>  . ("language_server.sh"))
> ```

Can you see if the patch below solves your problem?

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 058bcec..42793a1 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -222,7 +222,10 @@ eglot-server-programs
                                 (dart-mode . ("dart" "language-server"
                                               "--client-id" "emacs.eglot-dart"))
                                 ((elixir-mode elixir-ts-mode heex-ts-mode)
-                                 . ("language_server.sh"))
+                                 . ,(if (and (fboundp 'w32-shell-dos-semantics)
+                                             (w32-shell-dos-semantics))
+                                        "language_server.bat"
+                                      "language_server.sh"))
                                 (ada-mode . ("ada_language_server"))
                                 (scala-mode . ,(eglot-alternatives
                                                 '("metals" "metals-emacs")))





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  6:35     ` Eli Zaretskii
@ 2023-03-24  7:18       ` 牟 桐
  2023-03-24  7:47         ` 牟 桐
  2023-03-24 15:29         ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: 牟 桐 @ 2023-03-24  7:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62407@debbugs.gnu.org

> because some people use Bash on Windows as well

Sorry, I haven’t considered that.

> Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?

The former, `language_server.bat` is shipped with the distribution.

> Can you see if the patch below solves your problem?

It will raise an error, so I changed it like this, now it solves my problem:

    ((elixir-mode elixir-ts-mode heex-ts-mode)
     . ,(if (and (fboundp 'w32-shell-dos-semantics)
                 (w32-shell-dos-semantics))        
            '("language_server.bat")        
          '("language_server.sh")))         




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  7:18       ` 牟 桐
@ 2023-03-24  7:47         ` 牟 桐
  2023-03-24 11:40           ` Eli Zaretskii
  2023-03-24 15:29         ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: 牟 桐 @ 2023-03-24  7:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62407@debbugs.gnu.org


> 
>    ((elixir-mode elixir-ts-mode heex-ts-mode)
>     . ,(if (and (fboundp 'w32-shell-dos-semantics)
>                 (w32-shell-dos-semantics))        
>            '("language_server.bat")        
>          '("language_server.sh")))         
> 
> 
> 

BTW, elixir's lsp installed by brew on Mac is `elixir-ls`, a soft link
to `language_server.sh`.

I don't have a linux computer, so I don't know what the command is on
Linux.

Should we use a unified name in Eglot like `elixir-ls` (which is the
user's job to name their elixir's lsp), or keep using `language_server`,
which may leading to conflict on system wide.

I guess the best way to solve this is to let elixir-ls's dev rename
their release :)






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  7:47         ` 牟 桐
@ 2023-03-24 11:40           ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-24 11:40 UTC (permalink / raw)
  To: 牟 桐; +Cc: 62407

> From: 牟 桐 <mou.tong@outlook.com>
> CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 07:47:54 +0000
> 
> 
> BTW, elixir's lsp installed by brew on Mac is `elixir-ls`, a soft link
> to `language_server.sh`.
> 
> I don't have a linux computer, so I don't know what the command is on
> Linux.
> 
> Should we use a unified name in Eglot like `elixir-ls` (which is the
> user's job to name their elixir's lsp), or keep using `language_server`,
> which may leading to conflict on system wide.
> 
> I guess the best way to solve this is to let elixir-ls's dev rename
> their release :)

I think we should invoke the server as the developers tell us.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24  7:18       ` 牟 桐
  2023-03-24  7:47         ` 牟 桐
@ 2023-03-24 15:29         ` Eli Zaretskii
  2023-03-24 15:40           ` João Távora
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-24 15:29 UTC (permalink / raw)
  To: 牟 桐, João Távora; +Cc: 62407

> From: 牟 桐 <mou.tong@outlook.com>
> CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> Date: Fri, 24 Mar 2023 07:18:24 +0000
> 
> > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> 
> The former, `language_server.bat` is shipped with the distribution.
> 
> > Can you see if the patch below solves your problem?
> 
> It will raise an error, so I changed it like this, now it solves my problem:
> 
>     ((elixir-mode elixir-ts-mode heex-ts-mode)
>      . ,(if (and (fboundp 'w32-shell-dos-semantics)
>                  (w32-shell-dos-semantics))        
>             '("language_server.bat")        
>           '("language_server.sh")))         

Right, sorry about that.

João, okay to install on the master branch?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24 15:29         ` Eli Zaretskii
@ 2023-03-24 15:40           ` João Távora
  2023-03-24 18:38             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: João Távora @ 2023-03-24 15:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 62407, 牟 桐

On Fri, Mar 24, 2023 at 3:29 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: 牟 桐 <mou.tong@outlook.com>
> > CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> > Date: Fri, 24 Mar 2023 07:18:24 +0000
> >
> > > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> >
> > The former, `language_server.bat` is shipped with the distribution.
> >
> > > Can you see if the patch below solves your problem?
> >
> > It will raise an error, so I changed it like this, now it solves my problem:
> >
> >     ((elixir-mode elixir-ts-mode heex-ts-mode)
> >      . ,(if (and (fboundp 'w32-shell-dos-semantics)
> >                  (w32-shell-dos-semantics))
> >             '("language_server.bat")
> >           '("language_server.sh")))
>
> Right, sorry about that.
>
> João, okay to install on the master branch?

OK.

João





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat`
  2023-03-24 15:40           ` João Távora
@ 2023-03-24 18:38             ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2023-03-24 18:38 UTC (permalink / raw)
  To: João Távora; +Cc: 62407-done, mou.tong

> From: João Távora <joaotavora@gmail.com>
> Date: Fri, 24 Mar 2023 15:40:24 +0000
> Cc: 牟 桐 <mou.tong@outlook.com>, 62407@debbugs.gnu.org
> 
> On Fri, Mar 24, 2023 at 3:29 PM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > From: 牟 桐 <mou.tong@outlook.com>
> > > CC: "62407@debbugs.gnu.org" <62407@debbugs.gnu.org>
> > > Date: Fri, 24 Mar 2023 07:18:24 +0000
> > >
> > > > Btw, is language_server.bat part of that server's distribution, or did you write the batch file yourself?
> > >
> > > The former, `language_server.bat` is shipped with the distribution.
> > >
> > > > Can you see if the patch below solves your problem?
> > >
> > > It will raise an error, so I changed it like this, now it solves my problem:
> > >
> > >     ((elixir-mode elixir-ts-mode heex-ts-mode)
> > >      . ,(if (and (fboundp 'w32-shell-dos-semantics)
> > >                  (w32-shell-dos-semantics))
> > >             '("language_server.bat")
> > >           '("language_server.sh")))
> >
> > Right, sorry about that.
> >
> > João, okay to install on the master branch?
> 
> OK.

Thanks, installed, and closing the bug.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-24 18:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 16:14 bug#62407: 30.0.50; The command to run elixir-ls on Windows is `language_server.bat` 牟 桐
2023-03-23 19:29 ` Eli Zaretskii
2023-03-24  2:22   ` 牟 桐
2023-03-24  6:35     ` Eli Zaretskii
2023-03-24  7:18       ` 牟 桐
2023-03-24  7:47         ` 牟 桐
2023-03-24 11:40           ` Eli Zaretskii
2023-03-24 15:29         ` Eli Zaretskii
2023-03-24 15:40           ` João Távora
2023-03-24 18:38             ` Eli Zaretskii
2023-03-24  6:57     ` Eli Zaretskii

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).