checkers/spell: add +flyspell flag
spell-fu lacks support for multiple dictionaries, affix expansion, and many non-English dictionaries, so I've added back flyspell support to the spell module, but opt-in, because it is still the significantly slower option and spell-fu may support them one day. If not, tlikonen/wcheck-mode is another alternative to consider. Fixes #3813
This commit is contained in:
parent
97471f11db
commit
e3750dbf66
8 changed files with 313 additions and 111 deletions
28
modules/checkers/spell/autoload/flyspell.el
Normal file
28
modules/checkers/spell/autoload/flyspell.el
Normal file
|
@ -0,0 +1,28 @@
|
|||
;;; checkers/spell/autoload/flyspell.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +flyspell)
|
||||
|
||||
;;;###autodef
|
||||
(defalias 'flyspell-mode! #'flyspell-mode)
|
||||
|
||||
(defvar +spell--flyspell-predicate-alist nil
|
||||
"TODO")
|
||||
|
||||
;;;###autodef
|
||||
(defun set-flyspell-predicate! (modes predicate)
|
||||
"TODO"
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes) +spell--flyspell-predicate-alist)
|
||||
(add-to-list '+spell--flyspell-predicate-alist (cons mode predicate))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +spell-init-flyspell-predicate-h ()
|
||||
"TODO"
|
||||
(when-let (pred (assq major-mode +spell--flyspell-predicate-alist))
|
||||
(setq-local flyspell-generic-check-word-predicate (cdr pred))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +spell-correction-at-point-p (&optional point)
|
||||
"TODO"
|
||||
(cl-loop for ov in (overlays-at (or point (point)))
|
||||
if (overlay-get ov 'flyspell-overlay)
|
||||
return t))
|
Loading…
Add table
Add a link
Reference in a new issue