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
|
#+DATE: June 8, 2020
|
||||||
|
#+SINCE: v2.0
|
||||||
#+STARTUP: inlineimages nofold
|
#+STARTUP: inlineimages nofold
|
||||||
|
|
||||||
|
|
||||||
* Table of Contents :TOC_3:noexport:
|
* Table of Contents :TOC_3:noexport:
|
||||||
- [[#description][Description]]
|
- [[#description][Description]]
|
||||||
- [[#maintainers][Maintainers]]
|
- [[#maintainers][Maintainers]]
|
||||||
- [[#module-flags][Module Flags]]
|
- [[#module-flags][Module Flags]]
|
||||||
- [[#plugins][Plugins]]
|
- [[#plugins][Plugins]]
|
||||||
- [[#hacks][Hacks]]
|
|
||||||
- [[#prerequisites][Prerequisites]]
|
- [[#prerequisites][Prerequisites]]
|
||||||
- [[#features][Features]]
|
- [[#features][Features]]
|
||||||
- [[#configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
|
@ -37,10 +38,7 @@ This module has no dedicated maintainers.
|
||||||
This module provides no flags.
|
This module provides no flags.
|
||||||
|
|
||||||
** Plugins
|
** Plugins
|
||||||
# A list of linked plugins
|
+ [[https://github.com/rolandwalker/unicode-fonts][unicode-fonts]]
|
||||||
|
|
||||||
** Hacks
|
|
||||||
# A list of internal modifications to included packages; omit if unneeded
|
|
||||||
|
|
||||||
* Prerequisites
|
* Prerequisites
|
||||||
This module has no prerequisites.
|
This module has no prerequisites.
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
|
;;; 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
|
;;;###autoload
|
||||||
(add-hook! 'doom-init-ui-hook
|
(add-hook! 'doom-init-ui-hook
|
||||||
(defun +unicode-init-fonts-h ()
|
(defun +unicode-init-fonts-h ()
|
||||||
|
@ -21,10 +13,15 @@ necessary."
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +unicode-setup-fonts-h (&optional frame)
|
(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))
|
(when (and frame (display-graphic-p frame))
|
||||||
(with-selected-frame frame
|
(with-selected-frame frame
|
||||||
(require 'unicode-fonts)
|
(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
|
;; NOTE will impact startup time on first run
|
||||||
(+unicode--add-doom-unicode-font)
|
|
||||||
(unicode-fonts-setup))))
|
(unicode-fonts-setup))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue