From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Joe Casadonte" Newsgroups: gmane.emacs.help Subject: defcustom - restricted list of symbols Date: Sun, 15 Oct 2006 14:48:48 -0400 Organization: Llama Fresh Farms, Neare Paraguay Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1160941229 26189 80.91.229.2 (15 Oct 2006 19:40:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2006 19:40:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 15 21:40:28 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GZBqV-0007va-8Y for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Oct 2006 21:40:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GZBqU-0004eJ-NA for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Oct 2006 15:40:26 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 15 Oct 2006 13:48:48 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:dEAow8zES5V3wVH/qoelJb3AWnY= Original-Lines: 56 Original-NNTP-Posting-Host: 66.92.238.209 Original-X-Trace: sv3-L9klPmQSTdg2NwvYOLmZoGrMeO+chESmwzPqpvrpDGI1mIpADItzERPkrJO+MRlzWdcHlvPjrsVdUff!LSth+dW/qQ5umfPBZXrRZooWS5WPLI6KS63tzrAbA9aENB+8R/3GFL1PiNNlZRQ6NqKVUtvWA7Fq!CiUywcZ10JI8AGAVjmNVlemlZCMutA== Original-X-Complaints-To: abuse@speakeasy.net X-DMCA-Complaints-To: abuse@speakeasy.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Original-Xref: shelby.stanford.edu gnu.emacs.help:142433 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38054 Archived-At: 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! ------------------------------------------------------------------------------