From de5643494ae61617aa247b00d42d84b84ea9b12e Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 4 Jan 2019 16:12:40 -0500 Subject: * lisp/emms-mode-line-icon.el: allow changing icon Allow the icon's color to be changed easily. --- lisp/emms-mode-line-icon.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-mode-line-icon.el b/lisp/emms-mode-line-icon.el index 85d9674..82cf815 100644 --- a/lisp/emms-mode-line-icon.el +++ b/lisp/emms-mode-line-icon.el @@ -42,13 +42,13 @@ For example, if you want to have something like : \[ Foo - The Foo Song ] You should set it to \"[\", and set emms-mode-line-format to \"%s ]\"") -(defvar emms-mode-line-icon-image-cache - `(image :type xpm :ascent center :data ,(concat "/* XPM */ +(defun emms-mode-line-icon-generate (color) + `(image :type xpm :ascent center :data ,(concat "/* XPM */ static char *note[] = { /* width height num_colors chars_per_pixel */ \" 10 11 2 1\", /* colors */ -\". c " emms-mode-line-icon-color "\", +\". c " color "\", \"# c None s None\", /* pixels */ \"###...####\", @@ -63,11 +63,12 @@ static char *note[] = { \"######....\", \"#######..#\"};"))) - (defun emms-mode-line-icon-function () (concat " " emms-mode-line-icon-before-format - (emms-propertize "NP:" 'display emms-mode-line-icon-image-cache) + (emms-propertize "NP:" 'display + (emms-mode-line-icon-generate + emms-mode-line-icon-color)) (emms-mode-line-playlist-current))) (setq emms-mode-line-mode-line-function 'emms-mode-line-icon-function) -- cgit v1.2.3