unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Default for editing XML files
@ 2009-09-12  0:12 Chong Yidong
  2009-09-12  1:41 ` Miles Bader
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Chong Yidong @ 2009-09-12  0:12 UTC (permalink / raw)
  To: emacs-devel; +Cc: 4169

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.




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

* Re: Default for editing XML files
  2009-09-12  0:12 Default for editing XML files Chong Yidong
@ 2009-09-12  1:41 ` Miles Bader
  2009-09-12  6:29 ` joakim
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Miles Bader @ 2009-09-12  1:41 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4169, emacs-devel

Chong Yidong <cyd@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.




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

* Re: Default for editing XML files
  2009-09-12  0:12 Default for editing XML files Chong Yidong
  2009-09-12  1:41 ` Miles Bader
@ 2009-09-12  6:29 ` joakim
  2009-09-12 16:02 ` Eric Hanchrow
  2009-09-18 18:49 ` Chong Yidong
  3 siblings, 0 replies; 19+ messages in thread
From: joakim @ 2009-09-12  6:29 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 4169, emacs-devel

Chong Yidong <cyd@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




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

* Re: Default for editing XML files
  2009-09-12  0:12 Default for editing XML files Chong Yidong
  2009-09-12  1:41 ` Miles Bader
  2009-09-12  6:29 ` joakim
@ 2009-09-12 16:02 ` Eric Hanchrow
  2009-09-12 22:19   ` Sean Sieger
  2009-09-18 18:49 ` Chong Yidong
  3 siblings, 1 reply; 19+ messages in thread
From: Eric Hanchrow @ 2009-09-12 16:02 UTC (permalink / raw)
  To: emacs-devel

What Miles and Joakim said -- I have this in my .emacs:

;; nxml-mode is superior to the built-in XML mode in every way.
(fset 'xml-mode 'nxml-mode)

:-)




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

* Re: Default for editing XML files
  2009-09-12 16:02 ` Eric Hanchrow
@ 2009-09-12 22:19   ` Sean Sieger
  2009-09-13  1:16     ` Stefan Monnier
  2009-09-13  1:30     ` Jason Rumney
  0 siblings, 2 replies; 19+ messages in thread
From: Sean Sieger @ 2009-09-12 22:19 UTC (permalink / raw)
  To: emacs-devel

Eric Hanchrow <eric.hanchrow@gmail.com> writes:

    What Miles and Joakim said -- I have this in my .emacs:

    ;; nxml-mode is superior to the built-in XML mode in every way.
    (fset 'xml-mode 'nxml-mode)

    :-)

Right.  But xml-mode supports the super-set, SGML, no?





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

* Re: Default for editing XML files
  2009-09-12 22:19   ` Sean Sieger
@ 2009-09-13  1:16     ` Stefan Monnier
  2009-09-13  1:30     ` Jason Rumney
  1 sibling, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2009-09-13  1:16 UTC (permalink / raw)
  To: Sean Sieger; +Cc: emacs-devel

>     What Miles and Joakim said -- I have this in my .emacs:
>     ;; nxml-mode is superior to the built-in XML mode in every way.
>     (fset 'xml-mode 'nxml-mode)

> Right.  But xml-mode supports the super-set, SGML, no?

Not really.  The superset is handled by ... sgml-mode.


        Stefan




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

* Re: Default for editing XML files
  2009-09-12 22:19   ` Sean Sieger
  2009-09-13  1:16     ` Stefan Monnier
@ 2009-09-13  1:30     ` Jason Rumney
  1 sibling, 0 replies; 19+ messages in thread
From: Jason Rumney @ 2009-09-13  1:30 UTC (permalink / raw)
  To: Sean Sieger; +Cc: emacs-devel

Sean Sieger wrote:
> Eric Hanchrow <eric.hanchrow@gmail.com> writes:
>
>     What Miles and Joakim said -- I have this in my .emacs:
>
>     ;; nxml-mode is superior to the built-in XML mode in every way.
>     (fset 'xml-mode 'nxml-mode)
>
>     :-)
>
> Right.  But xml-mode supports the super-set, SGML, no?
>   

