[Top][All Lists]

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

bug#11301: 24.1.50; `define-minor-mode' should set `custom-mode-group' a

From: Drew Adams
Subject: bug#11301: 24.1.50; `define-minor-mode' should set `custom-mode-group' according to :group
Date: Sat, 21 Apr 2012 10:18:34 -0700

I just started to look at this, so forgive me if I am missing something.
`define-derived-mode' picks up the :group keyword and uses it, among
other things, to do this: (put ',child 'custom-mode-group ,group), that
is, to declare the group as the custom-mode-group for the new mode.
My suggestion is for `define-minor-mode' - and perhaps other
mode-defining macros - to do likewise.  `define-minor-mode' apparently
uses the :group keyword only for defining the user options it defines.
As it stands today, you can define a minor mode `foo' using
`define-minor-mode', and then try `C-u customize-mode, but `foo' will
not appear as a possible completion, because neither property
`custom-mode-group' nor property `custom-group' has been applied to the
symbol `foo'.  This is too bad.
Grepping for `custom-mode-group' shows that it is applied _only_ in
`define-derived-mode', and it is used _only_ in `custom-group-of-mode',
which in turn is used _only_ in `customize-mode'.
Grepping for `custom-group' and filtering a bit, my impression is that
that property is put on symbols only by `custom-add-to-group'.  And
grepping for `custom-add-to-group', it is not too clear where
`custom-group' is put on symbols.  Things like `custom-declare-variable'
do so, but is that used by `defcustom' or does `defcustom' do likewise?
In any case, I do not see a `custom-group' property on any of the user
options or faces I have defined using `defcustom' and `defface'.
Likewise, for the options defined by `define-minor-mode'.
So what's the story here?  Does `customize-mode' work only for derived
modes?  If so, why?  Can we please DTRT so that it works (e.g. with a prefix
arg) for any major or minor mode with a clearly identified :group?  See related
bug #11299.
Please do what it takes to have major and minor modes - at least those clearly
recognizable as such via `define-minor-mode' etc. and that clearly have a
defined :group - be assigned the property `custom-mode-group' (or
`custom-group'), so that `custom-group-of-mode' recognizes them.

In GNU Emacs (i386-mingw-nt5.1.2600)
 of 2012-04-19 on MARVIN
Bzr revision: 107968 address@hidden
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --no-opt --enable-checking --cflags

reply via email to

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