我正在尝试创建一个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中找到答案。我查看了文档,我不确定我做错了什么。