32 |
|
|
33 |
;;; Code: |
;;; Code: |
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 |
|
|
47 |
;;;; [[ Xemacs overlay compatibility |
;;;; [[ Xemacs overlay compatibility |
48 |
(if (featurep 'xemacs) (progn |
(if (featurep 'xemacs) (progn |
49 |
(autoload 'make-overlay "overlay" "Overlay compatibility kit." t) |
(autoload 'make-overlay "overlay" "Overlay compatibility kit." t) |
65 |
(defalias 'flymake-float-time |
(defalias 'flymake-float-time |
66 |
(if (fboundp 'float-time) |
(if (fboundp 'float-time) |
67 |
'float-time |
'float-time |
68 |
(lambda () |
(with-no-warnings |
69 |
(multiple-value-bind (s0 s1 s2) (current-time) |
(lambda () |
70 |
(+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2)))))) |
(multiple-value-bind (s0 s1 s2) (current-time) |
71 |
|
(+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2))))))) |
72 |
|
|
73 |
(defsubst flymake-replace-regexp-in-string (regexp rep str) |
(defsubst flymake-replace-regexp-in-string (regexp rep str) |
74 |
(if (fboundp 'replace-regexp-in-string) |
(if (fboundp 'replace-regexp-in-string) |
1151 |
(let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs)))) |
(let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs)))) |
1152 |
include-dirs)) |
include-dirs)) |
1153 |
|
|
|
(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))) |
|
|
|
|
1154 |
(defun flymake-restore-formatting (source-buffer) |
(defun flymake-restore-formatting (source-buffer) |
1155 |
"Remove any formatting made by flymake." |
"Remove any formatting made by flymake." |
1156 |
) |
) |
1463 |
;;+(add-hook 'find-file-hook 'flymake-find-file-hook) |
;;+(add-hook 'find-file-hook 'flymake-find-file-hook) |
1464 |
|
|
1465 |
(flymake-report-status (current-buffer) "" "") |
(flymake-report-status (current-buffer) "" "") |
1466 |
|
|
1467 |
(setq flymake-timer |
(setq flymake-timer |
1468 |
(run-at-time nil 1 'flymake-on-timer-event (current-buffer))) |
(run-at-time nil 1 'flymake-on-timer-event (current-buffer))) |
1469 |
|
|