;;; cedet-files.el --- Common routines dealing with file names.
-;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;; Package: cedet
(setq file (concat driveletter ":"
(substring file (match-end 1))))))
- ;; Handle the \\file\name nomenclature on some windows boxes.
+ ;; Handle the \\file\name nomenclature on some Windows boxes.
(when (string-match "^!" file)
(setq file (concat "//" (substring file 1)))))
file))
+(defun cedet-files-list-recursively (dir re)
+ "Returns list of files in directory matching to given regex"
+ (when (file-accessible-directory-p dir)
+ (let ((files (directory-files dir t))
+ matched)
+ (dolist (file files matched)
+ (let ((fname (file-name-nondirectory file)))
+ (cond
+ ((or (string= fname ".")
+ (string= fname "..")) nil)
+ ((and (file-regular-p file)
+ (string-match re fname))
+ (setq matched (cons file matched)))
+ ((file-directory-p file)
+ (let ((tfiles (cedet-files-list-recursively file re)))
+ (when tfiles (setq matched (append matched tfiles)))))))))))
+
+
(provide 'cedet-files)
-;; arch-tag: 4884c616-82c3-475d-ac9f-039e3431a702
;;; cedet-files.el ends here