c85d938
To: vim-dev@vim.org
c85d938
Subject: Patch 7.2.031
c85d938
Fcc: outbox
c85d938
From: Bram Moolenaar <Bram@moolenaar.net>
c85d938
Mime-Version: 1.0
c85d938
Content-Type: text/plain; charset=ISO-8859-1
c85d938
Content-Transfer-Encoding: 8bit
c85d938
------------
c85d938
c85d938
Patch 7.2.031
c85d938
Problem:    Information in the viminfo file about previously edited files is
c85d938
	    not available to the user.  There is no way to get a complete list
c85d938
	    of files edited in previous Vim sessions.
c85d938
Solution:   Add v:oldfiles and fill it with the list of old file names when
c85d938
	    first reading the viminfo file.  Add the ":oldfiles" command,
c85d938
	    ":browse oldfiles" and the "#<123" special file name.  Increase
c85d938
	    the default value for 'viminfo' from '20 to '100.
c85d938
Files:	    runtime/doc/cmdline.txt, runtime/doc/eval.txt,
c85d938
	    runtime/doc/starting.txt, runtime/doc/usr_21.txt, src/eval.c,
c85d938
	    src/ex_cmds.c, src/ex_cmds.h, src/ex_docmd.c, src/feature.h,
c85d938
	    src/fileio.c, src/main.c, src/mark.c, src/misc1.c,
c85d938
	    src/proto/eval.pro, src/proto/ex_cmds.pro, src/proto/mark.pro,
c85d938
	    src/option.c, src/structs.h, src/vim.h
c85d938
c85d938
c85d938
*** ../vim-7.2.030/runtime/doc/cmdline.txt	Sat Aug  9 19:36:46 2008
c85d938
--- runtime/doc/cmdline.txt	Thu Sep 18 22:55:27 2008
c85d938
***************
c85d938
*** 1,4 ****
c85d938
! *cmdline.txt*   For Vim version 7.2.  Last change: 2008 Jul 29
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
c85d938
--- 1,4 ----
c85d938
! *cmdline.txt*   For Vim version 7.2.  Last change: 2008 Sep 18
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
c85d938
***************
c85d938
*** 157,162 ****
c85d938
--- 157,167 ----
c85d938
  				(doesn't work at the expression prompt; some
c85d938
  				things such as changing the buffer or current
c85d938
  				window are not allowed to avoid side effects)
c85d938
+ 				When the result is a |List| the items are used
c85d938
+ 				as lines.  They can have line breaks inside
c85d938
+ 				too.
c85d938
+ 				When the result is a Float it's automatically
c85d938
+ 				converted to a String.
c85d938
  		See |registers| about registers.  {not in Vi}
c85d938
  		Implementation detail: When using the |expression| register
c85d938
  		and invoking setcmdpos(), this sets the position before
c85d938
***************
c85d938
*** 730,748 ****
c85d938
  In Ex commands, at places where a file name can be used, the following
c85d938
  characters have a special meaning.  These can also be used in the expression
c85d938
  function expand() |expand()|.
c85d938
! 	%	is replaced with the current file name			*:_%*
c85d938
! 	#	is replaced with the alternate file name		*:_#*
c85d938
  	#n	(where n is a number) is replaced with the file name of
c85d938
! 		buffer n.  "#0" is the same as "#"
c85d938
! 	##	is replaced with all names in the argument list		*:_##*
c85d938
  		concatenated, separated by spaces.  Each space in a name
c85d938
  		is preceded with a backslash.
c85d938
! Note that these give the file name as it was typed.  If an absolute path is
c85d938
! needed (when using the file name from a different directory), you need to add
c85d938
! ":p".  See |filename-modifiers|.
c85d938
  Note that backslashes are inserted before spaces, so that the command will
c85d938
  correctly interpret the file name.  But this doesn't happen for shell
c85d938
! commands.  For those you probably have to use quotes: >
c85d938
  	:!ls "%"
c85d938
  	:r !spell "%"
c85d938
  
c85d938
--- 735,763 ----
c85d938
  In Ex commands, at places where a file name can be used, the following
c85d938
  characters have a special meaning.  These can also be used in the expression
c85d938
  function expand() |expand()|.
c85d938
! 	%	Is replaced with the current file name.		  *:_%* *c_%*
c85d938
! 	#	Is replaced with the alternate file name.	  *:_#* *c_#*
c85d938
  	#n	(where n is a number) is replaced with the file name of
c85d938
! 		buffer n.  "#0" is the same as "#".
c85d938
! 	##	Is replaced with all names in the argument list	  *:_##* *c_##*
c85d938
  		concatenated, separated by spaces.  Each space in a name
c85d938
  		is preceded with a backslash.
c85d938
! 	#<n	(where n is a number > 0) is replaced with old	  *:_#<* *c_#<*
c85d938
! 		file name n.  See |:oldfiles| or |v:oldfiles| to get the
c85d938
! 		number.							*E809*
c85d938
! 		{only when compiled with the +eval and +viminfo features}
c85d938
! 
c85d938
! Note that these, except "#
c85d938
! absolute path is needed (when using the file name from a different directory),
c85d938
! you need to add ":p".  See |filename-modifiers|.
c85d938
! 
c85d938
! The "#
c85d938
! below your home directory.
c85d938
! 
c85d938
  Note that backslashes are inserted before spaces, so that the command will
c85d938
  correctly interpret the file name.  But this doesn't happen for shell
c85d938
! commands.  For those you probably have to use quotes (this fails for files
c85d938
! that contain a quote and wildcards): >
c85d938
  	:!ls "%"
c85d938
  	:r !spell "%"
c85d938
  
c85d938
*** ../vim-7.2.030/runtime/doc/eval.txt	Sat Aug  9 19:36:47 2008
c85d938
--- runtime/doc/eval.txt	Sun Nov  2 14:25:38 2008
c85d938
***************
c85d938
*** 1,4 ****
c85d938
! *eval.txt*	For Vim version 7.2.  Last change: 2008 Aug 09
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL	  by Bram Moolenaar
c85d938
--- 1,4 ----
c85d938
! *eval.txt*	For Vim version 7.2.  Last change: 2008 Nov 02
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL	  by Bram Moolenaar
c85d938
***************
c85d938
*** 1484,1489 ****
c85d938
--- 1484,1500 ----
c85d938
  		This is the screen column number, like with |virtcol()|.  The
c85d938
  		value is zero when there was no mouse button click.
c85d938
  
c85d938
+ 					*v:oldfiles* *oldfiles-variable*
c85d938
+ v:oldfiles	List of file names that is loaded from the |viminfo| file on
c85d938
+ 		startup.  These are the files that Vim remembers marks for.
c85d938
+ 		The length of the List is limited by the ' argument of the
c85d938
+ 		'viminfo' option (default is 100).
c85d938
+ 		Also see |:oldfiles| and |c_#<|.
c85d938
+ 		The List can be modified, but this has no effect on what is
c85d938
+ 		stored in the |viminfo| file later.  If you use values other
c85d938
+ 		than String this will cause trouble.
c85d938
+ 		{only when compiled with the +viminfo feature}
c85d938
+ 
c85d938
  					*v:operator* *operator-variable*
c85d938
  v:operator	The last operator given in Normal mode.  This is a single
c85d938
  		character except for commands starting with <g> or <z>,
c85d938
*** ../vim-7.2.030/runtime/doc/starting.txt	Sat Aug  9 19:36:52 2008
c85d938
--- runtime/doc/starting.txt	Sun Nov  9 12:12:19 2008
c85d938
***************
c85d938
*** 1,4 ****
c85d938
! *starting.txt*  For Vim version 7.2.  Last change: 2008 Jun 21
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
c85d938
--- 1,4 ----
c85d938
! *starting.txt*  For Vim version 7.2.  Last change: 2008 Nov 09
c85d938
  
c85d938
  
c85d938
  		  VIM REFERENCE MANUAL    by Bram Moolenaar
c85d938
***************
c85d938
*** 1337,1344 ****
c85d938
  							*viminfo-read*
c85d938
  When Vim is started and the 'viminfo' option is non-empty, the contents of
c85d938
  the viminfo file are read and the info can be used in the appropriate places.
c85d938
! The marks are not read in at startup (but file marks are).  See
c85d938
! |initialization| for how to set the 'viminfo' option upon startup.
c85d938
  
c85d938
  							*viminfo-write*
c85d938
  When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
c85d938
--- 1335,1343 ----
c85d938
  							*viminfo-read*
c85d938
  When Vim is started and the 'viminfo' option is non-empty, the contents of
c85d938
  the viminfo file are read and the info can be used in the appropriate places.
c85d938
! The |v:oldfiles| variable is filled.  The marks are not read in at startup
c85d938
! (but file marks are).  See |initialization| for how to set the 'viminfo'
c85d938
! option upon startup.
c85d938
  
c85d938
  							*viminfo-write*
c85d938
  When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
c85d938
***************
c85d938
*** 1372,1377 ****
c85d938
--- 1371,1378 ----
c85d938
  that start with any string given with the "r" flag in 'viminfo'.  This can be
c85d938
  used to avoid saving marks for files on removable media (for MS-DOS you would
c85d938
  use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
c85d938
+ The |v:oldfiles| variable is filled with the file names that the viminfo file
c85d938
+ has marks for.
c85d938
  
c85d938
  							*viminfo-file-marks*
c85d938
  Uppercase marks ('A to 'Z) are stored when writing the viminfo file.  The
c85d938
***************
c85d938
*** 1463,1470 ****
c85d938
  						   *:rv* *:rviminfo* *E195*
c85d938
  :rv[iminfo][!] [file]	Read from viminfo file [file] (default: see above).
c85d938
  			If [!] is given, then any information that is
c85d938
! 			already set (registers, marks, etc.) will be
c85d938
! 			overwritten.  {not in Vi}
c85d938
  
c85d938
  					*:wv* *:wviminfo* *E137* *E138* *E574*
c85d938
  :wv[iminfo][!] [file]	Write to viminfo file [file] (default: see above).
c85d938
--- 1464,1471 ----
c85d938
  						   *:rv* *:rviminfo* *E195*
c85d938
  :rv[iminfo][!] [file]	Read from viminfo file [file] (default: see above).
c85d938
  			If [!] is given, then any information that is
c85d938
! 			already set (registers, marks, |v:oldfiles|, etc.)
c85d938
! 			will be overwritten   {not in Vi}
c85d938
  
c85d938
  					*:wv* *:wviminfo* *E137* *E138* *E574*
c85d938
  :wv[iminfo][!] [file]	Write to viminfo file [file] (default: see above).
c85d938
***************
c85d938
*** 1479,1482 ****
c85d938
--- 1480,1499 ----
c85d938
  			the .viminfo file.
c85d938
  			{not in Vi}
c85d938
  
c85d938
+ 						*:ol* *:oldfiles*
c85d938
+ :ol[dfiles]		List the files that have marks stored in the viminfo
c85d938
+ 			file.  This list is read on startup and only changes
c85d938
+ 			afterwards with ":rviminfo!".  Also see |v:oldfiles|.
c85d938
+ 			The number can be used with |c_#<|.
c85d938
+ 			{not in Vi, only when compiled with the +eval feature}
c85d938
+ 
c85d938
+ :bro[wse] ol[dfiles][!]
c85d938
+ 			List file names as with |:oldfiles|, and then prompt
c85d938
+ 			for a number.  When the number is valid that file from
c85d938
+ 			the list is edited.
c85d938
+ 			If you get the |press-enter| prompt you can press "q"
c85d938
+ 			and still get the prompt to enter a file number.
c85d938
+ 			Use ! to abondon a modified buffer. |abandon|
c85d938
+ 			{not when compiled with tiny or small features}
c85d938
+ 
c85d938
   vim:tw=78:ts=8:ft=help:norl:
c85d938
*** ../vim-7.2.030/runtime/doc/usr_21.txt	Sat Aug  9 19:36:53 2008
c85d938
--- runtime/doc/usr_21.txt	Sun Nov  9 12:14:10 2008
c85d938
***************
c85d938
*** 1,4 ****
c85d938
! *usr_21.txt*	For Vim version 7.2.  Last change: 2007 May 01
c85d938
  
c85d938
  		     VIM USER MANUAL - by Bram Moolenaar
c85d938
  
c85d938
--- 1,4 ----
c85d938
! *usr_21.txt*	For Vim version 7.2.  Last change: 2008 Nov 09
c85d938
  
c85d938
  		     VIM USER MANUAL - by Bram Moolenaar
c85d938
  
c85d938
***************
c85d938
*** 153,159 ****
c85d938
  to be lost.  Each item can be remembered only once.
c85d938
  
c85d938
  
c85d938
! GETTING BACK TO WHERE YOU WERE
c85d938
  
c85d938
  You are halfway editing a file and it's time to leave for holidays.  You exit
c85d938
  Vim and go enjoy yourselves, forgetting all about your work.  After a couple
c85d938
--- 153,159 ----
c85d938
  to be lost.  Each item can be remembered only once.
c85d938
  
c85d938
  
c85d938
! GETTING BACK TO WHERE YOU STOPPED VIM
c85d938
  
c85d938
  You are halfway editing a file and it's time to leave for holidays.  You exit
c85d938
  Vim and go enjoy yourselves, forgetting all about your work.  After a couple
c85d938
***************
c85d938
*** 168,173 ****
c85d938
--- 168,215 ----
c85d938
     The |:marks| command is useful to find out where '0 to '9 will take you.
c85d938
  
c85d938
  
c85d938
+ GETTING BACK TO SOME FILE
c85d938
+ 
c85d938
+ If you want to go back to a file that you edited recently, but not when
c85d938
+ exiting Vim, there is a slightly more complicated way.  You can see a list of
c85d938
+ files by typing the command: >
c85d938
+ 
c85d938
+ 	:oldfiles
c85d938
+ <	1: ~/.viminfo ~
c85d938
+ 	2: ~/text/resume.txt ~
c85d938
+ 	3: /tmp/draft ~
c85d938
+ 
c85d938
+ Now you would like to edit the second file, which is in the list preceded by
c85d938
+ "2:".  You type: >
c85d938
+ 
c85d938
+ 	:e #<2
c85d938
+ 
c85d938
+ Instead of ":e" you can use any command that has a file name argument, the
c85d938
+ "#<2" item works in the same place as "%" (current file name) and "#"
c85d938
+ (alternate file name).  So you can also split the window to edit the third
c85d938
+ file: >
c85d938
+ 
c85d938
+ 	:split #<3
c85d938
+ 
c85d938
+ That #<123 thing is a bit complicated when you just want to edit a file.
c85d938
+ Fortunately there is a simpler way: >
c85d938
+ 
c85d938
+ 	:browse oldfiles
c85d938
+ <	1: ~/.viminfo ~
c85d938
+ 	2: ~/text/resume.txt ~
c85d938
+ 	3: /tmp/draft ~
c85d938
+ 	-- More --
c85d938
+ 
c85d938
+ You get the same list of files as with |:oldfiles|.  If you want to edit
c85d938
+ "resume.txt" first press "q" to stop the listing.  You will get a prompt:
c85d938
+ 
c85d938
+ 	Type number and <Enter> (empty cancels): ~
c85d938
+ 
c85d938
+ Type "2" and press <Enter> to edit the second file.
c85d938
+ 
c85d938
+ More info at |:oldfiles|, |v:oldfiles| and |c_#<|.
c85d938
+ 
c85d938
+ 
c85d938
  MOVE INFO FROM ONE VIM TO ANOTHER
c85d938
  
c85d938
  You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
c85d938
*** ../vim-7.2.030/src/eval.c	Thu Nov  6 11:04:50 2008
c85d938
--- src/eval.c	Sun Nov  9 11:59:39 2008
c85d938
***************
c85d938
*** 348,353 ****
c85d938
--- 348,354 ----
c85d938
      {VV_NAME("mouse_col",	 VAR_NUMBER), 0},
c85d938
      {VV_NAME("operator",	 VAR_STRING), VV_RO},
c85d938
      {VV_NAME("searchforward",	 VAR_NUMBER), 0},
c85d938
+     {VV_NAME("oldfiles",	 VAR_LIST), 0},
c85d938
  };
