From 6f04ea1f3f7c2b6c4727210c492e293edd8a1823 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 9 Sep 2025 13:15:17 +0100 Subject: Delete copy of tangled org file using unwind-protect. unwind-protect is safer and ensures deletion even if there are non-local exits. --- ennum.el | 8 +++++--- 1 file 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) -- cgit 1.4.1