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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4169 in the body.
You can then email your comments to 4169 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Mon, 17 Aug 2009 02:40:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Xah Lee" <xah <at> xahlee.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 17 Aug 2009 02:40:06 GMT) Full text and rfc822 format available.

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

From: "Xah Lee" <xah <at> xahlee.org>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.1.50; default mode for xml files not correct
Date: Sun, 16 Aug 2009 19:33:27 -0700
On my Windows emacs, when i open a xml file, the default mode loaded is 
sgml-mode, not nxml.

This is reproducible with Emacs -Q with FSF's binary for Windows.

Since nxml is better, it seems the default should be nxml-mode.

PS here's some tidbits from Lennart.

On Aug 16, 5:49 pm, Lennart Borgman <lennart.borg...@gmail.com> wrote:
> On Sat, Aug 15, 2009 at 5:08 PM, Xah Lee<xah...@gmail.com> wrote:
>
> > is this a bug or intentional?
>
> It is one of those unintentional problems that has not got the
> official bug status ;-)
>
> 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.

 Xah
∑ http://xahlee.org/

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Mon, 17 Aug 2009 14:40:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 17 Aug 2009 14:40:10 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Xah Lee <xah <at> xahlee.org>, 4169 <at> debbugs.gnu.org
Subject: Re: bug#4169: 23.1.50; default mode for xml files not correct
Date: Mon, 17 Aug 2009 16:35:29 +0200
On Mon, Aug 17, 2009 at 4:33 AM, Xah Lee<xah <at> xahlee.org> wrote:

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



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Thu, 20 Aug 2009 20:21:26 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 20 Aug 2009 20:21:27 GMT) Full text and rfc822 format available.

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



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Thu, 20 Aug 2009 20:21:50 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 20 Aug 2009 20:21:51 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
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: Tue, 18 Aug 2009 04:25:06 +0200
On Tue, Aug 18, 2009 at 4:18 AM, Stefan Monnier<monnier <at> iro.umontreal.ca> wrote:
>>>> 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).


That is a good idea, but I would suggest using a table in between
instead of fset.

And a simple way to manipulate that table. (Maybe putting a property
like 'this-is-a-major-mode on major mode functions?)



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Sat, 12 Sep 2009 00:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 12 Sep 2009 00:20:03 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: emacs-devel <at> gnu.org
Cc: 4169 <at> debbugs.gnu.org
Subject: Default for editing XML files
Date: Fri, 11 Sep 2009 20:12:30 -0400
In Bug#4169, it's been suggested to default to nXML mode for editing XML
files.  Does anyone on this list support or object to this?  I don't
edit XML files, so I can't form an opinion on this.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Sat, 12 Sep 2009 01:50:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Miles Bader <miles <at> gnu.org>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 12 Sep 2009 01:50:04 GMT) Full text and rfc822 format available.

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

From: Miles Bader <miles <at> gnu.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: emacs-devel <at> gnu.org, 4169 <at> debbugs.gnu.org
Subject: Re: Default for editing XML files
Date: Sat, 12 Sep 2009 10:41:47 +0900
Chong Yidong <cyd <at> stupidchicken.com> writes:
> In Bug#4169, it's been suggested to default to nXML mode for editing XML
> files.  Does anyone on this list support or object to this?  I don't
> edit XML files, so I can't form an opinion on this.

I support it -- nxml is an _excellent_ mode for editing xml files,
mostly because it does real-time verification.

-Miles

-- 
Patience, n. A minor form of despair, disguised as a virtue.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4169; Package emacs. (Sat, 12 Sep 2009 06:35:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to joakim <at> verona.se:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 12 Sep 2009 06:35:04 GMT) Full text and rfc822 format available.

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

From: joakim <at> verona.se
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: emacs-devel <at> gnu.org, 4169 <at> debbugs.gnu.org
Subject: Re: Default for editing XML files
Date: Sat, 12 Sep 2009 08:29:02 +0200
Chong Yidong <cyd <at> stupidchicken.com> writes:

> In Bug#4169, it's been suggested to default to nXML mode for editing XML
> files.  Does anyone on this list support or object to this?  I don't
> edit XML files, so I can't form an opinion on this.
>

Nxml has been my default xml editing mode for years, so yes.

-- 
Joakim Verona



Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Fri, 18 Sep 2009 18:55:05 GMT) Full text and rfc822 format available.

Notification sent to "Xah Lee" <xah <at> xahlee.org>:
bug acknowledged by developer. (Fri, 18 Sep 2009 18:55:06 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: emacs-devel <at> gnu.org
Cc: 4169-done <at> debbugs.gnu.org
Subject: Re: Default for editing XML files
Date: Fri, 18 Sep 2009 14:49:02 -0400
I've made nXML mode the default for editing XML files.



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sat, 17 Oct 2009 14:24:14 GMT) Full text and rfc822 format available.

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.