c85d938
  
c85d938
  /* shorthand */
c85d938
***************
c85d938
*** 355,360 ****
c85d938
--- 356,362 ----
c85d938
  #define vv_nr		vv_di.di_tv.vval.v_number
c85d938
  #define vv_float	vv_di.di_tv.vval.v_float
c85d938
  #define vv_str		vv_di.di_tv.vval.v_string
c85d938
+ #define vv_list		vv_di.di_tv.vval.v_list
c85d938
  #define vv_tv		vv_di.di_tv
c85d938
  
c85d938
  /*
c85d938
***************
c85d938
*** 426,432 ****
c85d938
  static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
c85d938
  static void list_append __ARGS((list_T *l, listitem_T *item));
c85d938
  static int list_append_tv __ARGS((list_T *l, typval_T *tv));
c85d938
- static int list_append_string __ARGS((list_T *l, char_u *str, int len));
c85d938
  static int list_append_number __ARGS((list_T *l, varnumber_T n));
c85d938
  static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
c85d938
  static int list_extend __ARGS((list_T	*l1, list_T *l2, listitem_T *bef));
c85d938
--- 428,433 ----
c85d938
***************
c85d938
*** 845,852 ****
c85d938
  	p = &vimvars[i];
c85d938
  	if (p->vv_di.di_tv.v_type == VAR_STRING)
c85d938
  	{
c85d938
! 	    vim_free(p->vv_di.di_tv.vval.v_string);
c85d938
! 	    p->vv_di.di_tv.vval.v_string = NULL;
c85d938
  	}
c85d938
      }
c85d938
      hash_clear(&vimvarht);
c85d938
--- 846,858 ----
c85d938
  	p = &vimvars[i];
c85d938
  	if (p->vv_di.di_tv.v_type == VAR_STRING)
c85d938
  	{
c85d938
! 	    vim_free(p->vv_string);
c85d938
! 	    p->vv_string = NULL;
c85d938
! 	}
c85d938
! 	else if (p->vv_di.di_tv.v_type == VAR_LIST)
c85d938
! 	{
c85d938
! 	    list_unref(p->vv_list);
c85d938
! 	    p->vv_list = NULL;
c85d938
  	}
c85d938
      }
c85d938
      hash_clear(&vimvarht);
c85d938
***************
c85d938
*** 6057,6062 ****
c85d938
--- 6063,6087 ----
c85d938
  }
c85d938
  
c85d938
  /*
c85d938
+  * Get list item "l[idx - 1]" as a string.  Returns NULL for failure.
c85d938
+  */
c85d938
+     char_u *
c85d938
+ list_find_str(l, idx)
c85d938
+     list_T	*l;
c85d938
+     long	idx;
c85d938
+ {
c85d938
+     listitem_T	*li;
c85d938
+ 
c85d938
+     li = list_find(l, idx - 1);
c85d938
+     if (li == NULL)
c85d938
+     {
c85d938
+ 	EMSGN(_(e_listidx), idx);
c85d938
+ 	return NULL;
c85d938
+     }
c85d938
+     return get_tv_string(&li->li_tv);
c85d938
+ }
c85d938
+ 
c85d938
+ /*
c85d938
   * Locate "item" list "l" and return its index.
c85d938
   * Returns -1 when "item" is not in the list.
c85d938
   */
c85d938
***************
c85d938
*** 6147,6153 ****
c85d938
   * When "len" >= 0 use "str[len]".
c85d938
   * Returns FAIL when out of memory.
c85d938
   */
c85d938
!     static int
c85d938
  list_append_string(l, str, len)
c85d938
      list_T	*l;
c85d938
      char_u	*str;
c85d938
--- 6172,6178 ----
c85d938
   * When "len" >= 0 use "str[len]".
c85d938
   * Returns FAIL when out of memory.
c85d938
   */
c85d938
!     int
c85d938
  list_append_string(l, str, len)
c85d938
      list_T	*l;
c85d938
      char_u	*str;
c85d938
***************
c85d938
*** 6507,6512 ****
c85d938
--- 6532,6540 ----
c85d938
  	set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
c85d938
      }
c85d938
  
c85d938
+     /* v: vars */
c85d938
+     set_ref_in_ht(&vimvarht, copyID);
c85d938
+ 
c85d938
      /*
c85d938
       * 2. Go through the list of dicts and free items without the copyID.
c85d938
       */
