]> code.delx.au - gnu-emacs/commitdiff
Extract "^[wW]arning" into a new var flymake-warning-re
authorLeo Liu <sdl.web@gmail.com>
Thu, 30 Aug 2012 11:41:40 +0000 (19:41 +0800)
committerLeo Liu <sdl.web@gmail.com>
Thu, 30 Aug 2012 11:41:40 +0000 (19:41 +0800)
lisp/ChangeLog
lisp/progmodes/flymake.el

index a2e9abede1358be3052ff13c27f1bbd223422ca3..3af8b506ee71a7e711d6683899dfaa6635cdb831 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-30  Leo Liu  <sdl.web@gmail.com>
+
+       * progmodes/flymake.el (flymake-warning-re): New variable.
+       (flymake-parse-line): Use it.
+
 2012-08-30  Glenn Morris  <rgm@gnu.org>
 
        * calendar/holidays.el (holiday-christian-holidays):
index 07393c6954d70869ac6e89f67929f257b2519720..0b1290211a53d8c3b3b02b1cbf019bbd30993ea2 100644 (file)
@@ -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 "<no error 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