这个还没来得及写,等过年吧
强烈赞成!并期待中。。。
我的配置文档已经绵绵无绝期了。但前段时间给company-mode传一个简短的bug fix,还是被“吐槽”的一踏糊涂
刚刚更新了 变量设置的一些内容,也许有用
你不会步入田春的后尘吧? 成为一个lisp历史学家?
1 个赞
其实我对这一块也挺感兴趣的:joy:
我在zsh里是这么用的, 多谢 我抄下来了
我也有个启动赋诗 用的今日诗词接口,分享下
(defvar poem-file "~/.emacs.d/.poem.json")
(defvar poem-cache nil)
(defun poem-update ()
"Download poem from `jinrishici.com`"
(let ((url-request-extra-headers
'(("X-User-Token" . "======今日诗词网站申请的token======"))))
(ignore-errors
(url-retrieve
"https://v2.jinrishici.com/sentence"
(lambda (status)
(write-region url-http-end-of-headers (point-max) poem-file)))))
(setq poem-cache nil))
(defun poem-get (prop)
"Get poem from cache file, PROP can be 'content, 'origin"
(ignore-errors
(if poem-cache
(alist-get prop poem-cache)
(with-temp-buffer
(insert-file-contents poem-file)
(let ((data (alist-get 'data (json-read))))
(setq poem-cache data)
(alist-get prop data))))))
(defun poem-get-formatted ()
(let* ((poem (poem-get 'origin))
(lines (alist-get 'content poem))
(content (mapconcat #'identity lines "\n")))
(format "%s\n%s · %s\n%s"
(alist-get 'title poem)
(alist-get 'dynasty poem)
(alist-get 'author poem)
content)))
然后放到dashboard上,就可以按g刷新了(刷新好像还有bug )
(advice-add #'dashboard-refresh-buffer :after #'poem-update)
(defun dashboard-poem (list-size)
(insert (poem-get-formatted)))
(add-to-list 'dashboard-item-generators '(poem . dashboard-poem))
连标题栏都是诗
(setq frame-title-format '(multiple-frames "%e" (:eval (poem-get 'content))))
顺便看了下,我今天的标题栏是 君子死知己,提剑出燕京
3 个赞
emacser遇到的最悲哀的事情就是想象力慢慢的失去了。。。。
1 个赞