diff --git a/avy.el b/avy.el index 25d89e9..0055fcb 100644 --- a/avy.el +++ b/avy.el @@ -748,6 +748,11 @@ Set `avy-style' according to COMMMAND as well." (declare-function flyspell-correct-word-before-point "flyspell") +(defcustom avy-flyspell-correct-function #'flyspell-correct-word-before-point + "Function called to correct word by `avy-action-ispell' when +`flyspell-mode' is enabled." + :type 'function) + (defun avy-action-ispell (pt) "Auto correct word at PT." (save-excursion @@ -758,7 +763,7 @@ Set `avy-style' according to COMMMAND as well." (line-beginning-position) (line-end-position))) ((bound-and-true-p flyspell-mode) - (flyspell-correct-word-before-point)) + (funcall avy-flyspell-correct-function)) ((looking-at-p "\\b") (ispell-word)) (t