Skip to content

Instantly share code, notes, and snippets.

@kkatsuyuki
Created January 21, 2018 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkatsuyuki/69de02026945d20931897eaf67cd593b to your computer and use it in GitHub Desktop.
Save kkatsuyuki/69de02026945d20931897eaf67cd593b to your computer and use it in GitHub Desktop.
auto-export every time you edit and save an org-file in your project directory
(defun org-auto-export-project ()
(let ((project
(catch 'is-project-dir
(dolist (each-project org-publish-project-alist)
(if (string-match
(expand-file-name (plist-get (cdr each-project) :base-directory))
(expand-file-name buffer-file-name))
(throw 'is-project-dir (car each-project)))))))
(if project
(save-excursion (org-publish-project project)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment