Function: filesets-files-under

filesets-files-under is a byte-compiled function defined in filesets.el.gz.

Signature

(filesets-files-under LEVEL DEPTH ENTRY DIR PATT &optional RELATIVEP)

Documentation

Files under DIR that match PATT.

LEVEL is the current level under DIR. DEPTH is the maximal tree scanning depth for ENTRY. ENTRY is a fileset. DIR is a directory. PATT is a regexp that included file names must match. RELATIVEP non-nil means use relative file names.

Source Code

;; Defined in /usr/src/emacs/lisp/filesets.el.gz
(defun filesets-files-under (level depth entry dir patt &optional relativep)
  "Files under DIR that match PATT.
LEVEL is the current level under DIR.
DEPTH is the maximal tree scanning depth for ENTRY.
ENTRY is a fileset.
DIR is a directory.
PATT is a regexp that included file names must match.
RELATIVEP non-nil means use relative file names."
  (and (or (= depth 0) (< level depth))
       (let* ((dir         (file-name-as-directory dir))
              (files-here  (filesets-directory-files
                            dir patt nil (not relativep)
                            (filesets-entry-get-filter-dirs-flag entry)))
              (subdirs     (filesets-filter-dir-names files-here))
              (files
               (filesets-filter-dir-names
                (apply #'append
                       files-here
                       (mapcar
                        (lambda (subdir)
                          (let* ((subdir (file-name-as-directory subdir))
                                 (full-subdir  (concat dir subdir)))
                            (filesets-files-under (+ level 1) depth entry
                                                  full-subdir patt)))
                        subdirs))
                t)))
         files)))