Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.223
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.223
Karsten Hopp 81c285
Problem:    When a script is run with ":silent" it is not able to give warning
Karsten Hopp 81c285
	    messages.
Karsten Hopp 81c285
Solution:   Add the ":unsilent" command.
Karsten Hopp 81c285
Files:	    runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.222/runtime/doc/various.txt	2008-08-09 19:36:54.000000000 +0200
Karsten Hopp 81c285
--- runtime/doc/various.txt	2009-07-09 15:52:54.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 508,513 ****
Karsten Hopp 81c285
--- 508,524 ----
Karsten Hopp 81c285
  			messages though.  Use ":silent" in the command itself
Karsten Hopp 81c285
  			to avoid that: ":silent menu .... :silent command".
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+ 						*:uns* *:unsilent*
Karsten Hopp 81c285
+ :uns[ilent] {command}	Execute {command} not silently.  Only makes a
Karsten Hopp 81c285
+ 			difference when |:silent| was used to get to this
Karsten Hopp 81c285
+ 			command.
Karsten Hopp 81c285
+ 			Use this for giving a message even when |:silent| was
Karsten Hopp 81c285
+ 			used.  In this example |:silent| is used to avoid the
Karsten Hopp 81c285
+ 			message about reading the file and |:unsilent| to be
Karsten Hopp 81c285
+ 			able to list the first line of each file. >
Karsten Hopp 81c285
+     		:silent argdo unsilent echo expand('%') . ": " . getline(1)
Karsten Hopp 81c285
+ <
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
  						*:verb* *:verbose*
Karsten Hopp 81c285
  :[count]verb[ose] {command}
Karsten Hopp 81c285
  			Execute {command} with 'verbose' set to [count].  If
Karsten Hopp 81c285
*** ../vim-7.2.222/src/ex_cmds.h	2008-11-09 13:43:25.000000000 +0100
Karsten Hopp 81c285
--- src/ex_cmds.h	2009-07-01 18:12:55.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 991,996 ****
Karsten Hopp 81c285
--- 991,998 ----
Karsten Hopp 81c285
  			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
