Sebastian Rose <address@hidden> writes:
Hi Eric,
sorry for being unclear. I use the -o option. The image is always
created correctly. But it seems that the exporter
(org-publish-attachment) refuses to overwrite existing files.
Hi Sebastian,
I see now. It looks like org-publish-attachment uses the `copy-file'
function to copy files to the publish directory. We just need to
set an
option argument to copy-file to tell it how to deal with overwriting.
,----[from copy-file documentation]
| The optional third argument OK-IF-ALREADY-EXISTS specifies what to
do
| if file NEWNAME already exists. If OK-IF-ALREADY-EXISTS is nil, we
| signal a `file-already-exists' error without overwriting. If
| OK-IF-ALREADY-EXISTS is a number, we request confirmation from the
user
| about overwriting; this is what happens in interactive use with M-x.
| Any other value for OK-IF-ALREADY-EXISTS means to overwrite the
| existing file.
`----
This file is currently set to nil, we should probably set it to t so
it
always overwrites files. Does that sound like the best option?
The attached minimal patch set this option to t.
Best -- Eric
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index aa8c495..bbd9180 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -537,7 +537,7 @@ See `org-publish-org-to' to the list of
arguments."
;; make sure eshell/cp code is loaded
(unless (file-directory-p pub-dir)
(make-directory pub-dir t))
- (copy-file filename pub-dir))
+ (copy-file filename pub-dir t))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Publishing files, sets of files, and indices