From xemacs-m  Tue Apr 15 07:17:51 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 HAA22293
	for <xemacs-beta@xemacs.org>; Tue, 15 Apr 1997 07:17:50 -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 OAA03269; Tue, 15 Apr 1997 14:17:36 +0200
Received: (abraham@localhost) by zuse.dina.kvl.dk (8.6.12/8.6.4) id OAA11499; Tue, 15 Apr 1997 14:17:47 +0200
Sender: abraham@dina.kvl.dk
To: Hrvoje Niksic <hniksic@srce.hr>
Cc: XEmacs Developers <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>
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 14:17:47 +0200
In-Reply-To: Hrvoje Niksic's message of 15 Apr 1997 13:15:58 +0200
Message-ID: <rj67xofpjo.fsf@zuse.dina.kvl.dk>
Lines: 43
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:

> It would work, without a special-case support for specifiers, which
> you don't like (the specifiers, not the special-case).  Can you
> propose a nicer implementation?

The :type argument describes the value, not how to set or get it.
Doing what you outlined would be a violation of the layers.

However, your basic point is right.  Sorry for just giving a knee-jerk
reaction to the layer violation, instead of looking further.  The only
difference is that the keywords will apply directly to the defcustom,
not to the type argument, like this:

(defcustom ispell-dictionary nil
  "bla bla"
  :type '(choice (const :tag "default" nil)
                 (string :format "%v"))
  :group 'ispell
  :set (lambda (symbol value)
         (if (featurep 'ispell)
             ;; Ispell is not loaded yet, just setting the variable will work!
             (set-default symbol value)
           ;; After loading the library, we must call this function.
           (ispell-change-dictionary value))))

A similar `:get' function will also be available.

I can see at least two questions that must be answered (in the general
case, not just for specifiers), though:

- How should other namespaces be handled?  `ispell-dictionary' lives
  in the variable namespace, but I can easily think of examples of
  customizations that aren't directly associated with variables.
  Specifiers may be one of these.  Forcing them into the variable
  namespace seems wrong. 

- How about initialization?  If the user saves an option with a :set
  or :get argument, should the file with the defcustom then be
  loaded at upstart to get at them?  Or should the get/set functions
  be saved in the users .emacs file?

