From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: predicate group-p to see if a group exists? Date: Thu, 31 Jan 2008 15:03:04 -0800 Message-ID: <002801c8645d$6fb86230$9eb22382@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201820619 16380 80.91.229.12 (31 Jan 2008 23:03:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2008 23:03:39 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 01 00:04:01 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKiRk-0003fM-1W for ged-emacs-devel@m.gmane.org; Fri, 01 Feb 2008 00:03:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKiRI-00062V-HI for ged-emacs-devel@m.gmane.org; Thu, 31 Jan 2008 18:03:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKiRE-000603-1W for emacs-devel@gnu.org; Thu, 31 Jan 2008 18:03:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKiRA-0005t0-OW for emacs-devel@gnu.org; Thu, 31 Jan 2008 18:03:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKiRA-0005sn-HJ for emacs-devel@gnu.org; Thu, 31 Jan 2008 18:03:16 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JKiRA-0006uP-3O for emacs-devel@gnu.org; Thu, 31 Jan 2008 18:03:16 -0500 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m0VN36Nq016276 for ; Thu, 31 Jan 2008 17:03:06 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m0UAwRkl020290 for ; Thu, 31 Jan 2008 16:03:06 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3550438341201820585; Thu, 31 Jan 2008 15:03:05 -0800 Original-Received: from dradamslap1 (/130.35.178.158) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 31 Jan 2008 15:02:58 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AchkXW9gCC6B7s39REqink/ysoojFA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87894 Archived-At: 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.