Peter Dyballa <[EMAIL PROTECTED]> writes:

> Am 17.05.2005 um 14:55 schrieb Michael Dewar:
>
>
> than one cons to auto-mode-alist you can merge them together. It was
> said on this list that \\' is a more precise description of a file
> name's end than $. When using more excessively the regular expressions
> the code can become very hard to understand:
>
> (setq auto-mode-alist
>    (append
>     '(("\\.\\(xsl\\|id\\[de\\]\\)\\'"                 . sgml-mode)
>       ("\\.\\(plist\\|xml\\|xsl\\|fo\\)\\'"           . xml-mode)
>       ("\\.\\(tgz\\|tar\\.\\(bz2\\|gz\\|Z\\)\\)\\'"   . tar-mode)
>       ("\\.\\(arc\\|jar\\|lzh\\|zip\\|zoo\\)\\'"      . tar-mode)
>     auto-mode-alist)))
>
Unless I'm missing something, the \\ doesn't have anything to do with
the end of a word - in the RE above, the \\ at the end of literal
atoms is introducing 'special' characters i.e. \\| indicates an
alternative and \\(...\\) a grouping which allows you to reference
parts of the match with $1, $2 etc. The $ matches the end of the
string your trying to match and is as far as I know the best and only
way to match the end of a string.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to