all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: 13568@debbugs.gnu.org
Subject: bug#13568: 24.3.50; wishlist: add a `group-p' predicate
Date: Sun, 27 Jan 2013 10:24:56 -0800	[thread overview]
Message-ID: <0138B6575E46439E9E33E54D07D2C103@us.oracle.com> (raw)

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	other threads:[~2013-01-27 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27 18:24 Drew Adams [this message]
2016-04-28 22:06 ` bug#13568: 24.3.50; wishlist: add a `group-p' predicate 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0138B6575E46439E9E33E54D07D2C103@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=13568@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.