Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at

Bug 223023

Summary: Review Request: nxml-mode - Emacs package for editing XML
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: Package ReviewAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Package Reviews List <fedora-package-review>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: wtogami
Target Milestone: ---Flags: ville.skytta: fedora-review+
kevin: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-16 09:49:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 163779    
Description Flags
auto-mode-alist, magic-mode-alist dumps none

Description Tim Waugh 2007-01-17 16:17:10 UTC
Spec URL:
This is an Emacs mode for editing XML with interactive validity and well-formedness checks.  Given a DTD it will also complete tags and attributes, and '</' closes the current tag correctly.

Comment 1 Ville Skyttä 2007-01-19 18:59:07 UTC
The package should probably be called emacs-nxml-mode according to the package
naming guidelines.

The naming guidelines say emacs-common-<foo> but I suppose emacs-<foo> would be
enough for this package because it doesn't work with XEmacs, and I'm not aware
of anything that would change that in the foreseeable future.

Comment 3 Ville Skyttä 2007-01-27 00:04:00 UTC
- rpmlint: E: emacs-nxml-mode invalid-spec-name emacs-xml-mode.spec
Should be renamed to emacs-nxml-mode.spec

- rpmlint: W: emacs-nxml-mode prereq-use info
PreReq: info should be replaced by "Requires(post): info" and 
"Requires(postun): info", or /sbin/install-info, see

- Dependency on emacs missing.  Or should that be emacs-common?  Possibly
versioned so that a newer or equal version of Emacs which was used to build the
package is needed?

- Better URL:

- Origin of slides.rnc and slidesdb.rnc?  I guess , there seems to be newer
version(s) available in the 3.4.0/schema/relaxng/ dir -> maybe upgrade and use
full URLs to sources?

- Package rename needs to be reflected in install-info invocations, now fails on
install-info: No such file or directory for /usr/share/info/
...and on removal:
install-info: warning: no entries found for
`/usr/share/info/'; nothing deleted

- auto-mode-alist association in nxml-init.el fails to do its job, XML and XHTML
files still open in xml-mode and html-mode here.  My (unverified) guess is that
it's because of magic-mode-alist.  So perhaps either add the appropriate
magic-mode-list associations to the init file too or remove the nonfunctional
auto-mode-alist one?

Comment 4 Tim Waugh 2007-02-07 17:47:50 UTC
Regarding the XML/HTML files opening in other modes: I think it depends what
kind of file you choose.  DocBook XML files open in nxml-mode for example.

Comment 5 Ville Skyttä 2007-02-07 19:40:57 UTC
Tested with this docbook XML file, it doesn't open in nxml-mode here:*checkout*/docbook/slides/doc/slides.xml
I think this issue is something that needs to be resolved for real so that it is
clear under which situations nxml-mode vs xml/xhtml modes are used before the
package can be published.  If no better ways are found, removing nxml-mode's
associations completely by default and providing commented out examples
somewhere how to make it override xml/xhtml for all types nxml supports would be
much better than the current uncertainty.

.1%{?dist} needs to move from the version tag to release.  If upgradeability
from earlier versions of this package somewhere is a concern, plain 20041004
without the 0. prefix or 0.20041004.2 would provide that after the move.

Could you comment on the dependency on emacs vs emacs-common?  Currently,
nxml-mode can't be installed with only emacs-nox available (no emacs), even
though it'd probably work just fine.  I'm leaning towards emacs-common being a
better alternative, but won't treat this as a blocker.

Comment 6 Tim Waugh 2007-02-08 13:06:20 UTC
Works here with slides.xml.  I get '(nXML Valid)' in the mode bar, and 'Using
schema /usr/share/emacs/site-lisp/nxml-mode/schema/docbook.rnc' in the minibuffer.

Perhaps you have a .emacs file that is preventing things from working correctly?
 Do you have the psgml package installed, possibly overriding our own mode?

FWIW, I get nxml-mode for .xml, .xsl, .rng and .xhtml, which is precisely the
set of modes expected:

(setq auto-mode-alist
      (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)

SGML and HTML already have handlers (sgml-mode), and I'm not sure we want to
override that (do we?).

Comment 7 Ville Skyttä 2007-02-08 22:59:46 UTC
I had already tested with empty ~/.emacs and ~/.emacs.d too, and I don't think
I've ever had psgml installed.  Pretty much all *.xml, *.xsl, *.xhtml files open
in XML/XHTML modes, not nxml here; I don't have an explanation to that, but it
does happen.  I do remember getting some XML files opened in nxml-mode in
earlier tests, but can't find one at the moment.

And you're right, SGML/HTML would probably be better off handled by SGML based
modes, not nxml - I doubt it is even supposed to work with those.

The confusion with getting files to consistently open with or without nxml-mode
is the only remaining blocker here as far as I'm concerned - if you have ideas
what to try, let me know.  Everything *looks* correct as far as I can tell (eg.
value of auto-mode-alist at runtime).

BTW, the last trailing ".1" could be dropped from the Version tag, but no need
to roll a new package for review just because of that.

Comment 8 Tim Waugh 2007-02-09 09:40:56 UTC
Well, what provides XML/XHTML modes?  I don't have any package installed that
does.  On removing emacs-nxml-mode, .xsl files open in fundamental mode here.

I think if there are different packages each trying to modify auto-mode-alist,
it just comes down to which order their init files are read.

Comment 9 Ville Skyttä 2007-02-09 19:15:18 UTC
Created attachment 147796 [details]
auto-mode-alist, magic-mode-alist dumps

C-h f xml-mode:
xml-mode is an alias for `sgml-mode' in `textmodes/sgml-mode.el'.

