summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-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.