unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4169: 23.1.50; default mode for xml files not correct
@ 2009-08-17  2:33 ` Xah Lee
  2009-08-17 14:35   ` Lennart Borgman
  2009-09-18 18:55   ` bug#4169: marked as done (23.1.50; default mode for xml files not correct) Emacs bug Tracking System
  0 siblings, 2 replies; 5+ messages in thread
From: Xah Lee @ 2009-08-17  2:33 UTC (permalink / raw)
  To: emacs-pretest-bug

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/^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4169: 23.1.50; default mode for xml files not correct
  2009-08-17  2:33 ` bug#4169: 23.1.50; default mode for xml files not correct Xah Lee
@ 2009-08-17 14:35   ` Lennart Borgman
  2009-08-18  2:18     ` Stefan Monnier
  2009-09-18 18:55   ` bug#4169: marked as done (23.1.50; default mode for xml files not correct) Emacs bug Tracking System
  1 sibling, 1 reply; 5+ messages in thread
From: Lennart Borgman @ 2009-08-17 14:35 UTC (permalink / raw)
  To: Xah Lee, 4169

On Mon, Aug 17, 2009 at 4:33 AM, Xah Lee<xah@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4169: 23.1.50; default mode for xml files not correct
  2009-08-17 14:35   ` Lennart Borgman
@ 2009-08-18  2:18     ` Stefan Monnier
  2009-08-18  2:25       ` Lennart Borgman
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2009-08-18  2:18 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Xah Lee, 4169

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4169: 23.1.50; default mode for xml files not correct
  2009-08-18  2:18     ` Stefan Monnier
@ 2009-08-18  2:25       ` Lennart Borgman
  0 siblings, 0 replies; 5+ messages in thread
From: Lennart Borgman @ 2009-08-18  2:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Xah Lee, 4169

On Tue, Aug 18, 2009 at 4:18 AM, Stefan Monnier<monnier@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?)





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4169: marked as done (23.1.50; default mode for xml files not correct)
  2009-08-17  2:33 ` bug#4169: 23.1.50; default mode for xml files not correct Xah Lee
  2009-08-17 14:35   ` Lennart Borgman
@ 2009-09-18 18:55   ` Emacs bug Tracking System
  1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2009-09-18 18:55 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 866 bytes --]

Your message dated Fri, 18 Sep 2009 14:49:02 -0400
with message-id <87eiq4jdgh.fsf@stupidchicken.com>
and subject line Re: Default for editing XML files
has caused the Emacs bug report #4169,
regarding 23.1.50; default mode for xml files not correct
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4169: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4169
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3593 bytes --]

From: "Xah Lee" <xah@xahlee.org>
To: <emacs-pretest-bug@gnu.org>
Subject: 23.1.50; default mode for xml files not correct
Date: Sun, 16 Aug 2009 19:33:27 -0700
Message-ID: <48317C0E1A69429482B1548C992F0FFC@xahPC>

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/[-- Attachment #3: Type: message/rfc822, Size: 1674 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: emacs-devel@gnu.org
Cc: 4169-done@emacsbugs.donarmstrong.com
Subject: Re: Default for editing XML files
Date: Fri, 18 Sep 2009 14:49:02 -0400
Message-ID: <87eiq4jdgh.fsf@stupidchicken.com>

I've made nXML mode the default for editing XML files.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-18 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87eiq4jdgh.fsf@stupidchicken.com>
2009-08-17  2:33 ` bug#4169: 23.1.50; default mode for xml files not correct Xah Lee
2009-08-17 14:35   ` Lennart Borgman
2009-08-18  2:18     ` Stefan Monnier
2009-08-18  2:25       ` Lennart Borgman
2009-09-18 18:55   ` bug#4169: marked as done (23.1.50; default mode for xml files not correct) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).