From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Billy O'Connor Newsgroups: gmane.emacs.help Subject: Re: about auto-mode-alist Date: Thu, 29 Nov 2007 21:13:41 -0500 Message-ID: <87tzn4cwfe.fsf@t22.i-did-not-set--mail-host-address--so-tickle-me> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196388948 27509 80.91.229.12 (30 Nov 2007 02:15:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2007 02:15:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 30 03:15:56 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IxvQ3-0002NE-I5 for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Nov 2007 03:15:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxvPn-0006iG-Oz for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Nov 2007 21:15:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IxvPZ-0006gF-AD for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 21:15:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IxvPX-0006g3-Uz for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 21:15:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IxvPX-0006g0-RX for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 21:15:23 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IxvPX-0004DN-JM for help-gnu-emacs@gnu.org; Thu, 29 Nov 2007 21:15:23 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1IxvPC-0000qG-Of for help-gnu-emacs@gnu.org; Fri, 30 Nov 2007 02:15:02 +0000 Original-Received: from cpe-66-108-47-95.nyc.res.rr.com ([66.108.47.95]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Nov 2007 02:15:02 +0000 Original-Received: from billyoc by cpe-66-108-47-95.nyc.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 30 Nov 2007 02:15:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe-66-108-47-95.nyc.res.rr.com User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:8pG1uxxlPf8r2Q8OC9jkRA8EERU= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:49707 Archived-At: step 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