Skip to content

Commit

Permalink
Tie flyspell-prog-mode to prog-mode in Emacs >= 24
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Feb 28, 2013
1 parent f7dd176 commit bf7107a
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions init-flyspell.el
@@ -1,27 +1,29 @@
;;----------------------------------------------------------------------------
;; Add spell-checking in comments for all programming language modes
;;----------------------------------------------------------------------------
(dolist (hook '(lisp-mode-hook
emacs-lisp-mode-hook
scheme-mode-hook
clojure-mode-hook
ruby-mode-hook
yaml-mode
python-mode-hook
shell-mode-hook
php-mode-hook
css-mode-hook
haskell-mode-hook
caml-mode-hook
nxml-mode-hook
crontab-mode-hook
perl-mode-hook
tcl-mode-hook
javascript-mode-hook))
(add-hook hook 'flyspell-prog-mode))
(add-hook 'nxml-mode-hook
(lambda ()
(add-to-list 'flyspell-prog-text-faces 'nxml-text-face)))
(if (fboundp 'prog-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
(dolist (hook '(lisp-mode-hook
emacs-lisp-mode-hook
scheme-mode-hook
clojure-mode-hook
ruby-mode-hook
yaml-mode
python-mode-hook
shell-mode-hook
php-mode-hook
css-mode-hook
haskell-mode-hook
caml-mode-hook
nxml-mode-hook
crontab-mode-hook
perl-mode-hook
tcl-mode-hook
javascript-mode-hook))
(add-hook hook 'flyspell-prog-mode)))

(eval-after-load 'flyspell
'(add-to-list 'flyspell-prog-text-faces 'nxml-text-face))


(provide 'init-flyspell)

0 comments on commit bf7107a

Please sign in to comment.