redguardtoo / emacs.d

Fast and robust Emacs setup.
http://blog.binchen.org
GNU General Public License v3.0
2.39k stars 619 forks source link

how to use langtool? #967

Closed PandaZhym closed 2 years ago

PandaZhym commented 2 years ago

first, i add the file downloaded from the link, and, i add the path to load-path in init.el by this: (add-to-list 'load-path "/home/myname/Downloads/LanguageTool-5.6/") then, i go to the langtool.el, i find this: (defcustom langtool-language-tool-jar nil "LanguageTool jar file. No need to set this variable when `langtool-java-classpath' is set." :group 'langtool :type 'file) i need do something to make this work, but i have no any good idea. can i do something, such as using my path to replace nil, to make langtool work?

PandaZhym commented 2 years ago

i add this to the file of init.el: ;; by zhouyiming (add-to-list 'load-path "/home/yimzhou/Downloads/LanguageTool-5.6/") (setq langtool-language-tool-jar "/home/yimzhou/Downloads/LanguageTool-5.6/languagetool-commandline.jar") (require 'langtool) ;;(setq langtool-language-tool-server-jar "/home/yimzhou/Downloads/LanguageTool-5.6/languagetool-server.jar") ;;(setq langtool-server-user-arguments '("-p" "8082"))

and the langtool can work, but when i add the path of server.jar, emacs will still display "waitting connection.................................."

redguardtoo commented 2 years ago

My setup is just one liner (setq langtool-language-tool-jar "/path/to/languagetool-commandline.jar")

I don't know why you need set load-path.

You could (setq langtool-default-language "en-US") or let the command line program to detect the language automatically.

PandaZhym commented 2 years ago

i also don't why there are setting load-path, and the follow content is part of the page (https://github.com/mhayashi1120/Emacs-langtool): install: Install LanguageTool version 3.0 or later (and java) https://languagetool.org/ Put this file into load-path'ed directory, and byte compile it if desired. And put the following expression into your ~/.emacs.

anyway, langtool.el works well in my emacs.thank you