56 |
(defun flymake-makehash(&optional test) |
(defun flymake-makehash(&optional test) |
57 |
(cond |
(cond |
58 |
((equal flymake-emacs 'xemacs) (if test (make-hash-table :test test) (make-hash-table))) |
((equal flymake-emacs 'xemacs) (if test (make-hash-table :test test) (make-hash-table))) |
59 |
(t (makehash test)) |
(t (makehash test)) |
60 |
) |
) |
61 |
) |
) |
62 |
|
|
370 |
(let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name)))) |
(let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name)))) |
371 |
;(flymake-log 0 "calling %s" init-f) |
;(flymake-log 0 "calling %s" init-f) |
372 |
;(funcall init-f (current-buffer)) |
;(funcall init-f (current-buffer)) |
373 |
|
init-f |
374 |
) |
) |
|
(nth 0 (flymake-get-file-name-mode-and-masks file-name)) |
|
375 |
) |
) |
376 |
|
|
377 |
(defun flymake-get-cleanup-function(file-name) |
(defun flymake-get-cleanup-function(file-name) |
846 |
(set-buffer source-buffer) |
(set-buffer source-buffer) |
847 |
|
|
848 |
(flymake-parse-residual source-buffer) |
(flymake-parse-residual source-buffer) |
849 |
(flymake-post-syntax-check source-buffer) |
(flymake-post-syntax-check source-buffer exit-status command) |
850 |
(flymake-set-buffer-is-running source-buffer nil) |
(flymake-set-buffer-is-running source-buffer nil) |
851 |
) |
) |
852 |
) |
) |
863 |
) |
) |
864 |
) |
) |
865 |
|
|
866 |
(defun flymake-post-syntax-check(source-buffer) |
(defun flymake-post-syntax-check(source-buffer exit-status command) |
867 |
"" |
"" |
868 |
(flymake-set-buffer-err-info source-buffer (flymake-get-buffer-new-err-info source-buffer)) |
(flymake-set-buffer-err-info source-buffer (flymake-get-buffer-new-err-info source-buffer)) |
869 |
(flymake-set-buffer-new-err-info source-buffer nil) |
(flymake-set-buffer-new-err-info source-buffer nil) |
1220 |
) |
) |
1221 |
) |
) |
1222 |
|
|
1223 |
(eval-when-compile (require 'compile)) |
(defun flymake-reformat-err-line-patterns-from-compile-el(original-list) |
1224 |
|
"grab error line patterns from original list in compile.el format, convert to flymake internal format" |
1225 |
|
(let* ((converted-list '())) |
1226 |
|
(mapcar |
1227 |
|
(lambda (item) |
1228 |
|
(setq item (cdr item)) |
1229 |
|
(let ((regexp (nth 0 item)) |
1230 |
|
(file (nth 1 item)) |
1231 |
|
(line (nth 2 item)) |
1232 |
|
(col (nth 3 item)) |
1233 |
|
end-line) |
1234 |
|
(if (consp file) (setq file (car file))) |
1235 |
|
(if (consp line) (setq end-line (cdr line) line (car line))) |
1236 |
|
(if (consp col) (setq col (car col))) |
1237 |
|
|
1238 |
|
(when (not (functionp line)) |
1239 |
|
(setq converted-list (cons (list regexp file line col) converted-list)) |
1240 |
|
) |
1241 |
|
) |
1242 |
|
) |
1243 |
|
original-list |
1244 |
|
) |
1245 |
|
converted-list |
1246 |
|
) |
1247 |
|
) |
1248 |
|
|
1249 |
|
(require 'compile) |
1250 |
(defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text |
(defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text |
1251 |
(append |
(append |
1252 |
'( |
'( |
1269 |
(" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" |
(" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" |
1270 |
2 4 nil 5) |
2 4 nil 5) |
1271 |
) |
) |
1272 |
;; compilation-error-regexp-alist) |
;; compilation-error-regexp-alist) |
1273 |
(mapcar (lambda (x) (cdr x)) compilation-error-regexp-alist-alist)) |
(flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) |
1274 |
"patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" |
"patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx). Use flymake-reformat-err-line-patterns-from-compile-el to add patterns from compile.el" |
1275 |
) |
) |
1276 |
;(defcustom flymake-err-line-patterns |
;(defcustom flymake-err-line-patterns |
1277 |
; '( |
; '( |
1478 |
(let* ((dir (nth idx include-dirs))) |
(let* ((dir (nth idx include-dirs))) |
1479 |
(setq full-file-name (concat dir "/" rel-file-name)) |
(setq full-file-name (concat dir "/" rel-file-name)) |
1480 |
(when (file-exists-p full-file-name) |
(when (file-exists-p full-file-name) |
1481 |
(setq done t) |
(setq found t) |
1482 |
) |
) |
1483 |
) |
) |
1484 |
(setq idx (1+ idx)) |
(setq idx (1+ idx)) |
1600 |
process |
process |
1601 |
) |
) |
1602 |
(error |
(error |
1603 |
(let ((err-str (format "Failed to launch syntax check process '%s' with args %s: %s" |
(let* ((err-str (format "Failed to launch syntax check process '%s' with args %s: %s" |
1604 |
cmd args (error-message-string err))) |
cmd args (error-message-string err))) |
1605 |
(source-file-name (buffer-file-name buffer)) |
(source-file-name (buffer-file-name buffer)) |
1606 |
(cleanup-f (flymake-get-cleanup-function source-file-name))) |
(cleanup-f (flymake-get-cleanup-function source-file-name))) |
1931 |
(defun flymake-mode(&optional arg) |
(defun flymake-mode(&optional arg) |
1932 |
"toggle flymake-mode" |
"toggle flymake-mode" |
1933 |
(interactive) |
(interactive) |
1934 |
(let ((old-flymake-mode flymake-mode)) |
(let ((old-flymake-mode flymake-mode) |
1935 |
|
(turn-on nil)) |
1936 |
|
|
1937 |
(setq turn-on |
(setq turn-on |
1938 |
(if (null arg) |
(if (null arg) |