aboutsummaryrefslogtreecommitdiffstats

Integrate the french grammar and typography checker Grammalecte with flycheck to automatically look for mistakes in your writings. It also provides an easy way to find synonyms and antonyms for a given word (to avoid repetitions for exemple). This package is of very little interest for other languages.

Installation

This package has a strong dependency on python3. The installation of the right version of python is up to you.

Flycheck grammalecte is available on MELPA stable and unstable. Please read the Installing Package documentation from the EmacsWiki to know more how to install a package. A manual installation procedure exists too if you prefer.

To enable it, simply add the following line somewhere in your GNU Emacs config file:

Finally, the last expected step is to download the CLI & Server upstream package. Just enter the following command: M-x flycheck-grammalecte-download-grammalecte

Usage

Enable flycheck in a buffer, which major mode is declared in flycheck-grammalecte-enabled-modes, and voilà!

To correct a word or expression at point, you can use the command flycheck-grammalecte-correct-error-at-point, which is bind to C-c ! g by default1. You can also right-click on it and a menu will popup to let you choose the better correction.

If you are looking for a better word at some place, you can use the function flycheck-grammalecte-find-synonyms-at-point (which will take the word at point to find synonyms and antonyms) or the simpler flycheck-grammalecte-find-synonyms (which will ask you for a word before doing the search). Pro tip: these functions are available even in buffer, which major mode is not in the flycheck-grammalecte-enabled-modes list.

Configuration

All options are accessibles with customize. In GNU Emacs, enter M-x customize, then click on Editing, then I18n, and finally on Flycheck Grammalecte.

You can also set these variables in your GNU Emacs config file. Configuration must occurs before calling flycheck-grammalecte-setup. In that case, don't forget to first require flycheck-grammalecte to prefill its variables. For exemple:

Here is a quick reference of the available variables:

flycheck-grammalecte-report-spellcheck
If this variable is set to nil, Flycheck will not report spellchecking error. Only grammar errors will be notified. nil is the default value as you should better use flyspell or ispell.
flycheck-grammalecte-report-grammar
If this variable is set to nil, Flycheck will not report grammar error. Only spellchecking errors will be notified. Default is t.
flycheck-grammalecte-report-apos
If this variable is set to nil, Flycheck will not report typographical apostrophes (’) error. This can be usefull when your main editor mode manage apostrophe by itself (like LaTeX, org-mode export…). Default is t.
flycheck-grammalecte-report-nbsp
If this variable is set to nil, Flycheck will not report non-breakable spaces error. This can be usefull when your main editor mode manage spaces by itself (like LaTeX, org-mode export…). Default is t.
flycheck-grammalecte-report-esp
If this variable is set to nil, Flycheck will not report useless spaces and tabs error. This can be usefull when your main editor mode manage spaces by itself (like LaTeX, org-mode export…). Default is t.
flycheck-grammalecte-enabled-modes
This variable stores the list of major modes for which flycheck-grammalecte must be used. Default is ’(latex-mode mail-mode markdown-mode message-mode mu4e-compose-mode org-mode text-mode). To add markdown mode use the following line for exemple: (add-to-list 'flycheck-grammalecte-enabled-modes 'fountain-mode)
flycheck-grammalecte-filters
Patterns for which errors in matching texts are ignored. See its documentation for details. There is also a flycheck-grammalecte~filters-by-mode variable, which allow to enable filters only for a given mode.

Breaking changes

Version 1.0

As you may have noticed, the most important change is the introduction of the function flycheck-grammalecte-setup, which didn't exist before. If you don't add it to your init file, the checker won't be added to Flycheck checkers list and will never start. Thus, you are required now to add the following line after your customization to this package:

Version 0.9

This version changes the default value of flycheck-grammalecte-report-spellcheck to nil, making now grammalecte to not report spellchecking errors. If you like the old behavior, you are now required to explicitely set this variable to t.

Credits

The original package has been written by Guilhem Doulcier.

This package would have not existed without the nice work of the people behinds the Grammalecte and the “Dictionnaire Électronique des Synonymes” projects.


  1. In fact, it is bind only to g in the flycheck-command-map, C-c ! being the flycheck default prefix.