I like to automatically publish my org files using a cron job once an hour. I therefore run a cron job that executes the following script:
;;; Load everything ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'org)
(org-babel-load-file
(expand-file-name "emacs-init.org"
user-emacs-directory))
;;; Publish ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(org-publish-project "org-notes")
Please note that my org-notes
project uses the org-html-publish-to-html
publishing function.
However, if this job runs while I'm visiting an unsaved file in another Emacs instance the script hangs with a message like this:
...foo.org locked by tom@pam... (pid 12320): (s, q, p, ?)?
Based on the Emacs interlocking help page it looks like I should get an error like this is I try to edit a file that contains unsaved edits that were made by another Emacs instance. However, I don't see why org-publish-project
would try to edit any org files. It was my impression that it just read the org files from the disk and then converted them into HTML.
Why would org-html-publish-to-html
actually try to edit an org file?