diff options
| author | Luc Teirlinck | 2005-07-14 00:56:13 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-07-14 00:56:13 +0000 |
| commit | c736d6cff689df097b396d823c9db7168809c091 (patch) | |
| tree | d41ef9e067dd9f762876696a95f13024a2a57781 | |
| parent | ec641d50562aaa11a1c23edce1ebeaf8eca3072b (diff) | |
| download | emacs-c736d6cff689df097b396d823c9db7168809c091.tar.gz emacs-c736d6cff689df097b396d823c9db7168809c091.zip | |
(define-minor-mode): Do not override explicitly specified :initialize keyword.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 4c232b2882c..3b4662277b6 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -142,6 +142,7 @@ For example, you could write | |||
| 142 | (let* ((mode-name (symbol-name mode)) | 142 | (let* ((mode-name (symbol-name mode)) |
| 143 | (pretty-name (easy-mmode-pretty-mode-name mode lighter)) | 143 | (pretty-name (easy-mmode-pretty-mode-name mode lighter)) |
| 144 | (globalp nil) | 144 | (globalp nil) |
| 145 | (initialize nil) | ||
| 145 | (group nil) | 146 | (group nil) |
| 146 | (extra-args nil) | 147 | (extra-args nil) |
| 147 | (extra-keywords nil) | 148 | (extra-keywords nil) |
| @@ -159,6 +160,7 @@ For example, you could write | |||
| 159 | (:lighter (setq lighter (pop body))) | 160 | (:lighter (setq lighter (pop body))) |
| 160 | (:global (setq globalp (pop body))) | 161 | (:global (setq globalp (pop body))) |
| 161 | (:extra-args (setq extra-args (pop body))) | 162 | (:extra-args (setq extra-args (pop body))) |
| 163 | (:initialize (setq initialize (list :initialize (pop body)))) | ||
| 162 | (:group (setq group (nconc group (list :group (pop body))))) | 164 | (:group (setq group (nconc group (list :group (pop body))))) |
| 163 | (:require (setq require (pop body))) | 165 | (:require (setq require (pop body))) |
| 164 | (:keymap (setq keymap (pop body))) | 166 | (:keymap (setq keymap (pop body))) |
| @@ -167,6 +169,10 @@ For example, you could write | |||
| 167 | (setq keymap-sym (if (and keymap (symbolp keymap)) keymap | 169 | (setq keymap-sym (if (and keymap (symbolp keymap)) keymap |
| 168 | (intern (concat mode-name "-map")))) | 170 | (intern (concat mode-name "-map")))) |
| 169 | 171 | ||
| 172 | (unless initialize | ||
| 173 | (setq initialize | ||
| 174 | '(:initialize 'custom-initialize-default))) | ||
| 175 | |||
| 170 | (unless group | 176 | (unless group |
| 171 | ;; We might as well provide a best-guess default group. | 177 | ;; We might as well provide a best-guess default group. |
| 172 | (setq group | 178 | (setq group |
| @@ -196,7 +202,7 @@ See the command `%s' for a description of this minor-mode.")) | |||
| 196 | `(defcustom ,mode ,init-value | 202 | `(defcustom ,mode ,init-value |
| 197 | ,(format base-doc-string pretty-name mode mode) | 203 | ,(format base-doc-string pretty-name mode mode) |
| 198 | :set 'custom-set-minor-mode | 204 | :set 'custom-set-minor-mode |
| 199 | :initialize 'custom-initialize-default | 205 | ,@initialize |
| 200 | ,@group | 206 | ,@group |
| 201 | :type 'boolean | 207 | :type 'boolean |
| 202 | ,@(cond | 208 | ,@(cond |