Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/leotaku/flycheck-aspell

Spell check in Emacs using Flycheck/Flymake and Aspell
https://github.com/leotaku/flycheck-aspell

aspell emacs flycheck spellcheck

Last synced: 3 months ago
JSON representation

Spell check in Emacs using Flycheck/Flymake and Aspell

Awesome Lists containing this project

README

        

# flycheck-aspell

[![GitHub License](https://img.shields.io/github/license/leotaku/flycheck-aspell?logo=none&style=flat)](https://spdx.org/licenses/GPL-3.0-or-later.html)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/leotaku/flycheck-aspell/check.yml?logo=none&style=flat)](https://github.com/leotaku/flycheck-aspell/actions)
[![flycheck-aspell on MELPA](https://melpa.org/packages/flycheck-aspell-badge.svg)](https://melpa.org/#/flycheck-aspell)

## Basic usage

For natively supported modes, register your preferred checkers with Flycheck and then start `flycheck-mode` in the buffer you would like to spell-check.

```emacs-lisp
;; Ensure `flycheck-aspell' is available
(require 'flycheck-aspell)
;; If you want to check TeX/LaTeX/ConTeXt buffers
(add-to-list 'flycheck-checkers 'tex-aspell-dynamic)
;; If you want to check Markdown/GFM buffers
(add-to-list 'flycheck-checkers 'markdown-aspell-dynamic)
;; If you want to check HTML buffers
(add-to-list 'flycheck-checkers 'html-aspell-dynamic)
;; If you want to check XML/SGML buffers
(add-to-list 'flycheck-checkers 'xml-aspell-dynamic)
;; If you want to check Nroff/Troff/Groff buffers
(add-to-list 'flycheck-checkers 'nroff-aspell-dynamic)
;; If you want to check Texinfo buffers
(add-to-list 'flycheck-checkers 'texinfo-aspell-dynamic)
;; If you want to check comments and strings for C-like languages
(add-to-list 'flycheck-checkers 'c-aspell-dynamic)
;; If you want to check message buffers
(add-to-list 'flycheck-checkers 'mail-aspell-dynamic)
```

If you want to enable spell checking for a mode that is not in the above list, you should define and register an additional checker for that mode as seen below.

``` emacs-lisp
;; Because Aspell does not support Org syntax, the user has
;; to define a checker with the desired flags themselves.
(flycheck-aspell-define-checker "org"
"Org" ("--add-filter" "url")
(org-mode))
(add-to-list 'flycheck-checkers 'org-aspell-dynamic)
```

It might be wise to skim the [Flycheck docs](https://www.flycheck.org/en/latest/) to learn how to best use and configure Flycheck.

## Other configuration snippets

You may also want to advice `ispell-pdict-save` to refresh flycheck when inserting new entries into your local dictionary.
This way highlighting instantly updates when you add a previously unknown word.

```emacs-lisp
(advice-add #'ispell-pdict-save :after #'flycheck-maybe-recheck)
(defun flycheck-maybe-recheck (_)
(when (bound-and-true-p flycheck-mode)
(flycheck-buffer)))
```