;;; +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
