summary refs log tree commit diff stats
path: root/lisp/+flyspell-correct.el
blob: f4fc956a25389f1d40a7b901cb4ef45fecc3920a (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