all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to obtain customize :type for an option at runtime?
@ 2006-01-28 16:53 Drew Adams
  2006-01-29  2:09 ` Lennart Borgman
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2006-01-28 16:53 UTC (permalink / raw)


How can I determine, for a given user option, what its Customize :type is?

For example, function `user-variable-p' tests whether a symbol is a user
option, but what if I want to test whether a variable is a toggle (binary)
option?

Although not all options that can act as toggles are defined with a simple
":type 'boolean" in Customize (far from it, and there are good reasons for
that), obtaining such :type info would be a start.

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

* Re: How to obtain customize :type for an option at runtime?
       [not found] <mailman.13.1138483893.3044.help-gnu-emacs@gnu.org>
@ 2006-01-28 22:57 ` John Paul Wallington
  2006-01-28 23:25   ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: John Paul Wallington @ 2006-01-28 22:57 UTC (permalink / raw)
  Cc: Help-Gnu-Emacs

"Drew Adams" <drew.adams@oracle.com> writes:

> How can I determine, for a given user option, what its Customize :type is?

Examine its `custom-type' property.

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

* RE: How to obtain customize :type for an option at runtime?
  2006-01-28 22:57 ` How to obtain customize :type for an option at runtime? John Paul Wallington
@ 2006-01-28 23:25   ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2006-01-28 23:25 UTC (permalink / raw)


    > How can I determine, for a given user option, what its
    > Customize :type is?

    Examine its `custom-type' property.

Thanks a lot John-Paul - just what I needed.

I guess this is another one of those things that you need to search the
source code to find - it's not in the Elisp manual.

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

* Re: How to obtain customize :type for an option at runtime?
  2006-01-28 16:53 Drew Adams
@ 2006-01-29  2:09 ` Lennart Borgman
  0 siblings, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2006-01-29  2:09 UTC (permalink / raw)
  Cc: Help-Gnu-Emacs

Drew Adams wrote:
> How can I determine, for a given user option, what its Customize :type is?
>
> For example, function `user-variable-p' tests whether a symbol is a user
> option, but what if I want to test whether a variable is a toggle (binary)
> option?
>
> Although not all options that can act as toggles are defined with a simple
> ":type 'boolean" in Customize (far from it, and there are good reasons for
> that), obtaining such :type info would be a start.
>   
It is in the symbol property list:

    (get 'your-symbol 'custom-type)

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

end of thread, other threads:[~2006-01-29  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.13.1138483893.3044.help-gnu-emacs@gnu.org>
2006-01-28 22:57 ` How to obtain customize :type for an option at runtime? John Paul Wallington
2006-01-28 23:25   ` Drew Adams
2006-01-28 16:53 Drew Adams
2006-01-29  2:09 ` Lennart Borgman

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.