Run `set-fontset-font` only if it is available (for emoji layer)

This commit is contained in:
NicholasTD07 2017-09-12 11:14:40 +10:00 committed by duianto
parent 7818fa3ccf
commit f2e4b8d377
2 changed files with 12 additions and 9 deletions

View File

@ -1365,6 +1365,8 @@ Other:
- Added support for Emoji fonts on macOS and Linux (thanks to CodeFalling)
- Setup =emojify= cache directory (thanks to Boris Buliga)
- Hide mode-line indicator: =emoji= (thanks to duianto)
- Prevented =set-fontset-font= from being set in Emacs without a window system
(thanks to NicholasTD07k)
**** ERC
- Key bindings:
- ~SPC m b~ to switch between ERC buffers (thanks to Evan Klitzke)

View File

@ -13,15 +13,16 @@
;; Mac OS X and using the Cocoa version of Emacs
(defun spacemacs//set-emoji-font (frame)
"Adjust the font settings of FRAME so Emacs can display emoji properly."
(cond
((spacemacs/system-is-mac)
(set-fontset-font t 'symbol
(font-spec :family "Apple Color Emoji")
frame 'prepend))
((spacemacs/system-is-linux)
(set-fontset-font t 'symbol
(font-spec :family "Symbola")
frame 'prepend))))
(when (fboundp 'set-fontset-font)
(cond
((spacemacs/system-is-mac)
(set-fontset-font t 'symbol
(font-spec :family "Apple Color Emoji")
frame 'prepend))
((spacemacs/system-is-linux)
(set-fontset-font t 'symbol
(font-spec :family "Symbola")
frame 'prepend)))))
(defun spacemacs//set-emoji-font-for-current-frame ()
"Adjust the font settings of current frame so Emacs can display emoji