On 11:12 Wed 01 Feb     , Marcin Szamotulski wrote:
> Dear Bram and Vim_Dev,
> 
> I attach a patch which adds the following commands to QuickFixCmdPre and
> QuickFixCmdPost autocmds groups: :cfile, :cgetfile, :caddfile, :lfile,
> :lgetfile, :laddfile.
> 
> The reason is that for some compilers (for example LaTeX) the error file is
> not easily readable by vim using errorformat. With this patch using
> QuickFxCmdPost, one can write a script which rewrites the log file in a vim
> readable way.
> 
> The attached patch contains also changes to the description of QuickFixCmdPre
> in the doc.
> 
> Best regards,
> Marcin Szamotulski

I send an updated version of the patch: QuickFixCmdPost for :cfile and :lfile
is run after reading the errorfile but before jumping to the first error. The
intention for the group is to be able filter error list (For example LaTeX
is quite verbatim, and this allows to show different kind of warning,
depending on user settings.

Best regards,
Marcin

-- 
You received this message from the "vim_dev" 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
diff -r d3cf98aa1619 runtime/doc/autocmd.txt
--- a/runtime/doc/autocmd.txt   Sat Jan 28 18:03:35 2012 +0100
+++ b/runtime/doc/autocmd.txt   Thu Feb 02 10:43:19 2012 +0000
@@ -700,7 +700,9 @@
                                |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
                                |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
                                |:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
-                               |:helpgrep|, |:lhelpgrep|).
+                               |:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
+                               |:lgetfile|, |:laddfile|, |:helpgrep|,
+                               |:lhelpgrep|).
                                The pattern is matched against the command
                                being run.  When |:grep| is used but 'grepprg'
                                is set to "internal" it still matches "grep".
@@ -711,7 +713,10 @@
                                                        *QuickFixCmdPost*
 QuickFixCmdPost                        Like QuickFixCmdPre, but after a 
quickfix
                                command is run, before jumping to the first
-                               location.  See |QuickFixCmdPost-example|.
+                               location. For |:cfile| and |:lfile| commands
+                               it is run after error file is read and before
+                               moving to the first error. 
+                               See |QuickFixCmdPost-example|.
                                                        *RemoteReply*
 RemoteReply                    When a reply from a Vim that functions as
                                server was received |server2client()|.  The
diff -r d3cf98aa1619 src/quickfix.c
--- a/src/quickfix.c    Sat Jan 28 18:03:35 2012 +0100
+++ b/src/quickfix.c    Thu Feb 02 10:43:19 2012 +0000
@@ -2999,7 +2999,23 @@
     if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
        || eap->cmdidx == CMD_laddfile)
        wp = curwin;
-
+#ifdef FEAT_AUTOCMD
+    char_u     *au_name = NULL;
+    switch (eap->cmdidx)
+    {
+       case CMD_cfile:     au_name = (char_u *)"cfile"; break;
+       case CMD_cgetfile:  au_name = (char_u *)"cgetfile"; break;
+       case CMD_caddfile:  au_name = (char_u *)"caddfile"; break;
+       case CMD_lfile:     au_name = (char_u *)"lfile"; break;
+       case CMD_lgetfile:  au_name = (char_u *)"lgetfile"; break;
+       case CMD_laddfile:  au_name = (char_u *)"laddfile"; break;
+       default: break;
+    }
+    if (au_name != NULL)
+    {
+       apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, FALSE, curbuf);
+    }
+#endif
 #ifdef FEAT_BROWSE
     if (cmdmod.browse)
     {
@@ -3031,10 +3047,26 @@
                                  && (eap->cmdidx == CMD_cfile
                                             || eap->cmdidx == CMD_lfile))
     {
+#ifdef FEAT_AUTOCMD
+       if (au_name != NULL)
+       {
+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
+       }
+#endif
        if (wp != NULL)
            qi = GET_LOC_LIST(wp);
        qf_jump(qi, 0, 0, eap->forceit);        /* display first error */
     }
+
+    else
+    {
+#ifdef FEAT_AUTOCMD
+       if (au_name != NULL)
+       {
+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
+       }
+#endif
+    }
 }
 
 /*

Raspunde prin e-mail lui