c85d938
***************
c85d938
*** 6597,6603 ****
c85d938
      {
c85d938
  	case VAR_DICT:
c85d938
  	    dd = tv->vval.v_dict;
c85d938
! 	    if (dd->dv_copyID != copyID)
c85d938
  	    {
c85d938
  		/* Didn't see this dict yet. */
c85d938
  		dd->dv_copyID = copyID;
c85d938
--- 6625,6631 ----
c85d938
      {
c85d938
  	case VAR_DICT:
c85d938
  	    dd = tv->vval.v_dict;
c85d938
! 	    if (dd != NULL && dd->dv_copyID != copyID)
c85d938
  	    {
c85d938
  		/* Didn't see this dict yet. */
c85d938
  		dd->dv_copyID = copyID;
c85d938
***************
c85d938
*** 6607,6613 ****
c85d938
  
c85d938
  	case VAR_LIST:
c85d938
  	    ll = tv->vval.v_list;
c85d938
! 	    if (ll->lv_copyID != copyID)
c85d938
  	    {
c85d938
  		/* Didn't see this list yet. */
c85d938
  		ll->lv_copyID = copyID;
c85d938
--- 6635,6641 ----
c85d938
  
c85d938
  	case VAR_LIST:
c85d938
  	    ll = tv->vval.v_list;
c85d938
! 	    if (ll != NULL && ll->lv_copyID != copyID)
c85d938
  	    {
c85d938
  		/* Didn't see this list yet. */
c85d938
  		ll->lv_copyID = copyID;
c85d938
***************
c85d938
*** 18106,18111 ****
c85d938
--- 18134,18150 ----
c85d938
  }
c85d938
  
c85d938
  /*
c85d938
+  * Get List v: variable value.  Caller must take care of reference count when
c85d938
+  * needed.
c85d938
+  */
c85d938
+     list_T *
c85d938
+ get_vim_var_list(idx)
c85d938
+     int		idx;
c85d938
+ {
c85d938
+     return vimvars[idx].vv_list;
c85d938
+ }
c85d938
+ 
c85d938
+ /*
c85d938
   * Set v:count, v:count1 and v:prevcount.
c85d938
   */
c85d938
      void
c85d938
***************
c85d938
*** 18141,18146 ****
c85d938
--- 18180,18199 ----
c85d938
  }
c85d938
  
c85d938
  /*
c85d938
+  * Set List v: variable to "val".
c85d938
+  */
c85d938
+     void
c85d938
+ set_vim_var_list(idx, val)
c85d938
+     int		idx;
c85d938
+     list_T	*val;
c85d938
+ {
c85d938
+     list_unref(vimvars[idx].vv_list);
c85d938
+     vimvars[idx].vv_list = val;
c85d938
+     if (val != NULL)
c85d938
+ 	++val->lv_refcount;
c85d938
+ }
c85d938
+ 
c85d938
+ /*
c85d938
   * Set v:register if needed.
c85d938
   */
c85d938
      void
c85d938
***************
c85d938
*** 21900,21905 ****
c85d938
--- 21953,22014 ----
c85d938
      }
c85d938
  }
c85d938
  
c85d938
+ /*
c85d938
+  * List v:oldfiles in a nice way.
c85d938
+  */
c85d938
+ /*ARGSUSED*/
c85d938
+     void
c85d938
+ ex_oldfiles(eap)
c85d938
+     exarg_T	*eap;
c85d938
+ {
c85d938
+     list_T	*l = vimvars[VV_OLDFILES].vv_list;
c85d938
+     listitem_T	*li;
c85d938
+     int		nr = 0;
c85d938
+ 
c85d938
+     if (l == NULL)
c85d938
+ 	msg((char_u *)_("No old files"));
c85d938
+     else
c85d938
+     {
c85d938
+ 	msg_start();
c85d938
+ 	msg_scroll = TRUE;
c85d938
+ 	for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
c85d938
+ 	{
c85d938
+ 	    msg_outnum((long)++nr);
c85d938
+ 	    MSG_PUTS(": ");
c85d938
+ 	    msg_outtrans(get_tv_string(&li->li_tv));
c85d938
+ 	    msg_putchar('\n');
c85d938
+ 	    out_flush();	    /* output one line at a time */
c85d938
+ 	    ui_breakcheck();
c85d938
+ 	}
c85d938
+ 	/* Assume "got_int" was set to truncate the listing. */
c85d938
+ 	got_int = FALSE;
c85d938
+ 
c85d938
+ #ifdef FEAT_BROWSE_CMD
c85d938
+ 	if (cmdmod.browse)
c85d938
+ 	{
c85d938
+ 	    quit_more = FALSE;
c85d938
+ 	    nr = prompt_for_number(FALSE);
c85d938
+ 	    msg_starthere();
c85d938
+ 	    if (nr > 0)
c85d938
+ 	    {
c85d938
+ 		char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
c85d938
+ 								    (long)nr);
c85d938
+ 
c85d938
+ 		if (p != NULL)
c85d938
+ 		{
c85d938
+ 		    p = expand_env_save(p);
c85d938
+ 		    eap->arg = p;
c85d938
+ 		    eap->cmdidx = CMD_edit;
c85d938
+ 		    cmdmod.browse = FALSE;
c85d938
+ 		    do_exedit(eap, NULL);
c85d938
+ 		    vim_free(p);
c85d938
+ 		}
c85d938
+ 	    }
c85d938
+ 	}
c85d938
+ #endif
c85d938
+     }
c85d938
+ }
c85d938
+ 
c85d938
  #endif /* FEAT_EVAL */
c85d938
  
c85d938
  
c85d938
*** ../vim-7.2.030/src/ex_cmds.c	Sun Sep 14 21:40:26 2008
c85d938
--- src/ex_cmds.c	Sun Sep 14 13:45:03 2008
c85d938
***************
c85d938
*** 24,30 ****
c85d938
  static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
c85d938
  #ifdef FEAT_VIMINFO
c85d938
  static char_u *viminfo_filename __ARGS((char_u	*));
c85d938
! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read));
c85d938
  static int viminfo_encoding __ARGS((vir_T *virp));
c85d938
  static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
c85d938
  #endif
c85d938
--- 24,30 ----
c85d938
  static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
c85d938
  #ifdef FEAT_VIMINFO
c85d938
  static char_u *viminfo_filename __ARGS((char_u	*));
c85d938
! static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags));
c85d938
  static int viminfo_encoding __ARGS((vir_T *virp));
c85d938
  static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
c85d938
  #endif
c85d938
***************
c85d938
*** 1676,1689 ****
c85d938
  
c85d938
  /*
c85d938
   * read_viminfo() -- Read the viminfo file.  Registers etc. which are already
c85d938
!  * set are not over-written unless force is TRUE. -- webb
c85d938
   */
c85d938
      int
c85d938
! read_viminfo(file, want_info, want_marks, forceit)
c85d938
!     char_u	*file;
c85d938
!     int		want_info;
c85d938
!     int		want_marks;
c85d938
!     int		forceit;
c85d938
  {
c85d938
      FILE	*fp;
c85d938
      char_u	*fname;
c85d938
--- 1676,1687 ----
c85d938
  
c85d938
  /*
c85d938
   * read_viminfo() -- Read the viminfo file.  Registers etc. which are already
c85d938
!  * set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
c85d938
   */
c85d938
      int
c85d938
! read_viminfo(file, flags)
c85d938
!     char_u	*file;	    /* file name or NULL to use default name */
c85d938
!     int		flags;	    /* VIF_WANT_INFO et al. */
c85d938
  {
c85d938
      FILE	*fp;
c85d938
      char_u	*fname;
c85d938
***************
c85d938
*** 1691,1697 ****
c85d938
      if (no_viminfo())
c85d938
  	return FAIL;
c85d938
  
c85d938
!     fname = viminfo_filename(file);	    /* may set to default if NULL */
c85d938
      if (fname == NULL)
c85d938
  	return FAIL;
c85d938
      fp = mch_fopen((char *)fname, READBIN);
c85d938
--- 1689,1695 ----
c85d938
      if (no_viminfo())
c85d938
  	return FAIL;
c85d938
  
c85d938
!     fname = viminfo_filename(file);	/* get file name in allocated buffer */
c85d938
      if (fname == NULL)
c85d938
  	return FAIL;
c85d938
      fp = mch_fopen((char *)fname, READBIN);
c85d938
***************
c85d938
*** 1701,1708 ****
c85d938
  	verbose_enter();
c85d938
  	smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
c85d938
  		fname,
c85d938
! 		want_info ? _(" info") : "",
c85d938
! 		want_marks ? _(" marks") : "",
c85d938
  		fp == NULL ? _(" FAILED") : "");
c85d938
  	verbose_leave();
c85d938
      }
