spacemacs - 如何在 spacemacs 中创建自己的函数?
问题描述
我已切换到 Spacemacs,但某些功能不再起作用。
我正在尝试运行一个函数来创建从工作量估计创建的时间范围由 lawlist 创建
(defun org-schedule-effort ()
(interactive)
(save-excursion
(org-back-to-heading t)
(let* (
(element (org-element-at-point))
(effort (org-element-property :EFFORT element))
(scheduled (org-element-property :scheduled element))
(ts-year-start (org-element-property :year-start scheduled))
(ts-month-start (org-element-property :month-start scheduled))
(ts-day-start (org-element-property :day-start scheduled))
(ts-hour-start (org-element-property :hour-start scheduled))
(ts-minute-start (org-element-property :minute-start scheduled)) )
(org-schedule nil (concat
(format "%s" ts-year-start)
"-"
(if (< ts-month-start 10)
(concat "0" (format "%s" ts-month-start))
(format "%s" ts-month-start))
"-"
(if (< ts-day-start 10)
(concat "0" (format "%s" ts-day-start))
(format "%s" ts-day-start))
" "
(if (< ts-hour-start 10)
(concat "0" (format "%s" ts-hour-start))
(format "%s" ts-hour-start))
":"
(if (< ts-minute-start 10)
(concat "0" (format "%s" ts-minute-start))
(format "%s" ts-minute-start))
"+"
effort)) )))
但是当我运行M-x org-schedule-effort
该功能时没有找到
我知道你会像往常一样称呼它,因为它在 Emacs 中工作
我已将所有功能放入 defun dotspacemacs/user-config ()
并使用 hello world 脚本进行了测试
(defun dotspacemacs/user-config ()
(defun say-hello ()
"hello")
)
如何在 Spacemacs 中运行 defun?
解决方案
推荐阅读
- python-3.x - max() arg 是 max(listname) 中的一个空序列
- ruby-on-rails - 使用 -d(守护进程)运行 Rails(Puma)时的 Nginx 502
- python-3.x - 运行 python 抓取代码后显示 TypeError(o'reilly 示例代码)
- flutter - 如何处理流控制器 Flutter
- reactjs - 反应中未显示图像预览
- ffmpeg - 使用 FFmpeg 录制屏幕
- log4j2 - 如何将 log4j.property 设置为 .jar 位置
- model-view-controller - stimulsoft mvc core如何动态报告图像大小
- c - 传递给函数的值已更改
- javascript - 将数组前一个对象分配给下一个元素并更新最后一个