+(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)))))))))))
+
+