From c736d6cff689df097b396d823c9db7168809c091 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Thu, 14 Jul 2005 00:56:13 +0000 Subject: [PATCH] (define-minor-mode): Do not override explicitly specified :initialize keyword. --- lisp/emacs-lisp/easy-mmode.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 4c232b2882..3b4662277b 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -142,6 +142,7 @@ For example, you could write (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 @@ For example, you could write (: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 @@ For example, you could write (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 @@ See the command `%s' for a description of this minor-mode.")) `(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 -- 2.39.2