From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: modify .emacs Date: Thu, 19 May 2005 08:21:39 +1000 Message-ID: <87k6lwi39o.fsf@tiger.rapttech.com.au> References: Reply-To: timx@spamto.devnul.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1116455129 20539 80.91.229.2 (18 May 2005 22:25:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 May 2005 22:25:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 19 00:25:20 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DYWx7-0000lf-0m for geh-help-gnu-emacs@m.gmane.org; Thu, 19 May 2005 00:23:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DYWzd-0008JS-50 for geh-help-gnu-emacs@m.gmane.org; Wed, 18 May 2005 18:26:21 -0400 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:8swMM2i4V2oqcD6h30r5TRBeO08= Original-NNTP-Posting-Host: ppp21-36.lns2.syd3.internode.on.net Original-X-Trace: duster.adelaide.on.net 1116454899 59.167.21.36 (19 May 2005 07:51:39 +0950) Original-Lines: 33 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!newsfeed.media.kyoto-u.ac.jp!news1.optus.net.au!optus!news.uwa.edu.au!nntp.waia.asn.au!202.72.130.18.MISMATCH!quokka.wn.com.au!figjam.pipenetworks.com!duster.adelaide.on.net!not-for-mail Original-Xref: shelby.stanford.edu gnu.emacs.help:131359 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:26815 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26815 Peter Dyballa 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!