aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-07-03 23:18:19 +0000
committerJuanma Barranquero2005-07-03 23:18:19 +0000
commitc92d602307b7884d948c937c163fa09323dddff0 (patch)
tree5032ca013a6dfd839734b5970cc7e5a11cf8c8e7
parentc7d2f2cc466edb01728256900b6cf92b5e6906e5 (diff)
downloademacs-c92d602307b7884d948c937c163fa09323dddff0.tar.gz
emacs-c92d602307b7884d948c937c163fa09323dddff0.zip
(flymake-find-file): Remove.
(flymake-float-time): Use `with-no-warnings'. (flymake-check-start-time, flymake-check-was-interrupted, flymake-err-info, flymake-is-running, flymake-last-change-time, flymake-new-err-info): `defvar' at compile time.
-rw-r--r--lisp/progmodes/flymake.el39
1 files changed, 17 insertions, 22 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 2fe7b75e35b..96bff481e30 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -32,6 +32,18 @@
32 32
33;;; Code: 33;;; Code:
34 34
35;;;; [[ Silence the byte-compiler
36
37(eval-when-compile
38 (defvar flymake-check-start-time)
39 (defvar flymake-check-was-interrupted)
40 (defvar flymake-err-info)
41 (defvar flymake-is-running)
42 (defvar flymake-last-change-time)
43 (defvar flymake-new-err-info))
44
45;;;; ]]
46
35;;;; [[ Xemacs overlay compatibility 47;;;; [[ Xemacs overlay compatibility
36(if (featurep 'xemacs) (progn 48(if (featurep 'xemacs) (progn
37(autoload 'make-overlay "overlay" "Overlay compatibility kit." t) 49(autoload 'make-overlay "overlay" "Overlay compatibility kit." t)
@@ -53,9 +65,10 @@
53(defalias 'flymake-float-time 65(defalias 'flymake-float-time
54 (if (fboundp 'float-time) 66 (if (fboundp 'float-time)
55 'float-time 67 'float-time
56 (lambda () 68 (with-no-warnings
57 (multiple-value-bind (s0 s1 s2) (current-time) 69 (lambda ()
58 (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))))) 70 (multiple-value-bind (s0 s1 s2) (current-time)
71 (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))))))
59 72
60(defsubst flymake-replace-regexp-in-string (regexp rep str) 73(defsubst flymake-replace-regexp-in-string (regexp rep str)
61 (if (fboundp 'replace-regexp-in-string) 74 (if (fboundp 'replace-regexp-in-string)
@@ -1138,24 +1151,6 @@ For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
1138 (let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs)))) 1151 (let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs))))
1139 include-dirs)) 1152 include-dirs))
1140 1153
1141(defun flymake-find-file (rel-file-name include-dirs)
1142 "Iterate through INCLUDE-DIRS to find file REL-FILE-NAME.
1143Return first 'INCLUDE-DIRS/REL-FILE-NAME' that exists, or just REL-FILE-NAME if not."
1144 (let* ((count (length include-dirs))
1145 (idx 0)
1146 (found nil)
1147 (full-file-name rel-file-name))
1148
1149 (while (and (not found) (< idx count))
1150 (let* ((dir (nth idx include-dirs)))
1151 (setq full-file-name (concat dir "/" rel-file-name))
1152 (when (file-exists-p full-file-name)
1153 (setq found t)))
1154 (setq idx (1+ idx)))
1155 (if found
1156 full-file-name
1157 rel-file-name)))
1158
1159(defun flymake-restore-formatting (source-buffer) 1154(defun flymake-restore-formatting (source-buffer)
1160 "Remove any formatting made by flymake." 1155 "Remove any formatting made by flymake."
1161 ) 1156 )
@@ -1468,7 +1463,7 @@ With arg, turn Flymake mode on if and only if arg is positive."
1468 ;;+(add-hook 'find-file-hook 'flymake-find-file-hook) 1463 ;;+(add-hook 'find-file-hook 'flymake-find-file-hook)
1469 1464
1470 (flymake-report-status (current-buffer) "" "") 1465 (flymake-report-status (current-buffer) "" "")
1471 1466
1472 (setq flymake-timer 1467 (setq flymake-timer
1473 (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) 1468 (run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
1474 1469