[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: perl-mode.el file in Mac OS X
From: |
Stefan Monnier |
Subject: |
Re: perl-mode.el file in Mac OS X |
Date: |
Wed, 02 Feb 2005 09:58:07 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
> (setq auto-mode-alist
> (append
> '(("\\.xsl$" . sgml-mode)
> ("\\.plist$" . sgml-mode)
> ("\\.idd$" . sgml-mode)
> ("\\.ide$" . sgml-mode)
> ("\\.xml$" . xml-mode)
> ("\\.xsl$" . xml-mode)
> ("\\.fo$" . xml-mode)
> ("\\.nw$" . noweb-mode)
> ("\\.f90$" . f90-mode)
> ("\\.pl$" . perl-mode)
> ("\\.pod$" . perl-mode)
> ("\\.tgz$" . tar-mode)
> ("\\.tar\\.bz2$" . tar-mode)
> ("\\.tar\\.gz$" . tar-mode))
> auto-mode-alist))
IIRC, the problem with the .pl extension is that it's used both for Perl and
Prolog files, so I recommend people avoid it and use one of the many other
possible extensions, such as ".perl".
Oh and BTW, while I'm posting a useless message, I might as well use
<anal-mode> and point out that the above regexps should be "\\.xsl\\'",
"\\.plist\\'", ..., "\\.pl\\'", ..., "\\.tar\\.gz\\'" (i.e. replace $ with
\\' because $ would also match an embedded newline in a file name whereas
\\' really only matches the end of the file name).
If you feel like shortening such a list, you can also use things like:
(setq auto-mode-alist
(append
'(("\\.\\(xsl\\|plist\\|id[de]\\)\\'" . sgml-mode)
("\\.\\(xml\\|xsl\\|fo\\)\\'" . xml-mode)
("\\.nw\\'" . noweb-mode)
("\\.f90\\'" . f90-mode)
("\\.\\(pl\\|pod\\)\\'" . perl-mode)
("\\.\\(tgz\\|tar.\\(gz\\|bz2\\)\\)\\'" . tar-mode))
auto-mode-alist))
-- Stefan