aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-09-27 21:12:12 +0000
committerStefan Monnier2002-09-27 21:12:12 +0000
commitbb76239ba1dea220089ef09cb320909fe57e92e1 (patch)
tree8aed76e8a51ca7d7a9da3e353d2c278d48dbbcd4
parent643415c46bde0c18336a5743366bb02a6889ca54 (diff)
downloademacs-bb76239ba1dea220089ef09cb320909fe57e92e1.tar.gz
emacs-bb76239ba1dea220089ef09cb320909fe57e92e1.zip
(define-minor-mode): Don't add properties
to the name since they're added by mode-line-format already. (define-minor-mode): Run (,mode -1) when needed.
-rw-r--r--lisp/emacs-lisp/easy-mmode.el13
1 files changed, 3 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index abd045a6532..8d814ea1e3f 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -133,13 +133,6 @@ BODY contains code that will be executed each time the mode is (dis)activated.
133 (setq group 133 (setq group
134 `(:group ',(intern (replace-regexp-in-string "-mode\\'" "" 134 `(:group ',(intern (replace-regexp-in-string "-mode\\'" ""
135 mode-name))))) 135 mode-name)))))
136 ;; Add default properties to LIGHTER.
137 (unless (or (not (stringp lighter)) (get-text-property 0 'local-map lighter)
138 (get-text-property 0 'keymap lighter))
139 (setq lighter
140 (propertize lighter
141 'local-map mode-line-minor-mode-keymap
142 'help-echo "mouse-3: minor mode menu")))
143 136
144 `(progn 137 `(progn
145 ;; Define the variable to enable or disable the mode. 138 ;; Define the variable to enable or disable the mode.
@@ -227,9 +220,9 @@ With zero or negative ARG turn mode off.
227 (symbol-value ',keymap-sym)))) 220 (symbol-value ',keymap-sym))))
228 221
229 ;; If the mode is global, call the function according to the default. 222 ;; If the mode is global, call the function according to the default.
230 ,(if (and globalp (null init-value)) 223 ,(if globalp
231 `(if (and load-file-name ,mode) 224 `(if (and load-file-name (not (equal ,init-value ,mode)))
232 (eval-after-load load-file-name '(,mode 1))))))) 225 (eval-after-load load-file-name '(,mode (if ,mode 1 -1))))))))
233 226
234;;; 227;;;
235;;; make global minor mode 228;;; make global minor mode