Code Monkey home page Code Monkey logo

emacs-langtool's Introduction

langtool.el

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.

(require 'langtool)

Or use Melpa (https://melpa.org/)

NOTE (2023-01-25)

Confirmed working on following environment

Java

java --version

openjdk 17.0.4 2022-07-19
OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.4+8-Debian-1deb11u1, mixed mode, sharing)

LanguageTool

Can be downloaded from here

java -jar languagetool-commandline.jar --version

LanguageTool version 6.0 (2022-12-29 12:13:11 +0000, e44dbb0)

Settings (required):

langtool.el have 3 types of client.

  1. Command line

This setting should be set, if you use rest of clients, to get full of completion support. And you should be set the variables before load this library.

(setq langtool-language-tool-jar "/path/to/languagetool-commandline.jar")
(require 'langtool)

Alternatively, you can set the classpath where LanguageTool's jars reside (e.g. ArchLinux):

(setq langtool-java-classpath
      "/usr/share/languagetool:/usr/share/java/languagetool/*")
(require 'langtool)

You can set a script that hold java setting (e.g. Gentoo):

(setq langtool-bin "/path/to/your/langtool")
(require 'langtool)
  1. HTTP server & client

You can use HTTP server implementation. This is very fast after listen server, but has security risk if there are multiple user on a same host.

(setq langtool-language-tool-server-jar "/path/to/languagetool-server.jar")

You can change HTTP server port number like following.

(setq langtool-server-user-arguments '("-p" "8082"))
  1. HTTP client

If you have running HTTP LanguageTool server instance on any machine:

(setq langtool-http-server-host "localhost"
      langtool-http-server-port 8082)

Now testing although, that running instance is working under HTTPSServer or via general ssl support (e.g. nginx) following may be working. Again, this is now testing, so please open issue when the ssl/tls connection is not working.

(setq langtool-http-server-stream-type 'tls)

Optional settings

  • Key binding if you desired.
(global-set-key "\C-x4w" 'langtool-check)
(global-set-key "\C-x4W" 'langtool-check-done)
(global-set-key "\C-x4l" 'langtool-switch-default-language)
(global-set-key "\C-x44" 'langtool-show-message-at-point)
(global-set-key "\C-x4c" 'langtool-interactive-correction)
  • Default language is detected by LanguageTool automatically. Please set langtool-default-language if you need specific language.
(setq langtool-default-language "en-US")

Otherwise, invoke M-x langtool-check with C-u (universal-argument)

  • Currently GNU java version is not working. Please change the variable to your favorite java executable.
(setq langtool-java-bin "/path/to/java")
  • Maybe your LanguageTool have launcher. (e.g. Gentoo) You need to set langtool-bin. See #24
(setq langtool-bin "/usr/bin/languagetool")
  • Maybe you want to specify your mother tongue.
(setq langtool-mother-tongue "en")
  • To customize LanguageTool commandline arguments.
(setq langtool-java-user-arguments '("-Dfile.encoding=UTF-8"))

You can also make the variable to buffer local like following:

(add-hook '**SOME**-mode-hook
          (lambda () (set (make-local-variable 'langtool-java-user-arguments)
                         '("-Dfile.encoding=UTF-8"))))

NOTE: Although there is no good example, langtool-user-arguments is a similar custom variable.

Usage:

  • To check current buffer and show warnings.
M-x langtool-check

Check with different language. You can complete supported language with C-i/TAB

C-u M-x langtool-check
  • To correct marker follow LanguageTool suggestions.
M-x langtool-correct-buffer
  • Go to warning point you can see a report from LanguageTool. Otherwise:
M-x langtool-show-message-at-point
  • You can optionally use extension package langtool-popup in this repository. To show automatically popup the cursor.

  • To finish checking. All langtool marker is removed.

M-x langtool-check-done

emacs-langtool's People

Contributors

jannisteunissen avatar mgttlinger avatar mhayashi1120 avatar rememberyou avatar toroidal-code avatar xaldew avatar xuchunyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-langtool's Issues

Dead link on documentation

This is not a issue but http://d.hatena.ne.jp/LaclefYoshi/20150912/langtool_popup link is dead on the README.md.

Error with "--langguagemodel" option

Hi, I was trying to add the --languagemodel option with the english n-gram data, but it does not work as expected (it was fine without the --langguagemodel).
The init.el file is as follow:

(setq langtool-language-tool-jar "/opt/program/nux/LanguageTool-4.1/languagetool-commandline.jar" )
(require 'langtool)

(setq langtool-java-user-arguments '(--languagemodel "/opt/program/nux/LanguageTool-4.1/ngrams"))

When I run M-x langtool-check,
it gave error message
LanguageTool exited abnormally with code 1 (Unrecognized option: --languagemodel /opt/program/nux/LanguageTool-4.1/ngrams)

Did I made a mistake?
Thanks!

Make emacs-langtool skip checking grammar for Latex commands starting with a backslash?

Hi,

I observe that current Emacs-langtool may report Latex macros, which starts by a backslash like \emph, \textbf, \textit,... as grammar errors. There is often a lot of such macros and and the overwhelming appearance of these errors actually makes the real error less obvious.

Do you know if it is possible to make Emacs-langtool skip such Latex macros?

Thank you!

way to add args before -jar

I got this exception NoClassDefFoundError: javax/xml/bind/JAXBException.

I don't know much about java. I figure out that --add-modules java.xml.bind works on my mac. But can't find way to add the arg before -jar.

mistakes not found (branch 1.1.x)

When using the French language, langtool with the "fr" language set up doesn't find all the mistakes it should. (However, some are well found).

For example, writing "Il a changer d'école." in emacs and checking it with langtool does not found any error.

However, checking with
java -jar LanguageTool.jar -l fr"
will find the mistake on "changer". Therefore there is an issue.

By the way, langtool always says "M-x langtool-correct-buffer to correct buffer." after a check even if no errors have been found when it should say "langtool hasn't found any errors" or something like that.

Another little detail is that when performing a check on a text, it might take a while (in my case even for 2/3 pages long texts) but during that time the mini-buffer doesn't say anything so we just wait hopping langtool is doing something… it would be great if the mini-buffer would says something like "Grammar checking in progress…"

Note: I use java 1.6.0_22 (OpenJDK6).

[Request] org-mode compatibility

Hi,
first thank you for your plug-in. It is really amazing.
In org-mod, file start with #+ and stuff...
By exemple :

+TITLE: MySuperTitle

+AUTHOR: JohnDo

+EMAIL: [email protected]

+LANGUAGE: fr

+OPTIONS: H:5

+OPTIONS: toc:3

How can i make a rule to don't correct it ?
(Sorry for my bad english)

Problems displaying special characters in the tips

Thanks for this package! It has been really useful.

When I use it for Brazilian Portuguese, it has problems displaying special characters (they are replaced by ? here):

image

While it's not a problem if we use (message "olá"), for example.

"Unsupported Encoding Exception" problem

One of the most common scenario when I would use langtool within emacs is when writing an email. I use Mew for email. When I run Emacs-langtool on a mew draft bufer, I get the following error when the language is set to auto:

LanguageTool exited abnormally with code 1 (Exception in thread "main" java.io.UnsupportedEncodingException: compound-text)

When the language is set to en-US, I get an error saying that langtool expects en-US.

If I copy the same text (including the header lines) to a new buffer as plain text, langtool runs as expected. However, if I have to do that, it almost negates the purpose of this script.

Can the text be given to langtool as en-US and not as "compount-text" from langtool.el?

-d option clashes when setting other language

When I check any buffer without setting the language, the output is correct (says that I have errors if any).

But when I set any language. it always returns that the buffer is correct (I know is not).

Checking langtool debugging tool in Emacs I notice that when I delete the -d when it has no options (in log the command is langtool.jar -c ascii -d -l en-GB file.txt) that error is fixed. Is the only flag that clashes.

I propose to change the code in the langtool-command--invoke-process to avoid the -d flag is there is no options to pass.

(defun langtool-command--invoke-process (file begin finish &optional lang)
  (let ((version (langtool--jar-version)))
    (cl-destructuring-bind (command args)
        (langtool--basic-command&args)
      ;; Construct arguments pass to jar file.
      ;; http://wiki.languagetool.org/command-line-options
      (setq args (append
                  args
                  (list "-c" (langtool--java-coding-system
                              buffer-file-coding-system))
                  ;;-----------------------------
                  ;; Avoid using -d flag if not needed.
                  (if (string= (langtool--disabled-rules) "")
                      (list "")
                    (list "-d" (langtool--disabled-rules)))))
      (cond
       ((stringp (or lang langtool-default-language))
        (setq args (append args (list "-l" (or lang langtool-default-language)))))
       (t
        (setq args (append args (list "--autoDetect")))))
      (when langtool-mother-tongue
        (setq args (append args (list "-m" langtool-mother-tongue))))
      (setq args (append args (langtool--custom-arguments 'langtool-user-arguments)))
      (setq args (append args (list (langtool--process-file-name file))))
      (langtool--debug "Command" "%s: %s" command args)
      (let* ((buffer (langtool--process-create-client-buffer))
             (proc (langtool--with-java-environ
                    (apply 'start-process "LanguageTool" buffer command args))))
        (set-process-filter proc 'langtool-command--process-filter)
        (set-process-sentinel proc 'langtool-command--process-sentinel)
        (process-put proc 'langtool-source-buffer (current-buffer))
        (process-put proc 'langtool-region-begin begin)
        (process-put proc 'langtool-region-finish finish)
        (process-put proc 'langtool-jar-version version)
        proc))))

Mention MELPA

You could mention that langtool is available through MELPA: https://melpa.org/#/langtool

(use-package langtool
	:ensure t
	:config (setq langtool-language-tool-jar "/path/to/languagetool-commandline.jar"))

being aware of the environment

When typing something else than just text, let's say a LaTeX document, langtool is not aware of the LaTeX syntaxe and found a lot of small errors due to that. It would be great if it would deal with environments only and ignore LaTeX commands for example.

Actually, I don't really think it's possible since LanguageTool isn't aware of the syntax... so, it's more a question: is that possible without too much work or not really ?

"require 'langtool" causes error

I just updated package"langtool" via melpa, and got the notification of error "wrong error argument :stringp, nil". I checked my .init.el, my setting comes below:

(require 'langtool)
(setq langtool-language-tool-jar "/usr/local/Cellar/languagetool/2.8/libexec/languagetool-commandline.jar"
langtool-mother-tongue "en"
langtool-disabled-rules '("WHITESPACE_RULE"
"EN_UNPAIRED_BRACKETS"
"COMMA_PARENTHESIS_WHITESPACE"
"EN_QUOTES"))
(global-set-key (kbd "") 'langtool-check-buffer)
(global-set-key (kbd "M-") 'langtool-correct-buffer)

I surprisingly found out this issue could be "fixed" by commenting "require 'langtool", all the functions work well,is this a bug?

Implement langtool-check for development language comments

Recently, I've been using your package and one of the things that caught my attention. Currently this package is great if you want to check the grammar of a text. However, it can also be useful to check the grammar of any comment in any development language.

I was surprised to see that there is not yet a function that would allow langtool-check to run only in code comments. In fact, such a function would avoid adding various rules in langtool-disabled-rules in order to avoid errors related to the syntax of the programming language. In addition, these disabled rules are a disadvantage because you would like to activate them in most cases.

My idea is this: what do you think about implementing a function like flyspell-prog-mode that would enable langtool only in comments when langtool-check runs in a mode other than markdown-mode, org-mode, text-mode?

Thank you for your work.

Provide setting for mothertongue

Please provide a setting for .emacs for mothertongue.

This should pass e.g. -m en if your mothertongue is English and is independent of the language for which grammar is being checked.

Implementing and documentating this allows for activation of extra grammar rules aimed specifically at native or non-native speakers regarding the non-native or native language in which grammar is checked.

May you please create a tag for release?

Good evening,

Tonight I am writing to humbly put in a request for you to tag this project.

The reason is that a lot of users want to rely on a "numbered" release, by
the most broad definition of the term. For me, it is really simple, I am setting
up a "kind of stable" Emacs configuration of my system here https://github.com/grettke/home/blob/master/.emacs.el
and I would like to rely 100% just one tag. Whenever a "kind of stable" version
is ready, another tag would be super, too.

You might already have the most stable version in the mainline; and tagging it
would make it crystal clear to new users. Perhaps you have already released such
a version elsewhere, and if so, my apologies, and where does it live?

Stable is not the best word here. It just means that the project lives on GitHub
and that it has a tag. It doesn't mean that the software is perfect, it just
means that it is tagged. That tag gives users a version to settle on and go on
with their life is all.

I've used your package for a long time, love it, and so do many, many others.
This is a way to get that project out to the other thousands and thousands of
users who also rely upon MELPA stable.

All it takes is for you to create a tag, and within hours, it will show up on
MELPA stable. Here are the specs for the tag name.

Can't wait to hear about what you think and whether or not a tag is in this
project's future!

Kind regards,

Grant Rettke

java.lang.NoClassDefFoundError: org/languagetool/JLanguageTool

Hello,

This is my setup with languagetool 2.5:

java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.6) (ArchLinux build 7.u51_2.4.6-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
GNU Emacs 24.3.1

I configure it this way:

(require 'langtool)
(setq langtool-language-tool-jar "/usr/share/java/languagetool/languagetool-commandline.jar")
(setq langtool-java-bin "/usr/bin/java")
;; Set keybindings
(global-set-key "\C-x4w" 'langtool-check)
(global-set-key "\C-x4W" 'langtool-check-done)
(global-set-key "\C-x4l" 'langtool-switch-default-language)
(global-set-key "\C-x44" 'langtool-show-message-at-point)
(global-set-key "\C-x4c" 'langtool-correct-buffer)

(setq langtool-mother-tongue "fr")

But langtool-check always return me the following:

LanguageTool exited abnormally with code 1 (Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/JLanguageTool)

wrong placement

When checking a sentence, the placement of the error and of the correction is wrong.

For example:
First sentence. For instance, most of people are chinese.
However, most of people are not old.

In the first one, the " most of peopl" will be highlighted and the correction will lead to " For instance,most of the peoplee"… which is just bad.
But the second one will be correct. This only appear if one or more sentence are contained in the line.

Eventually, the last example:
First sencence. Second sentence but a bit longer. For instance, most of people are using Emacs.

In this case, the last sentence is matched as "t most of peop".

To sum up:
The position of the mistake is good in the first sentence of the line.
The position of the mistakes in sentences after the first one will shift on the right by 1 caracter on the left for each sentence.

Small change required in the documentation?

Hello,

I've started playing with LanguageTool and Emacs-langtool yesterday. I could not make Emacs-langtool work until few minutes ago when I realized that:

(setq langtool-language-tool-jar "/path/to/LanguageTool.jar")

on line 14 of README.md, should be (at least for me):

(setq langtool-language-tool-jar "/path/to/languagetool-commandline.jar")

Now it looks really great!

Many tanks and Happy New Year!

Christophe

Checking a narrowed org subtree confuses langtool

Open a narrowed org subtree in a separate window or frame and launch langtool-check.

The highlighted areas will be shifted to a position that counts from the beginning of the original buffer, not of that narrowed buffer.

So all the highlighted areas will not correspond to the area that has a problem and the correction will be applied to the wrong area.

Archlinux and languagetool-server

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:

  • Archlinux
  • emacs 26.1 with spacemacs
  • languagetool 4.4

Is there a way to use Emacs-langtool with already running Langtool server?

I am starting a Langtool-server with my system start, which, I guess, leads to the error message

langtool-server--rendezvous: Failed to start LanguageTool Server.

when I am setting langtool-language-tool-server-jar. I can use langtool-server-user-arguments to start a second LanguageTool server instance, but I think it would be nicer to reuse the already running instance.

Ability to use LangTool launcher

Currently langtool-language-tool-jar or langtool-java-classpath setting is required.

But e.g. Gentoo distro provide executable standalone launcher for LangTool, running it manually without that is a pain.

So consider adding a way to use standalone LangTool launcher to work and just set it's path, say /usr/bin/languagetool.

Option to set classpath

I'm working on Arch Linux, and the way that packages install, they don't expose the proper classpaths using environment variables, but instead create wrapper scripts that contain the proper "-cp /some/path/here:/another/path/" in the command

for example:

#!/bin/bash
[...]
CP=/usr/share/languagetool
for name in /usr/share/java/languagetool/*.jar ; do
  CP=$CP:$name
done
[...]
CLI_command='org.languagetool.commandline.Main'
[...]
"$JAVA_HOME/bin/java" -cp $CP $CLI_command"

So whenever I try to run langtool-check or any of the other commands I get a rather lengthy "NoClassDefFoundError", and I can't set langtool-java-bin as the command with the classpath added, since langtool.el checks whether the set binary exists or not.

I was thinking this could be avoided by having some sort of variable like "langtool-java-classpath" that is empty by default, and then checking whether it's empty. If not, a "-cp " (langtool-java-classpath) could be added to the args list on line 251.

java command is not found

When using the "M-x langtool-check" command, I receive the error "java command not found"

This is my .emacs file:
(add-to-list 'load-path "~/.emacs.d/LanguageTool-4.3/") (setq langtool-java-bin "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin") (setq langtool-language-tool-jar "~/.emacs.d/LanguageTool-4.3/languagetool-commandline.jar") (setq langtool-default-language "en-US") (require 'langtool)

I installed the melpa package, java and downloaded version 4.3 of langtool.
There´s nothing wrong with the langtool download, as it works perfectly fine from the command-line. What am I doing wrong?

Not working in emacs 24

It doesn't seem to work on emacs24 with the latest version of LangTool.
Some times it shows "LanguageTool finished with code 1"

I have installed java 1.7 and the LangTool works fine in server mode setting with TexStudio.

Setting langtool-bin not respected in langtool--checker-mode

I am using NixOs where langtool is wrapped in a bash script to have a specific version an java available so I need (not strictly necessary but huuuge hacks otherwise) to use langtool-bin. However, setting this doesn't work given that langtool--checker-mode does not check this setting.

Don't check comented regions

I am using LanguageTool in LaTeX text. I guess that the integration with AUCTeX will be complicated, but I think that maybe it would be easy to implement the ability to skip commented regions.

Running Under Cygwin

Hello!

I recently started using Cygwin for some of my development on Windows and I noted that there are a number of issues with running ´langtool` under that platform:

  • Java requires the .jar path's to be specified in Windows syntax (C:\User\...). However, there is a file existance test for it as well where the path must be given in Cygwin syntax (/cygdrive/c/...)
    • This can However be circumvented by using the class-path and setting it to the proper Cygwin syntax.
  • When writing to the temporary process buffer, newlines are written as "\r\n" rather than just "\n". This causes the langtool-output-regexp to fail to match anything when creating the overlays.
    • The simplest fix for this is to simply clear all trailing whitespace when filtering the process output with the (delete-trailing-whitespace) function.
    • You could also change the langtool-output-regexp to match carriage returns ("\r?\n" rather than "\n"). This might be more effective in practice.

I may be able to generate a pull request that solves this soon.

Langtool with Emacspeak

Good day,

Emacspeak is a tool for Emacs which allows Emacs to be used by people who are blind. It uses Advise to know what Emacs is doing. I'm trying to use this with Langtool, and it works a little. The issues I'm having are:

  • When I do C-x 4 c, (langtool-correct-buffer), Emacspeak just reads the bottom of the mini buffer, where instructions for how to use the buffer are, not the actual error or corrections.
  • I can find out what the error is by doing C-x 4 4, (langtool-show-message-at-point), but the error isn't spoken unless I have Emacspeak speak the last thing in the Messages buffer (emacspeak-speak-message-again), bound to C-e a. I can then hear the problem, and do C-4 c 0, which hopefully corrects it. If not, I hear an error sound from Emacspeak, and can try to correct it manually.

So, what I'm asking is, can these two things be fixed? Can lang-tool be used with the function ispell uses for langtool-correct-buffer? And can langtool-show-message-at-point use the regular print function? This works well when the langtool-correct-buffer finishes, and langtool says that there are errors or not, but not when using langtool to show message at point.

I'm sorry if this isn't as specific as you need. I'm not a programmer, just a writer that finds Emacs more useful than any modern text editor. Langtool has been very useful already. I've found uncapitalized sentences, grammar problems, and more that I wouldn't have with other tools.

German messages have display problems on windows.

Hello,

I have an issue with the output coming from LanguageTool not displaying correctly.
I'm using the German language, langtool 1.5.1 on Windows 8.1 with emacs 25.2 and LanguageTool 3.7.

The issue appears with umlauts and the "ß" character, as shown below (and probably unicode characters in other languages).

issue

To fix the issue I took the second example from here and modified langtool as follows to switch java encoding to UTF-8:

diff --git a/langtool.el b/langtool.el
index 029bba4..b6aaad5 100644
--- a/langtool.el
+++ b/langtool.el
@@ -626,7 +626,9 @@ Ordinary no need to change this."
                                  "org.languagetool.commandline.Main")
                            args))
       (setq args (append
-                  (list "-jar" (langtool--process-file-name langtool-language-tool-jar))
+                  (list "-Dfile.encoding=UTF-8"
+                        "-jar"
+                        (langtool--process-file-name langtool-language-tool-jar))
                   args)))
     (when langtool-mother-tongue
       (setq args (append args (list "-m" langtool-mother-tongue))))

fixed

How do I correct word at point?

I only see the function langtool-correct-buffer, but I just want to correct the word my cursor is currently hovering over.

Is there something like langtool-correct-word-at-point?

LanguageTool exited abnormally

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)

LangTool command does not work

I am using use-package to load langtool. This is my configuration.

(use-package langtool
  :ensure t
  :init
  (setq langtool-language-tool-jar (concat user-emacs-directory "packages/LanguageTool-3.0/languagetool-commandline.jar")
        langtool-java-classpath (concat user-emacs-directory "packages/LanguageTool-3.0")
        langtool-default-language "en-US"
        langtool-java-bin "/usr/bin/java"))

However, when I invoke langtool-check on a buffer, I get the following error:

Error: Could not find or load main class org.languagetool.commandline.Main.

I am using langtool for desktop. Is this what I should use?

I enabled langtool debug, here is the output:

/usr/bin/java: (-cp ~/.emacs.d/packages/LanguageTool-3.0 org.languagetool.commandline.Main -c ascii -l en-US -d -m en <xxx.txt>)

However, the following command works from the terminal:
/usr/bin/java -jar languagetool-commandline.jar -c ascii -l en-US -d -m en <xxx.txt>

LangTool command does not work

Hey,

I'm trying to get LangTool to work on my Emacs.
I'm using Mac, and have java 8 installed.
Got language tool from the official site, and Emacs-langtool from Melpa (version 20160116.1654).

I followed the readme, and tried each of the alternatives. Here's my current setup:

(use-package langtool  
:ensure t  
:init  
(setq langtool-language-tool-jar "~/Downloads/LanguageTool-3.2/languagetool-commandline.jar")  
(setq langtool-default-language "en-US"))

I always get the same error message:

LanguageTool exited abnormally with code 1 (Exception in thread "main" java.lang.NoClassDefFoundError: org/languagetool/commandline/Main)

I'm sure configuring something wrong, but can't figure out what.

Thanks. Yaniv

[Feature] Remove `mode-line-message` on finish

Hey dood,

The mode-line-message clutters the mode line in my use case once it is done. I've used langtool-finish-hook to remove the entry `(t langtool-mode-line-message). I think this falls to the library to provide a means or option for this but this is just a minor request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.