summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easy-mmode.el
diff options
context:
space:
mode:
authorKelly Dean <kelly@prtime.org>2015-02-16 04:24:13 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-17 22:16:22 -0200
commit04096849d54e09553d25897591993d5e0221a8d8 (patch)
tree8b15f50c17ef4182a68c79d6cbaf443a7cc252b3 /lisp/emacs-lisp/easy-mmode.el
parentcc273d1c033e669c642115550d2f132c7a9618b8 (diff)
downloademacs-04096849d54e09553d25897591993d5e0221a8d8.tar.gz
emacs-lisp/easy-mmode.el: Clarify mode switch messages
* emacs-lisp/easy-mmode.el (define-minor-mode): Clarify mode switch messages for minor modes. (Bug#19690)
Diffstat (limited to 'lisp/emacs-lisp/easy-mmode.el')
-rw-r--r--lisp/emacs-lisp/easy-mmode.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index cc30042002b..bd95a6018ff 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -284,14 +284,23 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'.
(if (called-interactively-p 'any)
(progn
,(if (and globalp (symbolp mode))
+ ;; Unnecessary but harmless if mode set buffer-locally
`(customize-mark-as-set ',mode))
;; 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")))))
+ (let ((local
+ ,(if globalp
+ (if (symbolp mode)
+ `(if (local-variable-p ',mode)
+ " in current buffer"
+ "")
+ "")
+ " in current buffer")))
+ (message ,(format "%s %%sabled%%s" pretty-name)
+ (if ,mode "en" "dis") local)))))
,@(when after-hook `(,after-hook)))
(force-mode-line-update)
;; Return the new setting.