Skip to content

Commit

Permalink
Release version 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PillFall committed Jun 21, 2021
2 parents 21ad874 + 4f86efb commit e7d02a6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 17 deletions.
6 changes: 5 additions & 1 deletion ChangeLog.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= Change Log
Joar Buitago <jebuitragoc@unal.edu.co>
v0.4.0, 2020-01-21
v0.4.1, 2020-01-21

All notable changes to this project will be documented in this file.

Expand All @@ -13,6 +13,10 @@ link:https://semver.org/spec/v2.0.0.html[Semantic Versioning].

== [Unreleased]

== [0.4.1]
=== Fixed
* Support for using class files directly. (Fix #3)

== [0.4.0]
=== Added
* LanguageTool Server Mode has a delay of two secconds before checking
Expand Down
36 changes: 24 additions & 12 deletions ReadMe.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
= languagetool.el
Joar Buitago <jebuitragoc@unal.edu.co>
v0.4.0, 2020-01-21
v0.4.1, 2020-01-21

[.text-center]
--
Expand All @@ -9,7 +9,11 @@ link:https://stable.melpa.org/\#/languagetool[image:https://stable.melpa.org/pac
image:https://github.com/PillFall/Emacs-LanguageTool.el/workflows/build/badge.svg[build]
--

Use LanguageTool as your Emacs grammar and spelling corrector.
Use LanguageTool as your Emacs grammar, spelling and styling
corrector.

.Package in action. Text from https://languagetool.org/
image::https://i.stack.imgur.com/1oqM7.png[Package in action]

This package was based on
link:https://github.com/mhayashi1120/Emacs-langtool/[mhayashi1120
Expand All @@ -23,28 +27,34 @@ supports more than 30 languages.



== Getting Started
== Installation

=== Obtaining the prerequisites

The first thing you need is *Java*, so download and install it.

You also need to download
*link:https://languagetool.org/download/[LanguageTool]* from its
official page.

After download, extract the contents in the folder you want
(e.g. `~/.languagetool/`). Now you will need to say to the package
where is the `languagetool-commandline.jar` file in your `.emacs` file
like:
After download, extract the contents in a folder you want
(e.g. `~/.languagetool/`).

[source,lisp]

=== Configuring the package

Next you need to set the package configuration. First we add the path
to the `languagetool-commandline.jar` file in your `.emacs` file like:

[source, lisp]
----
(setq languagetool-language-tool-jar
"~/.languagetool/languagetool-commandline.jar")
----

Or via customize. It's highly encouraged to use full path instead.

If you are going to use the LanguageTool HTML Server instead, you need
If you are going to use the LanguageTool HTTP Server instead, you need
to add to your `.emacs` file:

[source, lisp]
Expand All @@ -57,15 +67,15 @@ to add to your `.emacs` file:
It's recommended to add a Java flag to process the files in UTF-8, so
you should add to your `.emacs`:

[source,lisp]
[source, lisp]
----
(setq languagetool-java-arguments '("-Dfile.encoding=UTF-8"))
----

And finally you should tell which language are you using by default in
your `.emacs` file like:

[source,lisp]
[source, lisp]
----
(setq languagetool-default-language "en-GB")
----
Expand Down Expand Up @@ -101,7 +111,7 @@ correction buffer at the minibuffer, you only need to choose.

Or you can use a LanguageTool HTTP Server with
`languagetool-server-mode`. In this mode the function
`languagetool-check` will be undefinded in the current buffer to
`languagetool-check` will be undefined in the current buffer to
prevent checking with another tool. `languagetool-clear-buffer`
clears and recheck the buffer in case of needed. The other functions
works as usual.
Expand All @@ -127,6 +137,8 @@ e.g.
;; or
(setq languagetool-java-arguments '("-flag" "argumentforflag")
----
* `languagetool-language-tool-class` Tell the package that the package
will use the class files directly. Set to `nil` by default.
* `languagetool-language-tool-jar` Sets the path of the LanguageTool
command line jar file. It's recommended to put the full path.
* `languagetool-language-tool-arguments` Sets arguments to pass to
Expand Down
2 changes: 1 addition & 1 deletion languagetool-issue-faces.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Joar Buitrago <jebuitragoc@unal.edu.co>
;; Keywords: grammar text docs tools convenience checker
;; URL: https://github.com/PillFall/Emacs-LanguageTool.el
;; Version: 0.4.0
;; Version: 0.4.1
;; Package-Requires: ((emacs "25.1") (request "0.3.2"))

;; This program is free software; you can redistribute it and/or modify
Expand Down
16 changes: 14 additions & 2 deletions languagetool.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Joar Buitrago <jebuitragoc@unal.edu.co>
;; Keywords: grammar text docs tools convenience checker
;; URL: https://github.com/PillFall/Emacs-LanguageTool.el
;; Version: 0.4.0
;; Version: 0.4.1
;; Package-Requires: ((emacs "25.1") (request "0.3.2"))

;; This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -39,6 +39,7 @@

(require 'json)
(require 'request)
(eval-when-compile (require 'subr-x))



Expand Down Expand Up @@ -74,6 +75,14 @@ recommends to use:

;; Variables related to LanguageTool Command Line:

(defcustom languagetool-language-tool-class nil
"Tells if the package is using the LanguageTool classes directly.
When nil this package will use the -jar flag in java, and will
omit it from arguments otherwise."
:group 'languagetool
:type 'boolean)

(defcustom languagetool-language-tool-jar nil
"Path to LanguageTool Command Line jar file."
:group 'languagetool
Expand Down Expand Up @@ -267,6 +276,7 @@ Its not recommended to run this function more than once."
(start-process "*LanguageTool Server*"
buffer
languagetool-java-bin
(string-join languagetool-java-arguments " ")
"-cp"
languagetool-server-language-tool-jar
"org.languagetool.server.HTTPServer"
Expand Down Expand Up @@ -469,7 +479,9 @@ the call of LanguageTool when correcting the text."
(setq arguments (append arguments (list arg))))

;; Appends the LanguageTool jar path
(setq arguments (append arguments (list "-jar" languagetool-language-tool-jar)))
(unless languagetool-language-tool-class
(setq arguments (append arguments (list "-jar"))))
(setq arguments (append arguments (list languagetool-language-tool-jar)))

;; Appends the LanguageTool arguments
(dolist (arg languagetool-language-tool-arguments)
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
EMACS = emacs

EMACS_FLAGS = -Q --batch -f package-initialize -L . -f batch-byte-compile
EMACS_FLAGS = -Q --batch --eval "(setq byte-compile-error-on-warn t)" -f package-initialize -L . -f batch-byte-compile

SOURCES = $(filter-out %-autoloads.el %-pkg.el, $(wildcard *.el))

Expand Down

0 comments on commit e7d02a6

Please sign in to comment.