From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.help Subject: Re: adding hook to auto-mode-alist load Date: Fri, 22 Aug 2003 08:41:18 +0200 Organization: CWI, Amsterdam 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=us-ascii X-Trace: sea.gmane.org 1061544899 17022 80.91.224.253 (22 Aug 2003 09:34:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2003 09:34:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 22 11:34:58 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 19q8Jt-0008GA-00 for ; Fri, 22 Aug 2003 11:34:58 +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 19q7HJ-0000kX-Ih for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Aug 2003 04:28:13 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!skynet.be!skynet.be!newshub1.home.nl!home.nl!newsfeed.multikabel.nl!news.tudelft.nl!tudelft.nl!surfnet.nl!news.surfnet.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: occarina.pna.cwi.nl Original-X-Trace: news.surfnet.nl 1061534478 2764 192.16.184.200 (22 Aug 2003 06:41:18 GMT) Original-X-Complaints-To: usenet@news.surfnet.nl Original-NNTP-Posting-Date: Fri, 22 Aug 2003 06:41:18 +0000 (UTC) In-Reply-To: (Todd Wylie's message of "Thu, 21 Aug 2003 16:09:45 -0500") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:sOpblyDDL1aId5vCqvLAO+TVwwY= Original-Xref: shelby.stanford.edu gnu.emacs.help:116067 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:11978 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11978 Todd Wylie writes: > I recently changed my dot-file to automatically invoke > paragraph-indent-text-mode for files of type *.plan like so: > > (setq auto-mode-alist (cons '("\.plan$" . paragraph-indent-text-mode) > auto-mode-alist)) > > But, I'd also like to load auto-fill-mode just for this type of > file. Can I add a text-mode-hook for this setup? auto-mode-alist can be used to associate a certain type of file with a major mode. Every major mode has a hook variable that can be used to customize that major mode. 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). Lute. -- (spook) => "Telex ASDIC Vickie Weaver" (insert-file-contents "~/.signature") => (error "`~/.signature' too rude")