Bug 223023 - Review Request: nxml-mode - Emacs package for editing XML
Summary: Review Request: nxml-mode - Emacs package for editing XML
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Package Reviews List
URL:
Whiteboard:
Depends On:
Blocks: FE-ACCEPT
TreeView+ depends on / blocked
 
Reported: 2007-01-17 16:17 UTC by Tim Waugh
Modified: 2008-01-11 05:29 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-02-16 09:49:34 UTC
Type: ---
Embargoed:
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 19:15 UTC, Ville Skyttä
no flags Details

Description Tim Waugh 2007-01-17 16:17:10 UTC
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
Description:
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. 
http://fedoraproject.org/wiki/Packaging/NamingGuidelines#head-f3625ee8ad50323dbc0a2efff9344b1080f31113

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
http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#info

- 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:
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 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.

http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode.spec
http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode-0.20041004.1-2.src.rpm


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:
http://docbook.cvs.sourceforge.net/*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)
            auto-mode-alist))

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

http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode.spec
http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode-0.20041004.1-3.src.rpm

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
emacs-common-22.0.93-4.cmn6.i386

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.

http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode.spec
http://cyberelk.net/tim/data/nxml-mode/emacs-nxml-mode-0.20041004.1-4.src.rpm


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 
http://fedoraproject.org/wiki/PackageMaintainers/CVSAdminProcedure

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.


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