unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <11301@debbugs.gnu.org>
Subject: bug#11301: 24.1.50; `define-minor-mode' should set `custom-mode-group' according to :group
Date: Sat, 21 Apr 2012 10:48:59 -0700	[thread overview]
Message-ID: <EFD781E4B0784FB28C5D3D6B855D743A@us.oracle.com> (raw)
In-Reply-To: <3208B35C4FFE47FFBD0A7029AB2DBB8C@us.oracle.com>

OK, so I looked a bit further.  For major or minor mode `foo-mode':

`custom-group-of-mode' checks for property `custom-mode-group' on the symbol
`foo-mode'.

Lacking that, it checks for property `custom-group' on the same symbol.

Lacking that, it checks for `custom-group' on symbol `foo'.

So if we look at `icomplete-mode', which is defined using
`define-minor-mode' specifying :group as `icomplete':
(custom-group-of-mode 'icomplete-mode) returns non-nil,
because symbol `icomplete' gets property `custom-group'.
Where does that come from?  

It seems to come from the :group.  But the :group value is not applied as
property `custom-group' to the _mode_ symbol.  It is applied only to the :group
value itself.  E.g., with :group 'Foo, property `custom-group' is applied to the
symbol `Foo' but not (also) to the mode name `foo-mode' or even `foo'.

So if you use as the :group value something that is not _identical_ to the
mode-function symbol (or that minus `-mode'), then `custom-group-of-mode' does
not work.  Its attempt to find the mode's group is too limited.  If you use
:group 'Foo or :group 'Foos, you are out of luck.  You must use :group 'foo for
`foo-mode' to be recognized by `custom-group-of-mode'.  (And no such limitations
are documented.)

Please DTRT: pick up whatever :group specifies as the group and include it in
the value of property `custom-group' for the mode name.






  reply	other threads:[~2012-04-21 17:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21 17:18 bug#11301: 24.1.50; `define-minor-mode' should set `custom-mode-group' according to :group Drew Adams
2012-04-21 17:48 ` Drew Adams [this message]
2021-06-02  6:54 ` Lars Ingebrigtsen
2021-06-02 13:25   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-03  7:45     ` Lars Ingebrigtsen
2021-06-03 13:20       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-04  8:45         ` Lars Ingebrigtsen
2021-06-04 17:13           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-06  9:29             ` Lars Ingebrigtsen
2021-06-06 17:57               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=EFD781E4B0784FB28C5D3D6B855D743A@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=11301@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 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).