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: auto-mode-alist for minor modes? Date: Thu, 11 Sep 2003 08:58:39 +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 1063263697 10647 80.91.224.253 (11 Sep 2003 07:01:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 11 Sep 2003 07:01:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 11 09:01:35 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 19xLSR-0006Oi-00 for ; Thu, 11 Sep 2003 09:01:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19xLS8-0003lu-4z for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Sep 2003 03:01:16 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!proxad.net!freenix!ircam.fr!news.completel.fr!nntpfeed-01.ops.asmr-01.energis-idc.net!surfnet.nl!news.surfnet.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: occarina.pna.cwi.nl Original-X-Trace: news.surfnet.nl 1063263520 12243 192.16.184.200 (11 Sep 2003 06:58:40 GMT) Original-X-Complaints-To: usenet@news.surfnet.nl Original-NNTP-Posting-Date: Thu, 11 Sep 2003 06:58:40 +0000 (UTC) In-Reply-To: (David Vanderschel's message of "Thu, 11 Sep 2003 00:23:36 -0500") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:EXENL6kDzNshkN0Tp4KBuvcAjpc= Original-Xref: shelby.stanford.edu gnu.emacs.help:116528 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:12449 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12449 "David Vanderschel" writes: > Though the naming for the auto-mode-alist variable is neutral, the > documentation for auto-mode-alist only talks about _major_ modes. I > would like to use it to invoke a _minor_ mode when a file with a > given extension is loaded. I have tried this, and it seems to work. > Is there some subtle way I am going to get myself in trouble doing > this? > > It seems to me that set-auto-mode does not know whether the function > associated with the extension is a major mode starter or a minor > mode starter. It is just going to call it once the buffer is set > up. That is all I want. But I know there are numerous potential > 'gotchas' in emacs, so I seek reassurance or, if necessary, > correction. In my understanding, auto-mode-alist is searched for a filename match and then the corresponding function is called. The only problem you may run into is that you want to set both a major mode and a minor mode for some type of file. Two entries in the alist won't do because only the first match is used. In this case you can best start the major mode using auto-mode-alist and the minor mode using the major mode's hook variable. Alternatively, you could define a function that starts the major mode as well as the minor mode and put this function in auto-mode-alist. Lute. -- (spook) => "CID Glock MD2" (insert-file-contents "~/.signature") => (error "`~/.signature' too rude")