Closed mavit closed 3 years ago
Hi, @mavit!
I don't know if this is possible since the package itself works by using the languagetool-commandline.jar
file and I don't think the executable accept checking by text
and not file
. 😕
If you specify -
as the filename then it reads from STDIN:
> echo foo | java -jar languagetool-commandline.jar --language en-GB -
Expected text language: English (GB)
Working on STDIN...
1.) Line 1, column 0, Rule ID: UPPERCASE_SENTENCE_START prio=1
Message: This sentence does not start with an uppercase letter.
Suggestion: Foo
foo
^^^
Time: 2485ms for 1 sentences (0.4 sentences/sec)
Cool! Thanks for the information! Just added in 96b4efd754d6d21af345a7300378363f9cfc86cf.
Can you upgrade to the latest version and see if this work for you? Thanks!
I think this will run into trouble if the buffer is larger than ARG_MAX, which varies from platform to platform. Also, on a multi-user system, it will allow other users to use the ps
command to snoop on what you're writing.
It's probably better to pass input to the command over standard input directly, perhaps with (start-process ...)
and (process-send-string ...)
.
If a buffer is not visiting a file (i.e., when
buffer-file-name
isnil
) the languagetool Flycheck checker appears to be active, but no errors are highlighted.If a buffer is visiting a file but that file has not been saved recently (i.e., when
(buffer-modified-p)
ist
), errors are shown for the file as it is on disk, not as it is in the buffer.