c85d938
--- 1699,1707 ----
c85d938
  	verbose_enter();
c85d938
  	smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
c85d938
  		fname,
c85d938
! 		(flags & VIF_WANT_INFO) ? _(" info") : "",
c85d938
! 		(flags & VIF_WANT_MARKS) ? _(" marks") : "",
c85d938
! 		(flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "",
c85d938
  		fp == NULL ? _(" FAILED") : "");
c85d938
  	verbose_leave();
c85d938
      }
c85d938
***************
c85d938
*** 1712,1721 ****
c85d938
  	return FAIL;
c85d938
  
c85d938
      viminfo_errcnt = 0;
c85d938
!     do_viminfo(fp, NULL, want_info, want_marks, forceit);
c85d938
  
c85d938
      fclose(fp);
c85d938
- 
c85d938
      return OK;
c85d938
  }
c85d938
  
c85d938
--- 1711,1719 ----
c85d938
  	return FAIL;
c85d938
  
c85d938
      viminfo_errcnt = 0;
c85d938
!     do_viminfo(fp, NULL, flags);
c85d938
  
c85d938
      fclose(fp);
c85d938
      return OK;
c85d938
  }
c85d938
  
c85d938
***************
c85d938
*** 1968,1974 ****
c85d938
      }
c85d938
  
c85d938
      viminfo_errcnt = 0;
c85d938
!     do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE);
c85d938
  
c85d938
      fclose(fp_out);	    /* errors are ignored !? */
c85d938
      if (fp_in != NULL)
c85d938
--- 1966,1972 ----
c85d938
      }
c85d938
  
c85d938
      viminfo_errcnt = 0;
c85d938
!     do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS));
c85d938
  
c85d938
      fclose(fp_out);	    /* errors are ignored !? */
c85d938
      if (fp_in != NULL)
c85d938
***************
c85d938
*** 2041,2052 ****
c85d938
   * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
c85d938
   */
c85d938
      static void
c85d938
! do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
c85d938
      FILE	*fp_in;
c85d938
      FILE	*fp_out;
