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

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

Re: auto-mode-alist, adding two modes


From: weber
Subject: Re: auto-mode-alist, adding two modes
Date: Mon, 08 Oct 2007 15:37:56 -0000
User-agent: G2/1.0

On Oct 8, 12:33 pm, Gijs Hillenius <gijs-nops...@hillenius.net> wrote:
> Hi
>
> I would like to get emacs to use longlines-mode *and* flyspell-mode
> for all files ending in .txt
>
> If I add this in my .emacs
>
> (add-to-list 'auto-mode-alist '("\\.txt\\'" . longlines-mode ))
>
> followed by a similar line for flyspell, ignores the first, and uses
> only the latter.
>
> I've tried several more complicated incantations, but I'm not exactly
> fluent in lisp.
>
> Would appreciate a hint or two..
>
> Thx
>
> Gijs
>
> --
> The genius of our ruling class is that it has kept a majority of the
> people from ever questioning the inequity of a system where most people
> drudge along paying heavy taxes for which they get nothing in return.
>                 -- Gore Vidal

Maybe something like this would suffice?

(add-hook 'text-mode-hook '(lambda () (longlines-mode 1) (flyspell-
mode 1))

Just turn on those minor modes when a text-mode file shows up (txt
would be associated with text-mode like in your example)

HTH
weber




reply via email to

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