Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tie flyspell-prog-mode to prog-mode in Emacs >= 24

  • Loading branch information...
commit bf7107ae58a198b3fbc561a437177e32b2c27bd5 1 parent f7dd176
@purcell authored
Showing with 23 additions and 21 deletions.
  1. +23 −21 init-flyspell.el
View
44 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)
Please sign in to comment.
Something went wrong with that request. Please try again.