From fa239e6ad85bda8831b1668518556779f190848a Mon Sep 17 00:00:00 2001 From: Matthew Fidler Date: Tue, 26 Apr 2016 12:30:12 -0500 Subject: [PATCH] Add a convert all png to xpm function --- mode-icons.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mode-icons.el b/mode-icons.el index ab9d5ea..fe0e583 100644 --- a/mode-icons.el +++ b/mode-icons.el @@ -971,6 +971,16 @@ When ICON-NAME is non-nil, return the mode-icons icon name." (nth 1 icon-spec) (mode-icons-get-icon-file (concat (nth 1 icon-spec) ".xpm")))) +(defun mode-icons--convert-all-png-icons-to-xpm () + "Convert all png icons to xpm files." + (interactive) + (setq mode-icons--convert-png-to-xpm (make-hash-table :test 'equal)) + (dolist (icon-spec mode-icons) + (when (eq 'png (nth 2 icon-spec)) + (mode-icons--convert-png-to-xpm + (mode-icons-get-icon-file (concat (nth 1 icon-spec) ".png")) + (mode-icons-get-icon-file (concat (nth 1 icon-spec) ".xpm")))))) + (defun mode-icons--get-emoji-xpm-file (icon-spec &optional icon-name) "Get the emoji xpm file name from ICON-SPEC. This only supports emoji enclosed in a \":\" like :herb:.