Emoji tweaks

This commit is contained in:
TEC 2023-11-09 02:01:40 +08:00
parent 0c93f9c1d8
commit 6f8948a46b
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 12 additions and 4 deletions

View File

@ -1844,15 +1844,23 @@ files.
***** Emojis
Lastly, it would be good to sort out emojis. All that's really needed here is to
apply =doom-emoji-font=, which needs to be done here because it's not /actually/ a
Doom font variable, but rather my own addition.
Emacs (28+) has an ~emoji~ script table. We're about to use it, but before doing
so we're going to excise a few characteris that I actually want rendered as
using the symbol font (not as emojis).
#+begin_src emacs-lisp
(dolist (char '(?⏩ ?⏪ ?❓))
(set-char-table-range char-script-table char 'symbol))
#+end_src
To actually sort out emojis, all that's really needed here is to apply
=doom-emoji-font=, which needs to be done /here/ because it's not /actually/ a Doom
font variable, but rather my own addition.
#+begin_src emacs-lisp
(add-hook! 'after-setting-font-hook
(defun +emoji-set-font ()
(set-fontset-font t 'emoji doom-emoji-font nil 'prepend)))
#+end_src
We might as well also construct a regexp to make identifying emojis if buffers