Subject: Re: bug#41145: 27.0.91; small issues with `display-fill-column-indicator' Customization group

From: Stefan Monnier <[email-masked]>
Date: Sun, 30 Aug 2020 10:51:23 -0400

>> `global-display-fill-column-indicator-mode` should definitely belong to
>> the `display-fill-column-indicator` group (because the `defcustom`
>> doesn't have an explicit `:group` so it should fallback to using the
>> last-defined group).
>
> Is it, though?
> emacs -Q
> M-x customize-option RET global-display-fill-column-indicator-mode
> And near the end of buffer I read:
> Groups: Global Display Fill Column Indicator

Oh, indeed, it's an old misfeature that was introduced by our
idiot-in-chief (tho to my defense, I think it made some sense back then
because `defcustom` did not have a useful default for `:group`).

We can fix it either by adding `:group 'display-fill-column-indicator`
to the `define-globalized-minor-mode` or by getting rid of the
misfeature, as in the patch below (this patch will likely fix a few
other similar cases).

Eli?

        Stefan

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 24c9e79f2c..e3eb9294ed 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -157,9 +157,6 @@ define-minor-mode
   the minor mode is global):
 
 :group GROUP	Custom group name to use in all generated `defcustom' forms.
-		Defaults to MODE without the possible trailing \"-mode\".
-		Don't use this default group name unless you have written a
-		`defgroup' to define that group properly.
 :global GLOBAL	If non-nil specifies that the minor mode is not meant to be
 		buffer-local, so don't make the variable MODE buffer-local.
 		By default, the mode is buffer-local.
@@ -262,12 +259,6 @@ define-minor-mode
     (unless initialize
       (setq initialize '(:initialize 'custom-initialize-default)))
 
-    (unless group
-      ;; We might as well provide a best-guess default group.
-      (setq group
-	    `(:group ',(intern (replace-regexp-in-string
-				"-mode\\'" "" mode-name)))))
-
     ;; TODO? Mark booleans as safe if booleanp?  Eg abbrev-mode.
     (unless type (setq type '(:type 'boolean)))