Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
37 lines
1.2 KiB
EmacsLisp
37 lines
1.2 KiB
EmacsLisp
;;; feature/spellcheck/config.el -*- lexical-binding: t; -*-
|
|
|
|
(defvar-local +spellcheck-immediately t
|
|
"If non-nil, spellcheck the current buffer upon starting `flyspell-mode'.
|
|
|
|
Since spellchecking can be slow in some buffers, this can be disabled with:
|
|
|
|
(setq-hook! 'LaTeX-mode-hook +spellcheck-immediately nil)")
|
|
|
|
(def-package! flyspell ; built-in
|
|
:defer t
|
|
:init
|
|
(add-hook 'flyspell-mode-hook #'+spellcheck|immediately)
|
|
:config
|
|
(setq ispell-program-name (executable-find "aspell")
|
|
ispell-list-command "--list"
|
|
ispell-extr-args '("--dont-tex-check-comments"))
|
|
|
|
(defun +spellcheck|immediately ()
|
|
"Spellcheck the buffer when `flyspell-mode' is enabled."
|
|
(when (and flyspell-mode +spellcheck-immediately)
|
|
(flyspell-buffer))))
|
|
|
|
|
|
(def-package! flyspell-correct
|
|
:commands (flyspell-correct-word-generic
|
|
flyspell-correct-previous-word-generic)
|
|
:config
|
|
(cond ((featurep! :completion helm)
|
|
(require 'flyspell-correct-helm))
|
|
((featurep! :completion ivy)
|
|
(require 'flyspell-correct-ivy))
|
|
(t
|
|
(require 'flyspell-correct-popup)
|
|
(setq flyspell-popup-correct-delay 0.8)
|
|
(define-key popup-menu-keymap [escape] #'keyboard-quit))))
|
|
|