changeset 62433:50ff61f0f99d

(define-minor-mode): Don't generate a defcustom for the mode hook variable.
author Lute Kamstra <lute@gnu.org>
date Tue, 17 May 2005 15:17:18 +0000
parents fc93171e5d7c
children 893818a65dc5
files lisp/emacs-lisp/easy-mmode.el
diffstat 1 files changed, 8 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el	Tue May 17 15:05:02 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Tue May 17 15:17:18 2005 +0000
@@ -36,7 +36,6 @@
 ;; For each mode, easy-mmode defines the following:
 ;; <mode>      : The minor mode predicate. A buffer-local variable.
 ;; <mode>-map  : The keymap possibly associated to <mode>.
-;; <mode>-hook : The hook run at the end of the toggle function.
 ;;       see `define-minor-mode' documentation
 ;;
 ;; eval
@@ -90,7 +89,7 @@
 (defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body)
   "Define a new minor mode MODE.
 This function defines the associated control variable MODE, keymap MODE-map,
-toggle command MODE, and hook MODE-hook.
+and toggle command MODE.
 
 DOC is the documentation for the mode toggle command.
 Optional INIT-VALUE is the initial value of the mode's variable.
@@ -103,11 +102,11 @@
 used (see below).
 
 BODY contains code that will be executed each time the mode is (dis)activated.
-  It will be executed after any toggling but before running the hooks.
-  Before the actual body code, you can write
-  keyword arguments (alternating keywords and values).
-  These following keyword arguments are supported (other keywords
-  will be passed to `defcustom' if the minor mode is global):
+  It will be executed after any toggling but before running the hook variable
+  `mode-HOOK'.
+  Before the actual body code, you can write keyword arguments (alternating
+  keywords and values).  These following keyword arguments are supported (other
+  keywords will be passed to `defcustom' if the minor mode is global):
 :group GROUP	Custom group name to use in all generated `defcustom' forms.
 		Defaults to MODE without the possible trailing \"-mode\".
 		Don't use this default group name unless you have written a
@@ -241,12 +240,6 @@
        ;; up-to-here.
        :autoload-end
 
-       ;; The toggle's hook.
-       (defcustom ,hook nil
-	 ,(format "Hook run at the end of function `%s'." mode-name)
-	 ,@group
-	 :type 'hook)
-
        ;; Define the minor-mode keymap.
        ,(unless (symbolp keymap)	;nil is also a symbol.
 	  `(defvar ,keymap-sym
@@ -323,8 +316,8 @@
 	   (with-current-buffer buf
 	     (if ,global-mode (,turn-on) (when ,mode (,mode -1))))))
 
-       ;; Autoloading easy-mmode-define-global-mode
-       ;; autoloads everything up-to-here.
+       ;; Autoloading define-global-minor-mode autoloads everything
+       ;; up-to-here.
        :autoload-end
 
        ;; List of buffers left to process.