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

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

Re: Three questions


From: Kevin Rodgers
Subject: Re: Three questions
Date: Fri, 17 Sep 2004 17:06:27 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

William Payne wrote:
> "John Paul Wallington" <jpw@gnu.org> wrote in message
> 86mzzwz6so.fsf@vaio.shootybangbang.com">news:86mzzwz6so.fsf@vaio.shootybangbang.com...
>>"William Payne" <mikas493_no_spam@student.liu.se> writes:
>>>Second question: I have the following in my .emacs:
>>>(setq auto-mode-alist
>>>      (cons '("\\(\\`\\|/\\)Makefile\\'" . makefile-mode)
>>>       auto-mode-alist))
>>>
>>>My old varaint would trigger Makefile mode (think I just had
>>>Makefile$ or something similar), if the path contained the string
>>>"Makefile". That wasn't so good. This varaint triggers makefile
>>>mode only if the actual file name itself is called Makefile: that
>>>is good. However, I want it to trigger make > file mode if the file
>>>name (not the path!) contains the string Makefile, so Makefile.in
>>>would trigger also. What do I need to change to get that?
>>
>>If you remove the above snippet from your .emacs file then Emacs
>>should work as you expect by default.  Does it?
>
> And if I comment out the lines regarding makefile-mode, I don't get
> makefile mode for files named Makefile.txt for example, only if they
> are named Makefile.

To match an optional extension:

(setq auto-mode-alist
      (cons '("\\(\\`\\|/\\)Makefile\\(\\.[^.]*\\)?\\'" . makefile-mode)
       auto-mode-alist))

--
Kevin Rodgers


reply via email to

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