summary refs log tree commit diff stats
path: root/lisp/acdw-frame.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw-frame.el')
-rw-r--r--lisp/acdw-frame.el36
1 files changed, 36 insertions, 0 deletions
diff --git a/lisp/acdw-frame.el b/lisp/acdw-frame.el new file mode 100644 index 0000000..753fd14 --- /dev/null +++ b/lisp/acdw-frame.el
@@ -0,0 +1,36 @@
1;;; acdw-frame.el -*- lexical-binding: t; coding: utf-8-unix -*-
2
3;;; Fonts
4
5(defun acdw/set-first-face-attribute (face font-list)
6 "Set FACE to the first font found in FONT-LIST.
7FONT-LIST is a list of `font-spec' plists to be passed to
8`set-face-attribute'."
9 (cond
10 ((or (null window-system)
11 (null font-list))
12 nil)
13 ((x-list-fonts (or (plist-get (car font-list) :font)
14 (plist-get (car font-list) :family)))
15 (apply #'set-face-attribute face nil (car font-list)))
16 (t (acdw/set-first-face-attribute face (cdr font-list)))))
17
18(defun acdw/set-emoji-fonts (&rest emoji-fonts)
19 "Add all installed EMOJI-FONTS to the symbol fontset."
20 (let ((ffl (font-family-list)))
21 (dolist (font emoji-fonts)
22 (when (member font ffl)
23 (set-fontset-font t 'symbol
24 (font-spec :family font) nil 'append)))))
25
26;;; Fringes
27
28(defun acdw/set-fringes (bitmap-list)
29 "Apply multiple fringes at once.
30BITMAP-LIST is a list of arglists passed directly to
31`define-fringe-bitmap', which see."
32 (dolist (bitmap bitmap-list)
33 (apply #'define-fringe-bitmap bitmap))
34 (redraw-frame))
35
36(provide 'acdw-frame)