changeset 48838:e0689be193e2

(define-minor-mode): Use `custom-current-group'. Pass all groups to the hook. (easy-mmode-define-global-mode): Use `custom-current-group'.
author Markus Rost <rost@math.uni-bielefeld.de>
date Fri, 13 Dec 2002 23:54:45 +0000
parents 15dcdff64493
children b4f252602421
files lisp/emacs-lisp/easy-mmode.el
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el	Fri Dec 13 22:42:21 2002 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Fri Dec 13 23:54:45 2002 +0000
@@ -140,8 +140,9 @@
     (unless group
       ;; We might as well provide a best-guess default group.
       (setq group
-	    `(:group ',(intern (replace-regexp-in-string "-mode\\'" ""
-							 mode-name)))))
+	    `(:group ',(or (custom-current-group)
+			   (intern (replace-regexp-in-string
+				    "-mode\\'" "" mode-name))))))
 
     `(progn
        ;; Define the variable to enable or disable the mode.
@@ -211,7 +212,7 @@
        ;; The toggle's hook.
        (defcustom ,hook nil
 	 ,(format "Hook run at the end of function `%s'." mode-name)
-	 :group ,(cadr group)
+	 ,@group
 	 :type 'hook)
 
        ;; Define the minor-mode keymap.
@@ -263,8 +264,10 @@
     (unless group
       ;; We might as well provide a best-guess default group.
       (setq group
-	    `(:group ',(intern (replace-regexp-in-string "-mode\\'" ""
-							 (symbol-name mode))))))
+	    `(:group ',(or (custom-current-group)
+			   (intern (replace-regexp-in-string
+				    "-mode\\'" "" (symbol-name mode)))))))
+
     `(progn
        ;; The actual global minor-mode
        (define-minor-mode ,global-mode