diff options
| author | Markus Rost | 2002-12-13 23:54:45 +0000 |
|---|---|---|
| committer | Markus Rost | 2002-12-13 23:54:45 +0000 |
| commit | dce88ea679bbc59910a5c6d5dad579821c70cddf (patch) | |
| tree | 8fc2d158e58acefda7caddf3708a4aac8527e688 | |
| parent | 990a41084b6a63674f6c1060b5b42ea1c95da08f (diff) | |
| download | emacs-dce88ea679bbc59910a5c6d5dad579821c70cddf.tar.gz emacs-dce88ea679bbc59910a5c6d5dad579821c70cddf.zip | |
(define-minor-mode): Use `custom-current-group'.
Pass all groups to the hook.
(easy-mmode-define-global-mode): Use `custom-current-group'.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 898afddaf31..a0c2ff11522 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -140,8 +140,9 @@ For example, you could write | |||
| 140 | (unless group | 140 | (unless group |
| 141 | ;; We might as well provide a best-guess default group. | 141 | ;; We might as well provide a best-guess default group. |
| 142 | (setq group | 142 | (setq group |
| 143 | `(:group ',(intern (replace-regexp-in-string "-mode\\'" "" | 143 | `(:group ',(or (custom-current-group) |
| 144 | mode-name))))) | 144 | (intern (replace-regexp-in-string |
| 145 | "-mode\\'" "" mode-name)))))) | ||
| 145 | 146 | ||
| 146 | `(progn | 147 | `(progn |
| 147 | ;; Define the variable to enable or disable the mode. | 148 | ;; Define the variable to enable or disable the mode. |
| @@ -211,7 +212,7 @@ With zero or negative ARG turn mode off. | |||
| 211 | ;; The toggle's hook. | 212 | ;; The toggle's hook. |
| 212 | (defcustom ,hook nil | 213 | (defcustom ,hook nil |
| 213 | ,(format "Hook run at the end of function `%s'." mode-name) | 214 | ,(format "Hook run at the end of function `%s'." mode-name) |
| 214 | :group ,(cadr group) | 215 | ,@group |
| 215 | :type 'hook) | 216 | :type 'hook) |
| 216 | 217 | ||
| 217 | ;; Define the minor-mode keymap. | 218 | ;; Define the minor-mode keymap. |
| @@ -263,8 +264,10 @@ KEYS is a list of CL-style keyword arguments: | |||
| 263 | (unless group | 264 | (unless group |
| 264 | ;; We might as well provide a best-guess default group. | 265 | ;; We might as well provide a best-guess default group. |
| 265 | (setq group | 266 | (setq group |
| 266 | `(:group ',(intern (replace-regexp-in-string "-mode\\'" "" | 267 | `(:group ',(or (custom-current-group) |
| 267 | (symbol-name mode)))))) | 268 | (intern (replace-regexp-in-string |
| 269 | "-mode\\'" "" (symbol-name mode))))))) | ||
| 270 | |||
| 268 | `(progn | 271 | `(progn |
| 269 | ;; The actual global minor-mode | 272 | ;; The actual global minor-mode |
| 270 | (define-minor-mode ,global-mode | 273 | (define-minor-mode ,global-mode |