From e380c293e56463ea2366dfd5e6ccb92e9eef08be Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Tue, 31 May 2016 19:08:44 -0500 Subject: [PATCH] Fix font icons that are missing fonts. They need to match the xpm specifications --- mode-icons.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mode-icons.el b/mode-icons.el index 4da3de5..f50565d 100644 --- a/mode-icons.el +++ b/mode-icons.el @@ -1160,8 +1160,11 @@ ACTIVE if a flag for if the current window is active." (nth 1 icon-spec))) (put-text-property (point-min) (point-max) 'face face) - (put-text-property (point-min) (point-max) - 'mode-icons-p icon-spec) + (if (mode-icons-supported-font-p (nth 1 icon-spec) (nth 2 icon-spec)) + (put-text-property (point-min) (point-max) + 'mode-icons-p icon-spec) + (put-text-property (point-min) (point-max) + 'mode-icons-p (list (nth 0 icon-spec) xpm-name 'xpm-bw))) (buffer-string)))))) (defun mode-icons-propertize-mode (mode icon-spec &optional face active) @@ -1183,6 +1186,7 @@ ACTIVE is a flag to tell if the current window is active." 'mode-icons-p icon-spec)) ((mode-icons-supported-font-p (nth 1 icon-spec) (nth 2 icon-spec)) ;; (propertize mode 'display (nth 1 icon-spec) 'mode-icons-p t) + ;;(mode-icons--get-font " AI" '("\\` ?AI\\'" 61500 FontAwesome) face active) (mode-icons--get-font mode icon-spec face active)) ((and (stringp (nth 1 icon-spec)) (eq (nth 2 icon-spec) 'emoji)) (mode-icons--get-emoji mode icon-spec face active)) @@ -1196,11 +1200,13 @@ ACTIVE is a flag to tell if the current window is active." (concat "ext-" (nth 1 icon-spec)) 'xpm-bw))) (t (setq tmp (mode-icons-get-icon-display (nth 1 icon-spec) (nth 2 icon-spec) face active)) + ;; (when (string= (nth 0 icon-spec) "\\` ?AI\\'") + ;; (message "plist: %s" tmp)) (cond - ((and (plist-get tmp :xpm-bw) (plist-get tmp :icon)) - (setq new-icon-spec (list (nth 0 icon-spec) (plist-get tmp :icon) 'xpm-bw))) - ((and (eq (plist-get tmp :type) 'xpm) (plist-get tmp :icon)) - (setq new-icon-spec (list (nth 0 icon-spec) (plist-get tmp :icon) 'xpm))) + ((and (plist-get (cdr tmp) :xpm-bw) (plist-get (cdr tmp) :icon)) + (setq new-icon-spec (list (nth 0 icon-spec) (plist-get (cdr tmp) :icon) 'xpm-bw))) + ((and (eq (plist-get (cdr tmp) :type) 'xpm) (plist-get (cdr tmp) :icon)) + (setq new-icon-spec (list (nth 0 icon-spec) (plist-get (cdr tmp) :icon) 'xpm))) (t (setq new-icon-spec icon-spec))) (propertize (format "%s" mode) 'display tmp 'mode-icons-p new-icon-spec))))))