emacs-languagetool / flycheck-languagetool

Flycheck support for LanguageTool
GNU General Public License v3.0
54 stars 8 forks source link

feat: add support for custom LanguageTool command #21

Closed abougouffa closed 2 years ago

abougouffa commented 2 years ago

Usage example:

(use-package! flycheck-languagetool
  :ensure t
  :hook (text-mode . flycheck-languagetool-setup)
  :init
  ;; In Arch Linux, `languagetool --http` launches LT in HTTP server mode
  (setq flycheck-languagetool-server-command '("languagetool" "--http")
        flycheck-languagetool-language "auto"))

Fixes: #20 Ref: https://github.com/emacs-languagetool/flymake-languagetool/issues/6

jcs090218 commented 2 years ago

Looks good to me. @mavit WDYT?

mavit commented 2 years ago

Seems fine to me, but I wonder if we can do even better. If system languagetool commands exist, then we should probably try to auto-detect them so that the user doesn't have to do any unnecessary manual configurating.

@abougouffa Is this something you'd be interested in writing a patch to do?

abougouffa commented 2 years ago

@mavit I would like to, but I don't think it is a good idea, the command languagetool is not an official LanguageTool command, but rather a distro-specific script.

In Arch Linux, it is implemented as a pretty simple bash script which exposes the org.languagetool.server.HTTPServer class via the --http option.

I've just tested the Ubuntu's languagetool command, packaged as a snap, but I didn't find any CLI documentation about it. Other distros might implement the CLI differently, so I prefer leaving this to be configured by the user.

mavit commented 2 years ago

Thanks, @abougouffa.