[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:48:59 -0700 |
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.