branch: elpa/dirvish
commit cd77f4a517b84e137a398c8eee329d23b5ba9cdc
Author: Eki Zhang <liuyin...@outlook.com>
Commit: GitHub <nore...@github.com>

    dired-subtree respect dired-omit-mode now (#268)
---
 extensions/dirvish-subtree.el | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/extensions/dirvish-subtree.el b/extensions/dirvish-subtree.el
index 55798a1ce8..33d6f7d675 100644
--- a/extensions/dirvish-subtree.el
+++ b/extensions/dirvish-subtree.el
@@ -183,7 +183,9 @@ creation even the entry is in nested subtree nodes."
 
 (defun dirvish-subtree--readin (dir)
   "Readin DIR as a subtree node."
-  (let ((flags (or dirvish-subtree-listing-switches dired-actual-switches)) 
str)
+  (let ((flags (or dirvish-subtree-listing-switches dired-actual-switches))
+        (omit-p (bound-and-true-p dired-omit-mode))
+        str)
     (with-temp-buffer
       (cl-letf (((symbol-function 'dired-insert-set-properties) #'ignore))
         (save-excursion
@@ -192,7 +194,15 @@ creation even the entry is in nested subtree nodes."
           (delete-region (point) (line-beginning-position 2)))
         (setq str (buffer-string))
         (if (or (= (length str) 0) (string-prefix-p "//DIRED-OPTIONS//" str)) 
""
-          (substring (buffer-string) 0 -1))))))
+          (let ((str (substring (buffer-string) 0 -1)))
+            (if omit-p
+                (string-join (seq-remove
+                              (lambda (s)
+                                (string-match-p (dired-omit-regexp)
+                                                (substring s 
(next-single-property-change 0 'dired-filename s))))
+                              (string-split str "\n"))
+                             "\n")
+              str)))))))
 
 (defun dirvish-subtree--insert ()
   "Insert subtree under this directory."

Reply via email to