The below example, straight out of the VIM documentation, uses an "at sign" yet nowhere else in the entire document is it mentioned or explained.
Another example: Think of a Python interpreter that produces the
following error message (line numbers are not part of the actual
output):
1 ==============================================================
2 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)
3 --------------------------------------------------------------
4 Traceback (most recent call last):
5 File "unittests/dbfacadeTest.py", line 89, in testFoo
6 self.assertEquals(34, dtid)
7 File "/usr/lib/python2.2/unittest.py", line 286, in
8 failUnlessEqual
9 raise self.failureException, \
10 AssertionError: 34 != 33
11
12 --------------------------------------------------------------
13 Ran 27 tests in 0.063s
Say you want |:clist| write the relevant information of this message
only, namely:
5 unittests/dbfacadeTest.py:89: AssertionError: 34 != 33
Then the error format string could be defined as follows:
:set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
Note that the %C string is given before the %A here: since the
expression '' %.%#' (which stands for the regular expression '' .*')
matches every line starting with a space, followed by any characters
to the end of the line, it also hides line 7 which would trigger a
separate error message otherwise. Error format strings are always
parsed pattern by pattern until the first match occurs.
I have spent quite a few hours pouring over the quickfix & errorformat documentation to trying to find an explanation of the at sign and what it represents.
I've also looked through the scanf documentation just in case it means something there
I've also looked through VIM's regular expression documentation but not so thoroughly
What I do understand:
%C\ %.%#
A continuation line that must start with a space, and then any text until the end of the line (via the .* equivalent)
%A\ \ File\ \"%f\"\\,\ line\ %l%.%#
A non-specified starting line that must start with space, space, 'File', space - and then a quoted filename (extracted), followed by a comma some more literal text and a line number to be extracted. Lastly any other text is matched and ignored (via the .* equivalent)
What I do not understand:
%Z%[%^\ ]%\\@=%m
I think i got this part: is a terminating line that must start with a non-space character.
- This seems like an attempt to match line 10 which starts with an 'A'
Then my understanding breaks down...
%\\
: is a literal slash (i have no idea the purpose, since the only '\' is at the end of line 9)
@=
: does the @=
mean something?
%m
: then extract the message
-OR-
%\\@=
: perhaps all this together means something I don't get?
%m
: then extract the message
Can anyone shed some light on the point of the \@
within the errorformat string?
Or the \@=
, or the =%m
or the =
by itself, ... I don't understand this last bit.
Thanks in advance
:help \@=
.