c85d938
!     int		want_info;
c85d938
!     int		want_marks;
c85d938
!     int		force_read;
c85d938
  {
c85d938
      int		count = 0;
c85d938
      int		eof = FALSE;
c85d938
--- 2039,2048 ----
c85d938
   * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
c85d938
   */
c85d938
      static void
c85d938
! do_viminfo(fp_in, fp_out, flags)
c85d938
      FILE	*fp_in;
c85d938
      FILE	*fp_out;
c85d938
!     int		flags;
c85d938
  {
c85d938
      int		count = 0;
c85d938
      int		eof = FALSE;
c85d938
***************
c85d938
*** 2061,2068 ****
c85d938
  
c85d938
      if (fp_in != NULL)
c85d938
      {
c85d938
! 	if (want_info)
c85d938
! 	    eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL);
c85d938
  	else
c85d938
  	    /* Skip info, find start of marks */
c85d938
  	    while (!(eof = viminfo_readline(&vir))
c85d938
--- 2057,2065 ----
c85d938
  
c85d938
      if (fp_in != NULL)
c85d938
      {
c85d938
! 	if (flags & VIF_WANT_INFO)
c85d938
! 	    eof = read_viminfo_up_to_marks(&vir,
c85d938
! 					 flags & VIF_FORCEIT, fp_out != NULL);
c85d938
  	else
c85d938
  	    /* Skip info, find start of marks */
c85d938
  	    while (!(eof = viminfo_readline(&vir))
c85d938
***************
c85d938
*** 2092,2099 ****
c85d938
  	write_viminfo_bufferlist(fp_out);
c85d938
  	count = write_viminfo_marks(fp_out);
c85d938
      }
c85d938
!     if (fp_in != NULL && want_marks)
c85d938
! 	copy_viminfo_marks(&vir, fp_out, count, eof);
c85d938
  
c85d938
      vim_free(vir.vir_line);
c85d938
  #ifdef FEAT_MBYTE
c85d938
--- 2089,2097 ----
c85d938
  	write_viminfo_bufferlist(fp_out);
c85d938
  	count = write_viminfo_marks(fp_out);
c85d938
      }
c85d938
!     if (fp_in != NULL
c85d938
! 	    && (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT)))
c85d938
! 	copy_viminfo_marks(&vir, fp_out, count, eof, flags);
c85d938
  
c85d938
      vim_free(vir.vir_line);
c85d938
  #ifdef FEAT_MBYTE
c85d938
*** ../vim-7.2.030/src/ex_cmds.h	Thu Nov  6 20:47:00 2008
c85d938
--- src/ex_cmds.h	Thu Sep 18 22:18:14 2008
c85d938
***************
c85d938
*** 653,658 ****
c85d938
--- 653,660 ----
c85d938
  			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
c85d938
  EX(CMD_open,		"open",		ex_open,
c85d938
  			RANGE|EXTRA),
c85d938
+ EX(CMD_oldfiles,	"oldfiles",	ex_oldfiles,
c85d938
+ 			BANG|TRLBAR|SBOXOK|CMDWIN),
c85d938
  EX(CMD_omap,		"omap",		ex_map,
c85d938
  			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
c85d938
  EX(CMD_omapclear,	"omapclear",	ex_mapclear,
c85d938
*** ../vim-7.2.030/src/ex_docmd.c	Thu Nov  6 17:16:06 2008
c85d938
--- src/ex_docmd.c	Mon Nov  3 21:21:17 2008
c85d938
***************
c85d938
*** 364,369 ****
c85d938
--- 364,370 ----
c85d938
  # define ex_function		ex_ni
c85d938
  # define ex_delfunction		ex_ni
c85d938
  # define ex_return		ex_ni
c85d938
+ # define ex_oldfiles		ex_ni
c85d938
  #endif
c85d938
  static char_u	*arg_all __ARGS((void));
c85d938
  #ifdef FEAT_SESSION
c85d938
***************
c85d938
*** 1770,1776 ****
c85d938
  			}
c85d938
  			if (checkforcmd(&ea.cmd, "browse", 3))
c85d938
  			{
c85d938
! #ifdef FEAT_BROWSE
c85d938
  			    cmdmod.browse = TRUE;
c85d938
  #endif
c85d938
  			    continue;
c85d938
--- 1771,1777 ----
c85d938
  			}
c85d938
  			if (checkforcmd(&ea.cmd, "browse", 3))
c85d938
  			{
c85d938
! #ifdef FEAT_BROWSE_CMD
c85d938
  			    cmdmod.browse = TRUE;
c85d938
  #endif
c85d938
  			    continue;
c85d938
***************
c85d938
*** 9508,9531 ****
c85d938
  		    break;
c85d938
  		}
c85d938
  		s = src + 1;
c85d938
  		i = (int)getdigits(&s);
c85d938
  		*usedlen = (int)(s - src); /* length of what we expand */
c85d938
  
c85d938
! 		buf = buflist_findnr(i);
c85d938
! 		if (buf == NULL)
c85d938
  		{
c85d938
! 		    *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
c85d938
  		    return NULL;
c85d938
  		}
c85d938
! 		if (lnump != NULL)
c85d938
! 		    *lnump = ECMD_LAST;
c85d938
! 		if (buf->b_fname == NULL)
c85d938
  		{
c85d938
! 		    result = (char_u *)"";
c85d938
! 		    valid = 0;	    /* Must have ":p:h" to be valid */
c85d938
  		}
c85d938
- 		else
c85d938
- 		    result = buf->b_fname;
c85d938
  		break;
c85d938
  
c85d938
  #ifdef FEAT_SEARCHPATH
c85d938
--- 9509,9558 ----
c85d938
  		    break;
c85d938
  		}
c85d938
  		s = src + 1;
c85d938
+ 		if (*s == '<')		/* "#<99" uses v:oldfiles */
c85d938
+ 		    ++s;
c85d938
  		i = (int)getdigits(&s);
c85d938
  		*usedlen = (int)(s - src); /* length of what we expand */
c85d938
  
c85d938
! 		if (src[1] == '<')
c85d938
  		{
c85d938
! 		    if (*usedlen < 2)
c85d938
! 		    {
c85d938
! 			/* Should we give an error message for #
c85d938
! 			*usedlen = 1;
c85d938
! 			return NULL;
c85d938
! 		    }
c85d938
! #ifdef FEAT_EVAL
c85d938
! 		    result = list_find_str(get_vim_var_list(VV_OLDFILES),
c85d938
! 								     (long)i);
c85d938
! 		    if (result == NULL)
c85d938
! 		    {
c85d938
! 			*errormsg = (char_u *)"";
c85d938
! 			return NULL;
c85d938
! 		    }
c85d938
! #else
c85d938
! 		    *errormsg = (char_u *)_("E809: #< is not available without the +eval feature");
c85d938
  		    return NULL;
c85d938
+ #endif
c85d938
  		}
c85d938
! 		else
c85d938
  		{
c85d938
! 		    buf = buflist_findnr(i);
c85d938
! 		    if (buf == NULL)
c85d938
! 		    {
c85d938
! 			*errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
c85d938
! 			return NULL;
c85d938
! 		    }
c85d938
! 		    if (lnump != NULL)
c85d938
! 			*lnump = ECMD_LAST;
c85d938
! 		    if (buf->b_fname == NULL)
c85d938
! 		    {
c85d938
! 			result = (char_u *)"";
c85d938
! 			valid = 0;	    /* Must have ":p:h" to be valid */
c85d938
! 		    }
c85d938
! 		    else
c85d938
! 			result = buf->b_fname;
c85d938
  		}
c85d938
  		break;
c85d938
  
c85d938
  #ifdef FEAT_SEARCHPATH
c85d938
***************
c85d938
*** 10700,10706 ****
c85d938
  	p_viminfo = (char_u *)"'100";
c85d938
      if (eap->cmdidx == CMD_rviminfo)
c85d938
      {
c85d938
! 	if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL)
c85d938
  	    EMSG(_("E195: Cannot open viminfo file for reading"));
c85d938
      }
c85d938
      else
c85d938
--- 10727,10734 ----
c85d938
  	p_viminfo = (char_u *)"'100";
c85d938
      if (eap->cmdidx == CMD_rviminfo)
c85d938
      {
c85d938
! 	if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
c85d938
! 				  | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
c85d938
  	    EMSG(_("E195: Cannot open viminfo file for reading"));
c85d938
      }
c85d938
      else
c85d938
*** ../vim-7.2.030/src/feature.h	Wed Aug  6 18:45:07 2008
c85d938
--- src/feature.h	Fri Sep 19 19:14:22 2008
c85d938
***************
c85d938
*** 767,775 ****
c85d938
  
c85d938
  /*
c85d938
   * +browse		":browse" command.
c85d938
   */
c85d938
! #if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
c85d938
! # define FEAT_BROWSE
c85d938
  #endif
c85d938
  
c85d938
  /*
c85d938
--- 767,779 ----
c85d938
  
c85d938
  /*
c85d938
   * +browse		":browse" command.
c85d938
+  *			or just the ":browse" command modifier
c85d938
   */
c85d938
! #if defined(FEAT_NORMAL)
c85d938
! # define FEAT_BROWSE_CMD
c85d938
! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
c85d938
! #  define FEAT_BROWSE
c85d938
! # endif
c85d938
  #endif
c85d938
  
c85d938
  /*
c85d938
*** ../vim-7.2.030/src/fileio.c	Thu Sep 18 21:29:07 2008
c85d938
--- src/fileio.c	Mon Nov  3 21:21:47 2008
c85d938
***************
c85d938
*** 2711,2717 ****
c85d938
  {
c85d938
      if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
c85d938
  						  && curbuf->b_ffname != NULL)
c85d938
! 	read_viminfo(NULL, FALSE, TRUE, FALSE);
c85d938
  
c85d938
      /* Always set b_marks_read; needed when 'viminfo' is changed to include
c85d938
       * the ' parameter after opening a buffer. */
c85d938
--- 2711,2717 ----
c85d938
  {
c85d938
      if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
c85d938
  						  && curbuf->b_ffname != NULL)
c85d938
! 	read_viminfo(NULL, VIF_WANT_MARKS);
c85d938
  
c85d938
      /* Always set b_marks_read; needed when 'viminfo' is changed to include
c85d938
       * the ' parameter after opening a buffer. */
c85d938
***************
c85d938
*** 9108,9114 ****
c85d938
  set_context_in_autocmd(xp, arg, doautocmd)
c85d938
      expand_T	*xp;
c85d938
      char_u	*arg;
c85d938
!     int		doautocmd;	/* TRUE for :doautocmd, FALSE for :autocmd */
c85d938
  {
c85d938
      char_u	*p;
c85d938
      int		group;
c85d938
--- 9109,9115 ----
c85d938
  set_context_in_autocmd(xp, arg, doautocmd)
c85d938
      expand_T	*xp;
c85d938
      char_u	*arg;
c85d938
!     int		doautocmd;	/* TRUE for :doauto*, FALSE for :autocmd */
c85d938
  {
c85d938
      char_u	*p;
c85d938
      int		group;
c85d938
*** ../vim-7.2.030/src/main.c	Thu Sep 18 20:55:19 2008
c85d938
--- src/main.c	Sun Sep 14 13:26:10 2008
c85d938
***************
c85d938
*** 645,655 ****
c85d938
  
c85d938
  #ifdef FEAT_VIMINFO
c85d938
      /*
c85d938
!      * Read in registers, history etc, but not marks, from the viminfo file
c85d938
       */
c85d938
      if (*p_viminfo != NUL)
c85d938
      {
c85d938
! 	read_viminfo(NULL, TRUE, FALSE, FALSE);
c85d938
  	TIME_MSG("reading viminfo");
c85d938
      }
c85d938
  #endif
c85d938
--- 645,656 ----
c85d938
  
c85d938
  #ifdef FEAT_VIMINFO
c85d938
      /*
c85d938
!      * Read in registers, history etc, but not marks, from the viminfo file.
c85d938
!      * This is where v:oldfiles gets filled.
c85d938
       */
c85d938
      if (*p_viminfo != NUL)
c85d938
      {
c85d938
! 	read_viminfo(NULL, VIF_WANT_INFO | VIF_GET_OLDFILES);
c85d938
  	TIME_MSG("reading viminfo");
c85d938
      }
c85d938
  #endif
c85d938
*** ../vim-7.2.030/src/mark.c	Sat Aug  9 19:37:29 2008
c85d938
--- src/mark.c	Sun Sep 14 13:46:19 2008
c85d938
***************
c85d938
*** 1627,1641 ****
c85d938
  
c85d938
  /*
c85d938
   * Handle marks in the viminfo file:
c85d938
!  * fp_out == NULL   read marks for current buffer only
c85d938
!  * fp_out != NULL   copy marks for buffers not in buffer list
c85d938
   */
c85d938
      void
c85d938
! copy_viminfo_marks(virp, fp_out, count, eof)
c85d938
      vir_T	*virp;
c85d938
      FILE	*fp_out;
c85d938
      int		count;
c85d938
      int		eof;
c85d938
  {
c85d938
      char_u	*line = virp->vir_line;
c85d938
      buf_T	*buf;
c85d938
--- 1627,1643 ----
c85d938
  
c85d938
  /*
c85d938
   * Handle marks in the viminfo file:
c85d938
!  * fp_out != NULL: copy marks for buffers not in buffer list
c85d938
!  * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
c85d938
!  * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
c85d938
   */
c85d938
      void
c85d938
! copy_viminfo_marks(virp, fp_out, count, eof, flags)
c85d938
      vir_T	*virp;
c85d938
      FILE	*fp_out;
c85d938
      int		count;
c85d938
      int		eof;
c85d938
+     int		flags;
c85d938
  {
c85d938
      char_u	*line = virp->vir_line;
c85d938
      buf_T	*buf;
c85d938
***************
c85d938
*** 1647,1656 ****
c85d938
--- 1649,1671 ----
c85d938
      char_u	*p;
c85d938
      char_u	*name_buf;
c85d938
      pos_T	pos;
c85d938
+ #ifdef FEAT_EVAL
c85d938
+     list_T	*list = NULL;
c85d938
+ #endif
c85d938
  
c85d938
      if ((name_buf = alloc(LSIZE)) == NULL)
c85d938
  	return;
c85d938
      *name_buf = NUL;
c85d938
+ 
c85d938
+ #ifdef FEAT_EVAL
c85d938
+     if (fp_out == NULL && (flags & (VIF_GET_OLDFILES | VIF_FORCEIT)))
c85d938
+     {
c85d938
+ 	list = list_alloc();
c85d938
+ 	if (list != NULL)
c85d938
+ 	    set_vim_var_list(VV_OLDFILES, list);
c85d938
+     }
c85d938
+ #endif
c85d938
+ 
c85d938
      num_marked_files = get_viminfo_parameter('\'');
c85d938
      while (!eof && (count < num_marked_files || fp_out == NULL))
c85d938
      {
c85d938
***************
c85d938
*** 1681,1686 ****
c85d938
--- 1696,1706 ----
c85d938
  	    p++;
c85d938
  	*p = NUL;
c85d938
  
c85d938
+ #ifdef FEAT_EVAL
c85d938
+ 	if (list != NULL)
c85d938
+ 	    list_append_string(list, str, -1);
c85d938
+ #endif
c85d938
+ 
c85d938
  	/*
c85d938
  	 * If fp_out == NULL, load marks for current buffer.
c85d938
  	 * If fp_out != NULL, copy marks for buffers not in buflist.
c85d938
***************
c85d938
*** 1688,1694 ****
c85d938
  	load_marks = copy_marks_out = FALSE;
c85d938
  	if (fp_out == NULL)
c85d938
  	{
c85d938
! 	    if (curbuf->b_ffname != NULL)
c85d938
  	    {
c85d938
  		if (*name_buf == NUL)	    /* only need to do this once */
c85d938
  		    home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
c85d938
--- 1708,1714 ----
c85d938
  	load_marks = copy_marks_out = FALSE;
c85d938
  	if (fp_out == NULL)
c85d938
  	{
c85d938
! 	    if ((flags & VIF_WANT_MARKS) && curbuf->b_ffname != NULL)
c85d938
  	    {
c85d938
  		if (*name_buf == NUL)	    /* only need to do this once */
c85d938
  		    home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
c85d938
*** ../vim-7.2.030/src/misc1.c	Wed Jun 25 00:24:52 2008
c85d938
--- src/misc1.c	Sun Nov  9 11:47:00 2008
c85d938
***************
c85d938
*** 3245,3253 ****
c85d938
  
c85d938
      /* When using ":silent" assume that <CR> was entered. */
c85d938
      if (mouse_used != NULL)
c85d938
! 	MSG_PUTS(_("Type number or click with mouse (<Enter> cancels): "));
c85d938
      else
c85d938
! 	MSG_PUTS(_("Choice number (<Enter> cancels): "));
c85d938
  
c85d938
      /* Set the state such that text can be selected/copied/pasted and we still
c85d938
       * get mouse events. */
c85d938
--- 3245,3253 ----
c85d938
  
c85d938
      /* When using ":silent" assume that <CR> was entered. */
c85d938
      if (mouse_used != NULL)
c85d938
! 	MSG_PUTS(_("Type number and <Enter> or click with mouse (empty cancels): "));
c85d938
      else
c85d938
! 	MSG_PUTS(_("Type number and <Enter> (empty cancels): "));
c85d938
  
c85d938
      /* Set the state such that text can be selected/copied/pasted and we still
c85d938
       * get mouse events. */
c85d938
*** ../vim-7.2.030/src/proto/eval.pro	Sun Jan  6 20:06:30 2008
c85d938
--- src/proto/eval.pro	Sun Nov  9 12:05:56 2008
c85d938
***************
c85d938
*** 17,23 ****
c85d938
  int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
c85d938
  char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
c85d938
  int skip_expr __ARGS((char_u **pp));
c85d938
! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int dolist));
c85d938
  char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
c85d938
  int eval_to_number __ARGS((char_u *expr));
c85d938
  list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
c85d938
--- 17,23 ----
c85d938
  int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
c85d938
  char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
c85d938
  int skip_expr __ARGS((char_u **pp));
c85d938
! char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int convert));
c85d938
  char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
c85d938
  int eval_to_number __ARGS((char_u *expr));
c85d938
  list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
c85d938
***************
c85d938
*** 46,52 ****
c85d938
--- 46,54 ----
c85d938
  void list_unref __ARGS((list_T *l));
c85d938
  void list_free __ARGS((list_T *l, int recurse));
c85d938
  dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
c85d938
+ char_u *list_find_str __ARGS((list_T *l, long idx));
c85d938
  int list_append_dict __ARGS((list_T *list, dict_T *dict));
c85d938
+ int list_append_string __ARGS((list_T *l, char_u *str, int len));
c85d938
  int garbage_collect __ARGS((void));
c85d938
  dict_T *dict_alloc __ARGS((void));
c85d938
  int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
c85d938
***************
c85d938
*** 58,65 ****
c85d938
--- 60,69 ----
c85d938
  void set_vim_var_nr __ARGS((int idx, long val));
c85d938
  long get_vim_var_nr __ARGS((int idx));
c85d938
  char_u *get_vim_var_str __ARGS((int idx));
c85d938
+ list_T *get_vim_var_list __ARGS((int idx));
c85d938
  void set_vcount __ARGS((long count, long count1));
c85d938
  void set_vim_var_string __ARGS((int idx, char_u *val, int len));
c85d938
+ void set_vim_var_list __ARGS((int idx, list_T *val));
c85d938
  void set_reg_var __ARGS((int c));
c85d938
  char_u *v_exception __ARGS((char_u *oldval));
c85d938
  char_u *v_throwpoint __ARGS((char_u *oldval));
c85d938
***************
c85d938
*** 94,99 ****
c85d938
--- 98,104 ----
c85d938
  void write_viminfo_varlist __ARGS((FILE *fp));
c85d938
  int store_session_globals __ARGS((FILE *fd));
c85d938
  void last_set_msg __ARGS((scid_T scriptID));
c85d938
+ void ex_oldfiles __ARGS((exarg_T *eap));
c85d938
  int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
c85d938
  char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
c85d938
  /* vim: set ft=c : */
c85d938
*** ../vim-7.2.030/src/proto/ex_cmds.pro	Sat May  5 20:13:58 2007
c85d938
--- src/proto/ex_cmds.pro	Sat Sep 13 17:27:21 2008
c85d938
***************
c85d938
*** 11,17 ****
c85d938
  char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
c85d938
  void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
c85d938
  int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
c85d938
! int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit));
c85d938
  void write_viminfo __ARGS((char_u *file, int forceit));
c85d938
  int viminfo_readline __ARGS((vir_T *virp));
c85d938
  char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
c85d938
--- 11,17 ----
c85d938
  char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
c85d938
  void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
c85d938
  int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
c85d938
! int read_viminfo __ARGS((char_u *file, int flags));
c85d938
  void write_viminfo __ARGS((char_u *file, int forceit));
c85d938
  int viminfo_readline __ARGS((vir_T *virp));
c85d938
  char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
c85d938
*** ../vim-7.2.030/src/proto/mark.pro	Sat May  5 19:29:37 2007
c85d938
--- src/proto/mark.pro	Sat Sep 13 18:06:20 2008
c85d938
***************
c85d938
*** 26,30 ****
c85d938
  void write_viminfo_filemarks __ARGS((FILE *fp));
c85d938
  int removable __ARGS((char_u *name));
c85d938
  int write_viminfo_marks __ARGS((FILE *fp_out));
c85d938
! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof));
c85d938
  /* vim: set ft=c : */
