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: 2 months ago
JSON representation
Spell check in Emacs using Flycheck/Flymake and Aspell
- Host: GitHub
- URL: https://github.com/leotaku/flycheck-aspell
- Owner: leotaku
- License: gpl-3.0
- Created: 2019-05-26T12:17:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-25T21:02:28.000Z (over 1 year ago)
- Last Synced: 2025-03-16T06:32:55.152Z (over 1 year ago)
- Topics: aspell, emacs, flycheck, spellcheck
- Language: Emacs Lisp
- Homepage:
- Size: 335 KB
- Stars: 43
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README-FLYCHECK.md
- License: LICENSE
Awesome Lists containing this project
README
# flycheck-aspell
[](https://spdx.org/licenses/GPL-3.0-or-later.html)
[](https://github.com/leotaku/flycheck-aspell/actions)
[](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)))
```