all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* defcustom - restricted list of symbols
@ 2006-10-15 18:48 Joe Casadonte
  2006-10-15 23:53 ` Magnus Henoch
       [not found] ` <mailman.8194.1160956463.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Casadonte @ 2006-10-15 18:48 UTC (permalink / raw)



I'd like to write a defcustom variable definition that:

1. is a symbol (but could be a string, if need be)
2. is one of a list of "acceptable" symbols
3. the complete list of "acceptable" symbols is not know at the time I
   write I write the defcustom itself (but is known at run-time)
4. by the nature of #3, I need to be able to add to the list of valid
   symbols
5. presented to the user as a radio button or check box would be

Here's an example:

Let's say I have a generic dictionary front-end module, and I ship
with the two dictionaries: English and German.  When the user goes to
customize the 'default-dictionary' for this module, I want them to be
able to choose between English, German and any other dictionary they
have installed.  I don't know at the time I write the front-end which
dictionaries are available (as more could be added), and I don't know
which the user will have installed.  I can, however, count on the
proper installation of a dictionary to update some other variable,
which comprises a list of installed dictionaries.

If that is somehow possible, is it then possible to make this variable
just one element in a list of values that comprise a single variable?
To continue the above (completely contrived) example, say I want to
link a given mode and a default dictionary, so that message-mode uses
German as the default, and text-mode uses English.  Normally I would
create a compound defcustom definition, using the 'list type and
choice and what-not.

Now, assuming all of that *is* possible, is there a reason not to use
it?  Care would have to be taken to ensure that the list of installed
dictionaries is known *before* `custom-set-variables' is called.  But
I think that's possible to do given the :set-after and :require
keywords.

Thanks for the help!

--
Regards,


joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-17  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-15 18:48 defcustom - restricted list of symbols Joe Casadonte
2006-10-15 23:53 ` Magnus Henoch
     [not found] ` <mailman.8194.1160956463.9609.help-gnu-emacs@gnu.org>
2006-10-17  2:11   ` Joe Casadonte

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.