help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatically access all the possible values of a defcustom


From: Sebastien Vauban
Subject: Re: Programmatically access all the possible values of a defcustom
Date: Thu, 30 Jan 2014 11:17:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Hi Nicolas,

Nicolas Richard wrote:
> "Sebastien Vauban" writes:
>> Is there a possibility to programmatically access all the values that
>> a defcustom can take?
>
> I guess it's in the plist associated to the symbol. Let's check:
> (symbol-plist 'org-babel-load-languages)
>
> Ah ha!
>
> (get 'org-babel-load-languages 'custom-type)
> => (alist :tag "Babel Languages" :key-type (choice (const :tag "Awk" awk)
> (const :tag "C" C) (const :tag "R" R) (const :tag "Asymptote" asymptote)
> (const :tag "Calc" calc) (const :tag "Clojure" clojure) (const :tag "CSS" css)
> (const :tag "Ditaa" ditaa) (const :tag "Dot" dot) (const :tag "Emacs Lisp"
> emacs-lisp) (const :tag "Fortran" fortran) ...) :value-type (boolean :tag
> "Activate" :value t))

Thanks for putting me on track.

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

Best regards,
  Seb

-- 
Sebastien Vauban


reply via email to

[Prev in Thread] Current Thread [Next in Thread]