aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLute Kamstra2005-05-17 15:17:18 +0000
committerLute Kamstra2005-05-17 15:17:18 +0000
commitf56789436283d90804b406c8e205d53cd83b4baa (patch)
tree81c3b80575f7c625a92a78fb07705a6e8a56b7c7
parent77777daf1d13c411dc0439f09fc1c0a39de14475 (diff)
downloademacs-f56789436283d90804b406c8e205d53cd83b4baa.tar.gz
emacs-f56789436283d90804b406c8e205d53cd83b4baa.zip
(define-minor-mode): Don't generate a defcustom for the mode hook variable.
-rw-r--r--lisp/emacs-lisp/easy-mmode.el23
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.
92This function defines the associated control variable MODE, keymap MODE-map, 91This function defines the associated control variable MODE, keymap MODE-map,
93toggle command MODE, and hook MODE-hook. 92and toggle command MODE.
94 93
95DOC is the documentation for the mode toggle command. 94DOC is the documentation for the mode toggle command.
96Optional INIT-VALUE is the initial value of the mode's variable. 95Optional 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
103used (see below). 102used (see below).
104 103
105BODY contains code that will be executed each time the mode is (dis)activated. 104BODY 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.