Monday, August 15, 2011

Re: errorformat

On 09:18 Mon 15 Aug , Marc Weber wrote:
> Excerpts from Marcin Szamotulski's message of Mon Aug 15 09:03:36 +0200 2011:
> > When there are no errors clist command will list all the lines of the log
> > file. The question is how to modify it to do not list any line when there are
> > no errors.
> Why do you want to have no lines in the success case?

ATP has a tests if there are errors in the quickfix list, and changes it's
mode if there are no more errors and I prefer this over using error code
(error code might be 0 when there are warnings, I only posted the question for
errors not warnings for simplicity).

The solution I found is to add %-Z lines in errorformat which end the
multiline error pattern. This is what works (at least for now):

%E! LaTeX Error: %m
%E! %m
%E!pdfTeX Error: %m
%Cl.%l %m
%-ZI've inserted%.%#
%-ZThe control sequence%.%#
%-ZYour command was ignored%\%.
%-ZYou've closed more groups than you opened%\%.
%-ZThe `$' that I just saw%.%#
%+C %m
%+C%.%#-%.%#
%+C%.%#[]%.%#
%+C[]%.%#
%+C%.%#%[{}\]%.%#
%+C<%.%#>%.%#
%-GSee the LaTeX%m
%-GType H <return>%m
%-G ...%.%#
%-G%.%# (C) %.%#
%-G(see the transcript%.%#)
%-G\s%#
%-G%.%#
%+O(%*[^()])%r
%+O%*[^()](%*[^()])%r
%+P(%f%r
%+P %\=(%f%r
%+P%*[^()](%f%r
%+P[%\d%[^()]%#(%f%r
%+Q)%r
%+Q%*[^()])%r
%+Q[%\d%*[^()])%r

> Eventually :cclose / copen will work equally well for you.
>
> What about using exit code?
>
> call sysetm('latex foo &> errors.txt')
> if v:shell_error == 0
> " exit code 0, probably everything is fine
> cclose
> else
> " load errors into quickfix
> cfile errors.txt
> " open quickfix window
> cope
> fi
>
> You may also be interested in this project:
> https://launchpad.net/rubber

Thanks I'll take a look. ATP has a command :MakeLatex which does the same
(written in python), and also LatexBox
http://www.vim.org/scripts/script.php?script_id=3109 is embedded in ATP
which provides functionality for latexmk
http://www.phys.psu.edu/~collins/software/latexmk-jcc/

Thanks!
Marcin

If you are interested in ATP, the feature list here:
http://atp-vim.sourceforge.net/features.shtml

>
> Its a python script rerunning latex pdftext etc multiple time doing some
> additional magic also tidying errors.
>
> Marc Weber
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: