emacs-devel
[Top][All Lists]
Advanced

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

predicate group-p to see if a group exists?


From: Drew Adams
Subject: predicate group-p to see if a group exists?
Date: Thu, 31 Jan 2008 15:03:04 -0800

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.





reply via email to

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