mhayashi1120 / Emacs-langtool

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

LanguageTool exited abnormally #28

Open TeddyDD opened 6 years ago

TeddyDD commented 6 years ago

OS: Linux Arch languagetool: 3.8 from community repo Emacs: 25.3 I installed langtool package on Spacemacs. My config looks like this:

  (use-package langtool
    :ensure t
    :init (
    (setq langtool-bin "/usr/bin/languagetool")
    (setq langtool-mother-tongue "pl")
    (setq langtool-language-tool-jar "/usr/share/java/languagetool/languagetool-commandline.jar")
    (setq langtool-default-language "en-US")
    (setq langtool-java-bin "/usr/bin/java")
    ))

I tried this and few combinations (only langtool-java-bin or langtool-bin). Every time I try to run M-x langtool-check there is an error: LanguageTool exited abnormally with code 1 (Unrecognized option: -c)

novakboskov commented 6 years ago

Same here.

nypdmax commented 6 years ago

Same here. I have tried both languagetool-3.5 and languagetool-3.9. It seems related to 'langtool--java-coding-system' or 'buffer-file-coding-system' as I found '-c' option in line 707-712 in langtool.el. However when I executed the languagetool-commandline.jar with '-c utf8', it appeared to be working.

pksec commented 6 years ago

Problem: Same error here. I am using langtool-4.0, if I disable -c option in langtool.el, then I get an error with option -l. My tools:

GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
LanguageTool debug ON.
LanguageTool exited abnormally with code 1 (Unrecognized option: -c)
Org mode version 9.1.7 (9.1.7-12-g74f6ed-elpa @ /home/xxx/.emacs.d/elpa/org-20180305/)

I was getting an error in emacs saying cannot find or open tool called langtool. I disabled it, and everything starting working as normal.

FIX to the problem Do not use (require 'langtool), just comment the line and restart emacs.

;(require 'langtool)
(setq langtool-language-tool-jar "/home/xxx/LanguageTool-4.0/languagetool-commandline.jar")
(setq langtool-default-language "en-US")

(global-set-key "\C-c4l" 'langtool-check)
(global-set-key "\C-c4d" 'langtool-check-done)
(global-set-key "\C-c4m" 'langtool-show-message-at-point)
(global-set-key "\C-c4c" 'langtool-correct-buffer)

-- Now everything works!