From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jean Magnan de Bornier Newsgroups: gmane.emacs.help Subject: Re: nxml-mode autoload? Date: Sun, 30 Oct 2005 12:55:21 +0100 Organization: Guest of ProXad - France Message-ID: <87oe57fcd2.fsf@borlap.bornier.net> References: <44ednc8paYY1r_neRVn-hQ@speakeasy.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1130673874 5788 80.91.229.2 (30 Oct 2005 12:04:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2005 12:04:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 30 13:04:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EWBu0-0004Lk-ET for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Oct 2005 13:03:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWBtz-0000hg-VB for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Oct 2005 07:03:07 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!tiscali!newsfeed1.ip.tiscali.net!proxad.net!infeed-1.proxad.net!news14-e.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:r80LlS9vGcLIeSS3Dmlu4WAWbxA= Original-Lines: 69 Original-NNTP-Posting-Date: 30 Oct 2005 12:55:25 MET Original-NNTP-Posting-Host: 82.249.215.172 Original-X-Trace: 1130673325 news14-e.free.fr 3663 82.249.215.172:48422 Original-X-Complaints-To: abuse@proxad.net Original-Xref: shelby.stanford.edu gnu.emacs.help:135104 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:30695 Archived-At: Arturius mac Aidan wrote : > These entries are in my .emacs > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; autoinsert.el > ;;http://www.linuxgazette.com/issue39/marsden.html > > (setq auto-mode-alist > (append '(("\\.h$" . c++-mode) > ("\\.cpp\\'" . c++-mode) > ("\\.moc\\'" . c++-mode)) > auto-mode-alist)) > > (add-hook 'find-file-hooks 'auto-insert) > (setq-default auto-insert-query nil) > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ;; www.thaiopensource.com/nxml-mode > ;; per the ~/.emacs.d/lisp/nxml-mode-20041004/README > (load "~/.emacs.d/lisp/nxml-mode-20041004/rng-auto.el") > (setq auto-mode-alist > (append '(("\\.xml\\'" . nxml-mode) > ("\\.xsl\\'" . nxml-mode) > ("\\.rng\\'" . nxml-mode) > ("\\.xhtml\\'" . nxml-mode)) > auto-mode-alist)) > ;;;;;;;;;;;;;;;;;EOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > > The first auto-mode-alist entries (for c++) work as expected. the ones for > nxml-mode do not work. I can, however, start the mode with `M-x > nxml-mode'. Does anybody know why this is not working? > On emacs-wiki you can find this solution: (fset 'xml-mode 'nxml-mode) There was a recent discussion on the french emacs group, somebody argued this solution was lame, and proposed the following: (defcustom drkm-misc:magic-modes-to-delete '(html-mode sgml-mode xml-mode) "List of mode symbols whose entries to delete in `magic-mode-alist'." :type '(repeat symbol) :group 'drkm) (when (boundp 'magic-mode-alist) (setq magic-mode-alist (delete-if (lambda (cell) (memq (cdr cell) drkm-misc:magic-modes-to-delete)) magic-mode-alist))) (push '("\\`<\\?xml" . nxml-mode) magic-mode-alist) This works well, provided you load cl (before these commands) if it is not already loaded: (require 'cl) I cannot explain these lines but they have to do with the "magic-mode-alist" interfering in some way with "auto-mode-alist". hth, -- Jean Magnan de Bornier | Cours Victor Hugo e-mots: jean at bornier.net | 13980 Alleins France T 08 70 39 34 03 | P 06 09 17 35 87