d12frosted / flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Other
202 stars 14 forks source link

expose flyspell-correct-ivy-map and result #72

Closed d12frosted closed 4 years ago

d12frosted commented 4 years ago

Fixes #58

This change allows users to hook into the interface and modify result to their liking. As example, one can define a key binding for skipping a word:

(defun flyspell-correct-ivy-skip ()
  (interactive)
  (ivy-exit-with-action
   (lambda (_) (setq flyspell-correct-ivy--result (cons 'skip "")))))

(define-key flyspell-correct-ivy-map (kbd "C-;") #'flyspell-correct-ivy-skip)

But please be careful when modifying flyspell-correct-ivy--result. While it's structure rarely change, it does change time to time. See flyspell-correct-interface for more information.