diff options
author | Arun Isaac | 2022-08-17 00:11:24 +0530 |
---|---|---|
committer | Arun Isaac | 2022-08-17 00:51:55 +0530 |
commit | a29160c92f9aea5417b04a320bb6d51bdfe6b152 (patch) | |
tree | b2c6eb75aad02c7f995153c4dc5efb710dc2b1ed | |
parent | 8f6424cb50598ce742b146ec444e037ecfd606ae (diff) | |
download | ennum-a29160c92f9aea5417b04a320bb6d51bdfe6b152.tar.gz ennum-a29160c92f9aea5417b04a320bb6d51bdfe6b152.tar.lz ennum-a29160c92f9aea5417b04a320bb6d51bdfe6b152.zip |
Move ennum-with-current-directory to top.
* ennum.el (ennum-with-current-directory): Move to top.
-rw-r--r-- | ennum.el | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -33,6 +33,16 @@ last form in BODY." (insert-file-contents ,file) ,@body)) +(defmacro ennum-with-current-directory (directory &rest body) + "Change to DIRECTORY, evaluate BODY and restore the current +working directory. The value returned is the value of the last +form in BODY." + (declare (indent defun)) + (let ((current-directory-symbol (make-symbol "current-directory"))) + `(let ((,current-directory-symbol default-directory)) + (unwind-protect (progn (cd ,directory) ,@body) + (cd ,current-directory-symbol))))) + ;; TODO: Should the store have an absolute path to deal with directory ;; changes? Yes, since we ask for an absolute working directory, we ;; should. @@ -629,16 +639,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-current-directory (directory &rest body) - "Change to DIRECTORY, evaluate BODY and restore the current -working directory. The value returned is the value of the last -form in BODY." - (declare (indent defun)) - (let ((current-directory-symbol (make-symbol "current-directory"))) - `(let ((,current-directory-symbol default-directory)) - (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 |