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 21:06:03 -0500 (CDT)

Stefan Monnier wrote:

   > I believe the current value of "nil" for PARENT should be
   > eliminated and replaced by a separate macro `define-major-mode', which
   > would be a true analogue of `define-minor-mode'.  This would then
   > take over as the "standard" way to define a major mode.

   And what would be the benefit ?
   I know Richard hates `define-derived-mode' and wants a `define-major-mode'
   instead.  My point is just that the two can be merged and that we can
   define `define-major-mode as an alias for `define-derived-mode'
   or if you really dislike the "nil" argument, you can just do

     (defmacro define-major-mode (mode name &optional docstring &rest body)
       `(define-derived-mode ,mode nil ,name ,docstring ,@body)

   > I propose to define a macro that would be called like this:
   > 
   > (define-major-mode mymode name syntax-table abbrev-table mode-class
   > docstring body)

What is the benefit of the current situation?  It uses a macro for a
purpose that is way more general than its original intended purpose
and artificially forces two functionalities into one.  It all seems
very unnatural to me.

Defining a separate define-major-mode in the way you suggest would be
an improvement over the current situation.  However, it still seems
unnatural to define a very general function essentially as a special
case of an extremely specialized function.  It would be far more
logical to do the opposite.

I do not understand why you feel so strongly about this.  Richard
actually seems to agree with you in as far as the desirability of a
standard function is concerned.  So do I.  This seems to be the really
fundamental question.  The rest are technical details.  You extremely
strongly seem to insist that this standard function should be a
special case of define-derived-mode, which seems completely illogical.
Why?  What is the benefit of that?

Sincerely,

Luc.





reply via email to

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