From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.help Subject: Re: Programmatically access all the possible values of a defcustom Date: Thu, 30 Jan 2014 13:40:26 +0100 Organization: Sebastien Vauban Message-ID: <86lhxxhccl.fsf@somewhere.org> References: <86fvo6jzx5.fsf@somewhere.org> <86ha8lixj8.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391085922 20838 80.91.229.3 (30 Jan 2014 12:45:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jan 2014 12:45:22 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Jan 30 13:45:27 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W8qzh-0003pu-DD for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 13:45:21 +0100 Original-Received: from localhost ([::1]:48320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8qzh-0007bE-1Y for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jan 2014 07:45:21 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Injection-Info: mx05.eternal-september.org; posting-host="402b34550bd938aa98825778083dce0e"; logging-data="2736"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX18z20b+TT87OQV9rIyWO0T2" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:dUfyfTLLbPXcPRPTHrKfik2M4Lk= sha1:MUKJpVhifUKL4Y5/z2btEnSHIrk= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:203525 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:95794 Archived-At: Nicolas Richard wrote: > "Sebastien Vauban" writes: >> Now, I'll have to play with the list to obtain what I really want: >> a string like... >> >> Awk, C, R, Asymptote, Calc, Clojure, CSS, Ditaa, Dot, Emacs Lisp, >> Fortran > > The objects are "widgets", so e.g. > > (widget-get (get 'org-babel-load-languages 'custom-type) :key-type) > > will get you to the (choice ...) data which is documented at (info > "(widget) composite") > > I'm unsure what's the best way to get rid of the [keyword value] pairs > and only map over each inner (const ...) widget ; there ought to be > something defined within the widget library but i couldn't find it. Or > maybe my whole approach is wrong, I don't know. > > Anyway, this works for me : > > (mapconcat (lambda (widget) > (widget-get widget :tag)) > (cl-remove-if-not (lambda (it) > (and (consp it) > (eq (car it) 'const))) > (cdr > (widget-get > (get > 'org-babel-load-languages 'custom-type) > :key-type))) > ", ") You save me *a lot* of time: I'd have to "play" a lot before arriving to such a code. Thanks! (and it's perfectly what I was after) Best regards, Seb -- Sebastien Vauban