Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Best way to turn on a mode *always*?

1 view
Skip to first unread message

sebe...@spawar.navy.mil

unread,
Nov 30, 2008, 1:18:03 PM11/30/08
to
Some modes like Auto Fill mode only get turned on for a specific
buffer.
When you change buffers you are NOT in Auto Fill mode anymore!

How turn on a mode ALWAYS?

This works but I wonder if there is a simpler way that will work for
other modes:

(add-hook 'find-file-hooks 'turn-on-auto-fill)

Chris

Peter Milliken

unread,
Nov 30, 2008, 5:02:27 PM11/30/08
to help-gn...@gnu.org
There is probably some global way to set it ALWAYS but...

I define a lambda function that I hook in for all my major modes and then put all the stuff I want turned on in it i.e. the following is typical of what I have in my .emacs

(add-hook 'ada-mode-hook
          (lambda ()
            ;; add your customizations here... this can set
            ;; variables, turn on minor modes, etc.
            (tmmofl-mode)
            (show-paren-mode)
            (else-mode)
            (setq else-follow-menus nil)))

Since I only ever look at a limited set of file types i.e. major modes, this has worked perfectly well for me.

Peter

Lennart Borgman

unread,
Nov 30, 2008, 5:09:02 PM11/30/08
to sebe...@spawar.navy.mil, help-gn...@gnu.org
On Sun, Nov 30, 2008 at 7:18 PM, sebe...@spawar.navy.mil
<sebe...@spawar.navy.mil> wrote:
> Some modes like Auto Fill mode only get turned on for a specific
> buffer.
> When you change buffers you are NOT in Auto Fill mode anymore!
>
> How turn on a mode ALWAYS?

If you want to make a buffer local minor mode to be turned on
automatically for a lot of buffers you can use
define-globalized-minor-mode.


0 new messages