[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
defcustom - restricted list of symbols
From: |
Joe Casadonte |
Subject: |
defcustom - restricted list of symbols |
Date: |
Sun, 15 Oct 2006 14:48:48 -0400 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) |
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!
------------------------------------------------------------------------------
- defcustom - restricted list of symbols,
Joe Casadonte <=