From 0882ecb6d2102e5c5ced22cf98ef5f57565cbd37 Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Sun, 26 Jun 2016 17:01:28 +1200 Subject: [PATCH] Respect `inhibit-mode-name-delight' when already set --- delight.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/delight.el b/delight.el index 8e88e2eb2..8e588900a 100644 --- a/delight.el +++ b/delight.el @@ -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 . ;;; 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) -- 2.39.2