Karsten Hopp aa7dd6
To: vim_dev@googlegroups.com
Karsten Hopp aa7dd6
Subject: Patch 7.3.403
Karsten Hopp aa7dd6
Fcc: outbox
Karsten Hopp aa7dd6
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp aa7dd6
Mime-Version: 1.0
Karsten Hopp aa7dd6
Content-Type: text/plain; charset=UTF-8
Karsten Hopp aa7dd6
Content-Transfer-Encoding: 8bit
Karsten Hopp aa7dd6
------------
Karsten Hopp aa7dd6
Karsten Hopp aa7dd6
Patch 7.3.403
Karsten Hopp aa7dd6
Problem:    ":helpgrep" does not trigger QuickFixCmd* autocommands.
Karsten Hopp aa7dd6
Solution:   Trigger the autocommands. (Christian Brabandt)
Karsten Hopp aa7dd6
Files:	    src/quickfix.c
Karsten Hopp aa7dd6
Karsten Hopp aa7dd6
Karsten Hopp aa7dd6
*** ../vim-7.3.402/src/quickfix.c	2012-01-20 13:28:28.000000000 +0100
Karsten Hopp aa7dd6
--- src/quickfix.c	2012-01-20 13:37:10.000000000 +0100
Karsten Hopp aa7dd6
***************
Karsten Hopp aa7dd6
*** 3878,3893 ****
Karsten Hopp aa7dd6
      qf_info_T	*qi = &ql_info;
Karsten Hopp aa7dd6
      int		new_qi = FALSE;
Karsten Hopp aa7dd6
      win_T	*wp;
Karsten Hopp aa7dd6
! 
Karsten Hopp aa7dd6
!     /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
Karsten Hopp aa7dd6
!     save_cpo = p_cpo;
Karsten Hopp aa7dd6
!     p_cpo = empty_option;
Karsten Hopp aa7dd6
  
Karsten Hopp aa7dd6
  #ifdef FEAT_MULTI_LANG
Karsten Hopp aa7dd6
      /* Check for a specified language */
Karsten Hopp aa7dd6
      lang = check_help_lang(eap->arg);
Karsten Hopp aa7dd6
  #endif
Karsten Hopp aa7dd6
  
Karsten Hopp aa7dd6
      if (eap->cmdidx == CMD_lhelpgrep)
Karsten Hopp aa7dd6
      {
Karsten Hopp aa7dd6
  	/* Find an existing help window */
Karsten Hopp aa7dd6
--- 3878,3912 ----
Karsten Hopp aa7dd6
      qf_info_T	*qi = &ql_info;
Karsten Hopp aa7dd6
      int		new_qi = FALSE;
Karsten Hopp aa7dd6
      win_T	*wp;
Karsten Hopp aa7dd6
! #ifdef FEAT_AUTOCMD
Karsten Hopp aa7dd6
!     char_u	*au_name =  NULL;
Karsten Hopp aa7dd6
! #endif
Karsten Hopp aa7dd6
  
Karsten Hopp aa7dd6
  #ifdef FEAT_MULTI_LANG
Karsten Hopp aa7dd6
      /* Check for a specified language */
Karsten Hopp aa7dd6
      lang = check_help_lang(eap->arg);
Karsten Hopp aa7dd6
  #endif
Karsten Hopp aa7dd6
  
Karsten Hopp aa7dd6
+ #ifdef FEAT_AUTOCMD
Karsten Hopp aa7dd6
+     switch (eap->cmdidx)
Karsten Hopp aa7dd6
+     {
Karsten Hopp aa7dd6
+ 	case CMD_helpgrep:  au_name = (char_u *)"helpgrep"; break;
Karsten Hopp aa7dd6
+ 	case CMD_lhelpgrep: au_name = (char_u *)"lhelpgrep"; break;
Karsten Hopp aa7dd6
+ 	default: break;
Karsten Hopp aa7dd6
+     }
Karsten Hopp aa7dd6
+     if (au_name != NULL)
Karsten Hopp aa7dd6
+     {
Karsten Hopp aa7dd6
+ 	apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name,
Karsten Hopp aa7dd6
+ 					       curbuf->b_fname, TRUE, curbuf);
Karsten Hopp aa7dd6
+ 	if (did_throw || force_abort)
Karsten Hopp aa7dd6
+ 	    return;
Karsten Hopp aa7dd6
+     }
Karsten Hopp aa7dd6
+ #endif
Karsten Hopp aa7dd6
+ 
Karsten Hopp aa7dd6
+     /* Make 'cpoptions' empty, the 'l' flag should not be used here. */
Karsten Hopp aa7dd6
+     save_cpo = p_cpo;
Karsten Hopp aa7dd6
+     p_cpo = empty_option;
Karsten Hopp aa7dd6
+ 
Karsten Hopp aa7dd6
      if (eap->cmdidx == CMD_lhelpgrep)
Karsten Hopp aa7dd6
      {
Karsten Hopp aa7dd6
  	/* Find an existing help window */
Karsten Hopp aa7dd6
***************
Karsten Hopp aa7dd6
*** 4036,4041 ****
Karsten Hopp aa7dd6
--- 4055,4071 ----
Karsten Hopp aa7dd6
      qf_update_buffer(qi);
Karsten Hopp aa7dd6
  #endif
Karsten Hopp aa7dd6
  
Karsten Hopp aa7dd6
+ #ifdef FEAT_AUTOCMD
Karsten Hopp aa7dd6
+     if (au_name != NULL)
Karsten Hopp aa7dd6
+     {
Karsten Hopp aa7dd6
+ 	apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
Karsten Hopp aa7dd6
+ 					       curbuf->b_fname, TRUE, curbuf);
Karsten Hopp aa7dd6
+ 	if (!new_qi && qi != &ql_info && qf_find_buf(qi) == NULL)
Karsten Hopp aa7dd6
+ 	    /* autocommands made "qi" invalid */
Karsten Hopp aa7dd6
+ 	    return;
Karsten Hopp aa7dd6
+     }
Karsten Hopp aa7dd6
+ #endif
Karsten Hopp aa7dd6
+ 
Karsten Hopp aa7dd6
      /* Jump to first match. */
Karsten Hopp aa7dd6
      if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
Karsten Hopp aa7dd6
  	qf_jump(qi, 0, 0, FALSE);
Karsten Hopp aa7dd6
*** ../vim-7.3.402/src/version.c	2012-01-20 13:28:28.000000000 +0100
Karsten Hopp aa7dd6
--- src/version.c	2012-01-20 13:30:37.000000000 +0100
Karsten Hopp aa7dd6
***************
Karsten Hopp aa7dd6
*** 716,717 ****
Karsten Hopp aa7dd6
--- 716,719 ----
Karsten Hopp aa7dd6
  {   /* Add new patch number below this line */
Karsten Hopp aa7dd6
+ /**/
Karsten Hopp aa7dd6
+     403,
Karsten Hopp aa7dd6
  /**/
Karsten Hopp aa7dd6
Karsten Hopp aa7dd6
-- 
Karsten Hopp aa7dd6
Looking at Perl through Lisp glasses, Perl looks atrocious.
Karsten Hopp aa7dd6
Karsten Hopp aa7dd6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp aa7dd6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp aa7dd6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp aa7dd6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///