Karsten Hopp 137c8f
To: vim-dev@vim.org
Karsten Hopp 137c8f
Subject: Patch 7.2.286
Karsten Hopp 137c8f
Fcc: outbox
Karsten Hopp 137c8f
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 137c8f
Mime-Version: 1.0
Karsten Hopp 137c8f
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 137c8f
Content-Transfer-Encoding: 8bit
Karsten Hopp 137c8f
------------
Karsten Hopp 137c8f
Karsten Hopp 137c8f
Patch 7.2.286 (after 7.2.269)
Karsten Hopp 137c8f
Problem:    The "--startuptime=<file>" argument is not consistent with other
Karsten Hopp 137c8f
	    arguments.
Karsten Hopp 137c8f
Solution:   Use "--startuptime <file>".  Added the +startuptime feature.
Karsten Hopp 137c8f
Files:	    runtime/doc/eval.txt, runtime/doc/starting.txt,
Karsten Hopp 137c8f
	    runtime/doc/various.txt, src/eval.c, src/main.c, src/version.c
Karsten Hopp 137c8f
Karsten Hopp 137c8f
Karsten Hopp 137c8f
*** ../vim-7.2.285/runtime/doc/eval.txt	2009-04-22 12:53:31.000000000 +0200
Karsten Hopp 137c8f
--- runtime/doc/eval.txt	2009-11-11 13:01:58.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 5869,5874 ****
Karsten Hopp 137c8f
--- 5881,5887 ----
Karsten Hopp 137c8f
  signs			Compiled with |:sign| support.
Karsten Hopp 137c8f
  smartindent		Compiled with 'smartindent' support.
Karsten Hopp 137c8f
  sniff			Compiled with SNiFF interface support.
Karsten Hopp 137c8f
+ startuptime		Compiled with |--startuptime| support.
Karsten Hopp 137c8f
  statusline		Compiled with support for 'statusline', 'rulerformat'
Karsten Hopp 137c8f
  			and special formats of 'titlestring' and 'iconstring'.
Karsten Hopp 137c8f
  sun_workshop		Compiled with support for Sun |workshop|.
Karsten Hopp 137c8f
*** ../vim-7.2.285/runtime/doc/starting.txt	2009-11-03 12:10:39.000000000 +0100
Karsten Hopp 137c8f
--- runtime/doc/starting.txt	2009-11-11 13:20:56.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 144,155 ****
Karsten Hopp 137c8f
  			-u NORC			no		    yes
Karsten Hopp 137c8f
  			--noplugin		yes		    no
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
! --startuptime={fname}					*--startuptime*
Karsten Hopp 137c8f
  		During startup write timing messages to the file {fname}.
Karsten Hopp 137c8f
  		This can be used to find out where time is spent while loading
Karsten Hopp 137c8f
! 		your .vimrc and plugins.
Karsten Hopp 137c8f
  		When {fname} already exists new messages are appended.
Karsten Hopp 137c8f
! 		{only when compiled with this feature}
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  							*--literal*
Karsten Hopp 137c8f
  --literal	Take file names literally, don't expand wildcards.  Not needed
Karsten Hopp 137c8f
--- 144,156 ----
Karsten Hopp 137c8f
  			-u NORC			no		    yes
Karsten Hopp 137c8f
  			--noplugin		yes		    no
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
! --startuptime {fname}					*--startuptime*
Karsten Hopp 137c8f
  		During startup write timing messages to the file {fname}.
Karsten Hopp 137c8f
  		This can be used to find out where time is spent while loading
Karsten Hopp 137c8f
! 		your .vimrc, plugins and opening the first file.
Karsten Hopp 137c8f
  		When {fname} already exists new messages are appended.
Karsten Hopp 137c8f
! 		(Only available when compiled with the |+startuptime|
Karsten Hopp 137c8f
! 		feature).
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  							*--literal*
Karsten Hopp 137c8f
  --literal	Take file names literally, don't expand wildcards.  Not needed
Karsten Hopp 137c8f
*** ../vim-7.2.285/runtime/doc/various.txt	2009-07-09 15:55:34.000000000 +0200
Karsten Hopp 137c8f
--- runtime/doc/various.txt	2009-11-11 13:03:52.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 374,379 ****
Karsten Hopp 137c8f
--- 374,380 ----
Karsten Hopp 137c8f
  B  *+signs*		|:sign|
Karsten Hopp 137c8f
  N  *+smartindent*	|'smartindent'|
Karsten Hopp 137c8f
  m  *+sniff*		SniFF interface |sniff|
Karsten Hopp 137c8f
+ N  *+startuptime*	|--startuptime| argument
Karsten Hopp 137c8f
  N  *+statusline*	Options 'statusline', 'rulerformat' and special