We're not talking about removing it, or changing the default for non-XML 
SGML modes.
For XML, that SGML superset is part of the problem  - valid SGML is not 
necessarily valid XML.





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

* Re: Default for editing XML files
  2009-09-12  0:12 Default for editing XML files Chong Yidong
                   ` (2 preceding siblings ...)
  2009-09-12 16:02 ` Eric Hanchrow
@ 2009-09-18 18:49 ` Chong Yidong
  2009-09-21 21:48   ` Juri Linkov
  3 siblings, 1 reply; 19+ messages in thread
From: Chong Yidong @ 2009-09-18 18:49 UTC (permalink / raw)
  To: emacs-devel; +Cc: 4169-done

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




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

* Re: Default for editing XML files
  2009-09-18 18:49 ` Chong Yidong
@ 2009-09-21 21:48   ` Juri Linkov
  2009-09-21 22:12     ` Chong Yidong
  0 siblings, 1 reply; 19+ messages in thread
From: Juri Linkov @ 2009-09-21 21:48 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

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

Shouldn't `xml-mode' be replaced with `nxml-mode' in
`magic-fallback-mode-alist' and `conf-mode-maybe' as well?

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Default for editing XML files
  2009-09-21 21:48   ` Juri Linkov
@ 2009-09-21 22:12     ` Chong Yidong
  2009-09-22 14:27       ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Chong Yidong @ 2009-09-21 22:12 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

Juri Linkov <juri@jurta.org> writes:

>> I've made nXML mode the default for editing XML files.
>
> Shouldn't `xml-mode' be replaced with `nxml-mode' in
> `magic-fallback-mode-alist' and `conf-mode-maybe' as well?

Yes, I missed that.  Thanks.




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

* Re: Default for editing XML files
  2009-09-21 22:12     ` Chong Yidong
@ 2009-09-22 14:27       ` Stefan Monnier
  2009-09-23  9:06         ` Juri Linkov
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2009-09-22 14:27 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Juri Linkov, emacs-devel

>>> I've made nXML mode the default for editing XML files.
>> Shouldn't `xml-mode' be replaced with `nxml-mode' in
>> `magic-fallback-mode-alist' and `conf-mode-maybe' as well?

> Yes, I missed that.  Thanks.

I think this is wrong.  I think all those variable should point to
xml-mode, and then xml-mode should be an alias for nxml-mode (which the
user can re-alias back to sgml-mode if she so prefers).


        Stefan




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

* Re: Default for editing XML files
  2009-09-22 14:27       ` Stefan Monnier
@ 2009-09-23  9:06         ` Juri Linkov
  2009-09-23 15:57           ` Chong Yidong
  2009-09-23 20:43           ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Juri Linkov @ 2009-09-23  9:06 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

>>>> I've made nXML mode the default for editing XML files.
>>> Shouldn't `xml-mode' be replaced with `nxml-mode' in
>>> `magic-fallback-mode-alist' and `conf-mode-maybe' as well?
>
>> Yes, I missed that.  Thanks.
>
> I think this is wrong.  I think all those variable should point to
> xml-mode, and then xml-mode should be an alias for nxml-mode (which the
> user can re-alias back to sgml-mode if she so prefers).

I agree, it would be better to configure sgml-mode/nxml-mode
for all calls of xml-mode in one place.  Maybe with the help
of a new defcustom like:

(defcustom xml-mode 'nxml-mode
  "Define xml-mode."
  :type '(choice (const nxml-mode)
		 (const sgml-mode)))

