-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-spell.el
44 lines (36 loc) · 1.15 KB
/
my-spell.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; my-spell.el --- Spelling customisation
;;
;;; Commentary:
;;
;; I prefer using aspell as it is utf-8 safe
;;
;;; Code:
(require 'my-utils)
(use-package ispell
:config
(let ((spell-path (which-lookup '("aspell" "ispell")))) ; aspell is preferred
(when spell-path
(setq ispell-program-name spell-path
ispell-dictionary "british"))))
(use-package flyspell
:commands (flyspell-mode flyspell-prog-mode)
:after ispell
:diminish "fs"
:hook ((text-mode . turn-on-flyspell)
(prog-mode . flyspell-prog-mode)))
(defun turn-on-flyspell ()
"Force 'flyspell-mode' on using a positive arg. For use in hooks."
(interactive)
(flyspell-mode 1))
(defun my-highlight-non-possessive-its ()
"Turn on hi-lock mode for any (potentially incorrect) usage of it's"
(interactive)
(hi-lock-face-phrase-buffer "it's"))
(use-package hi-lock
:commands hi-lock-face-phrase-buffer
:hook ((text-mode . my-highlight-non-possessive-its)
(prog-mode . my-highlight-non-possessive-its))
:config (eval-after-load "hi-lock"
'(assq-delete-all 'hi-lock-mode minor-mode-map-alist)))
(provide 'my-spell)
;;; my-spell.el ends here