Karsten Hopp 137c8f
  			formats of 'titlestring' and 'iconstring'
Karsten Hopp 137c8f
  m  *+sun_workshop*	|workshop|
Karsten Hopp 137c8f
*** ../vim-7.2.285/src/eval.c	2009-11-03 14:26:29.000000000 +0100
Karsten Hopp 137c8f
--- src/eval.c	2009-11-11 12:59:53.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 11736,11741 ****
Karsten Hopp 137c8f
--- 11736,11744 ----
Karsten Hopp 137c8f
  #ifdef FEAT_SNIFF
Karsten Hopp 137c8f
  	"sniff",
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
+ #ifdef STARTUPTIME
Karsten Hopp 137c8f
+ 	"startuptime",
Karsten Hopp 137c8f
+ #endif
Karsten Hopp 137c8f
  #ifdef FEAT_STL_OPT
Karsten Hopp 137c8f
  	"statusline",
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
*** ../vim-7.2.285/src/main.c	2009-11-03 12:10:39.000000000 +0100
Karsten Hopp 137c8f
--- src/main.c	2009-11-08 12:57:46.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 204,212 ****
Karsten Hopp 137c8f
  #ifdef STARTUPTIME
Karsten Hopp 137c8f
      for (i = 1; i < argc; ++i)
Karsten Hopp 137c8f
      {
Karsten Hopp 137c8f
! 	if (STRNICMP(argv[i], "--startuptime=", 14) == 0)
Karsten Hopp 137c8f
  	{
Karsten Hopp 137c8f
! 	    time_fd = mch_fopen(argv[i] + 14, "a");
Karsten Hopp 137c8f
  	    TIME_MSG("--- VIM STARTING ---");
Karsten Hopp 137c8f
  	    break;
Karsten Hopp 137c8f
  	}
Karsten Hopp 137c8f
--- 204,212 ----
Karsten Hopp 137c8f
  #ifdef STARTUPTIME
Karsten Hopp 137c8f
      for (i = 1; i < argc; ++i)
Karsten Hopp 137c8f
      {
Karsten Hopp 137c8f
! 	if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
Karsten Hopp 137c8f
  	{
Karsten Hopp 137c8f
! 	    time_fd = mch_fopen(argv[i + 1], "a");
Karsten Hopp 137c8f
  	    TIME_MSG("--- VIM STARTING ---");
Karsten Hopp 137c8f
  	    break;
Karsten Hopp 137c8f
  	}
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 1726,1731 ****
Karsten Hopp 137c8f
--- 1726,1736 ----
Karsten Hopp 137c8f
  		    want_argument = TRUE;
Karsten Hopp 137c8f
  		    argv_idx += 3;
Karsten Hopp 137c8f
  		}
Karsten Hopp 137c8f
+ 		else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
Karsten Hopp 137c8f
+ 		{
Karsten Hopp 137c8f
+ 		    want_argument = TRUE;
Karsten Hopp 137c8f
+ 		    argv_idx += 11;
Karsten Hopp 137c8f
+ 		}
Karsten Hopp 137c8f
  #ifdef FEAT_CLIENTSERVER
Karsten Hopp 137c8f
  		else if (STRNICMP(argv[0] + argv_idx, "serverlist", 10) == 0)
Karsten Hopp 137c8f
  		    ; /* already processed -- no arg */
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 1761,1770 ****
Karsten Hopp 137c8f
  		    /* already processed, skip */
Karsten Hopp 137c8f
  		}
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
- 		else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
Karsten Hopp 137c8f
- 		{
Karsten Hopp 137c8f
- 		    /* already processed, skip */
Karsten Hopp 137c8f
- 		}
Karsten Hopp 137c8f
  		else
