From 00df579c6718a322e3a346ea62291856ecd0c480 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 2 Nov 2023 16:56:50 +0000 Subject: [PATCH] Fix (hopefully) enabling flyspell automatically --- home/emacs/modules/custom-defaults-config.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/home/emacs/modules/custom-defaults-config.el b/home/emacs/modules/custom-defaults-config.el index 3fd8b814..6cd02f67 100644 --- a/home/emacs/modules/custom-defaults-config.el +++ b/home/emacs/modules/custom-defaults-config.el @@ -30,10 +30,9 @@ (keymap-set global-map "C-c p d" #'package-delete) ;; turn on spell checking, if available. -(with-eval-after-load 'ispell - (when (executable-find ispell-program-name) - (add-hook 'text-mode-hook #'flyspell-mode) - (add-hook 'prog-mode-hook #'flyspell-prog-mode))) +(when (and (require 'ispell nil :noerror) (executable-find ispell-program-name)) + (add-hook 'text-mode-hook #'flyspell-mode) + (add-hook 'prog-mode-hook #'flyspell-prog-mode)) ;; Make shebang (#!) file executable when saved (add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p)