unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Billy O'Connor <billyoc@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: about auto-mode-alist
Date: Thu, 29 Nov 2007 21:13:41 -0500	[thread overview]
Message-ID: <87tzn4cwfe.fsf@t22.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: c33e45a0-32a3-4167-a12c-e3969f08339d@s19g2000prg.googlegroups.com

step <fxlzju@gmail.com> writes:

>   hi,i use gnu emacs23 ,when i set the auto-mode-alist, it seems don't
> work.
>   the elisp i add in the my .emacs file follow:
>    (setq auto-mode-alist
>   (append '(("\\.css\\'"  . css-mode)
>             ("\\.c\\'"    . c-mode)
>             ("\\.cc\\'"   . c++-mode)
>             ("\\.cpp\\'"  . c++-mode)
>             ("\\.cxx\\'"  . c++-mode)
>             ("\\.hpp\\'"  . c++-mode)
>             ("\\.e\\'"    . eiffel-mode)
>             ("\\.hxx\\'"  . c++-mode)
>             ("\\.h\\'"    . c-mode)
>             ("\\.hh\\'"   . c++-mode)
>             ("\\.idl\\'"  . c++-mode)
>             ("\\.ipp\\'"  . c++-mode)
>             ("\\.java\\'" . java-mode)
>             ("\\.lua\\'"   . lua-mode)
>             ("\\.pl\\'"   . perl-mode)
>             ("\\.pm\\'"   . perl-mode)
>             ("\\.rb\\'"   . ruby-mode)
>             ("\\.rbw\\'"  . ruby-mode)
>             ("\\.t2t\\'"  . t2t-mode)
> 	    ("\\.txt\\'"  . text-mode)
>             ("\\.py\\'"   . python-mode)
>      	    ("\\.tex\\'"  . LaTeX-mode)
> 	    ("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
> 	    )
>       auto-mode-alist))
>    when i use the C-x C-f create a new .xml file ,it can auto load to
> nxml-mode ,but if i open a exist .xml file ,it auto load to sgml-mode
> which is the default mode emacs set in the file.el .
>    is there somebody konw why? thanks!

Your code works for my xml files, both old and new.  Could you have mode
tags at the top of some xml files that are forcing xml mode?

--
Billy O'Connor

  reply	other threads:[~2007-11-30  2:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30  1:38 about auto-mode-alist step
2007-11-30  2:13 ` Billy O'Connor [this message]
     [not found] ` <mailman.4329.1196388926.18990.help-gnu-emacs@gnu.org>
2007-11-30  2:25   ` step
2007-11-30  2:38   ` step
2007-11-30  2:41     ` step

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87tzn4cwfe.fsf@t22.i-did-not-set--mail-host-address--so-tickle-me \
    --to=billyoc@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).