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

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

Re: How to apply a minor mode to all buffers


From: Robert Thorpe
Subject: Re: How to apply a minor mode to all buffers
Date: 20 Jan 2007 09:38:08 -0800
User-agent: G2/1.0

Eli Zaretskii wrote:
> > Date: Fri, 19 Jan 2007 08:30:31 -0800
> > From: "James Aguilar" <aguilar.james@gmail.com>
> > Cc: help-gnu-emacs@gnu.org
> > This applies to several programming languages, text files, configuration
> > files, and even non-files (I have a personal aversion to >80 chars in all
> > files I edit).  Since my only use for emacs is to edit these kinds of files,
> > I'd like to have a guard at the end so that I can know when I'm over the
> > line.
>
> Then mode hooks are probably the way to go.  I doubt that you use too
> many major modes, so this boils down to crafting a dozen or so mode
> hooks in your .emacs file.  For the few exceptions, you can always
> turn on the mode by hand.

I think it would be useful is Emacs had some more general hooks than
the ones it has a present, for example:-
progmodes-hook - A hook ran whenever a programming language mode starts
plain-text-modes-hook - A hook ran by text-mode,
paragraph-indent-text-mode etc
formatted-text-modes-hook - A hook ran by tex-mode, nroff-mode,
sgml-mode etc

This would provide the functionality with less code than hooking many
modes. It would avoid the problem of weird minor modes affecting
temporary buffers and things like M-x snake.

I might write that sometime, but I can't right now.



reply via email to

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