通过elisp自动化组织模式html导出

时间:2012-07-19 10:54:24

标签: automation elisp org-mode

我想使用~/.emacs中定义的elisp defun自动执行两个org-mode文件的html导出。我写了以下代码:

(defun publish-custom-orgs ()
  "publish certain org files as html files"
  (interactive)
  (find-file "~/org/a.org")
  (org-export-as-html)
  (find-file "~/org/b.org")
  (org-export-as-html)
)

但这不会导出文件;相反,它在迷你缓冲区中显示一个奇怪的输出:

enter image description here

我做错了什么?

1 个答案:

答案 0 :(得分:2)

您可以尝试org-export-as-html-batch

(defun publish-custom-orgs ()
  "publish certain org files as html files"
  (interactive)
  (find-file "~/org/a.org")
  (org-export-as-html-batch)
  (find-file "~/org/b.org")
  (org-export-as-html-batch)
)