summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.2.223
blob: cac2126cfbcb2675d77c06b579c9bb0a6b569b9e (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
To: vim-dev@vim.org
Subject: Patch 7.2.223
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.223
Problem:    When a script is run with ":silent" it is not able to give warning
	    messages.
Solution:   Add the ":unsilent" command.
Files:	    runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c


*** ../vim-7.2.222/runtime/doc/various.txt	2008-08-09 19:36:54.000000000 +0200
--- runtime/doc/various.txt	2009-07-09 15:52:54.000000000 +0200
***************
*** 508,513 ****
--- 508,524 ----
  			messages though.  Use ":silent" in the command itself
  			to avoid that: ":silent menu .... :silent command".
  
+ 						*:uns* *:unsilent*
+ :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)
+ <
+ 
  						*:verb* *:verbose*
  :[count]verb[ose] {command}
  			Execute {command} with 'verbose' set to [count].  If
*** ../vim-7.2.222/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.222/src/ex_docmd.c	2009-07-01 20:18:43.000000000 +0200
--- src/ex_docmd.c	2009-07-09 15:24:03.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},
  };
*** ../vim-7.2.222/src/version.c	2009-07-01 20:18:43.000000000 +0200
--- src/version.c	2009-07-09 15:53:05.000000000 +0200
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     223,
  /**/

-- 
Q: How many legs does a giraffe have?
A: Eight: two in front, two behind, two on the left and two on the right

 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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    ///