diff options
author | Arun Isaac | 2022-08-17 00:11:47 +0530 |
---|---|---|
committer | Arun Isaac | 2022-08-17 00:51:55 +0530 |
commit | 67fdece50779f1c986edd47ffa8363e41d688169 (patch) | |
tree | 30c587cea6c20502261255da377204e6d8b97500 | |
parent | a29160c92f9aea5417b04a320bb6d51bdfe6b152 (diff) | |
download | ennum-67fdece50779f1c986edd47ffa8363e41d688169.tar.gz ennum-67fdece50779f1c986edd47ffa8363e41d688169.tar.lz ennum-67fdece50779f1c986edd47ffa8363e41d688169.zip |
Move ennum-with-temporary-directory to top.
* ennum.el (ennum-with-temporary-directory): Move to top.
-rw-r--r-- | ennum.el | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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. |