$ rpm -qf /usr/share/emacs/22.0.93/lisp/textmodes/sgml-mode.elc

That's a Rawhide Emacs locally rebuilt for FC6.

I've already tried changing the order of the nxml-mode and sgml-mode
auto-mode-alist associations, to no avail, so it's not that.  And nxml-mode is
the only thing in my auto-mode-alist that is associated with *.xhtml files, yet
they open in xml-mode (ie. "XHTML" in the modeline).  That's why I suggested
magic-mode-alist might be interfering in comment 3.

See attached cleaned up typescript; the first part contains dumps of
auto-mode-alist and magic-mode-alist with the as-is nxml-init.el, and the
latter part the dump of auto-mode-alist after modifying nxml-init.el to append
instead of prepending its auto-mode-alist modifications.

Comment 10 Tim Waugh 2007-02-13 13:53:13 UTC
I've added something to nxml-init.el that I hope will resolve this.

Comment 11 Ville Skyttä 2007-02-13 21:13:36 UTC
Ok, I think that's good enough, approved.

Final non-blocker suggestions to consider before doing the first build:

- Drop trailing ".1" from the Version tag.

- Instead of defining magic-mode-alist to a dummy value in nxml-init.el on
earlier Emacsen (which may have side effects if other modes test for its
existence and make decisions based on that), do something like this instead:
  (if (boundp 'magic-mode-alist)
      ;; then do the setq (which could be replaced by add-to-list, BTW...)

Comment 12 Tim Waugh 2007-02-15 10:52:29 UTC
emacs-nxml-mode-0.20041004-5.fc7 built.  Thanks!

Comment 13 Ville Skyttä 2007-02-15 18:47:04 UTC
My pleasure.  Maybe this bug was meant to be closed now?

Comment 15 Warren Togami 2007-02-20 01:34:38 UTC
Why is fedora-cvs set to ?  Your request is unclear.

Comment 16 Tim Waugh 2007-02-20 09:25:50 UTC
I would like an FC-6 branch to be added for emacs-nxml-mode please.  Thanks.

Comment 17 Tim Waugh 2008-01-10 16:41:25 UTC
Please could I have an EPEL branch for emacs-nxml-mode?  Thanks.

Comment 19 Kevin Fenzi 2008-01-10 16:49:26 UTC
For EL-4? EL-5? or both?
Please use the template at

Please reset the fedora-cvs flag when you answer... 

Comment 20 Tim Waugh 2008-01-10 17:20:29 UTC
Package Change Request
Package Name: emacs-nxml-mode
New Branches: EL-4 EL-5

Comment 21 Kevin Fenzi 2008-01-11 05:29:51 UTC
cvs done.