37 lines
1.1 KiB
EmacsLisp
37 lines
1.1 KiB
EmacsLisp
;;; acdw-frame.el -*- lexical-binding: t; coding: utf-8-unix -*-
|
|
|
|
;;; Fonts
|
|
|
|
(defun acdw/set-first-face-attribute (face font-list)
|
|
"Set FACE to the first font found in FONT-LIST.
|
|
FONT-LIST is a list of `font-spec' plists to be passed to
|
|
`set-face-attribute'."
|
|
(cond
|
|
((or (null window-system)
|
|
(null font-list))
|
|
nil)
|
|
((x-list-fonts (or (plist-get (car font-list) :font)
|
|
(plist-get (car font-list) :family)))
|
|
(apply #'set-face-attribute face nil (car font-list)))
|
|
(t (acdw/set-first-face-attribute face (cdr font-list)))))
|
|
|
|
(defun acdw/set-emoji-fonts (&rest emoji-fonts)
|
|
"Add all installed EMOJI-FONTS to the symbol fontset."
|
|
(let ((ffl (font-family-list)))
|
|
(dolist (font emoji-fonts)
|
|
(when (member font ffl)
|
|
(set-fontset-font t 'symbol
|
|
(font-spec :family font) nil 'append)))))
|
|
|
|
;;; Fringes
|
|
|
|
(defun acdw/set-fringes (bitmap-list)
|
|
"Apply multiple fringes at once.
|
|
BITMAP-LIST is a list of arglists passed directly to
|
|
`define-fringe-bitmap', which see."
|
|
(dolist (bitmap bitmap-list)
|
|
(apply #'define-fringe-bitmap bitmap))
|
|
(redraw-frame))
|
|
|
|
(provide 'acdw-frame)
|