Bug 223023 - Review Request: nxml-mode - Emacs package for editing XML
Review Request: nxml-mode - Emacs package for editing XML
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Package Reviews List
Depends On:
  Show dependency treegraph
Reported: 2007-01-17 11:17 EST by Tim Waugh
Modified: 2008-01-11 00:29 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-16 04:49:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ville.skytta: fedora‑review+
kevin: fedora‑cvs+

Attachments (Terms of Use)
auto-mode-alist, magic-mode-alist dumps (14.13 KB, text/plain)
2007-02-09 14:15 EST, Ville Skyttä
no flags Details

  None (edit)
Description Tim Waugh 2007-01-17 11:17:10 EST
Spec URL: http://cyberelk.net/tim/data/nxml-mode/nxml-mode.spec
SRPM URL: http://cyberelk.net/tim/data/nxml-mode/nxml-mode-0.20041004.1-0.1.src.rpm
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 13:59:07 EST
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-26 19:04:00 EST
- 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: http://www.thaiopensource.com/nxml-mode/

- Origin of slides.rnc and slidesdb.rnc?  I guess 
http://docbook.sourceforge.net/release/slides/ , 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/emacs-nxml-mode.info
...and on removal:
install-info: warning: no entries found for
`/usr/share/info/emacs-nxml-mode.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 12:47:50 EST
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 14:40:57 EST
Tested with this docbook XML file, it doesn't open in nxml-mode here:
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 08:06:20 EST
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 17:59:46 EST
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 04:40:56 EST
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 14:15:18 EST
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 08:53:13 EST
I've added something to nxml-init.el that I hope will resolve this.

Comment 11 Ville Skyttä 2007-02-13 16:13:36 EST
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 05:52:29 EST
emacs-nxml-mode-0.20041004-5.fc7 built.  Thanks!
Comment 13 Ville Skyttä 2007-02-15 13:47:04 EST
My pleasure.  Maybe this bug was meant to be closed now?
Comment 15 Warren Togami 2007-02-19 20:34:38 EST
Why is fedora-cvs set to ?  Your request is unclear.
Comment 16 Tim Waugh 2007-02-20 04:25:50 EST
I would like an FC-6 branch to be added for emacs-nxml-mode please.  Thanks.
Comment 17 Tim Waugh 2008-01-10 11:41:25 EST
Please could I have an EPEL branch for emacs-nxml-mode?  Thanks.
Comment 19 Kevin Fenzi 2008-01-10 11:49:26 EST
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 12:20:29 EST
Package Change Request
Package Name: emacs-nxml-mode
New Branches: EL-4 EL-5
Comment 21 Kevin Fenzi 2008-01-11 00:29:51 EST
cvs done.

Note You need to log in before you can comment on or make changes to this bug.