summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-02-22 21:53:42 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-02-22 21:53:42 +0100
commit92443160fd248467a519552411dbcf32dc72de16 (patch)
treea0fae4d7a91077dac97195c3d51863e5868c02db
parent54b4be82089c50aa0aa2ec80bea83b32de36f076 (diff)
downloadorg-mode-92443160fd248467a519552411dbcf32dc72de16.tar.gz
ox-publish: Write cache after successfully publishing a file
* lisp/ox-publish.el (org-publish-file): Ignore NO-CACHE parameter when writing cache to file. This is needed to recover from an interrupted publishing process. Reported-by: Julien Cubizolles <j.cubizolles@free.fr> <http://permalink.gmane.org/gmane.emacs.orgmode/105046>
-rw-r--r--lisp/ox-publish.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 02a9f37..27f06ff 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -614,10 +614,10 @@ Return output file name."
(defun org-publish-file (filename &optional project no-cache)
"Publish file FILENAME from PROJECT.
-If NO-CACHE is not nil, do not initialize org-publish-cache and
-write it to disk. This is needed, since this function is used to
-publish single files, when entire projects are published.
-See `org-publish-projects'."
+If NO-CACHE is not nil, do not initialize `org-publish-cache'.
+This is needed, since this function is used to publish single
+files, when entire projects are published (see
+`org-publish-projects')."
(let* ((project
(or project
(or (org-publish-get-project-from-filename filename)
@@ -659,7 +659,9 @@ See `org-publish-projects'."
(run-hook-with-args 'org-publish-after-publishing-hook
filename
output))))
- (unless no-cache (org-publish-write-cache-file))))
+ ;; Make sure to write cache to file after successfully publishing
+ ;; a file, so as to minimize impact of a publishing failure.
+ (org-publish-write-cache-file)))
(defun org-publish-projects (projects)
"Publish all files belonging to the PROJECTS alist.