c85d938
--- 26,30 ----
c85d938
  void write_viminfo_filemarks __ARGS((FILE *fp));
c85d938
  int removable __ARGS((char_u *name));
c85d938
  int write_viminfo_marks __ARGS((FILE *fp_out));
c85d938
! void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags));
c85d938
  /* vim: set ft=c : */
c85d938
*** ../vim-7.2.030/src/option.c	Thu Oct  2 22:48:01 2008
c85d938
--- src/option.c	Fri Sep 26 22:20:20 2008
c85d938
***************
c85d938
*** 2593,2605 ****
c85d938
  #ifdef FEAT_VIMINFO
c85d938
  			    (char_u *)&p_viminfo, PV_NONE,
c85d938
  #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
c85d938
! 			    {(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"}
c85d938
  #else
c85d938
  # ifdef AMIGA
c85d938
  			    {(char_u *)"",
c85d938
! 				 (char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"}
c85d938
  # else
c85d938
! 			    {(char_u *)"", (char_u *)"'20,<50,s10,h"}
c85d938
  # endif
c85d938
  #endif
c85d938
  #else
c85d938
--- 2593,2605 ----
c85d938
  #ifdef FEAT_VIMINFO
c85d938
  			    (char_u *)&p_viminfo, PV_NONE,
c85d938
  #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
c85d938
! 			    {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"}
c85d938
  #else
c85d938
  # ifdef AMIGA
c85d938
  			    {(char_u *)"",
c85d938
! 				 (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"}
c85d938
  # else
c85d938
! 			    {(char_u *)"", (char_u *)"'100,<50,s10,h"}
c85d938
  # endif
c85d938
  #endif
c85d938
  #else
c85d938
*** ../vim-7.2.030/src/structs.h	Thu Jul 31 22:04:27 2008
c85d938
--- src/structs.h	Fri Sep 19 19:15:18 2008
c85d938
***************
c85d938
*** 459,465 ****
c85d938
  typedef struct
c85d938
  {
c85d938
      int		hide;			/* TRUE when ":hide" was used */
c85d938
! # ifdef FEAT_BROWSE
c85d938
      int		browse;			/* TRUE to invoke file dialog */
c85d938
  # endif
c85d938
  # ifdef FEAT_WINDOWS
c85d938
--- 459,465 ----
c85d938
  typedef struct
c85d938
  {
c85d938
      int		hide;			/* TRUE when ":hide" was used */
c85d938
! # ifdef FEAT_BROWSE_CMD
c85d938
      int		browse;			/* TRUE to invoke file dialog */
c85d938
  # endif
c85d938
  # ifdef FEAT_WINDOWS
c85d938
*** ../vim-7.2.030/src/vim.h	Sat Aug  9 19:37:40 2008
c85d938
--- src/vim.h	Sat Sep 13 17:41:24 2008
c85d938
***************
c85d938
*** 1728,1734 ****
c85d938
  #define VV_MOUSE_COL	51
c85d938
  #define VV_OP		52
c85d938
  #define VV_SEARCHFORWARD 53
c85d938
! #define VV_LEN		54	/* number of v: vars */
c85d938
  
c85d938
  #ifdef FEAT_CLIPBOARD
c85d938
  
c85d938
--- 1728,1735 ----
c85d938
  #define VV_MOUSE_COL	51
c85d938
  #define VV_OP		52
c85d938
  #define VV_SEARCHFORWARD 53
c85d938
! #define VV_OLDFILES	54
c85d938
! #define VV_LEN		55	/* number of v: vars */
c85d938
  
c85d938
  #ifdef FEAT_CLIPBOARD
c85d938
  
c85d938
***************
c85d938
*** 2054,2057 ****
c85d938
--- 2055,2064 ----
c85d938
  #define DOSO_VIMRC	1	/* loading vimrc file */
c85d938
  #define DOSO_GVIMRC	2	/* loading gvimrc file */
c85d938
  
c85d938
+ /* flags for read_viminfo() and children */
c85d938
+ #define VIF_WANT_INFO		1	/* load non-mark info */
c85d938
+ #define VIF_WANT_MARKS		2	/* load file marks */
c85d938
+ #define VIF_FORCEIT		4	/* overwrite info already read */
c85d938
+ #define VIF_GET_OLDFILES	8	/* load v:oldfiles */
c85d938
+ 
c85d938
  #endif /* VIM__H */
c85d938
*** ../vim-7.2.030/src/version.c	Thu Nov  6 20:47:00 2008
c85d938
--- src/version.c	Sun Nov  9 13:39:19 2008
c85d938
***************
c85d938
*** 678,679 ****
c85d938
--- 678,681 ----
c85d938
  {   /* Add new patch number below this line */
c85d938
+ /**/
c85d938
+     31,
c85d938
  /**/
c85d938
c85d938
-- 
c85d938
hundred-and-one symptoms of being an internet addict:
c85d938
217. Your sex life has drastically improved...so what if it's only cyber-sex!
c85d938
c85d938
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
c85d938
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
c85d938
\\\        download, build and distribute -- http://www.A-A-P.org        ///
c85d938
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///