(defun xml-mode ()
  (interactive)
  (funcall xml-mode))

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Default for editing XML files
  2009-09-23  9:06         ` Juri Linkov
@ 2009-09-23 15:57           ` Chong Yidong
  2009-09-23 20:43           ` Stefan Monnier
  1 sibling, 0 replies; 19+ messages in thread
From: Chong Yidong @ 2009-09-23 15:57 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Stefan Monnier, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> I agree, it would be better to configure sgml-mode/nxml-mode
> for all calls of xml-mode in one place.  Maybe with the help
> of a new defcustom like:
>
> (defcustom xml-mode 'nxml-mode
>   "Define xml-mode."
>   :type '(choice (const nxml-mode)
> 		 (const sgml-mode)))
>
> (defun xml-mode ()
>   (interactive)
>   (funcall xml-mode))

Sounds fine to me.




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

* Re: Default for editing XML files
  2009-09-23  9:06         ` Juri Linkov
  2009-09-23 15:57           ` Chong Yidong
@ 2009-09-23 20:43           ` Stefan Monnier
  2009-09-24 20:57             ` Juri Linkov
  1 sibling, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2009-09-23 20:43 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Chong Yidong, emacs-devel

> I agree, it would be better to configure sgml-mode/nxml-mode
> for all calls of xml-mode in one place.  Maybe with the help
> of a new defcustom like:

> (defcustom xml-mode 'nxml-mode
>   "Define xml-mode."
>   :type '(choice (const nxml-mode)
> 		 (const sgml-mode)))

> (defun xml-mode ()
>   (interactive)
>   (funcall xml-mode))

We already had xml-mode as an alias for sgml-mode, AFAICT.
I see no need to introduce such additional customization: we should just
change the alias to point to nxml-mode.


        Stefan




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

* Re: Default for editing XML files
  2009-09-23 20:43           ` Stefan Monnier
@ 2009-09-24 20:57             ` Juri Linkov
  2009-09-24 21:14               ` Lennart Borgman
  2009-09-25  2:03               ` Chong Yidong
  0 siblings, 2 replies; 19+ messages in thread
From: Juri Linkov @ 2009-09-24 20:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

>> I agree, it would be better to configure sgml-mode/nxml-mode
>> for all calls of xml-mode in one place.  Maybe with the help
>> of a new defcustom like:
>
>> (defcustom xml-mode 'nxml-mode
>>   "Define xml-mode."
>>   :type '(choice (const nxml-mode)
>> 		 (const sgml-mode)))
>
>> (defun xml-mode ()
>>   (interactive)
>>   (funcall xml-mode))
>
> We already had xml-mode as an alias for sgml-mode, AFAICT.
> I see no need to introduce such additional customization: we should just
> change the alias to point to nxml-mode.

The question is how often users might want to switch xml-mode back to
sgml-mode and how easy this should be.  Putting a line

  (defalias 'xml-mode 'sgml-mode)

to .emacs is easy but only if this line is easy to find in documentation.

One easy way is the Customization UI, another is adding menu entries to
the mode menu.  Designing a general mechanism to select a mode amongst
multiple implementations would be even better e.g. to switch `perl-mode'
between `perl-mode' and `cperl-mode', `js-mode' between `js2-mode' and
`espresso-mode', etc.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Default for editing XML files
  2009-09-24 20:57             ` Juri Linkov
@ 2009-09-24 21:14               ` Lennart Borgman
  2009-09-25  2:03               ` Chong Yidong
  1 sibling, 0 replies; 19+ messages in thread
From: Lennart Borgman @ 2009-09-24 21:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Chong Yidong, Stefan Monnier, emacs-devel

On Thu, Sep 24, 2009 at 10:57 PM, Juri Linkov <juri@jurta.org> wrote:

> One easy way is the Customization UI, another is adding menu entries to
> the mode menu.  Designing a general mechanism to select a mode amongst
> multiple implementations would be even better e.g. to switch `perl-mode'
> between `perl-mode' and `cperl-mode', `js-mode' between `js2-mode' and
> `espresso-mode', etc.

As I have mentioned before I have a library majmodpri.el in nXhtml
that sorts major modes according to user given priorities to them.
This is just distributed with nXhtml because I need a mechanism for
this there. If you want to edit a html file you may have a long list
of major and multi major modes to choose from.

Also please consider that if multi major modes are used then it is
perhaps not possible to use the same major modes in chunks as you
normally do for a whole buffer.




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

* Re: Default for editing XML files
  2009-09-24 20:57             ` Juri Linkov
  2009-09-24 21:14               ` Lennart Borgman
