]> code.delx.au - gnu-emacs/commitdiff
(define-minor-mode): Do not override explicitly specified :initialize keyword.
authorLuc Teirlinck <teirllm@auburn.edu>
Thu, 14 Jul 2005 00:56:13 +0000 (00:56 +0000)
committerLuc Teirlinck <teirllm@auburn.edu>
Thu, 14 Jul 2005 00:56:13 +0000 (00:56 +0000)
lisp/emacs-lisp/easy-mmode.el

index 4c232b2882c2240bda582f8ecdf93f43795c2c8b..3b4662277b641838091bacc42ad5b7238837daaf 100644 (file)
@@ -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