From: Leo Liu Date: Thu, 30 Aug 2012 11:41:40 +0000 (+0800) Subject: Extract "^[wW]arning" into a new var flymake-warning-re X-Git-Tag: emacs-24.2.90~406^2~10^2~2 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/3aca1291d030ea97eab8b99d7a3e916a980b0bae Extract "^[wW]arning" into a new var flymake-warning-re --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2e9abede1..3af8b506ee 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-30 Leo Liu + + * progmodes/flymake.el (flymake-warning-re): New variable. + (flymake-parse-line): Use it. + 2012-08-30 Glenn Morris * calendar/holidays.el (holiday-christian-holidays): diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 07393c6954..0b1290211a 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -947,6 +947,9 @@ from compile.el") ;; :type '(repeat (string number number number)) ;;) +(defvar flymake-warning-re "^[wW]arning" + "Regexp matching against err-text to detect a warning.") + (defun flymake-parse-line (line) "Parse LINE to see if it is an error or warning. Return its components if so, nil otherwise." @@ -967,7 +970,7 @@ Return its components if so, nil otherwise." (match-string (nth 4 (car patterns)) line) (flymake-patch-err-text (substring line (match-end 0))))) (or err-text (setq err-text "")) - (if (and err-text (string-match "^[wW]arning" err-text)) + (if (and err-text (string-match flymake-warning-re err-text)) (setq err-type "w") ) (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx