mirror of
https://github.com/ryuslash/mode-icons.git
synced 2024-11-21 09:30:29 +01:00
Only attempt to get the line height if the display is a graphic one
So that the height calculation doesn't interfere with the startup of the Emacs daemon, only try to calculate the height of the image when we're dealing with a graphical display.
This commit is contained in:
parent
1541e08557
commit
02fa5f74db
1 changed files with 8 additions and 3 deletions
|
@ -510,9 +510,14 @@ ACTIVE tells if current window is active."
|
|||
"Gets the height in pixels of WINDOW's mode-line font.
|
||||
This function also adjusts the line height by
|
||||
`mode-icons-line-height-adjust'. If WINDOW is nil, it defaults to
|
||||
the current window"
|
||||
(+ mode-icons-line-height-adjust
|
||||
(aref (font-info (face-font 'mode-line) (window-frame window)) 3)))
|
||||
the current window.
|
||||
|
||||
This function returns nil if the current display isn’t a graphic
|
||||
one. This is to make sure that things still work when dealing
|
||||
with, for example, a starting daemon."
|
||||
(when (display-graphic-p)
|
||||
(+ mode-icons-line-height-adjust
|
||||
(aref (font-info (face-font 'mode-line) (window-frame window)) 3))))
|
||||
|
||||
(defun mode-icons-get-icon-display (icon type &optional face active)
|
||||
"Get the value for the display property of ICON having TYPE.
|
||||
|
|
Loading…
Reference in a new issue