From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: How to ensure nxml-mode instead of sgml-mode for html-file? Date: Wed, 05 Dec 2007 16:54:23 +0100 Message-ID: <4756C9AF.4030401@gmail.com> References: <475653a6$0$5082$ba4acef3@news.orange.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196870096 29522 80.91.229.12 (5 Dec 2007 15:54:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2007 15:54:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 05 16:55:05 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IzwaS-0008KP-Bq for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Dec 2007 16:55:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzwaB-0003oB-Rt for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Dec 2007 10:54:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IzwZt-0003le-Fh for help-gnu-emacs@gnu.org; Wed, 05 Dec 2007 10:54:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IzwZs-0003ie-8v for help-gnu-emacs@gnu.org; Wed, 05 Dec 2007 10:54:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzwZs-0003iQ-3r for help-gnu-emacs@gnu.org; Wed, 05 Dec 2007 10:54:24 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IzwZr-00071B-4G for help-gnu-emacs@gnu.org; Wed, 05 Dec 2007 10:54:23 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:64219 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1IzwZo-0003Fr-6G for help-gnu-emacs@gnu.org; Wed, 05 Dec 2007 16:54:21 +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 In-Reply-To: <475653a6$0$5082$ba4acef3@news.orange.fr> X-Antivirus: avast! (VPS 071205-1, 2007-12-05), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1IzwZo-0003Fr-6G. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1IzwZo-0003Fr-6G 98a659ea118d826f07c45149f28a65d9 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49849 Archived-At: 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