请原谅我对 Emacs Lisp 的陌生。我开始使用 org-mode 并喜欢它。在我的工作流程中,我试图将模板加载到打开的缓冲区中或提示模板询问要保存文件的位置。
例如,我有一个“会议”模板。当我调用该模板时,系统会提示我输入文件名,然后将模板加载到该文件中,然后将文件加载到 Emacs 中。
如何在 Emacs 中做到这一点?
这是迄今为止我能想到的最好的:
(defun caputre-create-meeting-link ()
(let ((new-file (read-file-name "Save meeting info in ")))
(run-with-timer 1 nil (eval `(lambda () (find-file ,new-file))))
(format "[[%s]]" new-file)))
(setq org-capture-templates
'(("a" "Insert a link to meeting" plain
(file "~/org/notes.org")
"Meeting info: %(caputre-create-meeting-link)"
:immediate-finish t)))
或多或少地得到你描述的效果。但是您可能可以简单地替换%(capture-create-meeting-link)
为%^L
然后C-c C-o在链接上打开它。