mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-21 17:40:30 +01:00
parent
f030c261c5
commit
5644871fa3
1 changed files with 40 additions and 34 deletions
|
@ -1087,6 +1087,7 @@ the actual font."
|
|||
MODE should be a string, the name of the mode to propertize.
|
||||
ICON-SPEC should be a specification from `mode-icons'.
|
||||
FACE is the face to match when a xpm-bw image is used."
|
||||
(let (tmp)
|
||||
(mode-icons-save-buffer-state ;; Otherwise may cause issues with trasient mark mode
|
||||
(cond
|
||||
((and (stringp mode) (get-text-property 0 'mode-icons-p mode))
|
||||
|
@ -1096,10 +1097,15 @@ FACE is the face to match when a xpm-bw image is used."
|
|||
((and (stringp (nth 1 icon-spec)) (not (nth 2 icon-spec)))
|
||||
(propertize (nth 1 icon-spec) 'display (nth 1 icon-spec)
|
||||
'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)
|
||||
((or (mode-icons-supported-font-p (nth 1 icon-spec) (nth 2 icon-spec))
|
||||
(and (image-type-available-p 'xpm)
|
||||
(mode-icons--get-font-xpm-file icon-spec)
|
||||
(file-exists-p (mode-icons--get-font-xpm-file icon-spec))))
|
||||
(mode-icons--get-font mode icon-spec face))
|
||||
((and (stringp (nth 1 icon-spec)) (eq (nth 2 icon-spec) 'emoji))
|
||||
((and (eq (nth 2 icon-spec) 'emoji)
|
||||
(or (and (image-type-available-p 'png) (featurep 'emojify))
|
||||
(and (image-type-available-p 'xpm)
|
||||
(file-exists-p (mode-icons--get-emoji-xpm-file icon-spec)))))
|
||||
(mode-icons--get-emoji mode icon-spec face))
|
||||
((and (stringp (nth 1 icon-spec)) (eq (nth 2 icon-spec) 'png))
|
||||
(mode-icons--get-png mode icon-spec face))
|
||||
|
@ -1120,7 +1126,7 @@ FACE is the face to match when a xpm-bw image is used."
|
|||
(and (mode-icons--selected-window-active)
|
||||
'mode-line)
|
||||
'mode-line-inactive))
|
||||
'mode-icons-p icon-spec)))))
|
||||
'mode-icons-p icon-spec))))))
|
||||
|
||||
(defvar mode-icons-get-icon-spec (make-hash-table :test 'equal)
|
||||
"Hash table of icon-specifications.")
|
||||
|
|
Loading…
Reference in a new issue