]> code.delx.au - gnu-emacs-elpa/commitdiff
Respect `inhibit-mode-name-delight' when already set
authorPhil Sainty <psainty@orcon.net.nz>
Sun, 26 Jun 2016 05:01:28 +0000 (17:01 +1200)
committerPhil Sainty <psainty@orcon.net.nz>
Sun, 26 Jun 2016 05:18:49 +0000 (17:18 +1200)
delight.el

index 8e88e2eb25d805db3b11a0e4cbb69ab660ea20eb..8e588900ad2270e6c75c6261f1ae2b9614a0b653 100644 (file)
@@ -2,7 +2,16 @@
 ;;
 ;; Author: Phil S.
 ;; URL: http://www.emacswiki.org/emacs/DelightedModes
-;; Version: 1.03
+;; Keywords: convenience
+;; Created: 25 Jun 2013
+;; Version: 1.04
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software: you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free Software
+;; Foundation, either version 3 of the License, or (at your option) any later
+;; version. See <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 ;;
@@ -52,6 +61,7 @@
 
 ;;; Changelog:
 ;;
+;; 1.04 (2016-02-28) Respect `inhibit-mode-name-delight' when already set.
 ;; 1.03 (2014-05-30) Added support for `mode-line-mode-menu'.
 ;; 1.02 (2014-05-04) Bug fix for missing 'cl requirement for
 ;;       destructuring-bind macro.
@@ -156,10 +166,14 @@ When `mode-name' is displayed in other contexts (such as in the
                         ,mode-name ;; glum
                         ,(cadr major-delight)))))) ;; delighted
 
+(defvar inhibit-mode-name-delight)
+
 (defadvice format-mode-line (around delighted-modes-are-glum activate)
   "Delighted modes should exhibit their original `mode-name' when
 `format-mode-line' is called. See `delight-major-mode'."
-  (let ((inhibit-mode-name-delight t))
+  (let ((inhibit-mode-name-delight (if (boundp 'inhibit-mode-name-delight)
+                                       inhibit-mode-name-delight
+                                     t)))
     ad-do-it))
 
 (provide 'delight)