aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/flymake.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2007-07-20 04:09:08 +0000
committerStefan Monnier <[email protected]>2007-07-20 04:09:08 +0000
commit8ebbfc80ba6255d08b31b6be0f314f1481374f61 (patch)
treea8a87d7257cee444c13177614ac39e2d98012ad9 /lisp/progmodes/flymake.el
parent6b6b99547b477c24b5575116f1a42b82d045fb17 (diff)
(flymake-buildfile-dirs): Remove.
(flymake-find-buildfile): Use locate-dominating-file.
Diffstat (limited to 'lisp/progmodes/flymake.el')
-rw-r--r--lisp/progmodes/flymake.el25
1 files changed, 8 insertions, 17 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 4903d7d26e..7e353247b0 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -325,11 +325,6 @@ Return nil if we cannot, non-nil if we can."
(or (nth 2 (flymake-get-file-name-mode-and-masks file-name))
'flymake-get-real-file-name))
-(defcustom flymake-buildfile-dirs '("." ".." "../.." "../../.." "../../../.." "../../../../.." "../../../../../.." "../../../../../../.." "../../../../../../../.." "../../../../../../../../.." "../../../../../../../../../.." "../../../../../../../../../../..")
- "Dirs to look for buildfile."
- :group 'flymake
- :type '(repeat (string)))
-
(defvar flymake-find-buildfile-cache (flymake-makehash 'equal))
(defun flymake-get-buildfile-from-cache (dir-name)
@@ -346,19 +341,15 @@ Return nil if we cannot, non-nil if we can."
Buildfile includes Makefile, build.xml etc.
Return its file name if found, or nil if not found."
(or (flymake-get-buildfile-from-cache source-dir-name)
- (let* ((dirs flymake-buildfile-dirs)
- (buildfile-dir nil)
- (found nil))
- (while (and (not found) dirs)
- (setq buildfile-dir (concat source-dir-name (car dirs)))
- (when (file-exists-p (expand-file-name buildfile-name buildfile-dir))
- (setq found t))
- (setq dirs (cdr dirs)))
- (if found
+ (let* ((file (locate-dominating-file
+ source-dir-name
+ (concat "\\`" (regexp-quote buildfile-name) "\\'"))))
+ (if file
(progn
- (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name)
- (flymake-add-buildfile-to-cache source-dir-name buildfile-dir)
- buildfile-dir)
+ (flymake-log 3 "found buildfile at %s" file)
+ (setq file (file-name-directory file))
+ (flymake-add-buildfile-to-cache source-dir-name file)
+ file)
(progn
(flymake-log 3 "buildfile for %s not found" source-dir-name)
nil)))))