unofficial mirror of emacs-devel@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).