help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable some modes in every buffer


From: Geralt
Subject: Re: Enable some modes in every buffer
Date: Fri, 20 Feb 2009 11:16:06 +0100

You probably don't want to start flyspell in every major mode, there
are modes like dired or shell where it just makes no sense to have
flyspell enabled and then there are the programming major modes where
you have to call flyspell-prog-mode.
I'm currently calling the following function in my .emacs:

(defun hook-flyspell-mode ()
  "Adds flyspell mode to some major modes."
  (dolist (hook '(org-mode-hook))
    (add-hook hook (lambda () (flyspell-mode 1))))
  (dolist (hook '(c-mode-hook c++-mode-hook sh-mode-hook emacs-lisp-mode-hook))
    (add-hook hook (lambda () (flyspell-prog-mode)))))


And I just add all the major modes to it in which I really want flyspell mode.





Geralt.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]