Peter Flynn | 8 May 2011 00:27
Picon
Favicon

Disabling nxml-mode

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. 
How do I disable Emacs' new behaviour?

///Peter

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

Jason Rumney | 8 May 2011 06:35

Re: Disabling nxml-mode

Peter Flynn <peter <at> silmaril.ie> writes:

> 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. 
> How do I disable Emacs' new behaviour?

Replace the autoload line in your .emacs with:

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

This will ensure that psgml overrides nxml's definition of xml-mode. If
you leave those files to auto load, then it is always possible that nxml
loads later, overriding psgml's xml-mode definition, or nxml loads
first, and psgml never gets loaded because xml-mode is already defined.

------------------------------------

Yahoo! Groups Links

(Continue reading)

Dave Pawson | 8 May 2011 09:04
Picon
Gravatar

Re: Disabling nxml-mode

On 8 May 2011 05:35, Jason Rumney <jasonr <at> f2s.com> wrote:
> Peter Flynn <peter <at> silmaril.ie> writes:

> Replace the autoload line in your .emacs with:
>
> (require 'nxml-mode)
> (require 'psgml)
>
> This will ensure that psgml overrides nxml's definition of xml-mode.

Guessing you want psgml less than nxml-mode, I simply
load psgml-mode when needed, manually.

Not like James to screw up psgml-mode though. wonder if it's
a recent change with all this xhtml added recently?

Seems to work Peter?

--

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/
(Continue reading)

Peter Flynn | 8 May 2011 12:10
Picon
Favicon

Re: Disabling nxml-mode

On 08/05/11 08:04, Dave Pawson wrote:
> On 8 May 2011 05:35, Jason Rumney <jasonr <at> f2s.com> wrote:
>> Peter Flynn <peter <at> silmaril.ie> writes:
> 
>> Replace the autoload line in your .emacs with:
>>
>> (require 'nxml-mode)
>> (require 'psgml)
>>
>> This will ensure that psgml overrides nxml's definition of xml-mode.
> 
> 
> Guessing you want psgml less than nxml-mode, I simply
> load psgml-mode when needed, manually.

For me it's the other way around: I need psgml for everything, and I
haven't yet found a use for nxml. If I need nxml I can load it manually;
for my work the default needs to be psgml.

> Not like James to screw up psgml-mode though. wonder if it's
> a recent change with all this xhtml added recently?

I don't know, except that I have seen comments that GNU made nxml the
default in recent releases of Emacs, so It's unlikely to be James's
fault; more likely the GNU people assumed nxml provided the same
facilities as psgml, which of course it doesn't, not by a very long way
(yet, I hope).

///Peter

(Continue reading)

Steinar Bang | 8 May 2011 20:10
Picon
Picon
Favicon

Re: Disabling nxml-mode

>>>>> Peter Flynn <peter <at> silmaril.ie>:

> I don't know, except that I have seen comments that GNU made nxml the
> default in recent releases of Emacs, so It's unlikely to be James's
> fault; more likely the GNU people assumed nxml provided the same
> facilities as psgml,

They probably made an assumption, but I'm guessing that the assumption
was that psgml is no longer actively maintained.

Of course, neither is nxml-mode, unless someone (Lennart Borgman?) has
picked up the maintenance in the version of nxml-mode that is now in the
emacs source?

> which of course it doesn't, not by a very long way (yet, I hope).

Out of curiosity: what features in psgml are you missing from nxml mode?

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
(Continue reading)

Peter Flynn | 8 May 2011 20:46
Picon
Favicon

Re: Re: Disabling nxml-mode

On 08/05/11 19:10, Steinar Bang wrote:
>>>>>> Peter Flynn<peter <at> silmaril.ie>:
>
>> I don't know, except that I have seen comments that GNU made nxml the
>> default in recent releases of Emacs, so It's unlikely to be James's
>> fault; more likely the GNU people assumed nxml provided the same
>> facilities as psgml,
>
> They probably made an assumption, but I'm guessing that the assumption
> was that psgml is no longer actively maintained.
>
> Of course, neither is nxml-mode, unless someone (Lennart Borgman?) has
> picked up the maintenance in the version of nxml-mode that is now in the
> emacs source?
>
>> which of course it doesn't, not by a very long way (yet, I hope).
>
> Out of curiosity: what features in psgml are you missing from nxml mode?

DTD parsing (I'm sure nxml has this, I just haven't seen it at work).

C-c C-e element insertion with TAB completion according to the DTD; the 
population of such inserted elements which have required element 
content, and the prompting for required attributes.

C-c C-r tag-region, C-c - remove-tag, and C-c = change-tag; C-c C-k 
cut-element; in fact almost all the markup-management commands, point 
movement commands, and fold/unfold.

The highlighting and indentation (I also use xxml-mode); I have no doubt 
(Continue reading)

Dave Pawson | 9 May 2011 08:30
Picon
Gravatar

Re: Re: Disabling nxml-mode

On 8 May 2011 19:46, Peter Flynn <peter <at> silmaril.ie> wrote:

> DTD parsing (I'm sure nxml has this, I just haven't seen it at work).

I don't think it does Peter.

> C-c C-q Rewrapping elements:

RTFM?  M-q

>
> C-c C-a The attribute management panel (split screen)

RTFM again :-) It's there

> SGML conformance (I still have half a dozen clients using SGML).

Out of scope for nxml-mode.

>
> As I said, I'm sure nxml-mode provides some, if not many or even all, of
> these, but I can't yet find any comprehensive documentation,

It's there. I even have an html version Peter. 5 mins work.
I'm as much a dochead as you and love nxml-mode.
http://www.dpawson.co.uk/relaxng/nxml/nxml-mode.html

Strikes me your users are becoming archaic using sgml?

regards
(Continue reading)

Jason Rumney | 9 May 2011 15:48

Re: Re: Disabling nxml-mode

Dave Pawson <dave.pawson <at> gmail.com> writes:

> On 8 May 2011 19:46, Peter Flynn <peter <at> silmaril.ie> wrote:
>
>> DTD parsing (I'm sure nxml has this, I just haven't seen it at work).
>
> I don't think it does Peter.

Not directly, but converting DTDs to RelaxNG is very easy.
 (see http://relaxng.org/#conversion)

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

<*> To change settings via email:
    emacs-nxml-mode-digest <at> yahoogroups.com 
    emacs-nxml-mode-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
(Continue reading)

Peter Flynn | 9 May 2011 22:24
Picon
Favicon

Re: Re: Disabling nxml-mode

On 09/05/11 07:30, Dave Pawson wrote:
> On 8 May 2011 19:46, Peter Flynn<peter <at> silmaril.ie>  wrote:
>
>> DTD parsing (I'm sure nxml has this, I just haven't seen it at work).
>
> I don't think it does Peter.

That's a show-stopper for the moment until they all convert to RNG.
At the moment there are large banks of entity-dependent code.

> RTFM?

Must do that again.

> Out of scope for nxml-mode.
> Strikes me your users are becoming archaic using sgml?

"Conservative" is the word I would use :-) They are all planning to 
convert, but organizational inertia means it's a slow job. They 
originally picked SGML because it would "last forever" :-)

> It's there. I even have an html version Peter. 5 mins work.
> I'm as much a dochead as you and love nxml-mode.
> http://www.dpawson.co.uk/relaxng/nxml/nxml-mode.html

I have no idea how I missed that. I'll have to digest it...very many thanks.

> C-c C-- was my last 'need' for psgml-mode, about a week ago.
>   remove markup around point.
> sgml-untag-element
(Continue reading)

Steinar Bang | 16 May 2011 18:48
Picon
Picon
Favicon

Re: Disabling nxml-mode

>>>>> Peter Flynn <peter <at> silmaril.ie>:

> DTD parsing (I'm sure nxml has this, I just haven't seen it at work).

As others have said: no it doesn't.
But creating a RNG schema from a DTD using trang, is really easy.

And you can persist the association between your DOCTYPE declaration and
the RNG schema you have created.

> C-c C-e element insertion with TAB completion according to the DTD;
> the population of such inserted elements which have required element
> content, and the prompting for required attributes.

nxml did go a different route here.  You start typing, and then you
press C-RET (Control+RET) to get the stuff that expansion can offer.

As an example, here's how to create a DocBook document on a nxml on a
debian system (standard setup on debian).

Open the file /tmp/silly.xml

Select Menu XML->Set Schema->For Document Type->DocBook

When prompted, tell it to write this association to schemas.xml (or not,
but at least this will give you a look at at schemas file).

Then start typing:
 < C-RET b o o C-RET > C-c C-f

(Continue reading)

Steinar Bang | 16 May 2011 18:57
Picon
Picon
Favicon

Re: Disabling nxml-mode

>>>>> Steinar Bang <sb <at> dod.no>:

>>>>> Peter Flynn <peter <at> silmaril.ie>:

>> SGML conformance (I still have half a dozen clients using SGML).

> No, this is pure XML.  No SGML conformance attempted.

But there is nothing stopping you from having both psgml and nxml.  I
use psgml for HTML editing and nxml for all xml format.

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

<*> To change settings via email:
    emacs-nxml-mode-digest <at> yahoogroups.com 
    emacs-nxml-mode-fullfeatured <at> yahoogroups.com

<*> To unsubscribe from this group, send an email to:
(Continue reading)

Peter Flynn | 17 May 2011 01:51
Picon
Favicon

Re: Re: Disabling nxml-mode

On 16/05/11 17:48, Steinar Bang wrote:
>>>>>> Peter Flynn<peter <at> silmaril.ie>:
>
>> DTD parsing (I'm sure nxml has this, I just haven't seen it at work).
>
> As others have said: no it doesn't.
> But creating a RNG schema from a DTD using trang, is really easy.
>
> And you can persist the association between your DOCTYPE declaration and
> the RNG schema you have created.
>
>> C-c C-e element insertion with TAB completion according to the DTD;
>> the population of such inserted elements which have required element
>> content, and the prompting for required attributes.
>
> nxml did go a different route here.  You start typing, and then you
> press C-RET (Control+RET) to get the stuff that expansion can offer.
>
> As an example, here's how to create a DocBook document on a nxml on a
> debian system (standard setup on debian).

Thank you very much for that, it's very useful.

///Peter

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
(Continue reading)

Dave Pawson | 9 May 2011 08:26
Picon
Gravatar

Re: Re: Disabling nxml-mode

On 8 May 2011 19:10, Steinar Bang <sb <at> dod.no> wrote:

> Out of curiosity: what features in psgml are you missing from nxml mode?

C-c C-- was my last 'need' for psgml-mode, about a week ago.
  remove markup around point.
sgml-untag-element

regards

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

(Continue reading)

Peter Flynn | 8 May 2011 14:49
Picon
Favicon

Re: Disabling nxml-mode

On 08/05/11 05:35, Jason Rumney wrote:
[...]
> Replace the autoload line in your .emacs with:
>
> (require 'nxml-mode)
> (require 'psgml)
>
> This will ensure that psgml overrides nxml's definition of xml-mode. If
> you leave those files to auto load, then it is always possible that nxml
> loads later, overriding psgml's xml-mode definition, or nxml loads
> first, and psgml never gets loaded because xml-mode is already defined.

Perfect, many thanks.

///Peter

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/emacs-nxml-mode/join
    (Yahoo! ID required)

(Continue reading)


Gmane