all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
Subject: custom type tests
Date: Fri, 30 Nov 2007 17:09:23 -0800	[thread overview]
Message-ID: <DHEEKFAFJEFOJHLCFPFDOEJJCCAA.drew.adams@oracle.com> (raw)

Does anyone know of code that deals with custom types in such a way that you
could test whether the type of a user option is compatible with a given
type?

For instance, if a variable `foo' is of type `regexp' and `bar' is of type
`color', I would want a test for compatibility with type `string' to return
non-nil for each, since a regexp and a color are strings.

As another example, if `foo' is of type `string', I would want a test for
compatibility with type (choice (const nil) string) to return non-nil, since
a string is in the union of all strings and {nil}.

Any existing code that deals with subtypes this way? Any code that deals
with custom type tests, other than just `custom-variable-type' and (get __
'custom-type)?

I'm looking for code that would allow flexible type tests - subtyping, if
possible (see above), but also not differentiating between types such as
(choice (const :tag "toto" nil) string) and (choice (const nil) string) or
between (choice (choice (const nil) string) and (choice string (const nil)).

Any pointers to pertinent code or doc are appreciated. Think of it this way:
Given a custom type, how can I find all user options that have that type (or
a compatible type, such as a subtype)?

             reply	other threads:[~2007-12-01  1:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-01  1:09 Drew Adams [this message]
2007-12-01  1:38 ` custom type tests Lennart Borgman (gmail)
2007-12-01  1:57   ` Lennart Borgman (gmail)
2007-12-01  3:48     ` Drew Adams
2007-12-01 12:17       ` Lennart Borgman (gmail)
2007-12-01 20:12         ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DHEEKFAFJEFOJHLCFPFDOEJJCCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.