From 19717e5cb09e61df9435d5d61d31ca1506b5c823 Mon Sep 17 00:00:00 2001 From: "Alison G. Watson" Date: Fri, 2 Oct 2020 13:40:33 -0600 Subject: [PATCH] emacs: don't attempt to use flyspell on windows --- emacs/early-init.el | 10 ++++++++-- emacs/init.el | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/emacs/early-init.el b/emacs/early-init.el index 4fbfa48..4fe0013 100644 --- a/emacs/early-init.el +++ b/emacs/early-init.el @@ -12,8 +12,14 @@ initial-scratch-message nil mark-ring-max 1024)) -(when (string-equal system-type "windows-nt") - (setenv "PATH" (concat "C:/emacs/bin;" (getenv "PATH")))) +(if (eq system-type 'windows-nt) + (progn + (setenv "PATH" (concat "C:/emacs/bin;" (getenv "PATH"))) + (defalias 'agw-flyspell-mode #'ignore) + (defalias 'agw-flyspell-prog-mode #'ignore)) + (progn + (defalias 'agw-flyspell-mode #'flyspell-mode) + (defalias 'agw-flyspell-prog-mode #'flyspell-prog-mode))) ;; important ergonomics (setq fill-column 80 diff --git a/emacs/init.el b/emacs/init.el index a285a95..3bb99b8 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -21,13 +21,13 @@ (set-scroll-bar-mode nil) ;; `prog-mode' -(add-hook 'prog-mode-hook #'flyspell-prog-mode) +(add-hook 'prog-mode-hook #'agw-flyspell-prog-mode) (add-hook 'prog-mode-hook #'prettify-symbols-mode) (add-hook 'prog-mode-hook #'subword-mode) (add-hook 'prog-mode-hook #'agw-prog-mode) ;; `text-mode' -(add-hook 'text-mode-hook #'flyspell-prog-mode) +(add-hook 'text-mode-hook #'agw-flyspell-prog-mode) (add-hook 'text-mode-hook #'subword-mode) (add-hook 'text-mode-hook #'agw-prog-mode) @@ -153,7 +153,7 @@ (use-package markdown-mode :ensure t - :hook ((markdown-mode . flyspell-mode)) + :hook ((markdown-mode . agw-flyspell-mode)) :mode (("\\.mdwn\\'" . markdown-mode))) (use-package ninja-mode @@ -173,7 +173,7 @@ ;; org-mode (use-package org - :hook ((org-mode . flyspell-mode) + :hook ((org-mode . agw-flyspell-mode) (org-mode . agw-org-mode)) :init (setq org-fontify-whole-heading-line t