emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-v


From: Luc Teirlinck
Subject: Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?]
Date: Sat, 30 Jul 2005 20:02:00 -0500 (CDT)

Richard Stallman wrote:

   If we can't arrange to make just the defcustom do the job, documenting
   this method is ok with me.

   Perhaps we should document a simple way and a complex way.  The simple
   way is that it all gets done by the :set function when the defcustom's
   expansion is executed.  That requires putting the defcustom after the
   minor mode function and generating a defvar before the function.
   You'd use custom-initialize-reset.

   For cases which are more complex, you'd use custom-initialize-default
   and then write (if foo-mode (foo-mode 1)) at the end of the file.

If we are willing to change define-minor-mode, then I do not believe
that there is any need for the more complex method, unless there is
some reason why the define-minor-mode can not be delayed until all
functions called by the minor mode have been defined.

If we make define-minor-mode write a compiler defvar, then define the
mode function and then write the defcustom, one can use
custom-initialize-set if the define-minor-mode is not autoloaded, and
custom-initialize-reset if it is to be autoloaded.  Actually,
custom-initialize-reset is relatively harmless for the default
define-minor-mode :set function.  (The problems I was referring to
concern non minor mode :set functions, as I pointed out in my other
message.)

Sincerely,

Luc.





reply via email to

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