mhayashi1120 / Emacs-langtool

LanguageTool for Emacs
GNU General Public License v3.0
377 stars 31 forks source link

Archlinux and languagetool-server #40

Open gitlyap opened 5 years ago

gitlyap commented 5 years ago

Hi,

I can't start the languagetool-server with your package and this setup:

(setq langtool-java-classpath
        "/usr/share/languagetool:/usr/share/java/languagetool/*")
(setq langtool-language-tool-server-jar "/usr/share/java/languagetool/languagetool-server.jar")
(setq langtool-java-bin "/usr/bin/java")

If I use the languagetool-commandline from your package like this:

(setq langtool-java-classpath
        "/usr/share/languagetool:/usr/share/java/languagetool/*")
(setq langtool-language-tool-jar "/usr/share/java/languagetool/languagetool-commandline.jar")
(setq langtool-java-bin "/usr/bin/java")

then there is no problem.

my system:

satyanash commented 3 years ago

The issue is this bit here: https://github.com/mhayashi1120/Emacs-langtool/blob/8276eccc5587bc12fd205ee58a7a982f0a136e41/langtool.el#L1133-L1135

It only adds the langtool-language-tool-server-jar to the classpath and ignores langtool-java-classpath even if it is configured.

Small fix to make emacs-langtool work on ArchLinux is as follows:

(setq args (append args (list "-cp"
                            (format "%s:%s"
                                    langtool-java-classpath
                                    (langtool--process-file-name
                                        langtool-language-tool-server-jar)))))

Above snippet assumes that langtool-java-classpath is always defined. Might need more work to not add it if it is not specified.

ejuarezg commented 3 years ago

@satyanash Thank you for this workaround! I too have had issues with this.