]> code.delx.au - gnu-emacs/commitdiff
emacs-lisp/easy-mmode.el: Clarify mode switch messages
authorKelly Dean <kelly@prtime.org>
Mon, 16 Feb 2015 04:24:13 +0000 (04:24 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 18 Feb 2015 00:16:22 +0000 (22:16 -0200)
* emacs-lisp/easy-mmode.el (define-minor-mode): Clarify mode
switch messages for minor modes. (Bug#19690)

lisp/ChangeLog
lisp/emacs-lisp/easy-mmode.el

index b7ca890091bf3c64ad1005555346b9d70646ba55..3df34d6577cc79e62a80474815402fe0ad83df01 100644 (file)
@@ -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>
 
index cc30042002bb6dab992fe98d8faff6e2af482d7a..bd95a6018ff1aa87af56cd8b8cdebba22443c16a 100644 (file)
@@ -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.