【发布时间】:2017-11-27 09:51:17
【问题描述】:
我正在尝试创建一个将每个条目写入基于时间的文件名的 Org 模式捕获模板。
首先,在暂存缓冲区中有一个辅助函数:
;; Example input: (capture-date-based-file "~/path/to/logs/" "log")
;; Expected output: "~/path/to/logs/2017-11-27-monday-log.org"
(defun capture-date-based-file (path entry-type)
"Create a date-based file name based on the given type."
(downcase (concat path (format-time-string "%Y-%m-%d-%A-") entry-type ".org")))
然后,在捕获模板列表中使用它:
(setq org-capture-templates
'(("l" "Log" entry (file+headline ,(capture-date-based-file "~/path/to/logs/" "log"))
"* %?\n%U\n" :clock-in t :clock-resume t) ))
我收到一个错误:Symbol's function definition is void: \,
由于逗号字符,很难在 Google 中找到答案。我查看了文档,但我不确定我做错了什么。
【问题讨论】:
-
LISP 中的反引号是什么意思?:stackoverflow.com/questions/30150186/…