Allow Icon + Major mode name

This commit is contained in:
Matthew L. Fidler 2016-02-20 00:14:52 -06:00
parent 2f78ec906e
commit 66730cf972

View file

@ -403,12 +403,19 @@ ICON-SPEC should be a specification from `mode-icons'."
(throw 'found-mode item))) (throw 'found-mode item)))
nil)) nil))
(defcustom mode-icons-show-mode-name nil
"Show Icon and `mode-name'."
:type 'boolean
:group 'mode-icons)
(defun mode-icons-get-mode-icon (mode) (defun mode-icons-get-mode-icon (mode)
"Get the icon for MODE, if there is one." "Get the icon for MODE, if there is one."
(let* ((mode-name (format-mode-line mode)) (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)))
(if icon-spec (if icon-spec
(mode-icons-propertize-mode mode-name 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))) mode-name)))
(defvar mode-icons-cached-mode-name nil (defvar mode-icons-cached-mode-name nil