Org-mode如何导出到其它目录

如题,我想要导出 markdown~/org-mode/markdown/
导出 html~/org-mode/html/

而源文件目录是在~/org-mode/org/

(defun org-md-export-to-markdown (&optional async subtreep visible-only)
  "Export current buffer to a Markdown file.
If narrowing is active in the current buffer, only export its
narrowed part.
If a region is active, export that region.
A non-nil optional argument ASYNC means the process should happen
asynchronously.  The resulting file should be accessible through
the `org-export-stack' interface.
When optional argument SUBTREEP is non-nil, export the sub-tree
at point, extracting information from the headline properties
first.
When optional argument VISIBLE-ONLY is non-nil, don't export
contents of hidden elements.
Return output file's name."
  (interactive)
  (let ((outfile (org-export-output-file-name ".md" subtreep)))
    (org-export-to-file 'md outfile async subtreep visible-only)))

这个函数该怎么改?

一种方法是自己移过去,只是这样不灵活。org-export-to-file 返回是导出的文件名:

(defun [email protected] ()
  (interactive)
  (shell-command
   (format "mv -v %s %s"
           (shell-quote-argument (org-md-export-to-markdown))
           "~/org-mode/markdown/")))

也可以直接 advice org-md-export-to-markdown

Thank you,这个可以用