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

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

Re: setting makefile-mode for specific filenames


From: Marco Baringer
Subject: Re: setting makefile-mode for specific filenames
Date: 13 Jun 2002 01:28:01 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.30

"Kevin Dziulko" <address@hidden> writes:

> Noel
> 
> According to the bible "Learning GNU Emacs", page 313 this should work:
> 
> (setq auto-mode-alist (cons '("^mymakefile" . makefile-mode)
> auto-mode-alist))
> 
> But it doesn't! Not sure why at this point. Maybe the other
> makefile-mode rules in auto-mode-alist are messing it up. If you find
> a solution, let me know; I'd be interested.
> 
> Sorry I can't be more helpfull.
> 
> Kevin
> 

i don't know why "Learning GNU Emacs" says that...

the regexps in auto-mode-alist are matched against the _complete_
filename, hence we have to consider the directory in which the file
lies. to the best of my knowledge no filesystem on which emacs runs is
completly flat (no directories) so "^mymakefile$" will never match
anything. i believe "/mymakefile$" is what you are looking for. 

when i open ~/.bash_profile emacs correctly loads sh-mode, here's the
relevant part of auto-mode-alist:

 ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . 
sh-mode)

notice that there's no initial "^" in the regexp. (i don't know what
the "`" char at the start of the regexp is for.)

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There's a crack in everything.
It's how the light gets in.
     -Isonard Cohen



reply via email to

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