From 4bf5db38cb4bc6a8a337c80451454cc8569f5106 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 2 Mar 2016 09:23:14 -0600 Subject: [PATCH] Don't allow diminished major-modes. --- mode-icons.el | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mode-icons.el b/mode-icons.el index 4853980..6a4b079 100644 --- a/mode-icons.el +++ b/mode-icons.el @@ -468,12 +468,18 @@ ICON-SPEC should be a specification from `mode-icons'." (defun mode-icons-get-mode-icon (mode) "Get the icon for MODE, if there is one." (let* ((mode-name (format-mode-line mode)) - (icon-spec (mode-icons-get-icon-spec mode-name))) + (icon-spec (mode-icons-get-icon-spec mode-name)) + ret) (if icon-spec - (if mode-icons-show-mode-name - (concat (mode-icons-propertize-mode mode-name icon-spec) " " mode-name) - (mode-icons-propertize-mode mode-name icon-spec)) - mode-name))) + (setq ret + (if mode-icons-show-mode-name + (concat (mode-icons-propertize-mode mode-name icon-spec) " " mode-name) + (mode-icons-propertize-mode mode-name icon-spec))) + (setq ret mode-name)) + ;; Don't hide major mode names... + (when (string= ret "") + (setq ret mode-name)) + ret)) (defvar mode-icons-cached-mode-name nil "Cached mode name to restore when disabling mode-icons.")