Update module to conform to doom-emacs style
- Fix Readme.org alignment and metadata - Add unicode-font to "Plugins" section - Remove empty "Hacks" section - Inline +unicode--add-doom-unicode-font
This commit is contained in:
parent
6040feaa9a
commit
e26d69f39b
2 changed files with 11 additions and 16 deletions
|
@ -1,13 +1,14 @@
|
|||
#+TITLE: :ui unicode
|
||||
#+TITLE: ui/unicode
|
||||
#+DATE: June 8, 2020
|
||||
#+SINCE: v2.0
|
||||
#+STARTUP: inlineimages nofold
|
||||
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#maintainers][Maintainers]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#hacks][Hacks]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
|
@ -37,10 +38,7 @@ This module has no dedicated maintainers.
|
|||
This module provides no flags.
|
||||
|
||||
** Plugins
|
||||
# A list of linked plugins
|
||||
|
||||
** Hacks
|
||||
# A list of internal modifications to included packages; omit if unneeded
|
||||
+ [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]]
|
||||
|
||||
* Prerequisites
|
||||
This module has no prerequisites.
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +unicode--add-doom-unicode-font ()
|
||||
"Include doom-unicode font as the top suggested font for unicode glyphs for all blocks"
|
||||
(when doom-unicode-font
|
||||
(let ((doom-unicode-font-family (plist-get (font-face-attributes doom-unicode-font) :family)))
|
||||
(dolist (unicode-block unicode-fonts-block-font-mapping)
|
||||
(push doom-unicode-font-family (cadr unicode-block))))))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook! 'doom-init-ui-hook
|
||||
(defun +unicode-init-fonts-h ()
|
||||
|
@ -21,10 +13,15 @@ necessary."
|
|||
|
||||
;;;###autoload
|
||||
(defun +unicode-setup-fonts-h (&optional frame)
|
||||
"Initialize `unicode-fonts', if in a GUI session."
|
||||
"Initialize `unicode-fonts', if in a GUI session.
|
||||
|
||||
If doom-unicode-font is set, add it as preferred font for all unicode blocks."
|
||||
(when (and frame (display-graphic-p frame))
|
||||
(with-selected-frame frame
|
||||
(require 'unicode-fonts)
|
||||
(when doom-unicode-font
|
||||
(let ((doom-unicode-font-family (plist-get (font-face-attributes doom-unicode-font) :family)))
|
||||
(dolist (unicode-block unicode-fonts-block-font-mapping)
|
||||
(push doom-unicode-font-family (cadr unicode-block)))))
|
||||
;; NOTE will impact startup time on first run
|
||||
(+unicode--add-doom-unicode-font)
|
||||
(unicode-fonts-setup))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue