diff options
| author | Stefan Monnier | 2006-05-08 15:12:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-05-08 15:12:25 +0000 |
| commit | 8c87a72c22623843fea4af61601b7710579c9cc2 (patch) | |
| tree | f645e889c31e395a855673af754febb2d6ab9195 | |
| parent | 6e7c574fd8d71502741d36a2156fa39923b9ee88 (diff) | |
| download | emacs-8c87a72c22623843fea4af61601b7710579c9cc2.tar.gz emacs-8c87a72c22623843fea4af61601b7710579c9cc2.zip | |
(define-minor-mode): Only preserve messages output during execution of the body.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index caac02c2ee3..5475ed530d3 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -139,7 +139,8 @@ For example, you could write | |||
| 139 | (setq body (list* lighter keymap body) lighter nil keymap nil)) | 139 | (setq body (list* lighter keymap body) lighter nil keymap nil)) |
| 140 | ((keywordp keymap) (push keymap body) (setq keymap nil))) | 140 | ((keywordp keymap) (push keymap body) (setq keymap nil))) |
| 141 | 141 | ||
| 142 | (let* ((mode-name (symbol-name mode)) | 142 | (let* ((last-message (current-message)) |
| 143 | (mode-name (symbol-name mode)) | ||
| 143 | (pretty-name (easy-mmode-pretty-mode-name mode lighter)) | 144 | (pretty-name (easy-mmode-pretty-mode-name mode lighter)) |
| 144 | (globalp nil) | 145 | (globalp nil) |
| 145 | (set nil) | 146 | (set nil) |
| @@ -236,7 +237,10 @@ With zero or negative ARG turn mode off. | |||
| 236 | (if (called-interactively-p) | 237 | (if (called-interactively-p) |
| 237 | (progn | 238 | (progn |
| 238 | ,(if globalp `(customize-mark-as-set ',mode)) | 239 | ,(if globalp `(customize-mark-as-set ',mode)) |
| 239 | (unless (current-message) | 240 | ;; Avoid overwriting a message shown by the body, |
| 241 | ;; but do overwrite previous messages. | ||
| 242 | (unless ,(and (current-message) | ||
| 243 | (not (equal last-message (current-message)))) | ||
| 240 | (message ,(format "%s %%sabled" pretty-name) | 244 | (message ,(format "%s %%sabled" pretty-name) |
| 241 | (if ,mode "en" "dis"))))) | 245 | (if ,mode "en" "dis"))))) |
| 242 | (force-mode-line-update) | 246 | (force-mode-line-update) |