all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* predicate group-p to see if a group exists?
@ 2008-01-31 23:03 Drew Adams
  2008-02-01  6:40 ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2008-01-31 23:03 UTC (permalink / raw)
  To: Emacs-Devel

There seems to be no predicate to test whether a particular group is
defined. Should there be one? (group-p 'foo)

For example, consider a library that could be used with different Emacs
versions. Suppose that a group `foo' exists in one Emacs version but not in
another (Buffer-menu is an example - doesn't exist in Emacs 20).

Suppose I want to define a new group `my-foo'. I want it to have group `foo'
as parent, if group `foo' exists'. If not, I want it to have whatever
parent(s) `foo' has in the Emacs versions where `foo' is defined.

For that, I could do this, if predicate `group-p' existed:

(defgroup my-foo nil "jjjj"
  :group (if (group-p 'foo) 'foo 'bar))

Yes, I could just do this:

(defgroup my-foo nil "jjjj"
  :group 'foo :group 'bar)

But in the later Emacs versions, `my-foo' will also have `bar' as parent,
not just `foo', which is a bit less tidy.





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

end of thread, other threads:[~2008-02-02  7:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-31 23:03 predicate group-p to see if a group exists? Drew Adams
2008-02-01  6:40 ` martin rudalics
2008-02-01  7:11   ` Drew Adams
2008-02-01 14:53     ` Stefan Monnier
2008-02-01 15:00       ` Lennart Borgman (gmail)
2008-02-02  7:39     ` Richard Stallman

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.