Cache based on custom enabled themes.

This commit is contained in:
Matthew Fidler 2016-03-31 08:34:05 -05:00
parent c9150dc0c4
commit 98d03def53

View file

@ -345,8 +345,8 @@ specified by type 'xpm-bw."
(and (mode-icons--selected-window-active) (and (mode-icons--selected-window-active)
'mode-line) 'mode-line)
'mode-line-inactive))) 'mode-line-inactive)))
(or (gethash (list icon type face) mode-icons-get-icon-display) (or (gethash (list icon type face custom-enabled-themes) mode-icons-get-icon-display)
(puthash (list icon type face) (puthash (list icon type face custom-enabled-themes)
(let ((icon-path (mode-icons-get-icon-file (let ((icon-path (mode-icons-get-icon-file
(concat icon "." (or (and (eq type 'xpm-bw) "xpm") (concat icon "." (or (and (eq type 'xpm-bw) "xpm")
(symbol-name type)))))) (symbol-name type))))))
@ -354,7 +354,7 @@ specified by type 'xpm-bw."
(create-image (mode-icons-get-icon-display-xpm-bw-face icon-path face) (create-image (mode-icons-get-icon-display-xpm-bw-face icon-path face)
'xpm t :ascent 'center 'xpm t :ascent 'center
:face face) :face face)
`(image :type ,(or (and (eq type 'jpg) 'jpeg) type) :file ,icon-path :ascent center))) `(image :type ,(or (and (eq type 'jpg) 'jpeg) type) :file ,icon-path :ascent center :face ',face)))
mode-icons-get-icon-display)))) mode-icons-get-icon-display))))
(defcustom mode-icons-minor-mode-base-text-properties (defcustom mode-icons-minor-mode-base-text-properties
@ -991,7 +991,7 @@ When ENABLE is non-nil, enable the changes to the mode line."
(mode-icons-set-current-mode-icon) (mode-icons-set-current-mode-icon)
;; FIXME -- undo to allow `ergoemacs-mode' and color changing ;; FIXME -- undo to allow `ergoemacs-mode' and color changing
;; XPMs. Seems a bit heavy handed. ;; XPMs. Seems a bit heavy handed.
;; (mode-icons-set-minor-mode-icon-undo t) (mode-icons-set-minor-mode-icon-undo t)
(mode-icons-set-minor-mode-icon))) (mode-icons-set-minor-mode-icon)))
(defun mode-icons-reset () (defun mode-icons-reset ()