PillFall / languagetool.el

LanguageTool suggestions integrated within Emacs
GNU General Public License v3.0
98 stars 8 forks source link

🐛languagetool-server-start failing due to language-server-command not set  #19

Closed preiaen closed 1 year ago

preiaen commented 1 year ago

What version of Emacs are you running?

28.2

What version of LanguageTool are you running?

6.0.0

What version of this package are you running?

20230325.507

What is the current behaviour?

When I run m-x languagetool-server-start the message buffer states the following:

languagetool-server-start: LanguageTool Server Command is not set

However, my current .emacs contains the server command:

(setq languagetool-java-arguments '("-Dfile.encoding=UTF-8")
        languagetool-console-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-commandline.jar"
        languagetool-server-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-server.jar"))

The console mode is working properly.

What is you expect to happen?

I like the server to start and work with the server mode.

What do you do to get this bug?

(use-package languagetool
  :ensure t
  :defer t
  :commands (languagetool-check
             languagetool-clear-suggestions
             languagetool-correct-at-point
             languagetool-correct-buffer
             languagetool-set-language
             languagetool-server-mode
             languagetool-server-start
             languagetool-server-stop)
  :config
  (setq languagetool-java-arguments '("-Dfile.encoding=UTF-8")
        languagetool-console-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-commandline.jar"
        languagetool-server-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-server.jar"))

m-x languagetool-server-start

languagetool-server-start: LanguageTool Server Command is not set
PillFall commented 1 year ago

Are you using Emacs through MSYS2?

I checked the package with “Native” Emacs and also with MSYS2 Emacs (as that are the only two ways I know how to install Emacs in Windows).

“Native”

The “Native” version doesn't have any problem as far as I could check. I leave a demo showing that I can start the server without any concern.

Preview with Native

MSYS2

The MSYS2 version is incredibly slow and can't even invoke other process without blocking Emacs or the OS (maybe my installation is corrupt, but at this point I cannot tell). I checked that the server indeed start, using a web browser, but Emacs was totally blocked, and sometimes it also blocked my taskbar.

preiaen commented 1 year ago

I'm using emacs in the regular desktop version.

Given, that you can't reproduce the error with the current package of langtool 6.0.0 I assume that the error is on my side. However, if I use the recommended configuration, the value of both variables in emacs is nil (c-h v languagetool-server-command). If I change the configuration and remove the :config block and set the variables separately in my .emacs file, they have the correct value and everything seems to work.

It looks like this: `(use-package languagetool :ensure t :defer t :commands (languagetool-check languagetool-clear-suggestions languagetool-correct-at-point languagetool-correct-buffer languagetool-set-language languagetool-server-mode languagetool-server-start languagetool-server-stop) )

(setq languagetool-java-arguments '("-Dfile.encoding=UTF-8") languagetool-console-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-commandline.jar" languagetool-server-command "C:/Users/nilsh/LanguageTool/LanguageTool-6.0/languagetool-server.jar")`

PillFall commented 1 year ago

I will check what could be happening with the use-package config.

Maybe the way I'm showing is incorrect (But it shows no issues till now).

Could you try changing the :config section to the :init section?