]> git.eshelyaron.com Git - emacs.git/commitdiff
(flymake-find-buildfile): Remove invariant arg `dirs'. Adjust callers.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 10 Jan 2006 04:05:46 +0000 (04:05 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 10 Jan 2006 04:05:46 +0000 (04:05 +0000)
lisp/ChangeLog
lisp/progmodes/flymake.el

index 1bc6039b327ba2fc10615e756b15713d9951e919..9a5c8f672b8a5a5d6b381ac6dd43b66bc3086ed9 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/flymake.el (flymake-find-buildfile): Remove invariant arg
+       `dirs'.  Adjust callers.
+
 2006-01-09  John Paul Wallington  <jpw@gnu.org>
 
        * cus-edit.el (custom-comment) <defface>: Add TTY definitions.
index f5e4f58cb8f8a1abfc397c32a59a348861234f07..44da366cbb6ba5ded396296eda37e7e538963383 100644 (file)
@@ -312,30 +312,29 @@ Return nil if we cannot, non-nil if we can."
 (defun flymake-clear-buildfile-cache ()
   (clrhash flymake-find-buildfile-cache))
 
-(defun flymake-find-buildfile (buildfile-name source-dir-name dirs)
+(defun flymake-find-buildfile (buildfile-name source-dir-name)
   "Find buildfile starting from current directory.
 Buildfile includes Makefile, build.xml etc.
 Return its file name if found, or nil if not found."
-  (if (flymake-get-buildfile-from-cache source-dir-name)
-      (progn
-       (flymake-get-buildfile-from-cache source-dir-name))
-    (let* ((buildfile-dir          nil)
-          (buildfile              nil)
-          (found                  nil))
-      (while (and (not found) dirs)
-       (setq buildfile-dir (concat source-dir-name (car dirs)))
-       (setq buildfile (concat buildfile-dir "/" buildfile-name))
-       (when (file-exists-p buildfile)
-         (setq found t))
-       (setq dirs (cdr dirs)))
-      (if found
-         (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)
-       (progn
-         (flymake-log 3 "buildfile for %s not found" source-dir-name)
-         nil)))))
+  (or (flymake-get-buildfile-from-cache source-dir-name)
+      (let* ((dirs flymake-buildfile-dirs)
+             (buildfile-dir          nil)
+             (buildfile              nil)
+             (found                  nil))
+        (while (and (not found) dirs)
+          (setq buildfile-dir (concat source-dir-name (car dirs)))
+          (setq buildfile (concat buildfile-dir "/" buildfile-name))
+          (when (file-exists-p buildfile)
+            (setq found t))
+          (setq dirs (cdr dirs)))
+        (if found
+            (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)
+          (progn
+            (flymake-log 3 "buildfile for %s not found" source-dir-name)
+            nil)))))
 
 (defun flymake-fix-file-name (name)
   "Replace all occurences of '\' with '/'."
@@ -1608,8 +1607,7 @@ Return full-name.  Names are real, not patched."
   "Find buildfile, store its dir in buffer data and return its dir, if found."
   (let* ((buildfile-dir
           (flymake-find-buildfile buildfile-name
-                                  (file-name-directory source-file-name)
-                                  flymake-buildfile-dirs)))
+                                  (file-name-directory source-file-name))))
     (if buildfile-dir
         (setq flymake-base-dir buildfile-dir)
       (flymake-log 1 "no buildfile (%s) for %s" buildfile-name source-file-name)
@@ -1696,7 +1694,7 @@ Use CREATE-TEMP-F for creating temp copy."
     make-args))
 
 (defun flymake-find-make-buildfile (source-dir)
-  (flymake-find-buildfile "Makefile" source-dir flymake-buildfile-dirs))
+  (flymake-find-buildfile "Makefile" source-dir))
 
 ;;;; .h/make specific
 (defun flymake-master-make-header-init ()