all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
@ 2013-01-27 18:24 Drew Adams
  2016-04-28 22:06 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2013-01-27 18:24 UTC (permalink / raw)
  To: 13568

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'
 






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

end of thread, other threads:[~2016-04-29 18:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-27 18:24 bug#13568: 24.3.50; wishlist: add a `group-p' predicate Drew Adams
2016-04-28 22:06 ` Lars Ingebrigtsen
2016-04-29 15:44   ` Drew Adams
2016-04-29 15:45     ` Lars Ingebrigtsen
2016-04-29 18:11       ` Drew Adams
2016-04-29 18:29         ` Lars Ingebrigtsen

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.