Commit 04096849 authored by Kelly Dean's avatar Kelly Dean Committed by Artur Malabarba
Browse files

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)
parent cc273d1c
......@@ -3,6 +3,7 @@
* emacs-lisp/easy-mmode.el (define-minor-mode): Process macro
arguments correctly. (Bug#19685)
(define-minor-mode): Clarify docstring.
Clarify mode switch messages for minor modes. (Bug#19690)
 
2015-02-16 Kelly Dean <kelly@prtime.org>
 
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment