Only attempt to spellcheck if spellchecker is found.

This commit is contained in:
tastytea 2019-03-23 06:06:42 +01:00
parent 5c96c59867
commit 2a747731a1
1 changed files with 19 additions and 18 deletions

37
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;;; Time-stamp: <2019-03-23 05:57:53 CET>
;;; Time-stamp: <2019-03-23 06:06:13 CET>
;;; Commentary:
;;; I am using this file with Emacs 26, but most of it will probably work with
@ -493,23 +493,24 @@
(whitespace-space ((nil :foreground "gray18"))))
;; Spell checking.
(unless slow-computer
(use-package flyspell
:custom
(ispell-dictionary "english")
:config
(defun my/toggle-flyspell ()
"Toggle flyspell-mode and run flyspell-buffer after activating."
(interactive)
(if (bound-and-true-p flyspell-mode)
(flyspell-mode 0)
(flyspell-mode)
(flyspell-buffer)))
:bind
("<f6>" . my/toggle-flyspell)
:hook
;; Spellcheck comments.
(prog-mode . flyspell-prog-mode)))
(if (executable-find "aspell")
(unless slow-computer
(use-package flyspell
:custom
(ispell-dictionary "english")
:config
(defun my/toggle-flyspell ()
"Toggle flyspell-mode and run flyspell-buffer after activating."
(interactive)
(if (bound-and-true-p flyspell-mode)
(flyspell-mode 0)
(flyspell-mode)
(flyspell-buffer)))
:bind
("<f6>" . my/toggle-flyspell)
:hook
;; Spellcheck comments.
(prog-mode . flyspell-prog-mode))))
;; Multiple cursors.
(use-package multiple-cursors