diff options
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index a02f7be7d13..0892af1bb35 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | ;; For each mode, easy-mmode defines the following: | 36 | ;; For each mode, easy-mmode defines the following: |
| 37 | ;; <mode> : The minor mode predicate. A buffer-local variable. | 37 | ;; <mode> : The minor mode predicate. A buffer-local variable. |
| 38 | ;; <mode>-map : The keymap possibly associated to <mode>. | 38 | ;; <mode>-map : The keymap possibly associated to <mode>. |
| 39 | ;; <mode>-hook : The hook run at the end of the toggle function. | ||
| 40 | ;; see `define-minor-mode' documentation | 39 | ;; see `define-minor-mode' documentation |
| 41 | ;; | 40 | ;; |
| 42 | ;; eval | 41 | ;; eval |
| @@ -90,7 +89,7 @@ replacing its case-insensitive matches with the literal string in LIGHTER." | |||
| 90 | (defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body) | 89 | (defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body) |
| 91 | "Define a new minor mode MODE. | 90 | "Define a new minor mode MODE. |
| 92 | This function defines the associated control variable MODE, keymap MODE-map, | 91 | This function defines the associated control variable MODE, keymap MODE-map, |
| 93 | toggle command MODE, and hook MODE-hook. | 92 | and toggle command MODE. |
| 94 | 93 | ||
| 95 | DOC is the documentation for the mode toggle command. | 94 | DOC is the documentation for the mode toggle command. |
| 96 | Optional INIT-VALUE is the initial value of the mode's variable. | 95 | Optional INIT-VALUE is the initial value of the mode's variable. |
| @@ -103,11 +102,11 @@ The above three arguments can be skipped if keyword arguments are | |||
| 103 | used (see below). | 102 | used (see below). |
| 104 | 103 | ||
| 105 | BODY contains code that will be executed each time the mode is (dis)activated. | 104 | BODY contains code that will be executed each time the mode is (dis)activated. |
| 106 | It will be executed after any toggling but before running the hooks. | 105 | It will be executed after any toggling but before running the hook variable |
| 107 | Before the actual body code, you can write | 106 | `mode-HOOK'. |
| 108 | keyword arguments (alternating keywords and values). | 107 | Before the actual body code, you can write keyword arguments (alternating |
| 109 | These following keyword arguments are supported (other keywords | 108 | keywords and values). These following keyword arguments are supported (other |
| 110 | will be passed to `defcustom' if the minor mode is global): | 109 | keywords will be passed to `defcustom' if the minor mode is global): |
| 111 | :group GROUP Custom group name to use in all generated `defcustom' forms. | 110 | :group GROUP Custom group name to use in all generated `defcustom' forms. |
| 112 | Defaults to MODE without the possible trailing \"-mode\". | 111 | Defaults to MODE without the possible trailing \"-mode\". |
| 113 | Don't use this default group name unless you have written a | 112 | Don't use this default group name unless you have written a |
| @@ -241,12 +240,6 @@ With zero or negative ARG turn mode off. | |||
| 241 | ;; up-to-here. | 240 | ;; up-to-here. |
| 242 | :autoload-end | 241 | :autoload-end |
| 243 | 242 | ||
| 244 | ;; The toggle's hook. | ||
| 245 | (defcustom ,hook nil | ||
| 246 | ,(format "Hook run at the end of function `%s'." mode-name) | ||
| 247 | ,@group | ||
| 248 | :type 'hook) | ||
| 249 | |||
| 250 | ;; Define the minor-mode keymap. | 243 | ;; Define the minor-mode keymap. |
| 251 | ,(unless (symbolp keymap) ;nil is also a symbol. | 244 | ,(unless (symbolp keymap) ;nil is also a symbol. |
| 252 | `(defvar ,keymap-sym | 245 | `(defvar ,keymap-sym |
| @@ -323,8 +316,8 @@ in which `%s' turns it on." | |||
| 323 | (with-current-buffer buf | 316 | (with-current-buffer buf |
| 324 | (if ,global-mode (,turn-on) (when ,mode (,mode -1)))))) | 317 | (if ,global-mode (,turn-on) (when ,mode (,mode -1)))))) |
| 325 | 318 | ||
| 326 | ;; Autoloading easy-mmode-define-global-mode | 319 | ;; Autoloading define-global-minor-mode autoloads everything |
| 327 | ;; autoloads everything up-to-here. | 320 | ;; up-to-here. |
| 328 | :autoload-end | 321 | :autoload-end |
| 329 | 322 | ||
| 330 | ;; List of buffers left to process. | 323 | ;; List of buffers left to process. |