emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent attempts at standardizing major mode definitions.


From: Luc Teirlinck
Subject: Re: Recent attempts at standardizing major mode definitions.
Date: Tue, 3 Sep 2002 20:24:35 -0500 (CDT)

Stefan Monnier wrote:

   > define-derived-mode is currently used for two barely compatible, in
   > many respects diametrically opposite purposes:

   Could you expand a little ?  In what way are they diametrically opposed ?

As I already said, one use is to define a major mode starting from a
very closely related major mode.  This is a very specialized
situation.  In such a very specialized situation it is "easy" (or,
sometimes not so easy, as our discussion of inheritance versus using
of the parent abbrev table shows) to make standard decisions for the
author.  This provides convenience for the author and consistency for
the author.

Unless I misunderstood you, which is very well possible, you implied
in your previous message that you do not particularly care about this
particular use (again, I might have misunderstood), but it is the
original intended use and the code for a non-nil non-fundamental-mode
PARENT clearly reflects that, even the code for a nil PARENT still
does. 

The second use is as a standard way to define any major mode
whatsoever. There is a tremendous variety in major modes.  The level
of generality is "diametrically opposite" to the previous situation.
That is a very big difference.  In this situation, you have to make
only those decisions in advance, in the author's place, that you
definitely want all major modes to make.  The author can of course
override any decision the macro makes, as you showed with examples,
but the point is that (s)he should not have to worry about doing that.
Some modes, like dired and other related should not have an
abbrev-table for instance.  (I believe I would have to make some
change in my own proposed code to reflect that).  There is a
tremendous variety in major modes.

Sincerely,

Luc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]