diff options
| author | Leo Liu | 2012-08-30 19:41:40 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-08-30 19:41:40 +0800 |
| commit | 3aca1291d030ea97eab8b99d7a3e916a980b0bae (patch) | |
| tree | adc4ff9fe55c94ac90892ebd93f7c3fa281dae5a | |
| parent | b66833534f04da4293f54c353da9ced5ca213bb9 (diff) | |
| download | emacs-3aca1291d030ea97eab8b99d7a3e916a980b0bae.tar.gz emacs-3aca1291d030ea97eab8b99d7a3e916a980b0bae.zip | |
Extract "^[wW]arning" into a new var flymake-warning-re
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/flymake.el | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2e9abede13..3af8b506ee7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-08-30 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/flymake.el (flymake-warning-re): New variable. | ||
| 4 | (flymake-parse-line): Use it. | ||
| 5 | |||
| 1 | 2012-08-30 Glenn Morris <rgm@gnu.org> | 6 | 2012-08-30 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * calendar/holidays.el (holiday-christian-holidays): | 8 | * calendar/holidays.el (holiday-christian-holidays): |
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 07393c6954d..0b1290211a5 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -947,6 +947,9 @@ from compile.el") | |||
| 947 | ;; :type '(repeat (string number number number)) | 947 | ;; :type '(repeat (string number number number)) |
| 948 | ;;) | 948 | ;;) |
| 949 | 949 | ||
| 950 | (defvar flymake-warning-re "^[wW]arning" | ||
| 951 | "Regexp matching against err-text to detect a warning.") | ||
| 952 | |||
| 950 | (defun flymake-parse-line (line) | 953 | (defun flymake-parse-line (line) |
| 951 | "Parse LINE to see if it is an error or warning. | 954 | "Parse LINE to see if it is an error or warning. |
| 952 | Return its components if so, nil otherwise." | 955 | Return its components if so, nil otherwise." |
| @@ -967,7 +970,7 @@ Return its components if so, nil otherwise." | |||
| 967 | (match-string (nth 4 (car patterns)) line) | 970 | (match-string (nth 4 (car patterns)) line) |
| 968 | (flymake-patch-err-text (substring line (match-end 0))))) | 971 | (flymake-patch-err-text (substring line (match-end 0))))) |
| 969 | (or err-text (setq err-text "<no error text>")) | 972 | (or err-text (setq err-text "<no error text>")) |
| 970 | (if (and err-text (string-match "^[wW]arning" err-text)) | 973 | (if (and err-text (string-match flymake-warning-re err-text)) |
| 971 | (setq err-type "w") | 974 | (setq err-type "w") |
| 972 | ) | 975 | ) |
| 973 | (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx | 976 | (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx |