On 10/6/06, Keith Prickett <[EMAIL PROTECTED]> wrote:
Does anyone know a good regular expression for quickfix that will help
me sift through the weeds?

my solution for this is to use an external script (written in python)
to sift through the compiler output and only return the lines I want.

in my .vimrc I have an entry specifying a 'makeprg':

   set makeprg=/scripts/build.py\ %

and then /scripts/build.py looks like this (note that my compiler is
invoked via the command 'build', and the current directory must be set
properly -- ymmv):

import sys
import os

#
# main
#
if __name__ == '__main__':

   # search upwards for find a file called build.xml
   abs = os.path.abspath(sys.argv[1])
   dir = os.path.dirname(abs)
   while not os.path.exists(os.path.join(dir, 'build.xml')):
       parent = os.path.dirname(dir)
       if parent == dir: # reached root?
           print 'Cannot find build.xml'
           sys.exit()
       dir = parent

   # change current directory
   os.chdir(dir)

   # we only want to see lines which contain the following strings
   msgs = ('Success!', 'Error:', 'Caution:', 'Warning:', 'FATAL:')

   # invoke the compiler
   for line in os.popen('build .').readlines():
       if reduce(lambda val, m: val or line.find(m) != -1, msgs, False):
           print line[0:-1]

Reply via email to