diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-09-27 21:12:12 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2002-09-27 21:12:12 +0000 |
commit | bb76239ba1dea220089ef09cb320909fe57e92e1 (patch) | |
tree | 8aed76e8a51ca7d7a9da3e353d2c278d48dbbcd4 /lisp/emacs-lisp | |
parent | 643415c46bde0c18336a5743366bb02a6889ca54 (diff) | |
download | emacs-bb76239ba1dea220089ef09cb320909fe57e92e1.tar.gz emacs-bb76239ba1dea220089ef09cb320909fe57e92e1.tar.bz2 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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 13 |
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. (setq group `(:group ',(intern (replace-regexp-in-string "-mode\\'" "" mode-name))))) - ;; Add default properties to LIGHTER. - (unless (or (not (stringp lighter)) (get-text-property 0 'local-map lighter) - (get-text-property 0 'keymap lighter)) - (setq lighter - (propertize lighter - 'local-map mode-line-minor-mode-keymap - 'help-echo "mouse-3: minor mode menu"))) `(progn ;; Define the variable to enable or disable the mode. @@ -227,9 +220,9 @@ With zero or negative ARG turn mode off. (symbol-value ',keymap-sym)))) ;; If the mode is global, call the function according to the default. - ,(if (and globalp (null init-value)) - `(if (and load-file-name ,mode) - (eval-after-load load-file-name '(,mode 1))))))) + ,(if globalp + `(if (and load-file-name (not (equal ,init-value ,mode))) + (eval-after-load load-file-name '(,mode (if ,mode 1 -1)))))))) ;;; ;;; make global minor mode |