Permalink
Browse files

helm: search for relevant files and discard irrelevant

  • Loading branch information...
Antono Vasiljev authored and jrockway committed May 26, 2012
1 parent f41fc13 commit 8735c8f84354b17bb0d90510cc78477b856a9ff1
Showing with 14 additions and 9 deletions.
  1. +1 −2 contrib/eproject-anything.el
  2. +13 −7 contrib/helm-eproject.el
@@ -32,8 +32,7 @@
(init . (lambda () (if (buffer-file-name)
(setq anything-eproject-root-dir
(eproject-maybe-turn-on))
- (setq anything-eproject-root-dir 'nil)
- )))
+ (setq anything-eproject-root-dir 'nil))))
(candidates . (lambda () (if anything-eproject-root-dir
(eproject-list-project-files
anything-eproject-root-dir))))
View
@@ -60,21 +60,27 @@
(require 'eproject)
(require 'cl)
+(defun helm-eproject-build-matcher (matcher-type)
+ (format "\\(?:%s\\)"
+ (reduce (lambda (a b) (concat a "\\|" b))
+ (mapcar (lambda (f) (format "\\(?:%s\\)" f))
+ (eproject-get-project-metadatum
+ (eproject-type) matcher-type)))))
+
(defun helm-eproject-get-files ()
- (let ((matcher (format "\\(?:%s\\)"
- (reduce (lambda (a b) (concat a "\\|" b))
- (mapcar (lambda (f) (format "\\(?:%s\\)" f))
- (eproject-get-project-metadatum
- (eproject-type) :relevant-files))))))
- (eproject--search-directory-tree (eproject-root) matcher)))
+ (eproject--search-directory-tree
+ (eproject-root)
+ (helm-eproject-build-matcher :relevant-files)
+ (helm-eproject-build-matcher :irrelevant-files)))
(defvar helm-eproject-source
'((name . " helm-eproject: ")
(init . (lambda ()
(setq helm-eproject-last-buffer (current-buffer))))
(type . file)
(candidates . (lambda ()
- (with-current-buffer helm-eproject-last-buffer (helm-eproject-get-files))))))
+ (with-current-buffer helm-eproject-last-buffer
+ (helm-eproject-get-files))))))
(defun helm-eproject ()
"helps helm to use eproject to find a file"

0 comments on commit 8735c8f

Please sign in to comment.