[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: load a minor mode automatically
From: |
Kai Großjohann |
Subject: |
Re: load a minor mode automatically |
Date: |
Fri, 14 Feb 2003 18:35:23 +0100 |
User-agent: |
Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 |
Luca Ferrari <fluca1978@libero.it> writes:
> I'm a newbie of Emacs, I've tried to find my solution on the Emacs manual,
> but I can't:
> how to load automatically a minor mode modifing my .emacs file?
Maybe it's easier if you describe which minor mode you want and under
which circumstances.
For example, to enable auto-fill (it's a minor mode) for all
text-like modes (major modes), do this:
(add-hook 'text-mode-hook 'turn-on-auto-fill)
Other minor modes might not have a turn-on function. (Does auto-fill
turn you on? ;-) So you have to write it yourself:
(defun luca-turn-on-foo-mode ()
(foo-mode 1))
Let's say you want to enable foo-mode for C++ mode, then you need the
above, plus:
(add-hook 'c++-mode-hook 'luca-turn-on-foo-mode)
--
A turnip curses Elvis