.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Vi::QuickFix 3pm" .TH Vi::QuickFix 3pm "2008-01-16" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Vi::QuickFix \- Support for vim's QuickFix mode .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use Vi::QuickFix; \& use Vi::QuickFix ; \& use Vi::QuickFix ; \& use Vi::QuickFix ; .Ve .PP where \f(CW\*(C`\*(C'\fR is one or more of \f(CW\*(C`silent\*(C'\fR, \f(CW\*(C`sig\*(C'\fR, \&\f(CW\*(C`tie\*(C'\fR, and \f(CW\*(C`fork\*(C'\fR. .SH "DESCRIPTION" .IX Header "DESCRIPTION" When \f(CW\*(C`Vi::QuickFix\*(C'\fR is active, Perl logs errors and warnings to an \&\fIerror file\fR named, by default, \f(CW\*(C`errors.err\*(C'\fR. This file is picked up when you type \f(CW\*(C`:cf\*(C'\fR in a running vim editor. Vim will jump to the location of the first error recorded in the error file. \f(CW\*(C`:cn\*(C'\fR takes you to the next error, switching files if necessary. There are more QuickFix commands in vim. Type \f(CW\*(C`:help quickfix\*(C'\fR for a description. .PP To activate QuickFix support for a Perl source, add .PP .Vb 1 \& use Vi::QuickFix; .Ve .PP or, specifying an error file .PP .Vb 1 \& use Vi::QuickFix \(aq/my/errorfile\(aq; .Ve .PP early in the main program, before other \f(CW\*(C`use\*(C'\fR statements. .PP To leave the program file unaltered, Vi::QuickFix can be invoked from the command line as .PP .Vb 3 \& perl \-MVi::QuickFix program \&or \& perl \-MVi::QuickFix=/my/errorfile program .Ve .PP \&\f(CW\*(C`Vi::QuickFix\*(C'\fR is meant to be used as a development tool, not to remain in a distributed product. When the program ends, a warning is issued, indicating that \f(CW\*(C`Vi::QuickFix\*(C'\fR was active. This has the side effect that there is always an entry in the error file which points to the source file where \f(CW\*(C`Vi::QuickFix\*(C'\fR was invoked, normally the main program. \f(CW\*(C`:cf\*(C'\fR will take you there when other error entries don't point it elsewhere. Use the \f(CW\*(C`silent\*(C'\fR option with \f(CW\*(C`Vi::QuickFix\*(C'\fR to suppress this warning. .PP When the error file cannot be opened, a warning is issued and the program continues running without QuickFix support. If the error file is empty after the run (can only happen with \f(CW\*(C`silent\*(C'\fR), it is removed. .SH "ENVIRONMENT" .IX Header "ENVIRONMENT" \&\f(CW\*(C`Vi::QuickFix\*(C'\fR recognizes the environment variable \f(CW\*(C`VI_QUICKFIX_SOURCEFILE\*(C'\fR .PP When Perl reads its source from \f(CW\*(C`STDIN\*(C'\fR, error messages and warnings will contain the string \*(L"\-\*(R" where the source file name would otherwise appear. The environment variable \f(CW\*(C`VI_QUICKFIX_SOURCEFILE\*(C'\fR can be set to a filename, which will replace \*(L"\-\*(R" in those messages. If no \*(L"\-\*(R" appears as a file name, setting the variable has no effect. .PP This somewhat peculiar behavior can be useful if you call perl (with \&\f(CW\*(C`Vi::QuickFix\*(C'\fR) from within a vim run, as in \f(CW\*(C`:w !perl \-MVi::QickFix\*(C'\fR. When you set the environment variable \f(CW\*(C`VI_QUICKFIX_SOURCEFILE\*(C'\fR to the name of the file you are editing, this fools vim into doing the right thing when it encounters the modified messages. .PP This is an experimental feature, the behavior may change in future releases. .SH "USAGE" .IX Header "USAGE" The module file .../Vi/QuickFix.pm can also be called as an executable. In that mode, it behaves basically like the \f(CW\*(C`cat\*(C'\fR command, but also monitors the stream and logs Perl warnings and error messages to the error file. The error file can be set through the switches \f(CW\*(C`\-f\*(C'\fR or \f(CW\*(C`\-q\*(C'\fR. No warning about QuickFix activity is issued in this mode. .PP Called with \-v, it prints the version and exits. .SH "IMPLEMENTATION" .IX Header "IMPLEMENTATION" For a debugging tool, an implementation note is in order. .PP Perl offers three obvious ways to watch and capture its error output. One is through the (pseudo\-) signal handlers \f(CW$SIG{_\|_WARN_\|_}\fR and \&\f(CW$SIG{_\|_DIE_\|_}\fR. The other is through \f(CW\*(C`tie\*(C'\fR\-ing the \f(CW\*(C`STDERR\*(C'\fR file handle. A third method involves forking a child process for the capturing and redirect \f(CW\*(C`STDERR\*(C'\fR to there. .PP \&\f(CW\*(C`Vi::QuickFix\*(C'\fR can use these three methods to create the error file. As it turns out, the ability to tie \f(CW\*(C`STDERR\*(C'\fR is relatively new with Perl, as of version 5.8.1. With Versions 5.8.0 and earlier, a number of internal errors and warnings don't respect tie, so this method cannot be used. With Perl versions ealier than 5.8.1, \f(CW\*(C`Vi::QuickFix\*(C'\fR uses \f(CW%SIG\fR handlers to catch messages. With newer versions, \f(CW\*(C`Vi::Quickfix\*(C'\fR ties \f(CW\*(C`STDERR\*(C'\fR so that it (additionally) writes to the error file. The forking method can be used with any version of Perl. .PP A specific method can be requested through the options \f(CW\*(C`sig\*(C'\fR, \&\f(CW\*(C`tie\*(C'\fR and \f(CW\*(C`fork\*(C'\fR, as in .PP .Vb 3 \& use Vi::QuickFix qw(sig); \& use Vi::QuickFix qw(tie); \& use Vi::QuickFix qw(fork); .Ve .PP The forking method appears to work well in practice, but a race condition exists that intermittently leads to failing tests. It is not tested in the standard test suite and must be considered experimental. .PP Requesting \f(CW\*(C`tie\*(C'\fR with a Perl version that can't handle it is a fatal error, so the only option that does anything useful is \f(CW\*(C`sig\*(C'\fR with a new-ish Perl. It can be useful when \f(CW\*(C`tie\*(C'\fR\-ing \f(CW\*(C`STDERR\*(C'\fR conflicts with the surrounding code. .SH "CONFLICTS" .IX Header "CONFLICTS" Similar conflicts can occur with the \f(CW\*(C`sig\*(C'\fR method as well, and it can happen in two ways. Either \f(CW\*(C`Vi::QuickFix\*(C'\fR already finds a resource (a \f(CW%SIG\fR handler or a tie on \f(CW\*(C`STDERR\*(C'\fR) occupied at \f(CW\*(C`use\*(C'\fR time, or the surrounding code commandeers the resource after the fact. .PP However, if \f(CW\*(C`STDERR\*(C'\fR is already tied when \f(CW\*(C`Vi::QuickFix\*(C'\fR is \f(CW\*(C`use\*(C'\fRd, it cannot employ the \f(CW\*(C`tie\*(C'\fR method, and by default reverts to \f(CW\*(C`sig\*(C'\fR. If the \f(CW\*(C`tie\*(C'\fR method is specifically requested, a fatal error results. .PP If the \f(CW\*(C`sig\*(C'\fR method finds one of the handlers (\f(CW\*(C`_\|_WARN_\|_\*(C'\fR and \f(CW\*(C`_\|_DIE_\|_\*(C'\fR) already occupied, it chains to the previous handler after doing its thing, so that is not considered an obstacle. \*(L"Chaining\*(R" file ties is harder, and has not been attempted. .PP If \f(CW\*(C`Vi::QuickFix\*(C'\fR is already active, the surrounding code may later occupy a resource it is using. There is little that can be done when that happens, except issue a warning which is also logged to the error file. This can help in finding the source of the conflict. In \f(CW\*(C`silent\*(C'\fR mode, no such warning is given. .PP The warning is triggered when the corresponding resource is overwritten, except when the overwriting program keeps a copy of it. It is then assumed that the program will keep it functioning. Since we're still talking implementation \*(-- it is actually triggered through a \s-1DESTROY\s0 method when the corresponding object goes out of scope. \&\f(CW%SIG\fR handlers are code objects just for this reason. .SH "VERSION" .IX Header "VERSION" This document pertains to \f(CW\*(C`Vi::Quickfix\*(C'\fR version 1.134 .SH "BUGS" .IX Header "BUGS" \&\f(CW\*(C`no Vi::QuickFix\*(C'\fR has no effect .SH "AUTHOR" .IX Header "AUTHOR" .Vb 4 \& Anno Siegel \& CPAN ID: ANNO \& siegel@zrz.tu\-berlin.de \& http://www.tu\-berlin.de/~siegel .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \&\s-1LICENSE\s0 file included with this module. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIperl\fR\|(1), \fIvim\fR\|(1).