From 8df085bb42991a3c9bd216b1bbcb73738b29d411 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 21 Aug 2021 09:10:01 -0500 Subject: Rewrite early-init.el --- lisp/acdw-frame.el | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lisp/acdw-frame.el (limited to 'lisp/acdw-frame.el') 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 @@ +;;; 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) -- cgit 1.4.1-21-gabe81