Skip to content

Commit

Permalink
Add support for colourful faces
Browse files Browse the repository at this point in the history
  • Loading branch information
PillFall committed May 7, 2020
1 parent 469fde7 commit 8ebcda3
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 211 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ link:https://semver.org/spec/v2.0.0.html[Semantic Versioning].

== [Unreleased]
=== Added
- Support for "Real time" check with LanguageTool server.
- Support for different error faces.

=== Fixed
- Jagged minibuffer message
Expand Down
10 changes: 8 additions & 2 deletions ReadMe.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Joar Buitago <jebuitragoc@unal.edu.co>
v0.1.2, 2020-01-21

[.text-center]
--
link:https://melpa.org/\#/languagetool[image:https://melpa.org/packages/languagetool-badge.svg[melpa]]
link:https://stable.melpa.org/\#/languagetool[image:https://stable.melpa.org/packages/languagetool-badge.svg[MELPA Stable]]
--

Use LanguageTool as your Emacs grammar and spelling corrector.

This package was based on
Expand All @@ -28,7 +34,7 @@ is the `languagetool-commandline.jar` file in your `.emacs` file like:
[source,lisp]
----
(setq languagetool-language-tool-jar
"~/.languagetool/languagetool-command-line-jar")
"~/.languagetool/languagetool-commandline-jar")
----

Or via customize. It's preferred to use full path instead.
Expand Down Expand Up @@ -76,7 +82,7 @@ correction buffer at the minibuffer, you only need to choose.

== Customizable Variables

For this package there is a few customizable variables that should be
For this package there are a few customizable variables that should be
set in order to take control of LanguageTool suggestions.

- `languagetool-java-bin` Sets the path to the JAVA executable, if it
Expand Down
86 changes: 86 additions & 0 deletions languagetool-issue-faces.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
;;; languagetool-issue-faces.el --- LanguegeTool correction faces -*- lexical-binding: t; -*-

;; Copyright (C) 2020 Joar Buitrago

;; Author: Joar Buitrago <jebuitragoc@unal.edu.co>
;; Keywords: grammar text docs tools
;; URL: https://github.com/PillFall/Emacs-LanguageTool.el
;; Version: 0.1.2
;; Package-Requires: ((emacs "25.1"))

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; LanguageTool correction faces. Get from LanguageTool API.
;;
;; Addition, Characters, Duplication, Formatting, Grammar,
;; Inconsistency, InconsistentEntities, Internationalization, Legal,
;; Length, LocaleSpecificContent, LocaleViolation, Markup,
;; Misspelling, Mistranslation, NonConformance, Numbers, Omission,
;; Other, PatternProblem, Register, Style, Terminology, Typographical,
;; Uncategorized, Untranslated, Whitespace

;;; Code:

;; Faces:

(defface languagetool-default-face
'((((class mono))
:inverse-video t
:underline t)
(((class color))
:background "yellow"
:foreground "black")
(t (:bold t)))
"Default error face."
:group 'languagetool)

(defface languagetool-misspelling-face
'((((class mono))
:inverse-video t
:underline t)
(((class color))
:background "red"
:foreground "white")
(t :bold t))
"LanguageTool misspelling error face."
:group 'languagetool)

(defface languagetool-grammar-face
'((((class mono))
:inverse-video t
:underline t)
(((class color))
:background "green"
:foreground "black")
(t :bold t))
"LanguageTool grammar error face."
:group 'languagetool)

(defface languagetool-style-face
'((((class mono))
:inverse-video t
:underline t)
(((class color))
:background "blue"
:foreground "white")
(t :bold t))
"LanguageTool style error face."
:group 'languagetool)


(provide 'languagetool-issue-faces)

;;; languagetool-issue-faces.el ends here
Loading

0 comments on commit 8ebcda3

Please sign in to comment.