GNU bug report logs - #4169
23.1.50; default mode for xml files not correct

Previous Next

Package: emacs;

Reported by: "Xah Lee" <xah <at> xahlee.org>

Date: Mon, 17 Aug 2009 02:40:05 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 4169 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 4169 <at> debbugs.gnu.org, Xah Lee <xah <at> xahlee.org>
Subject: Re: bug#4169: 23.1.50; default mode for xml files not correct
Date: Mon, 17 Aug 2009 22:18:12 -0400
>>> I wrote majmodpri.el (part of nXhtml) to take care of this kind of
>>> problem and suggested that something like it should be included in
>>> Emacs. There has not been any positive response to it yet.
>>> 
>>> The reason I wrote it was that this problem is much more prominent
>>> when there are multi major modes as an alternative too. (For an xhtml
>>> file for example you could use html-mode, nxml-mode, html-mumamo-mode,
>>> nxhtml-mumamo-mode etc.)
>> 
>> I'm not sure how emacs choose modes, or the policies, mechanisms, file
>> locations...etc, or what majmodpri.el is supposed to do. Anyway, i thought
>> this warrant a bug report for the record. Thanks.


> Major modes are choosen by searching auto-mode-alist etc. The first
> hit is choosen. (Sometimes the lists are searched several times
> though.)

> majmodpri.el sorts the list so that the major modes (or multi major
> modes) that the user prefers comes first.

When we offer several different modes for the same language
(e.g. perl-mode vs cperl-mode), we should try to make auto-mode-alist
(and other such facilities) point to a function alias (e.g. html-mode)
which can then point to whichever major mode the user favors.

E.g. we should probably rename sgml-mode.el's html-mode to
sgml-html-mode, and then make (defalias 'html-mode 'sgml-html-mode) so
that the user can easily (fset 'html-mode 'my-html-mode).


        Stefan



This bug report was last modified 15 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.