Any comments on adding the ":unsilent" command modifier?
:uns[ilent] {command}
Execute {command} not silently. Only makes a
difference when |:silent| was used to get to this
command.
Use this for giving a message even when |:silent| was
used. In this example |:silent| is used to avoid the
message about reading the file and |:unsilent| to be
able to list the first line of each file. >
:silent argdo unsilent echo expand('%') . ": " . getline(1)
*** ../vim-7.2.221/src/ex_cmds.h 2008-11-09 13:43:25.000000000 +0100
--- src/ex_cmds.h 2009-07-01 18:12:55.000000000 +0200
***************
*** 991,996 ****
--- 991,998 ----
BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_unmenu, "unmenu", ex_menu,
BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+ EX(CMD_unsilent, "unsilent", ex_wrongmodifier,
+ NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
EX(CMD_update, "update", ex_update,
RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
EX(CMD_vglobal, "vglobal", ex_global,
*** ../vim-7.2.221/src/ex_docmd.c 2009-05-16 17:29:37.000000000 +0200
--- src/ex_docmd.c 2009-07-01 18:48:33.000000000 +0200
***************
*** 1677,1684 ****
char_u *errormsg = NULL; /* error message */
exarg_T ea; /* Ex command arguments */
long verbose_save = -1;
! int save_msg_scroll = 0;
! int did_silent = 0;
int did_esilent = 0;
#ifdef HAVE_SANDBOX
int did_sandbox = FALSE;
--- 1677,1684 ----
char_u *errormsg = NULL; /* error message */
exarg_T ea; /* Ex command arguments */
long verbose_save = -1;
! int save_msg_scroll = msg_scroll;
! int save_msg_silent = -1;
int did_esilent = 0;
#ifdef HAVE_SANDBOX
int did_sandbox = FALSE;
***************
*** 1856,1864 ****
}
if (!checkforcmd(&ea.cmd, "silent", 3))
break;
! ++did_silent;
++msg_silent;
- save_msg_scroll = msg_scroll;
if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
{
/* ":silent!", but not "silent !cmd" */
--- 1856,1864 ----
}
if (!checkforcmd(&ea.cmd, "silent", 3))
break;
! if (save_msg_silent == -1)
! save_msg_silent = msg_silent;
++msg_silent;
if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
{
/* ":silent!", but not "silent !cmd" */
***************
*** 1886,1891 ****
--- 1886,1898 ----
#endif
continue;
+ case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
+ break;
+ if (save_msg_silent == -1)
+ save_msg_silent = msg_silent;
+ msg_silent = 0;
+ continue;
+
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
{
#ifdef FEAT_VERTSPLIT
***************
*** 2684,2696 ****
cmdmod = save_cmdmod;
! if (did_silent > 0)
{
/* messages could be enabled for a serious error, need to check if the
* counters don't become negative */
! msg_silent -= did_silent;
! if (msg_silent < 0)
! msg_silent = 0;
emsg_silent -= did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
--- 2691,2702 ----
cmdmod = save_cmdmod;
! if (save_msg_silent != -1)
{
/* messages could be enabled for a serious error, need to check if the
* counters don't become negative */
! if (!did_emsg)
! msg_silent = save_msg_silent;
emsg_silent -= did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
***************
*** 2987,2992 ****
--- 2993,2999 ----
{"silent", 3, FALSE},
{"tab", 3, TRUE},
{"topleft", 2, FALSE},
+ {"unsilent", 3, FALSE},
{"verbose", 4, TRUE},
{"vertical", 4, FALSE},
};
--
hundred-and-one symptoms of being an internet addict:
42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---