aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO2004-11-01 17:42:31 +0000
committerMasatake YAMATO2004-11-01 17:42:31 +0000
commit12e46b0083cea4d9ef6eaf4d68497aac5d62343e (patch)
tree5ae6b4f91978efb5d11ea4c2bd3fc0811cfb32cf
parent11fd50f793989f6130b080ec285ba8dab376c5a6 (diff)
downloademacs-12e46b0083cea4d9ef6eaf4d68497aac5d62343e.tar.gz
emacs-12e46b0083cea4d9ef6eaf4d68497aac5d62343e.zip
2004-11-2 Pavel Kobiakov <pk_at_work@yahoo.com>
* progmodes/flymake.el (flymake-err-line-patterns): Use `flymake-reformat-err-line-patterns-from-compile-el' to convert `compilation-error-regexp-alist-alist' to internal Flymake format. * progmodes/flymake.el: eliminated byte-compiler warnings.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/progmodes/flymake.el49
2 files changed, 46 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 397c7d0052a..c18c0986bd3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12004-11-2 Pavel Kobiakov <pk_at_work@yahoo.com>
2
3 * progmodes/flymake.el (flymake-err-line-patterns): Use
4 `flymake-reformat-err-line-patterns-from-compile-el' to convert
5 `compilation-error-regexp-alist-alist' to internal Flymake format.
6
7 * progmodes/flymake.el: eliminated byte-compiler warnings.
8
12004-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 92004-11-01 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 10
3 * mouse.el (mouse-yank-at-click, mouse-yank-secondary): 11 * mouse.el (mouse-yank-at-click, mouse-yank-secondary):
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 3ccea967bc5..737071203e0 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -56,7 +56,7 @@
56(defun flymake-makehash(&optional test) 56(defun flymake-makehash(&optional test)
57 (cond 57 (cond
58 ((equal flymake-emacs 'xemacs) (if test (make-hash-table :test test) (make-hash-table))) 58 ((equal flymake-emacs 'xemacs) (if test (make-hash-table :test test) (make-hash-table)))
59 (t (makehash test)) 59 (t (makehash test))
60 ) 60 )
61) 61)
62 62
@@ -370,8 +370,8 @@
370 (let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name)))) 370 (let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name))))
371 ;(flymake-log 0 "calling %s" init-f) 371 ;(flymake-log 0 "calling %s" init-f)
372 ;(funcall init-f (current-buffer)) 372 ;(funcall init-f (current-buffer))
373 init-f
373 ) 374 )
374 (nth 0 (flymake-get-file-name-mode-and-masks file-name))
375) 375)
376 376
377(defun flymake-get-cleanup-function(file-name) 377(defun flymake-get-cleanup-function(file-name)
@@ -846,7 +846,7 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
846 (set-buffer source-buffer) 846 (set-buffer source-buffer)
847 847
848 (flymake-parse-residual source-buffer) 848 (flymake-parse-residual source-buffer)
849 (flymake-post-syntax-check source-buffer) 849 (flymake-post-syntax-check source-buffer exit-status command)
850 (flymake-set-buffer-is-running source-buffer nil) 850 (flymake-set-buffer-is-running source-buffer nil)
851 ) 851 )
852 ) 852 )
@@ -863,7 +863,7 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
863 ) 863 )
864) 864)
865 865
866(defun flymake-post-syntax-check(source-buffer) 866(defun flymake-post-syntax-check(source-buffer exit-status command)
867 "" 867 ""
868 (flymake-set-buffer-err-info source-buffer (flymake-get-buffer-new-err-info source-buffer)) 868 (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) 869 (flymake-set-buffer-new-err-info source-buffer nil)
@@ -1220,7 +1220,33 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1220 ) 1220 )
1221) 1221)
1222 1222
1223(eval-when-compile (require 'compile)) 1223(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)
1224(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 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
1225 (append 1251 (append
1226 '( 1252 '(
@@ -1243,9 +1269,9 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1243 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" 1269 (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)"
1244 2 4 nil 5) 1270 2 4 nil 5)
1245 ) 1271 )
1246 ;; compilation-error-regexp-alist) 1272 ;; compilation-error-regexp-alist)
1247 (mapcar (lambda (x) (cdr x)) compilation-error-regexp-alist-alist)) 1273 (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist))
1248 "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" 1274 "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"
1249) 1275)
1250;(defcustom flymake-err-line-patterns 1276;(defcustom flymake-err-line-patterns
1251; '( 1277; '(
@@ -1452,7 +1478,7 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1452 (let* ((dir (nth idx include-dirs))) 1478 (let* ((dir (nth idx include-dirs)))
1453 (setq full-file-name (concat dir "/" rel-file-name)) 1479 (setq full-file-name (concat dir "/" rel-file-name))
1454 (when (file-exists-p full-file-name) 1480 (when (file-exists-p full-file-name)
1455 (setq done t) 1481 (setq found t)
1456 ) 1482 )
1457 ) 1483 )
1458 (setq idx (1+ idx)) 1484 (setq idx (1+ idx))
@@ -1574,7 +1600,7 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1574 process 1600 process
1575 ) 1601 )
1576 (error 1602 (error
1577 (let ((err-str (format "Failed to launch syntax check process '%s' with args %s: %s" 1603 (let* ((err-str (format "Failed to launch syntax check process '%s' with args %s: %s"
1578 cmd args (error-message-string err))) 1604 cmd args (error-message-string err)))
1579 (source-file-name (buffer-file-name buffer)) 1605 (source-file-name (buffer-file-name buffer))
1580 (cleanup-f (flymake-get-cleanup-function source-file-name))) 1606 (cleanup-f (flymake-get-cleanup-function source-file-name)))
@@ -1905,7 +1931,8 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re
1905(defun flymake-mode(&optional arg) 1931(defun flymake-mode(&optional arg)
1906 "toggle flymake-mode" 1932 "toggle flymake-mode"
1907 (interactive) 1933 (interactive)
1908 (let ((old-flymake-mode flymake-mode)) 1934 (let ((old-flymake-mode flymake-mode)
1935 (turn-on nil))
1909 1936
1910 (setq turn-on 1937 (setq turn-on
1911 (if (null arg) 1938 (if (null arg)