From xemacs-m  Tue Apr 15 13:12:07 1997
Received: from elc1.dina.kvl.dk (elc1.dina.kvl.dk [130.225.40.228])
	by xemacs.org (8.8.5/8.8.5) with SMTP id NAA24567
	for <xemacs-beta@xemacs.org>; Tue, 15 Apr 1997 13:12:06 -0500 (CDT)
Received: from zuse.dina.kvl.dk (zuse.dina.kvl.dk [130.225.40.245]) by elc1.dina.kvl.dk (8.6.12/8.6.4) with ESMTP id UAA06486; Tue, 15 Apr 1997 20:11:38 +0200
Received: (abraham@localhost) by zuse.dina.kvl.dk (8.6.12/8.6.4) id UAA12174; Tue, 15 Apr 1997 20:11:49 +0200
Sender: abraham@dina.kvl.dk
To: xemacs-beta@xemacs.org, emacs-custom@sunsite.auc.dk
Subject: Re: Specifiers in custom
References: <kigzpv3xjqu.fsf@jagor.srce.hr> <rj912mj446.fsf@zuse.dina.kvl.dk> <kigiv1qyjyr.fsf@jagor.srce.hr> <rjzpv2ho21.fsf@zuse.dina.kvl.dk> <kigohbgh9t8.fsf@jagor.srce.hr> <rj912kfu45.fsf@zuse.dina.kvl.dk> <kign2r0h6z5.fsf@jagor.srce.hr> <rj67xofpjo.fsf@zuse.dina.kvl.dk> <kig912kgvam.fsf@jagor.srce.hr>
Organization: The Church of Emacs
X-Face: +kRV2]2q}lixHkE{U)mY#+6]{AH=yN~S9@IFiOa@X6?GM<U{B+4e{k79.Ya{~':DblFPCg$
 @60,BfLv2@SKZ19cMWK0/C'v;tM:|6B'R}U1rp6CL&kN({9<zF/V{:JCg27yC)9oZjeqcQawzKfiNL
 t9}`vjmK["dRQC/qGFQq"%u|Q`:6{"Rz}b(dnl_"3$Jtqimi>|8MBp/
From: Per Abrahamsen <abraham@dina.kvl.dk>
Date: 15 Apr 1997 20:11:49 +0200
In-Reply-To: Hrvoje Niksic's message of 15 Apr 1997 17:28:17 +0200
Message-ID: <rjn2r0dul6.fsf@zuse.dina.kvl.dk>
Lines: 51
X-Mailer: Gnus v5.4.37/Emacs 19.34
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


Hrvoje Niksic <hniksic@srce.hr> writes:

> If one declares something with `defcustom', maybe he'll have to cope
> with the fact that it becomes a variable?  I mean, you *will*
> generally declare variables with this feature, although their setting
> may be followed with some function calls.

Yes, I'll stick to the variable namespace for now.

There is still a problem with initialization.  How and when should the
`defcustom' construct call the :set function?

Here are some answers:

1) Never.  It is only used when changing the value, not when
   initializing.  This is the correct answer for `ispell-dictionary'.

2) Always.  Even if the variable is already bound, call the :set
   function with its current value.  This way the user can use `setq'
   to set the option is his .emacs, and get the code run anyway.  

3) Only when the variable is not already bound.  This is have it works
   for normal variables. 

4) Only when the variable is saved (or perhaps already bound).  I.e., don't
   :set it to its default value.  This makes sense if you have a mode
   that is off by default, but want to allow the user to turn it on
   with customize. 

Others?  It will probably be necessary to add a keyword to specify
this.  Maybe the value for the keyword should simply _be_ the
initialize function.  The default would be (1) then, which is the
current initialize function.  Pre-defined functions for (at least) 2-4
should be available. 

Perhaps there also should be a way to force the file containing the
declaration to be loaded from the `custom-set-variables' call in
`.emacs'.  If you use this to turn on `balloon-help' you want it to take
effect immediately, not whenever something happens to load
`balloon-help.el'.

Hmmm... adding up we get:

:get		function to get the current value (default: default-value)
:set		function to set the current value (default: set-default)
:initialize	function to initialize the the value
		(default: part of custom-declare-variable).
:require	feature to require after (before?) setting the value with
		`custom-set-variables' (default: none).

