]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-minor-mode): Use `custom-current-group'.
authorMarkus Rost <rost@math.uni-bielefeld.de>
Fri, 13 Dec 2002 23:54:45 +0000 (23:54 +0000)
committerMarkus Rost <rost@math.uni-bielefeld.de>
Fri, 13 Dec 2002 23:54:45 +0000 (23:54 +0000)
Pass all groups to the hook.
(easy-mmode-define-global-mode): Use `custom-current-group'.

lisp/emacs-lisp/easy-mmode.el

index 898afddaf31129aff3e296918b5a8e8acb4ee849..a0c2ff11522f44f09df429c32768692ce1a932be 100644 (file)
@@ -140,8 +140,9 @@ For example, you could write
     (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 @@ With zero or negative ARG turn mode off.
        ;; 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 @@ KEYS is a list of CL-style keyword arguments:
     (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