Disabling nxml-mode

P

Peter Flynn

I just upgraded a machine to Ubuntu Natty, which installed Emacs 23.2,
which appears to open XML files in nxml-mode by default. My .emacs file says
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t )
(setq auto-mode-alist (cons '("\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$" . xml-mode) auto-mode-alist))

which has been working fine for years. It looks as if Emacs 23.2 defines
xml-mode to point to nxml-mode, and this is somehow superseding my .emacs.

Unfortunately I still need to use psgml's xml-mode for all my XML stuff.
Does anyone know how I disable Emacs' new behaviour?

///Peter
 
L

Luuk

I just upgraded a machine to Ubuntu Natty, which installed Emacs 23.2,
which appears to open XML files in nxml-mode by default. My .emacs file
says
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t )
(setq auto-mode-alist (cons
'("\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$" .
xml-mode) auto-mode-alist))

which has been working fine for years. It looks as if Emacs 23.2 defines
xml-mode to point to nxml-mode, and this is somehow superseding my .emacs.

Unfortunately I still need to use psgml's xml-mode for all my XML stuff.
Does anyone know how I disable Emacs' new behaviour?

///Peter

http://lists.oasis-open.org/archives/docbook-apps/200707/msg00126.html

Is an article from someone who is switching to nxml in 2007, about 4
years ago......

I was just Googling because i want to know what nXML is, but still have
not found the answer ;)
 
X

Xah Lee

the reason it nxml-mode is loaded when u call xml-mode is probably
because there is a alias.

you can probably set it back by:

(defalias 'xml-mode 'sgml-xml-mode)
(setq auto-mode-alist (cons '("\\.[XxRrMmDdTt][TtMmDdSsNnEe]
[PpAaMmLlFfSsIi]?[EePp]*[Cc]*$" . xml-mode) auto-mode-alist))

that seems to be pretty bad.

you probably want to use add-to-list instead of setq.
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))

also, the file suffix
"\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$"
seems quite wild. What is it?

nxml-mode is a new mode for xml, written by the xml expert James
Clark, who is also the original author of sgml-mode (html-mode and xml-
mode are parts of sgml-mode). nxml-mode features on-the-fly xml
validation. It's 10k lines of elisp.

the following might provide helpful info:

〈How to Install Emacs Packages〉
http://xahlee.org/emacs/emacs_installing_packages.html

〈New Features in Emacs 23〉
http://xahlee.org/emacs/emacs23_features.html

Xah

I just upgraded a machine to Ubuntu Natty, which installed Emacs 23.2,
which appears to open XML files in nxml-mode by default. My .emacs file says
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t )
(setq auto-mode-alist (cons '("\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$" . xml-mode) auto-mode-alist))

which has been working fine for years. It looks as if Emacs 23.2 defines
xml-mode to point to nxml-mode, and this is somehow superseding my .emacs..

Unfortunately I still need to use psgml's xml-mode for all my XML stuff.
Does anyone know how I disable Emacs' new behaviour?

///Peter
 
P

Peter Flynn

I just upgraded a machine to Ubuntu Natty, which installed Emacs 23.2,
which appears to open XML files in nxml-mode by default. My .emacs file
says
(autoload 'xml-mode "psgml" "Major mode to edit XML files." t )
(setq auto-mode-alist (cons
'("\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$" .
xml-mode) auto-mode-alist))

which has been working fine for years. It looks as if Emacs 23.2 defines
xml-mode to point to nxml-mode, and this is somehow superseding my .emacs.

Unfortunately I still need to use psgml's xml-mode for all my XML stuff.
Does anyone know how I disable Emacs' new behaviour?

Thanks to Jason Rumney on the emacs-nxml-mode mailing list, the solution
is to replace the autoload above with

(require 'nxml-mode)
(require 'psgml)

This works perfectly.

///Peter
 
J

Joe Kesselman

also, the file suffix
"\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$"
seems quite wild. What is it?

It's a regular expression which covers .xml and a heck of a lot of other
possible extensions, including many you probably didn't intend to accept
(such as .repepepec, for those whose frogs confuse flies and files).


--
Joe Kesselman,
http://www.love-song-productions.com/people/keshlam/index.html

{} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
/\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
 
J

John Bokma

Joe Kesselman said:
also, the file suffix
"\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$"
seems quite wild. What is it?

It's a regular expression which covers .xml and a heck of a lot of
other possible extensions, including many you probably didn't intend
to accept (such as .repepepec, for those whose frogs confuse flies and
files).

LOL!
 
P

Peter Flynn

also, the file suffix
"\\.[XxRrMmDdTt][TtMmDdSsNnEe][PpAaMmLlFfSsIi]?[EePp]*[Cc]*$"
seems quite wild. What is it?

Matches .xml and a stack of other related file extensions. Needs pruning :)

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top