From f9d94b45fc82cb697a5c70869f4f164954c7a92b Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 29 Aug 2010 18:40:40 -0700 Subject: [PATCH] updated textmate-find-regex-in-project (still sucks though) need to create a mode based on grep-mode that doesn't suck --- emacs.d/textmate.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emacs.d/textmate.el b/emacs.d/textmate.el index 0837ade..a08c36e 100644 --- a/emacs.d/textmate.el +++ b/emacs.d/textmate.el @@ -301,20 +301,24 @@ Symbols matching the text at point are put first in the completion list." (setq *textmate-project-files* nil) (message "textmate-mode cache cleared.")) + +;; FIXME: +;; - use *textmate-gf-exclude* instead of hard-coding ignored paths +;; - format results nicely (like TextMate) (defun textmate-find-regex-in-project (regex) "Search the project for a regular expression and quickly jump to matches in a project. -This function just finds the project root and calls `LGREP'." +This function just finds the project root and calls `RGREP'." (interactive "sRegex: ") (let ((root (textmate-project-root))) (when (null root) (error (concat "Can't find a suitable project root (" - (string-join " " *textmate-project-roots* ) + (string-join " " *textmate-project-roots*) ")"))) - (lgrep regex "*" root))) + (grep (concat "grep -Hn -E '" regex "' " root "/**/{*.j,*.js,*akefile,*.sh}(N) | grep -vE '/([Bb]uild|Frameworks|.git)/?' | sed -e 's#" root "/##'")))) ;;; Utilities