diff options
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 25 |
2 files changed, 11 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c9bb50d3d0..4f297834a95 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2007-07-20 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-07-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * progmodes/flymake.el (flymake-buildfile-dirs): Remove. | ||
| 4 | (flymake-find-buildfile): Use locate-dominating-file. | ||
| 5 | |||
| 3 | * vc.el (vc-delistify): Use mapconcat. | 6 | * vc.el (vc-delistify): Use mapconcat. |
| 4 | (vc-do-command): Minor simplification. | 7 | (vc-do-command): Minor simplification. |
| 5 | (vc-expand-dirs): Use push. | 8 | (vc-expand-dirs): Use push. |
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 4903d7d26ec..7e353247b04 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." | |||
| 325 | (or (nth 2 (flymake-get-file-name-mode-and-masks file-name)) | 325 | (or (nth 2 (flymake-get-file-name-mode-and-masks file-name)) |
| 326 | 'flymake-get-real-file-name)) | 326 | 'flymake-get-real-file-name)) |
| 327 | 327 | ||
| 328 | (defcustom flymake-buildfile-dirs '("." ".." "../.." "../../.." "../../../.." "../../../../.." "../../../../../.." "../../../../../../.." "../../../../../../../.." "../../../../../../../../.." "../../../../../../../../../.." "../../../../../../../../../../..") | ||
| 329 | "Dirs to look for buildfile." | ||
| 330 | :group 'flymake | ||
| 331 | :type '(repeat (string))) | ||
| 332 | |||
| 333 | (defvar flymake-find-buildfile-cache (flymake-makehash 'equal)) | 328 | (defvar flymake-find-buildfile-cache (flymake-makehash 'equal)) |
| 334 | 329 | ||
| 335 | (defun flymake-get-buildfile-from-cache (dir-name) | 330 | (defun flymake-get-buildfile-from-cache (dir-name) |
| @@ -346,19 +341,15 @@ Return nil if we cannot, non-nil if we can." | |||
| 346 | Buildfile includes Makefile, build.xml etc. | 341 | Buildfile includes Makefile, build.xml etc. |
| 347 | Return its file name if found, or nil if not found." | 342 | Return its file name if found, or nil if not found." |
| 348 | (or (flymake-get-buildfile-from-cache source-dir-name) | 343 | (or (flymake-get-buildfile-from-cache source-dir-name) |
| 349 | (let* ((dirs flymake-buildfile-dirs) | 344 | (let* ((file (locate-dominating-file |
| 350 | (buildfile-dir nil) | 345 | source-dir-name |
| 351 | (found nil)) | 346 | (concat "\\`" (regexp-quote buildfile-name) "\\'")))) |
| 352 | (while (and (not found) dirs) | 347 | (if file |
| 353 | (setq buildfile-dir (concat source-dir-name (car dirs))) | ||
| 354 | (when (file-exists-p (expand-file-name buildfile-name buildfile-dir)) | ||
| 355 | (setq found t)) | ||
| 356 | (setq dirs (cdr dirs))) | ||
| 357 | (if found | ||
| 358 | (progn | 348 | (progn |
| 359 | (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name) | 349 | (flymake-log 3 "found buildfile at %s" file) |
| 360 | (flymake-add-buildfile-to-cache source-dir-name buildfile-dir) | 350 | (setq file (file-name-directory file)) |
| 361 | buildfile-dir) | 351 | (flymake-add-buildfile-to-cache source-dir-name file) |
| 352 | file) | ||
| 362 | (progn | 353 | (progn |
| 363 | (flymake-log 3 "buildfile for %s not found" source-dir-name) | 354 | (flymake-log 3 "buildfile for %s not found" source-dir-name) |
| 364 | nil))))) | 355 | nil))))) |