General module refactor

This commit is contained in:
Henrik Lissner 2019-03-02 01:56:32 -05:00
parent 0bd576673c
commit 7c9e96da87
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
14 changed files with 63 additions and 54 deletions

View file

@ -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))))

View file

@ -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)

View 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."))

View file

@ -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."