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

;;; Code:

(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")
  (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