Disabling nxml-mode

Discussion in 'XML' started by Peter Flynn, May 7, 2011.

  1. Peter Flynn

    Peter Flynn Guest

    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
     
    Peter Flynn, May 7, 2011
    #1
    1. Advertising

  2. Peter Flynn

    Luuk Guest

    On 08-05-2011 00:45, Peter Flynn wrote:
    > 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 ;)

    --
    Luuk
     
    Luuk, May 8, 2011
    #2
    1. Advertising

  3. On 5/8/2011 3:24 PM, Luuk wrote:
    > I was just Googling because i want to know what nXML is, but still have
    > not found the answer ;)


    nXML is a newer version of the XML syntax-annotation-and-assistance
    macros for the Emacs editor.

    --
    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."
     
    Joe Kesselman, May 8, 2011
    #3
  4. Joe Kesselman, May 8, 2011
    #4
  5. Joe Kesselman, May 8, 2011
    #5
  6. Peter Flynn

    Luuk Guest

    Luuk, May 9, 2011
    #6
  7. Peter Flynn

    Xah Lee Guest

    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)

    Peter wrote:
    > (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

    On May 7, 3:45 pm, Peter Flynn <> wrote:
    > 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
     
    Xah Lee, May 10, 2011
    #7
  8. Peter Flynn

    Peter Flynn Guest

    On 07/05/11 23:45, Peter Flynn wrote:
    > 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
     
    Peter Flynn, May 10, 2011
    #8
  9. > 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."
     
    Joe Kesselman, May 11, 2011
    #9
  10. Peter Flynn

    John Bokma Guest

    Joe Kesselman <> writes:

    >> 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!

    --
    John Bokma j3b

    Blog: http://johnbokma.com/ Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/
     
    John Bokma, May 11, 2011
    #10
  11. Peter Flynn

    Peter Flynn Guest

    On 10/05/11 12:23, Xah Lee wrote:
    > 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
     
    Peter Flynn, May 11, 2011
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John J Lee
    Replies:
    3
    Views:
    524
    bruno at modulix
    Dec 1, 2005
  2. Edward Loper
    Replies:
    0
    Views:
    510
    Edward Loper
    Aug 7, 2007
  3. John J Lee
    Replies:
    0
    Views:
    546
    John J Lee
    Aug 7, 2007
  4. Peter Flynn

    Nxml-mode

    Peter Flynn, Feb 10, 2011, in forum: XML
    Replies:
    2
    Views:
    992
    Joe Kesselman
    Feb 13, 2011
  5. Peter Flynn

    Unbinding nxml-mode

    Peter Flynn, May 21, 2012, in forum: XML
    Replies:
    0
    Views:
    796
    Peter Flynn
    May 21, 2012
Loading...

Share This Page