Make a backup of the source file; accidents happen

This commit is contained in:
TEC 2020-10-25 17:02:42 +08:00
parent 554b1896b9
commit f51f51e8a6
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 1 additions and 0 deletions

View File

@ -133,6 +133,7 @@ actions that may undesirably trigger the file watcher.")
(start-time (time-to-seconds (current-time)))
(org-pandoc-import-transient--currently-processing t))
(unless (plist-get file-info :initialised)
(copy-file source-file (concat source-file ".backup") nil t)
(delete-file org-file) ; to avoid the overwrite prompt
(message "Initialising...")
(org-pandoc-import-to-org nil source-file org-file t)