summaryrefslogtreecommitdiff
path: root/ennum.el
diff options
context:
space:
mode:
authorArun Isaac2022-08-15 16:41:47 +0530
committerArun Isaac2022-08-15 16:41:47 +0530
commit05da58d8322b54f6c2cb30a08204778da41cfdbe (patch)
tree13882cf75b892eccb811536f18e2e9fe601a9ec1 /ennum.el
parent5c1e8b73b29ed6db2931003f0e94400c1b185b10 (diff)
downloadennum-05da58d8322b54f6c2cb30a08204778da41cfdbe.tar.gz
ennum-05da58d8322b54f6c2cb30a08204778da41cfdbe.tar.lz
ennum-05da58d8322b54f6c2cb30a08204778da41cfdbe.zip
Localize conditional in chmod call.
* ennum.el (ennum--set-file-modes-recursively): Compute only the mode conditionally, not the whole chmod call.
Diffstat (limited to 'ennum.el')
-rw-r--r--ennum.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/ennum.el b/ennum.el
index a94c246..a8ab1aa 100644
--- a/ennum.el
+++ b/ennum.el
@@ -91,10 +91,11 @@ the current state of all its variables."
(defun ennum--set-file-modes-recursively (directory directory-mode file-mode executable-file-mode)
(chmod directory directory-mode)
(seq-do (lambda (file)
- (cond
- ((file-directory-p file) (chmod file directory-mode))
- ((file-executable-p file) (chmod file executable-file-mode))
- (t (chmod file file-mode))))
+ (chmod file
+ (cond
+ ((file-directory-p file) directory-mode)
+ ((file-executable-p file) executable-file-mode)
+ (t file-mode))))
(ennum-directory-files directory t t)))
(defmacro ennum-exp (&rest body)