@ 2009-09-25  2:03               ` Chong Yidong
  2009-09-25  9:01                 ` Juri Linkov
  1 sibling, 1 reply; 19+ messages in thread
From: Chong Yidong @ 2009-09-25  2:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Stefan Monnier, emacs-devel

Juri Linkov <juri@jurta.org> writes:

> The question is how often users might want to switch xml-mode back to
> sgml-mode and how easy this should be.

My impression, from those few who chimed in on the earlier thread about
the switch, is that there's basically no reason to switch back to
sgml-mode.  Or is there?

If hardly anyone will want to switch back, I don't think it's worth
adding an extra knob for customizing this; we can just mention this in
the nxml-mode docstring.




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

* Re: Default for editing XML files
  2009-09-25  2:03               ` Chong Yidong
@ 2009-09-25  9:01                 ` Juri Linkov
  2009-09-25 14:18                   ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Juri Linkov @ 2009-09-25  9:01 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Stefan Monnier, emacs-devel

>> The question is how often users might want to switch xml-mode back to
>> sgml-mode and how easy this should be.
>
> My impression, from those few who chimed in on the earlier thread about
> the switch, is that there's basically no reason to switch back to
> sgml-mode.  Or is there?

I know no reason to switch back to sgml-mode.  But what I worry about
is that someone who has a reason to use sgml-mode should be able to find
an instruction how to do this.

> If hardly anyone will want to switch back, I don't think it's worth
> adding an extra knob for customizing this; we can just mention this in
> the nxml-mode docstring.

I don't think the nxml-mode docstring is an appropriate place to mention
sgml-mode.  I remember that at the early days of Wikipedia an initial
version of the article about Leo Tolstoy started with the sentence
"Along with Dostoevsky, Tolstoy is one of the most famous novelists"
that looked very silly.  Starting the nxml-mode docstring with something
like "Along with sgml-mode, nxml-mode is a major mode for editing XML"
is no better ;-)

I think a good place to mention both nxml-mode and sgml-mode is the
docstring of the xml-mode alias since the optional third argument of
`defalias' specifies the docstring:

  (defalias 'xml-mode 'nxml-mode "Docstring.")

In this docstring we could write that there are two XML editing modes,
whereas nxml-mode is the default mode, add links to docstrings of both
and provide instructions how to switch xml-mode to sgml-mode.

-- 
Juri Linkov
http://www.jurta.org/emacs/




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

* Re: Default for editing XML files
  2009-09-25  9:01                 ` Juri Linkov
@ 2009-09-25 14:18                   ` Stefan Monnier
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2009-09-25 14:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Chong Yidong, emacs-devel

> I know no reason to switch back to sgml-mode.  But what I worry about
> is that someone who has a reason to use sgml-mode should be able to find
> an instruction how to do this.

cperl-mode managed quite well by putting such instructions in the major
mode's documentation.  We could even put it directly in
sgml-mode's docstring so C-h m shows it.


        Stefan






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

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

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-12  0:12 Default for editing XML files Chong Yidong
2009-09-12  1:41 ` Miles Bader
2009-09-12  6:29 ` joakim
2009-09-12 16:02 ` Eric Hanchrow
2009-09-12 22:19   ` Sean Sieger
2009-09-13  1:16     ` Stefan Monnier
2009-09-13  1:30     ` Jason Rumney
2009-09-18 18:49 ` Chong Yidong
2009-09-21 21:48   ` Juri Linkov
2009-09-21 22:12     ` Chong Yidong
2009-09-22 14:27       ` Stefan Monnier
2009-09-23  9:06         ` Juri Linkov
2009-09-23 15:57           ` Chong Yidong
2009-09-23 20:43           ` Stefan Monnier
2009-09-24 20:57             ` Juri Linkov
2009-09-24 21:14               ` Lennart Borgman
2009-09-25  2:03               ` Chong Yidong
2009-09-25  9:01                 ` Juri Linkov
2009-09-25 14:18                   ` Stefan Monnier

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