Mercurial > emacs
changeset 64295:f2e16ba201e0
(define-minor-mode): Do not override explicitly specified :initialize keyword.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Thu, 14 Jul 2005 00:56:13 +0000 |
parents | 3ac645ba3986 |
children | d905b8d515a1 |
files | lisp/emacs-lisp/easy-mmode.el |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el Wed Jul 13 21:47:54 2005 +0000 +++ b/lisp/emacs-lisp/easy-mmode.el Thu Jul 14 00:56:13 2005 +0000 @@ -142,6 +142,7 @@ (let* ((mode-name (symbol-name mode)) (pretty-name (easy-mmode-pretty-mode-name mode lighter)) (globalp nil) + (initialize nil) (group nil) (extra-args nil) (extra-keywords nil) @@ -159,6 +160,7 @@ (:lighter (setq lighter (pop body))) (:global (setq globalp (pop body))) (:extra-args (setq extra-args (pop body))) + (:initialize (setq initialize (list :initialize (pop body)))) (:group (setq group (nconc group (list :group (pop body))))) (:require (setq require (pop body))) (:keymap (setq keymap (pop body))) @@ -167,6 +169,10 @@ (setq keymap-sym (if (and keymap (symbolp keymap)) keymap (intern (concat mode-name "-map")))) + (unless initialize + (setq initialize + '(:initialize 'custom-initialize-default))) + (unless group ;; We might as well provide a best-guess default group. (setq group @@ -196,7 +202,7 @@ `(defcustom ,mode ,init-value ,(format base-doc-string pretty-name mode mode) :set 'custom-set-minor-mode - :initialize 'custom-initialize-default + ,@initialize ,@group :type 'boolean ,@(cond