diff --git a/_setup.sh b/_setup.sh index 3fbd063..16314d8 100755 --- a/_setup.sh +++ b/_setup.sh @@ -22,4 +22,6 @@ fi cat ~/.emacs-profiles.el echo "run emacs with each profile in '~/.emacs-profiles.el'" echo "install multimarkdown (windows bin release + add to emacs path like sqlite3)" -echo "pacman -Ss mingw-w64-x86_64-{emacs,emacs-pdf-tools-server,imagemagick} in msys2" +echo "pacman -S mingw-w64-x86_64-{emacs,emacs-pdf-tools-server,imagemagick} in msys2" +echo "pacman -S mingw-w64-x86_64-texlive-full in msys2" +echo "pacman -S mingw-w64-x86_64-aspell mingw-w64-x86_64-hunspell mingw-w64-x86_64-hunspell-en in msys2" diff --git a/common/_global.el b/common/_global.el index b21b507..07de9a4 100644 --- a/common/_global.el +++ b/common/_global.el @@ -395,38 +395,40 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; flyspell -;(require 'flyspell) -;(setenv "LANG" "en_US") +(require 'flyspell) +(setenv "LANG" "en_US") ;(setenv "DICPATH" "~/.emacs.d.profiles/common/dictionaries") ; https://github.com/wooorm/dictionaries -;(setq ispell-program-name "hunspell") -;(setq ispell-dictionary "en") -; -;(defun flyspell-on-for-buffer-type () -; "Enable Flyspell appropriately for the major mode of the current buffer. Uses `flyspell-prog-mode' for modes derived from `prog-mode', so only strings and comments get checked. All other buffers get `flyspell-mode' to check all text. If flyspell is already enabled, does nothing." -; (interactive) -; (if (not (symbol-value flyspell-mode)) ; if not already on -; (progn -; (if (derived-mode-p 'prog-mode) -; (progn -; (message "Flyspell on (code)") -; (flyspell-prog-mode)) -; ;; else -; (progn -; (message "Flyspell on (text)") -; (flyspell-mode 1))) -; ;; I tried putting (flyspell-buffer) here but it didn't seem to work -; ))) -; -; (defun flyspell-toggle () -; "Turn Flyspell on if it is off, or off if it is on. When turning on, it uses `flyspell-on-for-buffer-type' so code-vs-text is handled appropriately." -; (interactive) -; (if (symbol-value flyspell-mode) -; (progn ; flyspell is on, turn it off -; (message "Flyspell off") -; (flyspell-mode -1)) -; ; else - flyspell is off, turn it on -; (flyspell-on-for-buffer-type))) -; -;(add-hook 'find-file-hook 'flyspell-on-for-buffer-type) -;(add-hook 'text-mode-hook 'flyspell-on-for-buffer-type) -;(add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type) +(setq ispell-program-name "hunspell") +(setq ispell-dictionary "en_US") + +(global-set-key (kbd "C-c y") 'flyspell-toggle ) + +(defun flyspell-on-for-buffer-type () + "Enable Flyspell appropriately for the major mode of the current buffer. Uses `flyspell-prog-mode' for modes derived from `prog-mode', so only strings and comments get checked. All other buffers get `flyspell-mode' to check all text. If flyspell is already enabled, does nothing." + (interactive) + (if (not (symbol-value flyspell-mode)) ; if not already on + (progn + (if (derived-mode-p 'prog-mode) + (progn + (message "Flyspell on (code)") + (flyspell-prog-mode)) + ;; else + (progn + (message "Flyspell on (text)") + (flyspell-mode 1))) + ;; I tried putting (flyspell-buffer) here but it didn't seem to work + ))) + + (defun flyspell-toggle () + "Turn Flyspell on if it is off, or off if it is on. When turning on, it uses `flyspell-on-for-buffer-type' so code-vs-text is handled appropriately." + (interactive) + (if (symbol-value flyspell-mode) + (progn ; flyspell is on, turn it off + (message "Flyspell off") + (flyspell-mode -1)) + ; else - flyspell is off, turn it on + (flyspell-on-for-buffer-type))) + +(add-hook 'find-file-hook 'flyspell-on-for-buffer-type) +(add-hook 'text-mode-hook 'flyspell-on-for-buffer-type) +(add-hook 'after-change-major-mode-hook 'flyspell-on-for-buffer-type)