#********************************************************************************
#Copyright © 2020 Wcq
#File Name: emojify_install.org
#Author: Wcq
#Email: wcq-062821@163.com
#Created: 2020-05-21 00:55:55
#Last Update: 2022-06-22 11:01:16
#Description:
#********************************************************************************
安装 emojify 包
- 修改 ~/.dooom.d/packages.el 添加以下内容
1
(package! emojify)
- 修改 ~/.dooom.d/config.el 添加以下内容
1
(add-hook 'after-init-hook #'global-emojify-mode)
- 更新 doom emacs
1
doom sync
- 重启 emacs
SPC-q-R
简单用法
M-x: emojify-insert-emoji
第一次使用会提示没有图片包要求下载
![](/ox-hugo/_20200521_010950screenshot.png)
选中 y 后会自动下载 如果没有意外会是这样的结果
手动安装资源包
- C-h-f 输入 emojify-insert-emoji 查看函数定义
进入定义查看 搜索 download 定位到提示下载的位置
当输入 y 时把 download-confirmed-p 设为 t 并返回
-
接着看看哪里调用这个 emojify–confirm-emoji-download 函数
由此可以看出 下载函数的函数在 emojify-download-emoji 里 把光标移到 emojify-emoji-set 上 C-h-v 查看变量 结果如下
把光标移到 emojify-download-emoji 函数上按 g d可查看函数定义 如果要返回 按 C-o
分析函数可知下载地址在emojify-emoji-set-json 里 查看该变量得到结果如下1 2 3 4 5 6 7 8 9 10 11 12 13 14
Value #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("emojione-v2-22" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Emoji One (version 2), resized to 22px" "website" "http://emojione.com" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/emojione-fixed-v2-22.tar" "sha256" "8b0ccea3610dc98c74d04de8d8c6340b4aaa8e950cad8fb62961e45792625dd7")) "emojione-v2" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Emoji One (version 2)" "website" "http://emojione.com" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/emojione-fixed-v2.tar" "sha256" "828765e8f89dc6aa4cfb06c271e9de122aa51383ed85e1169ac774fdf1c739fb")) "emojione-v2.2.6-22" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Emoji One (version 2.2.6), resized to 22px" "website" "http://emojione.com" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/emojione-fixed-v2.2.6-22.tar" "sha256" "f4428b0875cd0a418168139418bb03aaae0655254e4a683ec101f901d2c6ce59")) "emojione-v2.2.6" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Emoji One (version 2.2.6)" "website" "http://emojione.com" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/emojione-fixed-v2.2.6.tar" "sha256" "eb0ff5637924a2a04d3ab649b66d816a69c5d71eab2bf5274d292115e8178244")) "twemoji-v2" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Twitter (version 2)" "website" "https://twemoji.twitter.com/" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/twemoji-fixed-v2.tar" "sha256" "0991b1032a04d948835fba4249f43993b4ac88a66d2ae7f278f03be31884851d")) "twemoji-v2-22" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("description" "Emojis provided by Twitter (version 2), resized to 22px" "website" "https://twemoji.twitter.com/" "url" "https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/twemoji-fixed-v2-22.tar" "sha256" "e3ae26d7ac111fe0be7b90f29afdab89676610a865353dfb672673efb5af044a"))))
根据 emojify-emoji-set 的值找出对应的下载地址为 https://raw.githubusercontent.com/iqbalansari/emacs-emojify/9e36d0e8c2a9c373a39728f837a507adfbb7b931/emojione-fixed-v2.2.6-22.tar
直接复制到 Chrome 下载 -
下载后的文件应该放到哪里去呢?
根据源码 (and (file-exists-p (expand-file-name emoji-set emojify-emojis-dir)) 可知 下载好的文件应该位于 emojify-emojis-dir/emoji-set 目录下
而 emojify-emojis-dir 的值为 ~/.emacs.d/emojis/ 即文件解压后应该位于 ~/.emacs.d/emojis/emojione-v2.2.6-22 目录下 操作如下1 2 3 4
cd ~/.emacs.d/ mkdir emojis cd emojis tar xvf ~/Download/emojione-fixed-v2.2.6-22.tar -C .
-
更新 doom
1
doom sync
-
重启 emacs
SPC-q-R
简单测试
顺便打开一个文件
M-x: emojify-insert-emoji
输入 earth 选一个后面是 unicode的 回车 效果如下:
🌎
注意: 图示后面带 github的不能正常显示