Jinx by Daniel Mendler
How I came to it
What I use now: Hunspell
What is it?
Jinx is a fast spell-checker for Emacs. It highlights misspelled words but only of the visible portion of the buffer. I.e. it does not check the entire buffer, but only what you can see. This approach makes it fast.
Each misspelling is corrected by selecting from a list of words displayed in a completion menu.
It's easy to install and configure.
It works on its own or with Emacs's built-in spell-checker Ispell.
Jinx supports spell-checking multiple languages in the same buffer.
Jinx can flexibly ignore misspellings by face, regexps.
Jinx Jinx lets you create custom rules for ignoring misspellings using Emacs Lisp.
Jinx comes preconfigured for key Emacs major modes, including Java, Ruby, and Rust. In these modes, composite words in camelCase and PascalCase are automatically accepted.
Jinx can be installed from GNU ELPA or MELPA.
How it Works
Jinx binds directly to the native Enchant API. This avoids the slower backend process communication that Aspell requires, leading to faster spell-checking. Jinx automatically compiles jinx-mod.c
and loads the dynamic module at startup, ensuring it is ready to use without manual intervention.
Requirements
I require enchant2-devel
and pkgconf
(as I'm on Fedora)
For Debian, Ubuntu: sudo apt install libenchant-2-dev pkgconf
Configuration
You can configure Jinx to activate in one of two modes: global-jinx-mode
OR jinx-mode
;; Alternative 1: Enable Jinx globally (add-hook 'emacs-startup-hook #'global-jinx-mode) ;; Alternative 2: Enable Jinx per mode (dolist (hook '(text-mode-hook prog-mode-hook conf-mode-hook)) (add-hook hook #'jinx-mode))
Sample use-package configurations
Global
(use-package jinx :ensure t :hook (emacs-startup . global-jinx-mode) :bind (("M-$" . jinx-correct) ("C-M-$" . jinx-languages)))
Mode Specific
(use-package jinx :ensure t :hook ((text-mode-hook . jinx-mode) (prog-mode-hook . jinx-mode) (conf-mode-hook . jinx-mode)) :bind (("M-$" . jinx-correct) ("C-M-$" . jinx-languages)))
Recommended bindings
(keymap-global-set "M-$" #'jinx-correct) (keymap-global-set "C-M-$" #'jinx-languages)
British Spelling
(setq jinx-languages "en_GB") ;; Set British Spelling
Get to use with auto-correct
(defun jinx--add-to-abbrev (overlay word) "Add abbreviation to `global-abbrev-table'. The misspelled word is taken from OVERLAY. WORD is the corrected word." (let ((abbrev (buffer-substring-no-properties (overlay-start overlay) (overlay-end overlay)))) (message "Abbrev: %s -> %s" abbrev word) (define-abbrev global-abbrev-table abbrev word))) (advice-add 'jinx--correct-replace :before #'jinx--add-to-abbrev)
Commands
jinx-correct
corrects misspellings.
jinx-languages
allows you to switch between languages.
To check the whole buffer
C-u M-$
To check word before point
M-$
misspelled
To check a word not misspelled
C-u C-u M-$
Why? For example, you may wish to change "corrections" into "corrections".
The Jinx Wiki for additional Tips
Other Ways of Correcting Misspellings
With the right click mouse
The menu also offers options to save the word
- temporarily for the current session (temporarily)
- in the personal dictionary (permanently)
- ensuring the word is recognised as correct only in that particular file (ensuring the word is recognised as correct only in that particular file)
You can also modify a proposed correction.
allotriomorpc
After invoking jinx-correct
you can navigate to misspelled words with M-n
and M-p
.
Compatibility with completion UIs
Special instructions for Vertico
(add-to-list 'vertico-multiform-categories '(jinx grid (vertico-grid-annotate . 20))) (vertico-multiform-mode 1)
Assessment
- I have not gotten it to work with auto-correct yet
- It's quick
- It's easy to add new words
Supercalifragilisticexpialidocious - It's not foolproof. See example
- It's not offering always the correct spellings, e.g. Hunspell