bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13568: 24.3.50; wishlist: add a `group-p' predicate


From: Drew Adams
Subject: bug#13568: 24.3.50; wishlist: add a `group-p' predicate
Date: Sun, 27 Jan 2013 10:24:56 -0800

Subject line says it all: Please add a predicate `group-p' that
returns non-nil if its symbol arg is a loaded customize group
(i.e. defined by a defgroup that has been evaluated).
 
Not sure what the code might be for an appropriate definition.
 
I thought that perhaps (rassq SYMBOL custom-current-group-alist) could
be used as the test, but apparently not.  When there is more than one
defgroup in a file, only the last group gets recorded for it in
`custom-current-group-alist'.  (Is that a bug or intended?)
 
Perhaps one of the following tests, pulled from `customize-read-group',
would be appropriate?  I'm not sure what the second one is about.
`group-p' should return non-nil only for a symbol defined in a defgroup
that has been evaluated (e.g. loaded).
 
1. (get symbol 'custom-group)
 
2. (or (and (get symbol 'custom-loads)
            (not (get symbol 'custom-autoload)))
       (get symbol 'custom-group))
 
But I see that a defgroup for a group that has not (yet) had any faces
or options (or subgroups) added to it is not reflected in
`custom-group', so I guess that test is not appropriate either.  E.g.,
if a (defgroup foo...) is evaluated but it gets no members, then (get
'foo 'custom-group) returns nil.
 
So I'm not sure what the proper definition might be.  That in itself
(showing my ignorance/confusion) is one argument for having a `group-p'
predicate.
 
In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-01-25 on ODIEONE
Bzr revision: 111604 eliz@gnu.org-20130125143821-1ykj7ia1qjojjjnp
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 






reply via email to

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