branch: externals/denote-org
commit 39abc5c0db7960ef753120ab96f016ea9d9fef66
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Move lexical variable where it is needed in 
denote-org-sequence--get-files-with-max-depth
---
 denote-org.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/denote-org.el b/denote-org.el
index 8a190f7678..2a02f72fbc 100644
--- a/denote-org.el
+++ b/denote-org.el
@@ -986,16 +986,16 @@ DEPTH of the root FILE is 1. Using 2 lists children, 3 
grandchildren, and so on.
 With optional FILES operate on them, otherwise use the return value of
 `denote-sequence-get-all-files'."
     (let* ((all-files (or files (denote-sequence-get-all-files)))
-           (hierarchy nil)
            (sorted-files (denote-sequence-sort-files all-files))
            (root-sequence (denote-retrieve-filename-signature (car 
sorted-files)))
            (root-depth (denote-sequence-depth root-sequence)))
-      (dolist (file sorted-files)
-        (let* ((sequence (denote-retrieve-filename-signature file))
-               (depth (denote-sequence-depth sequence)))
-          (when (<= depth (- (+ root-depth max-depth) 1))
-            (push file hierarchy))))
-      (nreverse hierarchy)))
+      (let ((hierarchy nil))
+        (dolist (file sorted-files)
+          (let* ((sequence (denote-retrieve-filename-signature file))
+                 (depth (denote-sequence-depth sequence)))
+            (when (<= depth (- (+ root-depth max-depth) 1))
+              (push file hierarchy))))
+        (nreverse hierarchy))))
 
   (defun denote-org-sequence--format-word-regexp (sequence)
     "Return word regexp matching SEQUENCE.

Reply via email to