[Top][All Lists]

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

Re: Default :group in lisp/emacs-lisp/easy-mmode.el.

From: Luc Teirlinck
Subject: Re: Default :group in lisp/emacs-lisp/easy-mmode.el.
Date: Fri, 1 Apr 2005 21:30:30 -0600 (CST)

Richard Stallman wrote:

   The use of custom-current-group seems like a bad practice to me.
   It is unreliable to make one defun depend on whatever was lying around
   from a previous defun in this way.  It has the result that moving
   code from one place in a file to another changes its meaning.

   So I think it would be better to document that define-minor-mode
   and easy-mmode-define-global-mode default the group based
   solely on the mode name.

I believe the default :group need not be documemted, because it should
*never* be relied on.  I believe that what should be emphatically
documented in the docstring of define-minor-mode and all other places
where define-minor-mode is documented is that an explicit :group
should *always* be given.  Alternatively, if the default group would
be documented, then it should be emphatically pointed out that, if the
user relies on that default, then the user needs to manually write an
appropriate defgroup for that default group, _with a valid parent
group_, having one of the major groups as an ancestor.  (Unless such a
defgroup already exists.)

The reason for that is that most of the time the default group chosen
by define-minor-mode is a bogus group without one of the major groups
as its ancestors.  As a result, users browsing Custom using
`customize-browse' or similar will never find the options.  One
example of a bug caused by the fake groups constructed by
define-minor-mode is `xterm-mouse-mode'.  I will discuss this
separately.  I seriuosly doubt that this is the only such example,
although it is the only one I am currently aware of.



reply via email to

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