summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-06-02 14:09:49 +0200
committerGravatar Tom Willemse2013-06-02 14:09:49 +0200
commit1e8fcc4982585f15dccc15747ec77dd0a58349f3 (patch)
tree3284d771df983f5139d15af4e1c32209dd5b315a
parent68fa015bf7f01dec7d87eefb6c0d70f24edca30c (diff)
downloadmode-icons-1e8fcc4982585f15dccc15747ec77dd0a58349f3.tar.gz
mode-icons-1e8fcc4982585f15dccc15747ec77dd0a58349f3.zip
Add minor-mode
The `mode-icons-mode' minor-mode enables/disables the setting of icons for each mode.
-rw-r--r--mode-icons.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/mode-icons.el b/mode-icons.el
index 7c6504c..9a1403f 100644
--- a/mode-icons.el
+++ b/mode-icons.el
@@ -87,5 +87,12 @@ ICON-SPEC should be a specification from `mode-icons'."
"Set the icon for the current major mode."
(set-mode-icon mode-name))
+(define-minor-mode mode-icons-mode
+ "Replace the name of the current major mode with an icon."
+ :global t
+ (if mode-icons-mode
+ (add-hook 'after-change-major-mode-hook 'set-current-mode-icon)
+ (remove-hook 'after-change-major-mode-hook 'set-current-mode-icon)))
+
(provide 'mode-icons)
;;; mode-icons.el ends here