* 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
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
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
0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-28 22:06 UTC (permalink / raw)
To: Drew Adams; +Cc: 13568
"Drew Adams" <drew.adams@oracle.com> writes:
> 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).
What the use case for such a function?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
2016-04-28 22:06 ` Lars Ingebrigtsen
@ 2016-04-29 15:44 ` Drew Adams
2016-04-29 15:45 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-04-29 15:44 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 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).
>
> What the use case for such a function?
Uh, to test whether a given symbol corresponds to "a loaded
customize group (i.e. defined by a defgroup that has been
evaluated)."
Clearly (see the rest of the bug report), it is not clear
how Lisp code can test for this. Property `custom-group'
is not the answer. Nor, apparently, is a combination of
properties `custom-group' and `custom-autoload'. How to
test for this condition?
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
2016-04-29 15:44 ` Drew Adams
@ 2016-04-29 15:45 ` Lars Ingebrigtsen
2016-04-29 18:11 ` Drew Adams
0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 15:45 UTC (permalink / raw)
To: Drew Adams; +Cc: 13568
Drew Adams <drew.adams@oracle.com> writes:
>> > 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).
>>
>> What the use case for such a function?
>
> Uh, to test whether a given symbol corresponds to "a loaded
> customize group (i.e. defined by a defgroup that has been
> evaluated)."
And what's the use case for that? Why do you want to know whether a
symbol has been used as a customization group?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
2016-04-29 15:45 ` Lars Ingebrigtsen
@ 2016-04-29 18:11 ` Drew Adams
2016-04-29 18:29 ` Lars Ingebrigtsen
0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2016-04-29 18:11 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 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).
> >>
> >> What the use case for such a function?
> >
> > Uh, to test whether a given symbol corresponds to "a loaded
> > customize group (i.e. defined by a defgroup that has been
> > evaluated)."
>
> And what's the use case for that? Why do you want to know whether a
> symbol has been used as a customization group?
Why wouldn't I? A custom group is a thing. If you have
code that uses that thing (and that is what the thing
is for) then it is reasonable to be able to test for
that thingness.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#13568: 24.3.50; wishlist: add a `group-p' predicate
2016-04-29 18:11 ` Drew Adams
@ 2016-04-29 18:29 ` Lars Ingebrigtsen
0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 18:29 UTC (permalink / raw)
To: Drew Adams; +Cc: 13568
Drew Adams <drew.adams@oracle.com> writes:
> Why wouldn't I? A custom group is a thing. If you have
> code that uses that thing (and that is what the thing
> is for) then it is reasonable to be able to test for
> that thingness.
So you have no use case? Closing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ 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 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).