1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

(define-minor-mode): Only preserve messages output during execution of the body.

This commit is contained in:
Stefan Monnier 2006-05-08 15:12:25 +00:00
parent 6e7c574fd8
commit 8c87a72c22

View File

@ -139,7 +139,8 @@ For example, you could write
(setq body (list* lighter keymap body) lighter nil keymap nil))
((keywordp keymap) (push keymap body) (setq keymap nil)))
(let* ((mode-name (symbol-name mode))
(let* ((last-message (current-message))
(mode-name (symbol-name mode))
(pretty-name (easy-mmode-pretty-mode-name mode lighter))
(globalp nil)
(set nil)
@ -236,7 +237,10 @@ With zero or negative ARG turn mode off.
(if (called-interactively-p)
(progn
,(if globalp `(customize-mark-as-set ',mode))
(unless (current-message)
;; Avoid overwriting a message shown by the body,
;; but do overwrite previous messages.
(unless ,(and (current-message)
(not (equal last-message (current-message))))
(message ,(format "%s %%sabled" pretty-name)
(if ,mode "en" "dis")))))
(force-mode-line-update)