From d36c62080b428120857b5ebaf58ea0f41553f1a4 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Sun, 7 Jul 2024 20:06:15 +0800 Subject: [PATCH] [feat] add cond-let marco --- config.org | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config.org b/config.org index 4f6dc4b..54dd0be 100644 --- a/config.org +++ b/config.org @@ -229,6 +229,19 @@ 'org-babel-load-languages '((restclient . t))) #+end_src +* 宏 +** cond-let +终于知道为什么没人想写这个宏了,括号是真得多啊。 + +#+begin_src emacs-lisp +(defmacro cond-let (forms) + (declare (debug t)) + (if forms + `(let* ,(setq varlist (internal--build-bindings (caar forms))) + (if-let ,(car (last varlist)) + ,(cadar forms) + (cond-let ,(cdr forms)))))) +#+end_src * 杂项 =cnfonts= 是一个可以分别设置中英文字体的 bk ,方便对其表格。