From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (=?iso-8859-1?q?Johan_Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: adding hook to auto-mode-alist load Date: Fri, 22 Aug 2003 16:40:24 +0200 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1061584113 27121 80.91.224.253 (22 Aug 2003 20:28:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 20:28:33 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 22 22:28:31 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19qIWN-0003O7-00 for ; Fri, 22 Aug 2003 22:28:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19qITP-00017O-FB for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Aug 2003 16:25:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.algonet.se!algonet!news.stupi.se!news.stupi.se!newsfeed.sunet.se!news01.sunet.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-NNTP-Posting-Host: frealaf.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:nMP70r52gCoXKEWUt7SzCsbhVQA= Original-Xref: shelby.stanford.edu gnu.emacs.help:116079 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11993 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11993 Lute Kamstra 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