about summary refs log tree commit diff
path: root/ennum.el
diff options
context:
space:
mode:
authorArun Isaac2025-09-09 13:15:17 +0100
committerArun Isaac2025-09-09 13:15:17 +0100
commit6f04ea1f3f7c2b6c4727210c492e293edd8a1823 (patch)
treeb6b5e898f1c134f2e5faec6ecfdeb513c8ea056d /ennum.el
parentb25a703572143b7f9cfc5f55704cd2c114b6adc3 (diff)
downloadennum-6f04ea1f3f7c2b6c4727210c492e293edd8a1823.tar.gz
ennum-6f04ea1f3f7c2b6c4727210c492e293edd8a1823.tar.lz
ennum-6f04ea1f3f7c2b6c4727210c492e293edd8a1823.zip
Delete copy of tangled org file using unwind-protect.
unwind-protect is safer and ensures deletion even if there are
non-local exits.
Diffstat (limited to 'ennum.el')
-rw-r--r--ennum.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/ennum.el b/ennum.el
index 6314a5c..12e04ce 100644
--- a/ennum.el
+++ b/ennum.el
@@ -501,9 +501,11 @@ result as a string."
                  (expand-file-name
                   (file-name-nondirectory interned-org-file)
                   (ennum-setting :static-directory))))
-           (ennum-copy interned-org-file post-file-copy)
-           (org-babel-tangle-file post-file-copy)
-           (delete-file post-file-copy)))))
+           (unwind-protect
+               (progn
+                 (ennum-copy interned-org-file post-file-copy)
+                 (org-babel-tangle-file post-file-copy))
+             (delete-file post-file-copy))))))
      (seq-mapcat 'ennum-publish-link (ennum-post-links post)))))
 
 (defun ennum-publish-generic (other-files-directory file)