help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to ensure nxml-mode instead of sgml-mode for html-file?


From: Lennart Borgman (gmail)
Subject: Re: How to ensure nxml-mode instead of sgml-mode for html-file?
Date: Wed, 05 Dec 2007 16:54:23 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Le TeXnicien de Surface wrote:
hello all

I'm using emacs 22.1.1 which doesn't solve a recurring problem I have for
too long a while.

I've put that in my .emacs:

;; BEGIN
(setq auto-mode-alist
      (cons '("\\.\\(xml\\|xsl\\|ent\\|rng\\)\\'" . nxml-mode)
              auto-mode-alist))
(setq auto-mode-alist
      (cons '("\\.\\(html\\|htm\\|xhtml\\)\\'" . nxhtml-mode)
            auto-mode-alist))

(load "/home/yvon/share/emacs/autostart.el")
;; this is where I've put all of the nxml and nxhtml trees
;; I do follow the instructions of the package author
(require 'fmode)
(fmode-replace-default-mode 'xml-mode 'nxml-mode)
(fmode-replace-default-mode 'sgml-mode 'nxml-mode)
(add-hook 'nxml-mode-hook 'turn-on-auto-fill)
;; END

but so far to no avail.

When I open a 1st  html file the mode is HTML but for the 2d it is SGML
which I would like to avoid. More over, it seems that the choice of HTML or
SGML mode is quite unpredictable.

I've got no problem with xml-files for there are always open in nxml-mode.

Is there any way out of it? And if there is, could anybody show me the light, please.

Many thanks in advance.

See

  http://www.emacswiki.org/cgi-bin/wiki/NxmlMode
  http://www.emacswiki.org/cgi-bin/wiki/NxhtmlMode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]