Mercurial > emacs
changeset 47657:e8df9e898436
(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.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 27 Sep 2002 21:12:12 +0000 |
parents | 940195447c9f |
children | de014e746a6b |
files | lisp/emacs-lisp/easy-mmode.el |
diffstat | 1 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el Fri Sep 27 20:55:33 2002 +0000 +++ b/lisp/emacs-lisp/easy-mmode.el Fri Sep 27 21:12:12 2002 +0000 @@ -133,13 +133,6 @@ (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 @@ (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