Karsten Hopp 2291d2
To: vim_dev@googlegroups.com
Karsten Hopp 2291d2
Subject: Patch 7.4.378
Karsten Hopp 2291d2
Fcc: outbox
Karsten Hopp 2291d2
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 2291d2
Mime-Version: 1.0
Karsten Hopp 2291d2
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 2291d2
Content-Transfer-Encoding: 8bit
Karsten Hopp 2291d2
------------
Karsten Hopp 2291d2
Karsten Hopp 2291d2
Patch 7.4.378
Karsten Hopp 2291d2
Problem:    Title of quickfist list is not kept for setqflist(list, 'r').
Karsten Hopp 2291d2
Solution:   Keep the title.  Add a test. (Lcd)
Karsten Hopp 2291d2
Files:	    src/quickfix.c, src/testdir/Make_amiga.mak,
Karsten Hopp 2291d2
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
Karsten Hopp 2291d2
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
Karsten Hopp 2291d2
	    src/testdir/Makefile, src/testdir/test_qf_title.in,
Karsten Hopp 2291d2
	    src/testdir/test_qf_title.ok
Karsten Hopp 2291d2
Karsten Hopp 2291d2
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/quickfix.c	2014-03-27 17:02:22.080660944 +0100
Karsten Hopp 2291d2
--- src/quickfix.c	2014-07-23 15:37:30.551910459 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 107,112 ****
Karsten Hopp 2291d2
--- 107,113 ----
Karsten Hopp 2291d2
  };
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  static int	qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title));
Karsten Hopp 2291d2
+ static void	qf_store_title __ARGS((qf_info_T *qi, char_u *title));
Karsten Hopp 2291d2
  static void	qf_new_list __ARGS((qf_info_T *qi, char_u *qf_title));
Karsten Hopp 2291d2
  static void	ll_free_all __ARGS((qf_info_T **pqi));
Karsten Hopp 2291d2
  static int	qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid));
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 126,132 ****
Karsten Hopp 2291d2
  static win_T	*qf_find_win __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static buf_T	*qf_find_buf __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static void	qf_update_buffer __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
! static void	qf_set_title __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static void	qf_fill_buffer __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  #endif
Karsten Hopp 2291d2
  static char_u	*get_mef_name __ARGS((void));
Karsten Hopp 2291d2
--- 127,133 ----
Karsten Hopp 2291d2
  static win_T	*qf_find_win __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static buf_T	*qf_find_buf __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static void	qf_update_buffer __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
! static void	qf_set_title_var __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  static void	qf_fill_buffer __ARGS((qf_info_T *qi));
Karsten Hopp 2291d2
  #endif
Karsten Hopp 2291d2
  static char_u	*get_mef_name __ARGS((void));
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 884,889 ****
Karsten Hopp 2291d2
--- 885,905 ----
Karsten Hopp 2291d2
      return retval;
Karsten Hopp 2291d2
  }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
+     static void
Karsten Hopp 2291d2
+ qf_store_title(qi, title)
Karsten Hopp 2291d2
+     qf_info_T	*qi;
Karsten Hopp 2291d2
+     char_u	*title;
Karsten Hopp 2291d2
+ {
Karsten Hopp 2291d2
+     if (title != NULL)
Karsten Hopp 2291d2
+     {
Karsten Hopp 2291d2
+ 	char_u *p = alloc((int)STRLEN(title) + 2);
Karsten Hopp 2291d2
+ 
Karsten Hopp 2291d2
+ 	qi->qf_lists[qi->qf_curlist].qf_title = p;
Karsten Hopp 2291d2
+ 	if (p != NULL)
Karsten Hopp 2291d2
+ 	    sprintf((char *)p, ":%s", (char *)title);
Karsten Hopp 2291d2
+     }
Karsten Hopp 2291d2
+ }
Karsten Hopp 2291d2
+ 
Karsten Hopp 2291d2
  /*
Karsten Hopp 2291d2
   * Prepare for adding a new quickfix list.
Karsten Hopp 2291d2
   */
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 895,901 ****
Karsten Hopp 2291d2
      int		i;
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      /*
Karsten Hopp 2291d2
!      * If the current entry is not the last entry, delete entries below
Karsten Hopp 2291d2
       * the current entry.  This makes it possible to browse in a tree-like
Karsten Hopp 2291d2
       * way with ":grep'.
Karsten Hopp 2291d2
       */
Karsten Hopp 2291d2
--- 911,917 ----
Karsten Hopp 2291d2
      int		i;
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      /*
Karsten Hopp 2291d2
!      * If the current entry is not the last entry, delete entries beyond
Karsten Hopp 2291d2
       * the current entry.  This makes it possible to browse in a tree-like
Karsten Hopp 2291d2
       * way with ":grep'.
Karsten Hopp 2291d2
       */
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 916,929 ****
Karsten Hopp 2291d2
      else
Karsten Hopp 2291d2
  	qi->qf_curlist = qi->qf_listcount++;
Karsten Hopp 2291d2
      vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
Karsten Hopp 2291d2
!     if (qf_title != NULL)
Karsten Hopp 2291d2
!     {
Karsten Hopp 2291d2
! 	char_u *p = alloc((int)STRLEN(qf_title) + 2);
Karsten Hopp 2291d2
! 
Karsten Hopp 2291d2
! 	qi->qf_lists[qi->qf_curlist].qf_title = p;
Karsten Hopp 2291d2
! 	if (p != NULL)
Karsten Hopp 2291d2
! 	    sprintf((char *)p, ":%s", (char *)qf_title);
Karsten Hopp 2291d2
!     }
Karsten Hopp 2291d2
  }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  /*
Karsten Hopp 2291d2
--- 932,938 ----
Karsten Hopp 2291d2
      else
Karsten Hopp 2291d2
  	qi->qf_curlist = qi->qf_listcount++;
Karsten Hopp 2291d2
      vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
Karsten Hopp 2291d2
!     qf_store_title(qi, qf_title);
Karsten Hopp 2291d2
  }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  /*
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 2444,2450 ****
Karsten Hopp 2291d2
      qf_fill_buffer(qi);
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
Karsten Hopp 2291d2
! 	qf_set_title(qi);
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
Karsten Hopp 2291d2
      curwin->w_cursor.col = 0;
Karsten Hopp 2291d2
--- 2453,2459 ----
Karsten Hopp 2291d2
      qf_fill_buffer(qi);
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
Karsten Hopp 2291d2
! 	qf_set_title_var(qi);
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
Karsten Hopp 2291d2
      curwin->w_cursor.col = 0;
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 2599,2605 ****
Karsten Hopp 2291d2
  	{
Karsten Hopp 2291d2
  	    curwin_save = curwin;
Karsten Hopp 2291d2
  	    curwin = win;
Karsten Hopp 2291d2
! 	    qf_set_title(qi);
Karsten Hopp 2291d2
  	    curwin = curwin_save;
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  	}
Karsten Hopp 2291d2
--- 2608,2614 ----
Karsten Hopp 2291d2
  	{
Karsten Hopp 2291d2
  	    curwin_save = curwin;
Karsten Hopp 2291d2
  	    curwin = win;
Karsten Hopp 2291d2
! 	    qf_set_title_var(qi);
Karsten Hopp 2291d2
  	    curwin = curwin_save;
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  	}
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 2612,2618 ****
Karsten Hopp 2291d2
  }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      static void
Karsten Hopp 2291d2
! qf_set_title(qi)
Karsten Hopp 2291d2
      qf_info_T	*qi;
Karsten Hopp 2291d2
  {
Karsten Hopp 2291d2
      set_internal_string_var((char_u *)"w:quickfix_title",
Karsten Hopp 2291d2
--- 2621,2627 ----
Karsten Hopp 2291d2
  }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      static void
Karsten Hopp 2291d2
! qf_set_title_var(qi)
Karsten Hopp 2291d2
      qf_info_T	*qi;
Karsten Hopp 2291d2
  {
Karsten Hopp 2291d2
      set_internal_string_var((char_u *)"w:quickfix_title",
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 3845,3851 ****
Karsten Hopp 2291d2
--- 3854,3863 ----
Karsten Hopp 2291d2
  	     prevp->qf_next != prevp; prevp = prevp->qf_next)
Karsten Hopp 2291d2
  	    ;
Karsten Hopp 2291d2
      else if (action == 'r')
Karsten Hopp 2291d2
+     {
Karsten Hopp 2291d2
  	qf_free(qi, qi->qf_curlist);
Karsten Hopp 2291d2
+ 	qf_store_title(qi, title);
Karsten Hopp 2291d2
+     }
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
      for (li = list->lv_first; li != NULL; li = li->li_next)
Karsten Hopp 2291d2
      {
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Make_amiga.mak	2014-07-16 17:01:38.275570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Make_amiga.mak	2014-07-23 15:26:51.455915053 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 40,45 ****
Karsten Hopp 2291d2
--- 40,46 ----
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
  		test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 		test_qf_title.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 169,173 ****
Karsten Hopp 2291d2
--- 170,175 ----
Karsten Hopp 2291d2
  test_breakindent.out: test_breakindent.in
Karsten Hopp 2291d2
  test_listlbr.out: test_listlbr.in
Karsten Hopp 2291d2
  test_listlbr_utf8.out: test_listlbr_utf8.in
Karsten Hopp 2291d2
+ test_qf_title.out: test_qf_title.in
Karsten Hopp 2291d2
  test_eval.out: test_eval.in
Karsten Hopp 2291d2
  test_options.out: test_options.in
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Make_dos.mak	2014-07-16 17:01:38.279570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Make_dos.mak	2014-07-23 15:27:01.231914983 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 39,44 ****
Karsten Hopp 2291d2
--- 39,45 ----
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
  		test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 		test_qf_title.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Make_ming.mak	2014-07-16 17:01:38.279570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Make_ming.mak	2014-07-23 15:27:13.163914897 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 59,64 ****
Karsten Hopp 2291d2
--- 59,65 ----
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
  		test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 		test_qf_title.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Make_os2.mak	2014-07-16 17:01:38.279570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Make_os2.mak	2014-07-23 15:27:25.999914805 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 40,47 ****
Karsten Hopp 2291d2
  		test_autoformat_join.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
- 		test_listlbr_utf8.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  .SUFFIXES: .in .out
Karsten Hopp 2291d2
--- 40,48 ----
Karsten Hopp 2291d2
  		test_autoformat_join.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
+ 		test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 		test_qf_title.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
  .SUFFIXES: .in .out
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Make_vms.mms	2014-07-16 17:01:38.279570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Make_vms.mms	2014-07-23 15:27:34.787914741 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 4,10 ****
Karsten Hopp 2291d2
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp 2291d2
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp 2291d2
  #
Karsten Hopp 2291d2
! # Last change:  2014 May 28
Karsten Hopp 2291d2
  #
Karsten Hopp 2291d2
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp 2291d2
  # Edit the lines in the Configuration section below to select.
Karsten Hopp 2291d2
--- 4,10 ----
Karsten Hopp 2291d2
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp 2291d2
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp 2291d2
  #
Karsten Hopp 2291d2
! # Last change:  2014 Jul 23
Karsten Hopp 2291d2
  #
Karsten Hopp 2291d2
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp 2291d2
  # Edit the lines in the Configuration section below to select.
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 100,105 ****
Karsten Hopp 2291d2
--- 100,106 ----
Karsten Hopp 2291d2
  	 test_breakindent.out \
Karsten Hopp 2291d2
  	 test_listlbr.out \
Karsten Hopp 2291d2
  	 test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 	 test_qf_title.out \
Karsten Hopp 2291d2
  	 test_eval.out \
Karsten Hopp 2291d2
  	 test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/Makefile	2014-07-16 17:01:38.279570568 +0200
Karsten Hopp 2291d2
--- src/testdir/Makefile	2014-07-23 15:27:46.947914654 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 37,42 ****
Karsten Hopp 2291d2
--- 37,43 ----
Karsten Hopp 2291d2
  		test_breakindent.out \
Karsten Hopp 2291d2
  		test_listlbr.out \
Karsten Hopp 2291d2
  		test_listlbr_utf8.out \
Karsten Hopp 2291d2
+ 		test_qf_title.out \
Karsten Hopp 2291d2
  		test_eval.out \
Karsten Hopp 2291d2
  		test_options.out
Karsten Hopp 2291d2
  
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/test_qf_title.in	2014-07-23 15:53:26.279903590 +0200
Karsten Hopp 2291d2
--- src/testdir/test_qf_title.in	2014-07-23 15:26:02.495915405 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 0 ****
Karsten Hopp 2291d2
--- 1,18 ----
Karsten Hopp 2291d2
+ Tests for quickfix window's title     vim: set ft=vim :
Karsten Hopp 2291d2
+ 
Karsten Hopp 2291d2
+ STARTTEST
Karsten Hopp 2291d2
+ :so small.vim
Karsten Hopp 2291d2
+ :if !has('quickfix') | e! test.ok | wq! test.out | endif
Karsten Hopp 2291d2
+ :set efm=%E%f:%l:%c:%m
Karsten Hopp 2291d2
+ :cgetexpr ['file:1:1:message']
Karsten Hopp 2291d2
+ :let qflist=getqflist()
Karsten Hopp 2291d2
+ :call setqflist(qflist, 'r')
Karsten Hopp 2291d2
+ :copen
Karsten Hopp 2291d2
+ :let g:quickfix_title=w:quickfix_title
Karsten Hopp 2291d2
+ :wincmd p
Karsten Hopp 2291d2
+ :$put =g:quickfix_title
Karsten Hopp 2291d2
+ :/^Results/,$w test.out
Karsten Hopp 2291d2
+ :qa!
Karsten Hopp 2291d2
+ ENDTEST
Karsten Hopp 2291d2
+ 
Karsten Hopp 2291d2
+ Results of test_qf_title:
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/testdir/test_qf_title.ok	2014-07-23 15:53:26.283903590 +0200
Karsten Hopp 2291d2
--- src/testdir/test_qf_title.ok	2014-07-23 15:25:55.303915456 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 0 ****
Karsten Hopp 2291d2
--- 1,2 ----
Karsten Hopp 2291d2
+ Results of test_qf_title:
Karsten Hopp 2291d2
+ :setqflist()
Karsten Hopp 2291d2
*** ../vim-7.4.377/src/version.c	2014-07-23 15:21:16.247917462 +0200
Karsten Hopp 2291d2
--- src/version.c	2014-07-23 15:28:57.251914149 +0200
Karsten Hopp 2291d2
***************
Karsten Hopp 2291d2
*** 736,737 ****
Karsten Hopp 2291d2
--- 736,739 ----
Karsten Hopp 2291d2
  {   /* Add new patch number below this line */
Karsten Hopp 2291d2
+ /**/
Karsten Hopp 2291d2
+     378,
Karsten Hopp 2291d2
  /**/
Karsten Hopp 2291d2
Karsten Hopp 2291d2
-- 
Karsten Hopp 2291d2
ARTHUR: Old woman!
Karsten Hopp 2291d2
DENNIS: Man!
Karsten Hopp 2291d2
ARTHUR: Man.  I'm sorry.  Old man, What knight live in that castle over there?
Karsten Hopp 2291d2
DENNIS: I'm thirty-seven.
Karsten Hopp 2291d2
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 2291d2
Karsten Hopp 2291d2
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 2291d2
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 2291d2
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 2291d2
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///