summary refs log tree commit diff stats
path: root/lisp/+flyspell-correct.el
blob: 22f8c8252a1b29b10a33374843b5b1448ba6692b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;;; +flyspell-correct.el ---                         -*- lexical-binding: t; -*-

;;; Code:

(require 'flyspell-correct)

(defun +flyspell-correct-buffer (&optional prefix)
  "Run `flyspell-correct-wrapper' on all misspelled words in the buffer.
With PREFIX, prompt to change the current dictionary."
  (interactive "P")
  (flyspell-buffer)
  (when prefix
    (let ((current-prefix-arg nil))
      (call-interactively #'ispell-change-dictionary)))
  (+with-message "Checking spelling"
    (flyspell-correct-move (point-min) :forward :rapid)))

(defun +flyspell-correct-buffer-h (&rest _)
  "Run `+flyspell-correct-buffer'.
This is suitable for placement in a hook."
  (+flyspell-correct-buffer))

(provide '+flyspell-correct)
;;; +flyspell-correct.el ends here