aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matthew L. Fidler2016-01-21 22:50:31 -0600
committerGravatar Matthew L. Fidler2016-01-21 22:50:31 -0600
commit34416c46437d972fb83141b34c5742e372d751d1 (patch)
tree583b5157920a6d079c2cd7ee5fe52ac8547ddae8
parent0e649a218efffc62a8585ddfeee5e31876f3a1d6 (diff)
downloadmode-icons-34416c46437d972fb83141b34c5742e372d751d1.tar.gz
mode-icons-34416c46437d972fb83141b34c5742e372d751d1.zip
Add mode-icons prefix to functions
-rw-r--r--mode-icons.el27
1 files changed, 14 insertions, 13 deletions
diff --git a/mode-icons.el b/mode-icons.el
index 10d40ec..6a3f7df 100644
--- a/mode-icons.el
+++ b/mode-icons.el
@@ -70,14 +70,15 @@ absolute path to ICON."
("XML" "xml" xpm)
("YAML" "yaml" xpm)
("YASnippet" "yas" xpm)
+ (" yas" "yas" xpm)
)
- "Icons for major modes.
+ "Icons for major and minor modes.
Each specification is a list with the first element being the
name of the major mode. The second the name of the icon file,
without the extension. And the third being the type of icon.")
-(defun get-icon-display (icon type)
+(defun mode-icons-get-icon-display (icon type)
"Get the value for the display property of ICON having TYPE.
ICON should be a string naming the file of the icon, without its
@@ -87,29 +88,29 @@ the icon."
(concat icon "." (symbol-name type)))))
`(image :type ,type :file ,icon-path :ascent center)))
-(defun propertize-mode (mode icon-spec)
+(defun mode-icons-propertize-mode (mode icon-spec)
"Propertize MODE with ICON-SPEC.
MODE should be a string, the name of the mode to propertize.
ICON-SPEC should be a specification from `mode-icons'."
(propertize
- mode 'display (get-icon-display (nth 1 icon-spec) (nth 2 icon-spec))))
+ mode 'display (mode-icons-get-icon-display (nth 1 icon-spec) (nth 2 icon-spec))))
-(defun get-mode-icon (mode)
+(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 (assoc mode-name mode-icons)))
(if icon-spec
- (propertize-mode mode-name icon-spec)
+ (mode-icons-propertize-mode mode-name icon-spec)
mode-name)))
-(defun set-mode-icon (mode)
+(defun mode-icons-set-mode-icon (mode)
"Set the icon for MODE."
- (setq mode-name (get-mode-icon mode)))
+ (setq mode-name (mode-icons-get-mode-icon mode)))
-(defun set-current-mode-icon ()
+(defun mode-icons-set-current-mode-icon ()
"Set the icon for the current major mode."
- (set-mode-icon mode-name))
+ (mode-icons-set-mode-icon mode-name))
;;;###autoload
(define-minor-mode mode-icons-mode
@@ -117,9 +118,9 @@ ICON-SPEC should be a specification from `mode-icons'."
:global t
(if mode-icons-mode
(progn
- (add-hook 'after-change-major-mode-hook 'set-current-mode-icon)
- (set-current-mode-icon))
- (remove-hook 'after-change-major-mode-hook 'set-current-mode-icon)))
+ (add-hook 'after-change-major-mode-hook 'mode-icons-set-current-mode-icon)
+ (mode-icons-set-current-mode-icon))
+ (remove-hook 'after-change-major-mode-hook 'mode-icons-set-current-mode-icon)))
(provide 'mode-icons)
;;; mode-icons.el ends here