From 67fdece50779f1c986edd47ffa8363e41d688169 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 17 Aug 2022 00:11:47 +0530 Subject: Move ennum-with-temporary-directory to top. * ennum.el (ennum-with-temporary-directory): Move to top. --- ennum.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ennum.el b/ennum.el index 59527e0..16c9159 100644 --- a/ennum.el +++ b/ennum.el @@ -43,6 +43,17 @@ form in BODY." (unwind-protect (progn (cd ,directory) ,@body) (cd ,current-directory-symbol))))) +(defmacro ennum-with-temporary-directory (temporary-directory &rest body) + "Create temporary directory, evaluate BODY with the absolute +path of that directory assigned to TEMPORARY-DIRECTORY and +finally delete the temporary directory. The value returned is the +value of the last form in BODY." + (declare (indent defun)) + `(let ((,temporary-directory (make-temp-file "ennum" t))) + (unwind-protect + (progn ,@body) + (delete-directory ,temporary-directory t)))) + ;; TODO: Should the store have an absolute path to deal with directory ;; changes? Yes, since we ask for an absolute working directory, we ;; should. @@ -639,17 +650,6 @@ recognized as a directory, it should end in a slash. See (ennum--file-join (ennum-setting :images-directory) (ennum-video-link-poster link))))))) -(defmacro ennum-with-temporary-directory (temporary-directory &rest body) - "Create temporary directory, evaluate BODY with the absolute -path of that directory assigned to TEMPORARY-DIRECTORY and -finally delete the temporary directory. The value returned is the -value of the last form in BODY." - (declare (indent defun)) - `(let ((,temporary-directory (make-temp-file "ennum" t))) - (unwind-protect - (progn ,@body) - (delete-directory ,temporary-directory t)))) - (defun ennum-assoc-delete (key alist) "Delete KEY from ALIST. -- cgit v1.2.3