]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/flymake.el
(gnus-newsrc-file-version): Add defvar.
[gnu-emacs] / lisp / progmodes / flymake.el
index 2fe7b75e35be848ec7ac1eefc336f1ee3a4198b6..d137284f795055c5b4a1fb3765b3139b6bc0f113 100644 (file)
@@ -1,6 +1,6 @@
 ;;; flymake.el -- a universal on-the-fly syntax checker
 
-;; Copyright (C) 2003, 2005  Free Software Foundation
+;; Copyright (C) 2003, 2004, 2005  Free Software Foundation
 
 ;; Author:  Pavel Kobiakov <pk_at_work@yahoo.com>
 ;; Maintainer: Pavel Kobiakov <pk_at_work@yahoo.com>
@@ -21,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 ;;
 
 ;;; Code:
 
+;;;; [[ Silence the byte-compiler
+
+(defvar flymake-check-start-time)
+(defvar flymake-check-was-interrupted)
+(defvar flymake-err-info)
+(defvar flymake-is-running)
+(defvar flymake-last-change-time)
+(defvar flymake-new-err-info)
+
+;;;; ]]
+
 ;;;; [[ Xemacs overlay compatibility
 (if (featurep 'xemacs) (progn
 (autoload 'make-overlay            "overlay" "Overlay compatibility kit." t)
 (defalias 'flymake-float-time
   (if (fboundp 'float-time)
       'float-time
-    (lambda ()
-      (multiple-value-bind (s0 s1 s2) (current-time)
-       (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2))))))
+    (if (featurep 'xemacs)
+       (lambda ()
+         (multiple-value-bind (s0 s1 s2) (current-time)
+           (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))))))
 
 (defsubst flymake-replace-regexp-in-string (regexp rep str)
-  (if (fboundp 'replace-regexp-in-string)
-      (replace-regexp-in-string regexp rep str)
-    (replace-in-string str regexp rep)))
+  (if (fboundp 'replace-in-string)
+      (replace-in-string str regexp rep)
+    (replace-regexp-in-string regexp rep str)))
 
 (defun flymake-split-string (str pattern)
   "Split STR into a list of substrings bounded by PATTERN.
@@ -794,11 +806,13 @@ line number outside the file being compiled."
 (defun flymake-highlight-err-lines (buffer err-info-list)
   "Highlight error lines in BUFFER using info from ERR-INFO-LIST."
   (with-current-buffer buffer
+   (save-excursion
     (let* ((idx    0)
           (count  (length err-info-list)))
       (while (< idx count)
-       (flymake-highlight-line (car (nth idx err-info-list)) (nth 1 (nth idx err-info-list)))
-       (setq idx (1+ idx))))))
+       (flymake-highlight-line (car (nth idx err-info-list))
+                               (nth 1 (nth idx err-info-list)))
+       (setq idx (1+ idx)))))))
 
 (defun flymake-overlay-p (ov)
   "Determine whether overlay OV was created by flymake."
@@ -846,16 +860,12 @@ Return t if it has at least one flymake overlay, nil if no overlay."
     (t (:bold t)))
   "Face used for marking error lines."
   :group 'flymake)
-;; backward-compatibility alias
-(put 'flymake-errline-face 'face-alias 'flymake-errline)
 
 (defface flymake-warnline
   '((((class color)) (:background "LightBlue2"))
     (t (:bold t)))
   "Face used for marking warning lines."
   :group 'flymake)
-;; backward-compatibility alias
-(put 'flymake-warnline-face 'face-alias 'flymake-warnline)
 
 (defun flymake-highlight-line (line-no line-err-info-list)
   "Highlight line LINE-NO in current buffer.
@@ -1138,24 +1148,6 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
   (let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs))))
     include-dirs))
 
-(defun flymake-find-file (rel-file-name include-dirs)
-  "Iterate through INCLUDE-DIRS to find file REL-FILE-NAME.
-Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists,  or just REL-FILE-NAME if not."
-  (let* ((count          (length include-dirs))
-        (idx            0)
-        (found          nil)
-        (full-file-name rel-file-name))
-
-    (while (and (not found) (< idx count))
-      (let* ((dir (nth idx include-dirs)))
-       (setq full-file-name  (concat dir "/" rel-file-name))
-       (when (file-exists-p full-file-name)
-         (setq found t)))
-      (setq idx (1+ idx)))
-    (if found
-       full-file-name
-      rel-file-name)))
-
 (defun flymake-restore-formatting (source-buffer)
   "Remove any formatting made by flymake."
   )
@@ -1468,7 +1460,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
       ;;+(add-hook 'find-file-hook 'flymake-find-file-hook)
 
       (flymake-report-status (current-buffer) "" "")
-        
+
       (setq flymake-timer
             (run-at-time nil 1 'flymake-on-timer-event (current-buffer)))