home *** CD-ROM | disk | FTP | other *** search
- To: vim-dev@vim.org
- Subject: Patch 6.1.130
- Fcc: outbox
- From: Bram Moolenaar <Bram@moolenaar.net>
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- ------------
-
- Patch 6.1.130
- Problem: The documentation for some of the 'errorformat' items is unclear.
- Solution: Add more examples and explain hard to understand items. (Stefan
- Roemer)
- Files: runtime/doc/quickfix.txt
-
-
- *** ../vim61.129/runtime/doc/quickfix.txt Tue Apr 23 22:43:00 2002
- --- runtime/doc/quickfix.txt Mon Jul 15 21:39:54 2002
- ***************
- *** 1,52 ****
- ! *quickfix.txt* For Vim version 6.1. Last change: 2002 Apr 23
-
-
- VIM REFERENCE MANUAL by Bram Moolenaar
-
-
- - {Vi does not have any of these commands}
- -
- - The quickfix commands are not available when the |+quickfix| feature was
- - disabled at compile time.
- -
- This subject is introduced in section |30.1| of the user manual.
-
- 1. Using QuickFix commands |quickfix|
- 2. The error window |quickfix-window|
- ! 3. Selecting a compiler |compiler-select|
- ! 4. Using more than one list of errors |quickfix-error-lists|
- ! 5. Using :make |:make_makeprg|
- ! 6. The error file format |error-file-format|
- ! 7. The directory stack |quickfix-directory-stack|
- ! 8. Specific error file formats |errorformats|
-
- =============================================================================
- 1. Using QuickFix commands *quickfix* *Quickfix* *E42*
-
- Vim has a special mode to speedup the edit-compile-edit cycle. This is
- inspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
- ! The idea is to save the error messages from the compiler in a file and use
- ! Vim to jump to the errors one by one. You can then examine each problem and
- ! fix it, without having to remember all the error messages.
- !
- ! If you are using Manx's Aztec C compiler on the Amiga you should do the
- ! following:
- ! - Set the CCEDIT environment variable with the command
- ! mset "CCEDIT=vim -q"
- ! - Compile with the -qf option. If the compiler finds any errors, Vim is
- ! started and the cursor is positioned on the first error. The error message
- ! will be displayed on the last line. You can go to other errors with the
- ! commands mentioned below. You can fix the errors and write the file(s).
- ! - If you exit Vim normally the compiler will re-compile the same file. If you
- ! exit with the :cq command, the compiler will terminate. Do this if you
- ! cannot fix the error, or if another file needs to be compiled first.
-
- ! If you are using another compiler you should save the error messages in a
- ! file and start Vim with "vim -q filename". An easy way to do this is with
- ! the ":make" command (see below). The 'errorformat' option should be set to
- ! match the error messages from your compiler (see below).
- !
- ! The following commands can be used if you are in QuickFix mode:
-
- *:cc*
- :cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
- --- 1,43 ----
- ! *quickfix.txt* For Vim version 6.1. Last change: 2002 Jul 15
-
-
- VIM REFERENCE MANUAL by Bram Moolenaar
-
-
- This subject is introduced in section |30.1| of the user manual.
-
- 1. Using QuickFix commands |quickfix|
- 2. The error window |quickfix-window|
- ! 3. Using more than one list of errors |quickfix-error-lists|
- ! 4. Using :make |:make_makeprg|
- ! 5. Using :grep |grep|
- ! 6. Selecting a compiler |compiler-select|
- ! 7. The error format |error-file-format|
- ! 8. The directory stack |quickfix-directory-stack|
- ! 9. Specific error file formats |errorformats|
- !
- ! {Vi does not have any of these commands}
- !
- ! The quickfix commands are not available when the |+quickfix| feature was
- ! disabled at compile time.
-
- =============================================================================
- 1. Using QuickFix commands *quickfix* *Quickfix* *E42*
-
- Vim has a special mode to speedup the edit-compile-edit cycle. This is
- inspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
- ! The idea is to save the error messages from the compiler in a file and use Vim
- ! to jump to the errors one by one. You can examine each problem and fix it,
- ! without having to remember all the error messages.
- !
- ! If you are using Manx's Aztec C compiler on the Amiga look here for how to use
- ! it with Vim: |quickfix-manx|. If you are using another compiler you should
- ! save the error messages in a file and start Vim with "vim -q filename". An
- ! easy way to do this is with the |:make| command (see below). The
- ! 'errorformat' option should be set to match the error messages from your
- ! compiler (see |errorformat| below).
-
- ! The following quickfix commands can be used:
-
- *:cc*
- :cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
- ***************
- *** 119,162 ****
- :cl[ist]! [from] [, [to]]
- List all errors.
-
- ! *:mak* *:make*
- ! :mak[e][!] [arguments] 1. If the 'autowrite' option is on, write any changed
- ! buffers
- ! 2. An errorfile name is made from 'makeef'. If
- ! 'makeef' doesn't contain "##", and a file with this
- ! name already exists, it is deleted.
- ! 3. The program given with the 'makeprg' option is
- ! started (default "make") with the optional
- ! [arguments] and the output is saved in the
- ! errorfile (for Unix it is also echoed on the
- ! screen).
- ! 4. The errorfile is read
- ! 5. If [!] is not given the first error is jumped to.
- ! 6. The errorfile is deleted.
- ! 7. You can now move through the errors with commands
- ! like |:cnext| and |:cprevious|, see above.
- ! This command does not accept a comment, any "
- ! characters are considered part of the arguments.
- !
- ! *:gr* *:grep*
- ! :gr[ep][!] [arguments] Just like ":make", but use 'grepprg' instead of
- ! 'makeprg' and 'grepformat' instead of 'errorformat'.
- ! See |grep|.
- ! [Unix trivia: The name for the Unix "grep" command
- ! comes from ":g/re/p", where "re" stands for Regular
- ! Expression.]
- ! *:grepa* *:grepadd*
- ! :grepa[dd][!] [arguments]
- ! Just like ":grep", but instead of making a new list of
- ! errors the matches are appended to the current list.
- ! Example: >
- ! :grep nothing %
- ! :bufdo grepadd! something %
- ! < The first command makes a new error list which is
- ! empty. The second command executes "grepadd" for each
- ! listed buffer. Note the use of ! to avoid that
- ! ":grepadd" jumps to the first error, which is not
- ! allowed with |:bufdo|.
-
- =============================================================================
- 2. The error window *quickfix-window*
- --- 110,120 ----
- :cl[ist]! [from] [, [to]]
- List all errors.
-
- ! If you insert or delete lines, mostly the correct error location is still
- ! found because hidden marks are used. Sometimes, when the mark has been
- ! deleted for some reason, the message "line changed" is shown to warn you that
- ! the error location may not be correct. If you quit Vim and start again the
- ! marks are lost and the error locations may not be correct anymore.
-
- =============================================================================
- 2. The error window *quickfix-window*
- ***************
- *** 187,195 ****
- :botright cwindow
- You can move the window around with |window-moving| commands.
- For example, to move it to the top: CTRL-W K
- ! The window will mostly keep its height, ignoring 'winheight' and
- ! 'equalalways'. You can change the height manually (e.g., by dragging the
- ! status line above it with the mouse).
-
- In the quickfix window, each line is one error. The line number is equal to
- the error number. You can use ":.cc" to jump to the error under the cursor.
- --- 145,153 ----
- :botright cwindow
- You can move the window around with |window-moving| commands.
- For example, to move it to the top: CTRL-W K
- ! The 'winfixheight' option will be set, which means that the window will mostly
- ! keep its height, ignoring 'winheight' and 'equalalways'. You can change the
- ! height manually (e.g., by dragging the status line above it with the mouse).
-
- In the quickfix window, each line is one error. The line number is equal to
- the error number. You can use ":.cc" to jump to the error under the cursor.
- ***************
- *** 217,260 ****
- list.
-
- =============================================================================
- ! 3. Selecting a compiler *compiler-select*
- !
- ! *:comp* *:compiler*
- ! :compiler {name} Set options to work with compiler {name}.
- ! {not available when compiled without the
- ! |+eval| feature}
- !
- !
- ! What this command actually does is:
- ! - delete the "current_compiler" variable
- ! - execute ":runtime! compiler/{name}.vim"
- !
- ! For writing a compiler plugin, see |write-compiler-plugin|.
- !
- !
- ! TEX COMPILER *compiler-tex*
- !
- ! Included in the distribution compiler for TeX ($VIMRUNTIME/compiler/tex.vim)
- ! is intended to handle all flavors of TeX formats. If b:tex_flavor or
- ! g:tex_flavor (in this precedence) variable exists, it defines TeX flavor for
- ! :make (actually, this is the name of executed command), and if both variables
- ! do not exist, it defaults to "latex". For example, while editing chapter2.tex
- ! \input-ed from mypaper.tex written in AMS-TeX: >
- !
- ! :let b:tex_flavor = 'amstex'
- ! :compiler tex
- ! < [editing...] >
- ! :make mypaper
- !
- ! Note that you must specify a name of the file to process as an argument (to
- ! process the right file when editing \input-ed or \include-ed file; portable
- ! solution for substituting % for no arguments is welcome). This is not in the
- ! semantics of make, but you may specify filename without extension ".tex" and
- ! mean this as "make filename.dvi or filename.pdf or
- ! filename.some_result_extension according to compiler"
- !
- ! =============================================================================
- ! 4. Using more than one list of errors *quickfix-error-lists*
-
- So far has been assumed that there is only one list of errors. Actually the
- ten last used lists are remembered. When starting a new list, the previous
- --- 175,181 ----
- list.
-
- =============================================================================
- ! 3. Using more than one list of errors *quickfix-error-lists*
-
- So far has been assumed that there is only one list of errors. Actually the
- ten last used lists are remembered. When starting a new list, the previous
- ***************
- *** 279,285 ****
- lists, use ":cnewer 99" first.
-
- =============================================================================
- ! 5. Using :make *:make_makeprg*
-
- The ":make" command executes the command given with the 'makeprg' option.
- This is done by passing the command to the shell given with the 'shell'
- --- 200,225 ----
- lists, use ":cnewer 99" first.
-
- =============================================================================
- ! 4. Using :make *:make_makeprg*
- !
- ! *:mak* *:make*
- ! :mak[e][!] [arguments] 1. If the 'autowrite' option is on, write any changed
- ! buffers
- ! 2. An errorfile name is made from 'makeef'. If
- ! 'makeef' doesn't contain "##", and a file with this
- ! name already exists, it is deleted.
- ! 3. The program given with the 'makeprg' option is
- ! started (default "make") with the optional
- ! [arguments] and the output is saved in the
- ! errorfile (for Unix it is also echoed on the
- ! screen).
- ! 4. The errorfile is read using 'errorformat'.
- ! 5. If [!] is not given the first error is jumped to.
- ! 6. The errorfile is deleted.
- ! 7. You can now move through the errors with commands
- ! like |:cnext| and |:cprevious|, see above.
- ! This command does not accept a comment, any "
- ! characters are considered part of the arguments.
-
- The ":make" command executes the command given with the 'makeprg' option.
- This is done by passing the command to the shell given with the 'shell'
- ***************
- *** 313,319 ****
- "|& tee" or "2>&1| tee" is the default, so stderr output will be included.
-
- If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
- ! for compilers that write to an errorfile themselves (Manx's Amiga C).
-
- There are some restrictions to the Quickfix mode on the Amiga. The
- compiler only writes the first 25 errors to the errorfile (Manx's
- --- 253,388 ----
- "|& tee" or "2>&1| tee" is the default, so stderr output will be included.
-
- If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
- ! for compilers that write to an errorfile themselves (e.g., Manx's Amiga C).
- !
- ! ==============================================================================
- ! 5. Using :grep *grep* *lid*
- !
- ! Vim can interface with "grep" and grep-like programs (such as the GNU
- ! id-utils) in a similar way to its compiler integration (see |:make| above).
- !
- ! [Unix trivia: The name for the Unix "grep" command comes from ":g/re/p", where
- ! "re" stands for Regular Expression.]
- !
- ! *:gr* *:grep*
- ! :gr[ep][!] [arguments] Just like ":make", but use 'grepprg' instead of
- ! 'makeprg' and 'grepformat' instead of 'errorformat'.
- ! *:grepa* *:grepadd*
- ! :grepa[dd][!] [arguments]
- ! Just like ":grep", but instead of making a new list of
- ! errors the matches are appended to the current list.
- ! Example: >
- ! :grep nothing %
- ! :bufdo grepadd! something %
- ! < The first command makes a new error list which is
- ! empty. The second command executes "grepadd" for each
- ! listed buffer. Note the use of ! to avoid that
- ! ":grepadd" jumps to the first error, which is not
- ! allowed with |:bufdo|.
- !
- ! 5.1 Setting up grep
- !
- ! If you have a standard "grep" program installed, the :grep command may work
- ! well with the defaults. The syntax is very similar to the standard command: >
- !
- ! :grep foo *.c
- !
- ! Will search all files with the .c extension for the substring "foo". The
- ! arguments to :grep are passed straight to the "grep" program, so you can use
- ! whatever options your "grep" supports.
- !
- ! By default, :grep invokes grep with the -n option (show file and line
- ! numbers). You can change this with the 'grepprg' option. You will need to set
- ! 'grepprg' if:
- !
- ! a) You are using a program that isn't called "grep"
- ! b) You have to call grep with a full path
- ! c) You want to pass other options automatically (e.g. case insensitive
- ! search.)
- !
- ! Once "grep" has executed, Vim parses the results using the 'grepformat'
- ! option. This option works in the same way as the 'errorformat' option - see
- ! that for details. You may need to change 'grepformat' from the default if
- ! your grep outputs in a non-standard format, or you are using some other
- ! program with a special format.
- !
- ! Once the results are parsed, Vim loads the first file containing a match and
- ! jumps to the appropriate line, in the same way that it jumps to a compiler
- ! error in |quickfix| mode. You can then use the |:cnext|, |:clist|, etc.
- ! commands to see the other matches.
- !
- !
- ! 5.2 Using :grep with id-utils
- !
- ! You can set up :grep to work with the GNU id-utils like this: >
- !
- ! :set grepprg=lid\ -Rgrep\ -s
- ! :set grepformat=%f:%l:%m
- !
- ! then >
- ! :grep (regexp)
- !
- ! works just as you'd expect.
- ! (provided you remembered to mkid first :)
- !
- !
- ! 5.3 Browsing source code with :grep
- !
- ! Using the stack of error lists that Vim keeps, you can browse your files to
- ! look for functions and the functions they call. For example, suppose that you
- ! have to add an argument to the read_file() function. You enter this command: >
- !
- ! :grep read_file *.c
- !
- ! You use ":cn" to go along the list of matches and add the argument. At one
- ! place you have to get the new argument from a higher level function msg(), and
- ! need to change that one too. Thus you use: >
- !
- ! :grep msg *.c
- !
- ! While changing the msg() functions, you find another function that needs to
- ! get the argument from a higher level. You can again use ":grep" to find these
- ! functions. Once you are finished with one function, you can use >
- !
- ! :colder
- !
- ! to go back to the previous one.
- !
- ! This works like browsing a tree: ":grep" goes one level deeper, creating a
- ! list of branches. ":colder" goes back to the previous level. You can mix
- ! this use of ":grep" and "colder" to browse all the locations in a tree-like
- ! way. If you do this consistently, you will find all locations without the
- ! need to write down a "todo" list.
- !
- ! =============================================================================
- ! 6. Selecting a compiler *compiler-select*
- !
- ! *:comp* *:compiler*
- ! :compiler {name} Set options to work with compiler {name}.
- ! {not available when compiled without the
- ! |+eval| feature}
- !
- !
- ! What this command actually does is:
- ! - delete the "current_compiler" variable
- ! - execute ":runtime! compiler/{name}.vim"
- !
- ! For writing a compiler plugin, see |write-compiler-plugin|.
- !
- !
- ! MANX AZTEC C *quickfix-manx*
- !
- ! To use Vim with Manx's Aztec C compiler on the Amiga you should do the
- ! following:
- ! - Set the CCEDIT environment variable with the command
- ! mset "CCEDIT=vim -q"
- ! - Compile with the -qf option. If the compiler finds any errors, Vim is
- ! started and the cursor is positioned on the first error. The error message
- ! will be displayed on the last line. You can go to other errors with the
- ! commands mentioned below. You can fix the errors and write the file(s).
- ! - If you exit Vim normally the compiler will re-compile the same file. If you
- ! exit with the :cq command, the compiler will terminate. Do this if you
- ! cannot fix the error, or if another file needs to be compiled first.
-
- There are some restrictions to the Quickfix mode on the Amiga. The
- compiler only writes the first 25 errors to the errorfile (Manx's
- ***************
- *** 321,361 ****
- you will have to fix a few errors and exit the editor. After recompiling,
- up to 25 remaining errors will be found.
-
- ! On the Amiga, if Vim was started from the compiler, the :sh and some :!
- ! commands will not work, because Vim is then running in the same process as the
- ! compiler and stdin (standard input) will not be interactive.
-
- - If you insert or delete lines, mostly the correct error location is still
- - found because hidden marks are used (Manx's Z editor does not do this).
- - Sometimes, when the mark has been deleted for some reason, the message "line
- - changed" is shown to warn you that the error location may not be correct. If
- - you quit Vim and start again the marks are lost and the error locations may
- - not be correct anymore.
-
- ! =============================================================================
- ! 6. The error file format *error-file-format*
-
- ! A template for the errorfile name can be set with the 'makeef' option. If it
- ! includes "##", Vim will replace this with a number to make it a unique name.
-
- ! The format of the file from the Aztec compiler is:
-
- ! filename>linenumber:columnnumber:errortype:errornumber:errormessage
-
- ! filename name of the file in which the error was detected
- ! linenumber line number where the error was detected
- ! columnnumber column number where the error was detected
- ! errortype type of the error, normally a single 'E' or 'W'
- ! errornumber number of the error (for lookup in the manual)
- ! errormessage description of the error
-
- *errorformat* *E372* *E373* *E374*
- *E375* *E376* *E377* *E378*
- ! Another compiler is likely to use a different format. You should set the
- ! 'errorformat' option to a scanf-like string that describes the format.
- First, you need to know how scanf works. Look in the documentation of your
- ! C compiler. Vim will understand the following conversion characters.
- ! Others are invalid.
- %f file name (finds a string)
- %l line number (finds a number)
- %c column number (finds a number representing character
- --- 390,446 ----
- you will have to fix a few errors and exit the editor. After recompiling,
- up to 25 remaining errors will be found.
-
- ! If Vim was started from the compiler, the :sh and some :! commands will not
- ! work, because Vim is then running in the same process as the compiler and
- ! stdin (standard input) will not be interactive.
-
-
- ! TEX COMPILER *compiler-tex*
-
- ! Included in the distribution compiler for TeX ($VIMRUNTIME/compiler/tex.vim)
- ! is intended to handle all flavors of TeX formats. If b:tex_flavor or
- ! g:tex_flavor (in this precedence) variable exists, it defines TeX flavor for
- ! :make (actually, this is the name of executed command), and if both variables
- ! do not exist, it defaults to "latex". For example, while editing chapter2.tex
- ! \input-ed from mypaper.tex written in AMS-TeX: >
-
- ! :let b:tex_flavor = 'amstex'
- ! :compiler tex
- ! < [editing...] >
- ! :make mypaper
-
- ! Note that you must specify a name of the file to process as an argument (to
- ! process the right file when editing \input-ed or \include-ed file; portable
- ! solution for substituting % for no arguments is welcome). This is not in the
- ! semantics of make, but you may specify filename without extension ".tex" and
- ! mean this as "make filename.dvi or filename.pdf or
- ! filename.some_result_extension according to compiler"
-
- ! =============================================================================
- ! 7. The error format *error-file-format*
-
- *errorformat* *E372* *E373* *E374*
- *E375* *E376* *E377* *E378*
- ! The 'errorformat' option specifies a list of formats that are recognized. The
- ! first format that matches with an error message is used. You can add several
- ! formats for different messages your compiler produces, or even entries for
- ! multiple compilers. See |efm-entries|.
- !
- ! Each entry in 'errorformat' is a scanf-like string that describes the format.
- First, you need to know how scanf works. Look in the documentation of your
- ! C compiler. Below you find the % items that Vim understands. Others are
- ! invalid.
- !
- ! Special characters in 'errorformat' are comma and backslash. See
- ! |efm-entries| for how to deal with them. Note that a literal "%" is matched
- ! by "%%", thus it is not escaped with a backslash.
- !
- ! Note: By default the difference between upper and lowercase is ignored. If
- ! you want to match case, add "\C" to the pattern |/\C|.
- !
- !
- ! Basic items
- !
- %f file name (finds a string)
- %l line number (finds a number)
- %c column number (finds a number representing character
- ***************
- *** 372,377 ****
- --- 457,486 ----
- %*{conv} any scanf non-assignable conversion
- %% the single '%' character
-
- + The "%f" conversion depends on the current 'isfname' setting.
- +
- + The "%f" and "%m" conversions have to detect the end of the string. They
- + should be followed by a character that cannot be in the string. Everything
- + up to that character is included in the string. But when the next character
- + is a '%' or a backslash, "%f" will look for any 'isfname' character and "%m"
- + finds anything. If the "%f" or "%m" is at the end, everything up to the end
- + of the line is included.
- +
- + On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
- + when using "%f:". This means that a file name which is a single alphabetical
- + letter will not be detected.
- +
- + The "%p" conversion is normally followed by a "^". It's used for compilers
- + that output a line like: >
- + ^
- + or >
- + ---------^
- + to indicate the column of the error. This is to be used in a multi-line error
- + message. See |errorformat-javac| for a useful example.
- +
- +
- + Changing directory
- +
- The following uppercase conversion characters specify the type of special
- format strings. At most one of them may be given as a prefix at the begin
- of a single comma-separated format pattern.
- ***************
- *** 383,406 ****
- %f that finds the directory name
- %X "leave directory" format string; expects following %f
-
- ! *errorformat-multi-line*
- ! It is possible to read the output of programs that produce multi-line messages,
- ! ie. error strings that consume more than one line. Possible prefixes are:
- ! %A start of a multi-line message (unspecified type)
- %E start of a multi-line error message
- %W start of a multi-line warning message
- %I start of a multi-line informational message
- %C continuation of a multi-line message
- %Z end of a multi-line message
- ! %G global; useful only in conjunction with '+' or '-'
- %O single-line file message: overread the matched part
- %P single-line file message: push file %f onto the stack
- %Q single-line file message: pop the last file from stack
- The codes '+' or '-' can be combined with the uppercase codes above; in that
- case they have to precede the letter, eg. '%+A' or '%-G':
- %- do not include the matching multi-line in any output
- %+ include the whole matching line in the %m error string
-
- The scanf()-like "%*[]" notation is supported for backward-compatibility
- with previous versions of Vim. However, it is also possible to specify
- (nearly) any Vim supported regular expression in format strings.
- --- 492,623 ----
- %f that finds the directory name
- %X "leave directory" format string; expects following %f
-
- ! When defining an "enter directory" or "leave directory" format, the "%D" or
- ! "%X" has to be given at the start of that substring. Vim tracks the directory
- ! changes and prepends the current directory to each erroneous file found with a
- ! relative path. See |quickfix-directory-stack| for details, tips and
- ! limitations.
- !
- !
- ! Multi-line messages *errorformat-multi-line*
- !
- ! It is possible to read the output of programs that produce multi-line
- ! messages, ie. error strings that consume more than one line. Possible
- ! prefixes are:
- %E start of a multi-line error message
- %W start of a multi-line warning message
- %I start of a multi-line informational message
- + %A start of a multi-line message (unspecified type)
- %C continuation of a multi-line message
- %Z end of a multi-line message
- ! These can be used with '+' and '-', see |efm-ignore| below.
- !
- ! Example: Your compiler happens to write out errors in the following format
- ! (leading line numbers not being part of the actual output):
- !
- ! 1 Error 275
- ! 2 line 42
- ! 3 column 3
- ! 4 ' ' expected after '--'
- !
- ! The appropriate error format string has to look like this: >
- ! :set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
- !
- ! And the |:clist| error message generated for this error is:
- !
- ! 1:42 col 3 error 275: ' ' expected after '--'
- !
- ! 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.
- !
- !
- ! Separate file name *errorformat-separate-filename*
- !
- ! These prefixes are useful if the file name is given once and multiple messages
- ! follow that refer to this file name.
- %O single-line file message: overread the matched part
- %P single-line file message: push file %f onto the stack
- %Q single-line file message: pop the last file from stack
- +
- + Example: Given a compiler that produces the following error logfile (without
- + leading line numbers):
- +
- + 1 [a1.tt]
- + 2 (1,17) error: ';' missing
- + 3 (21,2) warning: variable 'z' not defined
- + 4 (67,3) error: end of file found before string ended
- + 5
- + 6 [a2.tt]
- + 7
- + 8 [a3.tt]
- + 9 NEW compiler v1.1
- + 10 (2,2) warning: variable 'x' not defined
- + 11 (67,3) warning: 's' already defined
- +
- + This logfile lists several messages for each file enclosed in [...] which are
- + properly parsed by an error format like this: >
- + :set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q
- +
- + A call of |:clist| writes them accordingly with their correct filenames:
- +
- + 2 a1.tt:1 col 17 error: ';' missing
- + 3 a1.tt:21 col 2 warning: variable 'z' not defined
- + 4 a1.tt:67 col 3 error: end of file found before string ended
- + 8 a3.tt:2 col 2 warning: variable 'x' not defined
- + 9 a3.tt:67 col 3 warning: 's' already defined
- +
- + Unlike the other prefixes that all match against whole lines, %P, %Q and %O
- + can be used to match several patterns in the same line. Thus it is possible
- + to parse even nested files like in the following line:
- + {"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}}
- + The %O then parses over strings that do not contain any push/pop file name
- + information. See |errorformat-LaTeX| for an extended example.
- +
- +
- + Ignoring and using whole messages *efm-ignore*
- +
- The codes '+' or '-' can be combined with the uppercase codes above; in that
- case they have to precede the letter, eg. '%+A' or '%-G':
- %- do not include the matching multi-line in any output
- %+ include the whole matching line in the %m error string
-
- + One prefix is only useful in combination with '+' or '-', namely %G. It parses
- + over lines containing general information like compiler version strings or
- + other headers that can be skipped.
- + %-G ignore this message
- + %+G general message
- +
- +
- + Pattern matching
- +
- The scanf()-like "%*[]" notation is supported for backward-compatibility
- with previous versions of Vim. However, it is also possible to specify
- (nearly) any Vim supported regular expression in format strings.
- ***************
- *** 421,431 ****
- Important note: The \(...\) grouping of sub-matches can not be used in format
- specifications because it is reserved for internal conversions.
-
- ! note: By default the difference between upper and lowercase is ignored. If
- ! you want to match case, add "\C" to the pattern |/\C|.
-
- Some examples for C compilers that produce single-line error outputs:
- - %f>%l:%c:%t:%n:%m" for the AztecC.Err file
- %f:%l:\ %t%*[^0123456789]%n:\ %m for Manx/Aztec C error messages
- (scanf() doesn't understand [0-9])
- %f\ %l\ %t%*[^0-9]%n:\ %m for SAS C
- --- 638,688 ----
- Important note: The \(...\) grouping of sub-matches can not be used in format
- specifications because it is reserved for internal conversions.
-
- !
- ! Multiple entries in 'errorformat' *efm-entries*
- !
- ! To be able to detect output from several compilers, several format patterns
- ! may be put in 'errorformat', separated by commas (note: blanks after the comma
- ! are ignored). The first pattern that has a complete match is used. If no
- ! match is found, matching parts from the last one will be used, although the
- ! file name is removed and the error message is set to the whole message. If
- ! there is a pattern that may match output from several compilers (but not in a
- ! right way), put it after one that is more restrictive.
- !
- ! To include a comma in a pattern precede it with a backslash (you have to type
- ! two in a ":set" command). To include a backslash itself give two backslashes
- ! (you have to type four in a ":set" command). You also need to put a backslash
- ! before a space for ":set".
- !
- !
- ! Valid matches *quickfix-valid*
- !
- ! If a line does not completely match one of the entries in 'errorformat', the
- ! whole line is put in the error message and the entry is marked "not valid"
- ! These lines are skipped with the ":cn" and ":cp" commands (unless there is
- ! no valid line at all). You can use ":cl!" to display all the error messages.
- !
- ! If the error format does not contain a file name Vim cannot switch to the
- ! correct file. You will have to do this by hand.
- !
- !
- ! Examples
- !
- ! The format of the file from the Amiga Aztec compiler is:
- !
- ! filename>linenumber:columnnumber:errortype:errornumber:errormessage
- !
- ! filename name of the file in which the error was detected
- ! linenumber line number where the error was detected
- ! columnnumber column number where the error was detected
- ! errortype type of the error, normally a single 'E' or 'W'
- ! errornumber number of the error (for lookup in the manual)
- ! errormessage description of the error
- !
- ! This can be matched with this 'errorformat' entry:
- ! %f>%l:%c:%t:%n:%m"
-
- Some examples for C compilers that produce single-line error outputs:
- %f:%l:\ %t%*[^0123456789]%n:\ %m for Manx/Aztec C error messages
- (scanf() doesn't understand [0-9])
- %f\ %l\ %t%*[^0-9]%n:\ %m for SAS C
- ***************
- *** 447,499 ****
- :set command and one to avoid recognizing the comma as a separator of error
- formats.
-
- - The "%f" conversion depends on the current 'isfname' setting.
- -
- - The "%f" and "%m" conversions have to detect the end of the string. They
- - should be followed by a character that cannot be in the string. Everything
- - up to that character is included in the string. But when the next character
- - is '%' or a backslash, "%f" will look for any 'isfname' character and "%m"
- - finds anything. If the "%f" or "%m" is at the end, everything up to the end
- - of the line is included.
- -
- - On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
- - when using "%f:". This means that a file name which is a single alphabetical
- - letter will not be detected.
- -
- - The "%p" conversion is normally followed by a "^". It's used for compilers
- - that output a line like: >
- - ^
- - or >
- - ---------^
- - to indicate the column of the error. This is to be used in a multi-line error
- - message. See |errorformat-javac| for a useful example.
-
- !
- ! When defining an "enter directory" or "leave directory" format, the "%D" or
- ! "%X" has to be given at the start of that substring. Vim tracks the directory
- ! changes and prepends the current directory to each erroneous file found with a
- ! relative path. See |quickfix-directory-stack| for details, tips and
- ! limitations.
- !
- ! To be able to detect output from several compilers, several format patterns
- ! may be put in 'errorformat', separated by commas (note: blanks after the comma
- ! are ignored). The first pattern that has a complete match is used. If no
- ! match is found, matching parts from the last one will be used, although the
- ! file name is removed and the error message is set to the whole message. If
- ! there is a pattern that may match output from several compilers (but not in a
- ! right way), put it after one that is more restrictive. To include a comma in
- ! a pattern precede it with a backslash (you have to type two in a set command).
- ! To include a backslash itself give two backslashes (you have to type four in a
- ! set command).
- !
- ! *quickfix-valid*
- ! If a line is detected that does not completely match the 'errorformat', the
- ! whole line is put in the error message and the entry is marked "not valid"
- ! These lines are skipped with the ":cn" and ":cp" commands (unless there is
- ! no valid line at all). You can use ":cl!" to display all the error messages.
- !
- ! If the error format does not contain a file name Vim cannot switch to the
- ! correct file. You will have to do this by hand.
-
- If you have a compiler that produces error messages that do not fit in the
- format string, you could write a program that translates the error messages
- --- 704,711 ----
- :set command and one to avoid recognizing the comma as a separator of error
- formats.
-
-
- ! Filtering messages
-
- If you have a compiler that produces error messages that do not fit in the
- format string, you could write a program that translates the error messages
- ***************
- *** 505,511 ****
- required for the set command.
-
- =============================================================================
- ! 7. The directory stack *quickfix-directory-stack*
-
- Quickfix maintains a stack for saving all used directories parsed from the
- make output. For GNU-make this is rather simple, as it always prints the
- --- 717,723 ----
- required for the set command.
-
- =============================================================================
- ! 8. The directory stack *quickfix-directory-stack*
-
- Quickfix maintains a stack for saving all used directories parsed from the
- make output. For GNU-make this is rather simple, as it always prints the
- ***************
- *** 588,594 ****
- "Leaving dir".
-
- =============================================================================
- ! 8. Specific error file formats *errorformats*
-
- *errorformat-Jikes*
- Jikes(TM), a source-to-bytecode Java compiler published by IBM Research,
- --- 800,806 ----
- "Leaving dir".
-
- =============================================================================
- ! 9. Specific error file formats *errorformats*
-
- *errorformat-Jikes*
- Jikes(TM), a source-to-bytecode Java compiler published by IBM Research,
- *** ../vim61.129/src/version.c Sun Jul 21 20:30:31 2002
- --- src/version.c Sun Jul 21 20:33:37 2002
- ***************
- *** 608,609 ****
- --- 608,611 ----
- { /* Add new patch number below this line */
- + /**/
- + 130,
- /**/
-
- --
- Me? A skeptic? I trust you have proof.
-
- /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\
- /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
- \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
- \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
-