Karsten Hopp 137c8f
  		{
Karsten Hopp 137c8f
  		    if (argv[0][argv_idx])
Karsten Hopp 137c8f
--- 1766,1771 ----
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 2061,2067 ****
Karsten Hopp 137c8f
  		    mainerr(ME_GARBAGE, (char_u *)argv[0]);
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  		--argc;
Karsten Hopp 137c8f
! 		if (argc < 1 && c != 'S')
Karsten Hopp 137c8f
  		    mainerr_arg_missing((char_u *)argv[0]);
Karsten Hopp 137c8f
  		++argv;
Karsten Hopp 137c8f
  		argv_idx = -1;
Karsten Hopp 137c8f
--- 2062,2068 ----
Karsten Hopp 137c8f
  		    mainerr(ME_GARBAGE, (char_u *)argv[0]);
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  		--argc;
Karsten Hopp 137c8f
! 		if (argc < 1 && c != 'S')  /* -S has an optional argument */
Karsten Hopp 137c8f
  		    mainerr_arg_missing((char_u *)argv[0]);
Karsten Hopp 137c8f
  		++argv;
Karsten Hopp 137c8f
  		argv_idx = -1;
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 2102,2112 ****
Karsten Hopp 137c8f
  							    (char_u *)argv[0];
Karsten Hopp 137c8f
  		    break;
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
! 		case '-':	/* "--cmd {command}" execute command */
Karsten Hopp 137c8f
! 		    if (parmp->n_pre_commands >= MAX_ARG_CMDS)
Karsten Hopp 137c8f
! 			mainerr(ME_EXTRA_CMD, NULL);
Karsten Hopp 137c8f
! 		    parmp->pre_commands[parmp->n_pre_commands++] =
Karsten Hopp 137c8f
  							    (char_u *)argv[0];
Karsten Hopp 137c8f
  		    break;
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  	    /*	case 'd':   -d {device} is handled in mch_check_win() for the
Karsten Hopp 137c8f
--- 2103,2118 ----
Karsten Hopp 137c8f
  							    (char_u *)argv[0];
Karsten Hopp 137c8f
  		    break;
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
! 		case '-':
Karsten Hopp 137c8f
! 		    if (argv[-1][2] == 'c')
Karsten Hopp 137c8f
! 		    {
Karsten Hopp 137c8f
! 			/* "--cmd {command}" execute command */
Karsten Hopp 137c8f
! 			if (parmp->n_pre_commands >= MAX_ARG_CMDS)
Karsten Hopp 137c8f
! 			    mainerr(ME_EXTRA_CMD, NULL);
Karsten Hopp 137c8f
! 			parmp->pre_commands[parmp->n_pre_commands++] =
Karsten Hopp 137c8f
  							    (char_u *)argv[0];
Karsten Hopp 137c8f
+ 		    }
Karsten Hopp 137c8f
+ 		    /* "--startuptime <file>" already handled */
Karsten Hopp 137c8f
  		    break;
Karsten Hopp 137c8f
  
Karsten Hopp 137c8f
  	    /*	case 'd':   -d {device} is handled in mch_check_win() for the
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 3144,3149 ****
Karsten Hopp 137c8f
--- 3150,3158 ----
Karsten Hopp 137c8f
      main_msg(_("--serverlist\t\tList available Vim server names and exit"));
Karsten Hopp 137c8f
      main_msg(_("--servername <name>\tSend to/become the Vim server <name>"));
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
+ #ifdef STARTUPTIME
Karsten Hopp 137c8f
+     main_msg(_("--startuptime=<file>\tWrite startup timing messages to <file>"));
Karsten Hopp 137c8f
+ #endif
Karsten Hopp 137c8f
  #ifdef FEAT_VIMINFO
Karsten Hopp 137c8f
      main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
*** ../vim-7.2.285/src/version.c	2009-11-11 13:22:09.000000000 +0100
Karsten Hopp 137c8f
--- src/version.c	2009-11-11 14:17:28.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 494,499 ****
Karsten Hopp 137c8f
--- 494,504 ----
Karsten Hopp 137c8f
  #else
Karsten Hopp 137c8f
  	"-sniff",
Karsten Hopp 137c8f
  #endif
Karsten Hopp 137c8f
+ #ifdef STARTUPTIME
Karsten Hopp 137c8f
+ 	"+startuptime",
Karsten Hopp 137c8f
+ #else
Karsten Hopp 137c8f
+ 	"-startuptime",
Karsten Hopp 137c8f
+ #endif
Karsten Hopp 137c8f
  #ifdef FEAT_STL_OPT
Karsten Hopp 137c8f
  	"+statusline",
Karsten Hopp 137c8f
  #else
Karsten Hopp 137c8f
*** ../vim-7.2.285/src/version.c	2009-11-11 13:22:09.000000000 +0100
Karsten Hopp 137c8f
--- src/version.c	2009-11-11 14:17:28.000000000 +0100
Karsten Hopp 137c8f
***************
Karsten Hopp 137c8f
*** 678,679 ****
Karsten Hopp 137c8f
--- 683,686 ----
Karsten Hopp 137c8f
  {   /* Add new patch number below this line */
Karsten Hopp 137c8f
+ /**/
Karsten Hopp 137c8f
+     286,
Karsten Hopp 137c8f
  /**/
Karsten Hopp 137c8f
Karsten Hopp 137c8f
-- 
Karsten Hopp 137c8f
A fool must search for a greater fool to find admiration.
Karsten Hopp 137c8f
Karsten Hopp 137c8f
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 137c8f
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 137c8f
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 137c8f
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///