From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Bingham, Jay" Newsgroups: gmane.emacs.help Subject: RE: another newbie question -- auto-mode-alist regexp Date: Mon, 23 Sep 2002 17:59:03 -0500 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <72A87F7160C0994D8C5A36E2FDC227F5032E0B0F@txnexc01.americas.cpqcorp.net> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1032822019 5637 127.0.0.1 (23 Sep 2002 23:00:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 23 Sep 2002 23:00:19 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17tcBd-0001Sn-00 for ; Tue, 24 Sep 2002 01:00:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17tcBg-0002IY-00; Mon, 23 Sep 2002 19:00:20 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17tcAW-0002G9-00 for help-gnu-emacs@gnu.org; Mon, 23 Sep 2002 18:59:08 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17tcAU-0002Fx-00 for help-gnu-emacs@gnu.org; Mon, 23 Sep 2002 18:59:07 -0400 Original-Received: from zcamail04.zca.compaq.com ([161.114.32.104]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17tcAT-0002Ft-00 for help-gnu-emacs@gnu.org; Mon, 23 Sep 2002 18:59:05 -0400 Original-Received: from cacexg12.americas.cpqcorp.net (cacexg12.americas.cpqcorp.net [16.105.250.119]) by zcamail04.zca.compaq.com (Postfix) with ESMTP id 9C503272F for ; Mon, 23 Sep 2002 15:59:04 -0700 (PDT) Original-Received: from txnexc01.americas.cpqcorp.net ([16.74.7.244]) by cacexg12.americas.cpqcorp.net with Microsoft SMTPSVC(5.0.2195.2966); Mon, 23 Sep 2002 15:59:04 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: another newbie question -- auto-mode-alist regexp Thread-Index: AcJjUq55koJSQ2sHRkWtlt3+4BP60wAAGvYQ Original-To: "GNU emacs mailing list" X-OriginalArrivalTime: 23 Sep 2002 22:59:04.0164 (UTC) FILETIME=[D039B240:01C26354] Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1758 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1758 1. The \\ means make the next character literal. Two are required = because the string is parsed before it is placed in the variable if = there are not two then the single \ gets stripped out and the = literalness is lost. So \. becomes just . (which means match any = character) while \\. becomes \. (which means find a dot). 2. Yes, the $ means end of string. Why it is not used on the xml is = speculation unless you can get the author to respond. My guess is the = author wanted to match anything that had .xml in it. 3. Probably. -_ J_) C_)ingham . HP - NonStop Austin Software & Services - Software Product = Assurance . Austin, TX . Language is the apparel in which your thoughts parade in public. . Never clothe them in vulgar and shoddy attire. -Dr. George W. = Crane- -----Original Message----- From: Robert P. J. Day [mailto:rpjday@mindspring.com]=20 Sent: Monday, September 23, 2002 5:44 PM To: GNU emacs mailing list Subject: another newbie question -- auto-mode-alist regexp i've looked through both the emacs and elisp info pages, and i haven't found a simple explanation for the syntax of the=20 expression for setting the auto-mode-alist in my .emacs. a couple of examples that are part of the (add-to-list 'auto-mode-alist ... when i bring up online help within emacs on the variable auto-mode-alist: ("\\.xml\\'" . xml-mode) ("\\.spec$" . rpm-spec-mode) ("\\.php[34]\\'\\|\\.php\\'\\|\\.phtml\\'" . php-mode) what i haven't figured out yet: 1) what means the sequence \\', as in what you see after ".xml" in that first example? i can understand everything else, but that baffles me. 2) i assume that the "$" after .spec means end of string, which is familiar. i'm curious why a lot of the other suffix regexp matches also don't match to end of string. like the first one, .xml. just curious. 3) regarding the php example, couldn't that have been written as =20 ("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode) (this assumes that i still don't know what \\' means.) a pointer to the correct online help or info page would do nicely. thanks for your patience. rday _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs