[Top][All Lists]

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

Re: auto-mode-alist, adding two modes

From: Edward O'Connor
Subject: Re: auto-mode-alist, adding two modes
Date: Tue, 09 Oct 2007 17:34:01 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix)

> I would like to get emacs to use longlines-mode *and* flyspell-mode
> for all files ending in .txt

You might want to define a derived mode in this sort of case.

Something like this should do the trick. Untested, of course.

(define-derived-mode gijs-text-mode text-mode "Gijs"
  "Major mode for editing text files.")

(add-to-list 'auto-mode-alist '("\\.txt\\'" . gijs-text-mode))

(add-hook 'gijs-text-mode-hook 'longlines-mode)
(add-hook 'gijs-text-mode-hook 'flyspell-mode)

reply via email to

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