all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bingham, Jay" <Jay.Bingham@hp.com>
Subject: RE: another newbie question -- auto-mode-alist regexp
Date: Mon, 23 Sep 2002 17:59:03 -0500	[thread overview]
Message-ID: <72A87F7160C0994D8C5A36E2FDC227F5032E0B0F@txnexc01.americas.cpqcorp.net> (raw)

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] 
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 
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
  
  ("\\.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

             reply	other threads:[~2002-09-23 22:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-23 22:59 Bingham, Jay [this message]
2002-09-23 23:27 ` another newbie question -- auto-mode-alist regexp Robert P. J. Day
2002-09-23 23:34   ` Robert P. J. Day
     [not found] <mailman.1032823999.4821.help-gnu-emacs@gnu.org>
2002-09-23 23:56 ` Barry Margolin
     [not found] <mailman.1032821006.2883.help-gnu-emacs@gnu.org>
2002-09-23 23:15 ` Michael Slass
2002-09-23 23:17   ` Michael Slass
  -- strict thread matches above, loose matches on Subject: below --
2002-09-23 22:43 Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72A87F7160C0994D8C5A36E2FDC227F5032E0B0F@txnexc01.americas.cpqcorp.net \
    --to=jay.bingham@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.