General module refactor
This commit is contained in:
parent
0bd576673c
commit
7c9e96da87
14 changed files with 63 additions and 54 deletions
|
@ -6,6 +6,7 @@
|
|||
;;;###autodef
|
||||
(defun set-flyspell-predicate! (modes predicate)
|
||||
"TODO"
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes) +flyspell--predicate-alist)
|
||||
(add-to-list '+flyspell--predicate-alist (cons mode predicate))))
|
||||
|
||||
|
|
|
@ -19,7 +19,15 @@ Since spellchecking can be slow in some buffers, this can be disabled with:
|
|||
ispell-extra-args '("--sug-mode=ultra" "--run-together"))
|
||||
|
||||
(setq-hook! 'text-mode-hook
|
||||
ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
||||
ispell-extra-args (remove "--run-together" ispell-extra-args))
|
||||
|
||||
(defun +flyspell*setup-ispell-extra-args (orig-fun &rest args)
|
||||
(let ((ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
||||
(ispell-kill-ispell t)
|
||||
(apply orig-fun args)
|
||||
(ispell-kill-ispell t)))
|
||||
(advice-add #'ispell-word :around #'+flyspell*setup-ispell-extra-args)
|
||||
(advice-add #'flyspell-auto-correct-word :around #'+flyspell*setup-ispell-extra-args))
|
||||
|
||||
((executable-find "hunspell")
|
||||
(setq ispell-program-name "hunspell"
|
||||
|
@ -35,15 +43,7 @@ Since spellchecking can be slow in some buffers, this can be disabled with:
|
|||
nil
|
||||
utf-8)))))
|
||||
|
||||
(add-to-list 'ispell-extra-args "--dont-tex-check-comments")
|
||||
|
||||
(defun +flyspell*setup-ispell-extra-args (orig-fun &rest args)
|
||||
(let ((ispell-extra-args (remove "--run-together" ispell-extra-args)))
|
||||
(ispell-kill-ispell t)
|
||||
(apply orig-fun args)
|
||||
(ispell-kill-ispell t)))
|
||||
(advice-add #'ispell-word :around #'+flyspell*setup-ispell-extra-args)
|
||||
(advice-add #'flyspell-auto-correct-word :around #'+flyspell*setup-ispell-extra-args))
|
||||
(add-to-list 'ispell-extra-args "--dont-tex-check-comments"))
|
||||
|
||||
|
||||
;; `flyspell' (built-in)
|
||||
|
|
4
modules/tools/flyspell/doctor.el
Normal file
4
modules/tools/flyspell/doctor.el
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
(unless (or (executable-find "aspell")
|
||||
(executable-find "hunspell"))
|
||||
(warn! "Could not find aspell or hunspell. Flyspell will fall back to ispell, which may not work."))
|
|
@ -6,12 +6,7 @@
|
|||
(unless noninteractive
|
||||
(pdf-tools-install))
|
||||
|
||||
(define-key! pdf-view-mode-map
|
||||
"q" #'kill-this-buffer)
|
||||
|
||||
(when (featurep! :feature evil +everywhere)
|
||||
(evil-define-key* 'normal pdf-view-mode-map
|
||||
"q" #'kill-this-buffer))
|
||||
(map! :map pdf-view-mode-map :gn "q" #'kill-this-buffer)
|
||||
|
||||
(defun +pdf|cleanup-windows ()
|
||||
"Kill left-over annotation buffers when the document is killed."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue