emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0409684 7/8: emacs-lisp/easy-mmode.el: Clarify mode


From: Artur Malabarba
Subject: [Emacs-diffs] master 0409684 7/8: emacs-lisp/easy-mmode.el: Clarify mode switch messages
Date: Tue, 17 Feb 2015 23:17:58 +0000

branch: master
commit 04096849d54e09553d25897591993d5e0221a8d8
Author: Kelly Dean <address@hidden>
Commit: Artur Malabarba <address@hidden>

    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)
---
 lisp/ChangeLog                |    1 +
 lisp/emacs-lisp/easy-mmode.el |   13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b7ca890..3df34d6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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  <address@hidden>
 
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index cc30042..bd95a60 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]