Karsten Hopp 81c285
  EX(CMD_unmenu,		"unmenu",	ex_menu,
Karsten Hopp 81c285
  			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
Karsten Hopp 81c285
+ EX(CMD_unsilent,	"unsilent",	ex_wrongmodifier,
Karsten Hopp 81c285
+ 			NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
Karsten Hopp 81c285
  EX(CMD_update,		"update",	ex_update,
Karsten Hopp 81c285
  			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
Karsten Hopp 81c285
  EX(CMD_vglobal,		"vglobal",	ex_global,
Karsten Hopp 81c285
*** ../vim-7.2.222/src/ex_docmd.c	2009-07-01 20:18:43.000000000 +0200
Karsten Hopp 81c285
--- src/ex_docmd.c	2009-07-09 15:24:03.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1677,1684 ****
Karsten Hopp 81c285
      char_u		*errormsg = NULL;	/* error message */
Karsten Hopp 81c285
      exarg_T		ea;			/* Ex command arguments */
Karsten Hopp 81c285
      long		verbose_save = -1;
Karsten Hopp 81c285
!     int			save_msg_scroll = 0;
Karsten Hopp 81c285
!     int			did_silent = 0;
Karsten Hopp 81c285
      int			did_esilent = 0;
Karsten Hopp 81c285
  #ifdef HAVE_SANDBOX
Karsten Hopp 81c285
      int			did_sandbox = FALSE;
Karsten Hopp 81c285
--- 1677,1684 ----
Karsten Hopp 81c285
      char_u		*errormsg = NULL;	/* error message */
Karsten Hopp 81c285
      exarg_T		ea;			/* Ex command arguments */
Karsten Hopp 81c285
      long		verbose_save = -1;
Karsten Hopp 81c285
!     int			save_msg_scroll = msg_scroll;
Karsten Hopp 81c285
!     int			save_msg_silent = -1;
Karsten Hopp 81c285
      int			did_esilent = 0;
Karsten Hopp 81c285
  #ifdef HAVE_SANDBOX
Karsten Hopp 81c285
      int			did_sandbox = FALSE;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1856,1864 ****
Karsten Hopp 81c285
  			}
Karsten Hopp 81c285
  			if (!checkforcmd(&ea.cmd, "silent", 3))
Karsten Hopp 81c285
  			    break;
Karsten Hopp 81c285
! 			++did_silent;
Karsten Hopp 81c285
  			++msg_silent;
Karsten Hopp 81c285
- 			save_msg_scroll = msg_scroll;
Karsten Hopp 81c285
  			if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
Karsten Hopp 81c285
  			{
Karsten Hopp 81c285
  			    /* ":silent!", but not "silent !cmd" */
Karsten Hopp 81c285
--- 1856,1864 ----
Karsten Hopp 81c285
  			}
Karsten Hopp 81c285
  			if (!checkforcmd(&ea.cmd, "silent", 3))
Karsten Hopp 81c285
  			    break;
Karsten Hopp 81c285
! 			if (save_msg_silent == -1)
Karsten Hopp 81c285
! 			    save_msg_silent = msg_silent;
Karsten Hopp 81c285
  			++msg_silent;
Karsten Hopp 81c285
  			if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
Karsten Hopp 81c285
  			{
Karsten Hopp 81c285
  			    /* ":silent!", but not "silent !cmd" */
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1886,1891 ****
Karsten Hopp 81c285
--- 1886,1898 ----
Karsten Hopp 81c285
  #endif
Karsten Hopp 81c285
  			continue;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+ 	    case 'u':	if (!checkforcmd(&ea.cmd, "unsilent", 3))
Karsten Hopp 81c285
+ 			    break;
Karsten Hopp 81c285
+ 			if (save_msg_silent == -1)
Karsten Hopp 81c285
+ 			    save_msg_silent = msg_silent;
Karsten Hopp 81c285
+ 			msg_silent = 0;
Karsten Hopp 81c285
+ 			continue;
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
  	    case 'v':	if (checkforcmd(&ea.cmd, "vertical", 4))
Karsten Hopp 81c285
  			{
Karsten Hopp 81c285
  #ifdef FEAT_VERTSPLIT
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 2684,2696 ****
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      cmdmod = save_cmdmod;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (did_silent > 0)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	/* messages could be enabled for a serious error, need to check if the
Karsten Hopp 81c285
  	 * counters don't become negative */
Karsten Hopp 81c285
! 	msg_silent -= did_silent;
Karsten Hopp 81c285
! 	if (msg_silent < 0)
Karsten Hopp 81c285
! 	    msg_silent = 0;
Karsten Hopp 81c285
  	emsg_silent -= did_esilent;
Karsten Hopp 81c285
  	if (emsg_silent < 0)
Karsten Hopp 81c285
  	    emsg_silent = 0;
Karsten Hopp 81c285
--- 2691,2702 ----
Karsten Hopp 81c285
  
Karsten Hopp 81c285
      cmdmod = save_cmdmod;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
!     if (save_msg_silent != -1)
Karsten Hopp 81c285
      {
Karsten Hopp 81c285
  	/* messages could be enabled for a serious error, need to check if the
Karsten Hopp 81c285
  	 * counters don't become negative */
Karsten Hopp 81c285
! 	if (!did_emsg)
Karsten Hopp 81c285
! 	    msg_silent = save_msg_silent;
Karsten Hopp 81c285
  	emsg_silent -= did_esilent;
Karsten Hopp 81c285
  	if (emsg_silent < 0)
Karsten Hopp 81c285
  	    emsg_silent = 0;
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 2987,2992 ****
Karsten Hopp 81c285
--- 2993,2999 ----
Karsten Hopp 81c285
      {"silent", 3, FALSE},
Karsten Hopp 81c285
      {"tab", 3, TRUE},
Karsten Hopp 81c285
      {"topleft", 2, FALSE},
Karsten Hopp 81c285
+     {"unsilent", 3, FALSE},
Karsten Hopp 81c285
      {"verbose", 4, TRUE},
Karsten Hopp 81c285
      {"vertical", 4, FALSE},
Karsten Hopp 81c285
  };
Karsten Hopp 81c285
*** ../vim-7.2.222/src/version.c	2009-07-01 20:18:43.000000000 +0200
Karsten Hopp 81c285
--- src/version.c	2009-07-09 15:53:05.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     223,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
Q: How many legs does a giraffe have?
Karsten Hopp 81c285
A: Eight: two in front, two behind, two on the left and two on the right
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///