diff --git a/core/prelude-editor.el b/core/prelude-editor.el index cb137ec..8e54be4 100644 --- a/core/prelude-editor.el +++ b/core/prelude-editor.el @@ -218,8 +218,14 @@ (when (and prelude-flyspell (executable-find ispell-program-name)) (flyspell-mode +1))) -(add-hook 'message-mode-hook 'prelude-enable-flyspell) +(defun prelude-enable-whitespace () + (when prelude-whitespace + ;; keep the whitespace decent all the time (in this buffer) + (add-hook 'before-save-hook 'whitespace-cleanup nil t) + (whitespace-mode +1))) + (add-hook 'text-mode-hook 'prelude-enable-flyspell) +(add-hook 'text-mode-hook 'prelude-enable-whitespace) ;; enable narrowing commands (put 'narrow-to-region 'disabled nil) diff --git a/modules/prelude-programming.el b/modules/prelude-programming.el index e3c9dd0..fbdd4be 100644 --- a/modules/prelude-programming.el +++ b/modules/prelude-programming.el @@ -116,10 +116,7 @@ (flyspell-prog-mode)) (when prelude-guru (guru-mode +1)) - (when prelude-whitespace - ;; keep the whitespace decent all the time (in this buffer) - (add-hook 'before-save-hook 'whitespace-cleanup nil t) - (whitespace-mode +1)) + (prelude-enable-whitespace) (flycheck-mode +1) (prelude-local-comment-auto-fill) (prelude-add-watchwords))