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

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

Re: adding hook to auto-mode-alist load


From: Johan Bockgård
Subject: Re: adding hook to auto-mode-alist load
Date: Fri, 22 Aug 2003 16:40:24 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (usg-unix-v)

Lute Kamstra <Lute.Kamstra@cwi.nl> writes:

> In this case you can do
>
> (add-hook 'paragraph-indent-text-mode-hook (lambda () (auto-fill-mode 1)))
>
> to automatically start the auto-fill minor mode whenever you start
> the paragraph-indent-text major mode. If you want auto-fill-mode
> started only for .plan files and not for other files that are put in
> paragraph-indent-text-mode, then you could start auto-fill-mode
> conditionally (e.g., write a function to do this and put this
> function on paragraph-indent-text-mode-hook).

AFAICS auto-mode-alist just specifies a function to call. Is there any
reason the following is not a good idea?

(defun foo ()
  (paragraph-indent-text-mode)
  (turn-on-auto-fill))

(setq auto-mode-alist (cons '("\.plan$" . foo) auto-mode-alist))

You could call foo `plan-mode' if you like.

-- 
Johan Bockgård


reply via email to

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