Skip to content

Commit

Permalink
Move possible project root indicators into a defvar
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Aug 15, 2009
1 parent 6ad86ee commit c176031
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion textmate.el
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
(defvar *textmate-project-files* '())
(defvar *textmate-gf-exclude*
"/\\.|vendor|fixtures|tmp|log|build|\\.xcodeproj|\\.nib|\\.framework|\\.app|\\.pbproj|\\.pbxproj|\\.xcode|\\.xcodeproj|\\.bundle|\\.pyc")
(defvar *textmate-project-roots*
'(".git" ".hg" "Rakefile" "Makefile" "README" "build.xml"))

;;; Bindings

Expand Down Expand Up @@ -263,7 +265,7 @@
(defun textmate-find-project-root (&optional root)
(when (null root) (setq root default-directory))
(cond
((root-matches root '(".git" "Rakefile" "Makefile" "README" "build.xml"))
((root-matches root *textmate-project-roots*)
(expand-file-name root))
((equal (expand-file-name root) "/") nil)
(t (textmate-find-project-root (concat (file-name-as-directory root) "..")))))
Expand Down

0 comments on commit c176031

Please sign in to comment.