]> git.pld-linux.org Git - packages/vim.git/blob - 7.2.223
- new
[packages/vim.git] / 7.2.223
1 To: vim-dev@vim.org
2 Subject: Patch 7.2.223
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.2.223
11 Problem:    When a script is run with ":silent" it is not able to give warning
12             messages.
13 Solution:   Add the ":unsilent" command.
14 Files:      runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c
15
16
17 *** ../vim-7.2.222/runtime/doc/various.txt      2008-08-09 19:36:54.000000000 +0200
18 --- runtime/doc/various.txt     2009-07-09 15:52:54.000000000 +0200
19 ***************
20 *** 508,513 ****
21 --- 508,524 ----
22                         messages though.  Use ":silent" in the command itself
23                         to avoid that: ":silent menu .... :silent command".
24   
25 +                                               *:uns* *:unsilent*
26 + :uns[ilent] {command} Execute {command} not silently.  Only makes a
27 +                       difference when |:silent| was used to get to this
28 +                       command.
29 +                       Use this for giving a message even when |:silent| was
30 +                       used.  In this example |:silent| is used to avoid the
31 +                       message about reading the file and |:unsilent| to be
32 +                       able to list the first line of each file. >
33 +               :silent argdo unsilent echo expand('%') . ": " . getline(1)
34 + <
35
36                                                 *:verb* *:verbose*
37   :[count]verb[ose] {command}
38                         Execute {command} with 'verbose' set to [count].  If
39 *** ../vim-7.2.222/src/ex_cmds.h        2008-11-09 13:43:25.000000000 +0100
40 --- src/ex_cmds.h       2009-07-01 18:12:55.000000000 +0200
41 ***************
42 *** 991,996 ****
43 --- 991,998 ----
44                         BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
45   EX(CMD_unmenu,                "unmenu",       ex_menu,
46                         BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
47 + EX(CMD_unsilent,      "unsilent",     ex_wrongmodifier,
48 +                       NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
49   EX(CMD_update,                "update",       ex_update,
50                         RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
51   EX(CMD_vglobal,               "vglobal",      ex_global,
52 *** ../vim-7.2.222/src/ex_docmd.c       2009-07-01 20:18:43.000000000 +0200
53 --- src/ex_docmd.c      2009-07-09 15:24:03.000000000 +0200
54 ***************
55 *** 1677,1684 ****
56       char_u            *errormsg = NULL;       /* error message */
57       exarg_T           ea;                     /* Ex command arguments */
58       long              verbose_save = -1;
59 !     int                       save_msg_scroll = 0;
60 !     int                       did_silent = 0;
61       int                       did_esilent = 0;
62   #ifdef HAVE_SANDBOX
63       int                       did_sandbox = FALSE;
64 --- 1677,1684 ----
65       char_u            *errormsg = NULL;       /* error message */
66       exarg_T           ea;                     /* Ex command arguments */
67       long              verbose_save = -1;
68 !     int                       save_msg_scroll = msg_scroll;
69 !     int                       save_msg_silent = -1;
70       int                       did_esilent = 0;
71   #ifdef HAVE_SANDBOX
72       int                       did_sandbox = FALSE;
73 ***************
74 *** 1856,1864 ****
75                         }
76                         if (!checkforcmd(&ea.cmd, "silent", 3))
77                             break;
78 !                       ++did_silent;
79                         ++msg_silent;
80 -                       save_msg_scroll = msg_scroll;
81                         if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
82                         {
83                             /* ":silent!", but not "silent !cmd" */
84 --- 1856,1864 ----
85                         }
86                         if (!checkforcmd(&ea.cmd, "silent", 3))
87                             break;
88 !                       if (save_msg_silent == -1)
89 !                           save_msg_silent = msg_silent;
90                         ++msg_silent;
91                         if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
92                         {
93                             /* ":silent!", but not "silent !cmd" */
94 ***************
95 *** 1886,1891 ****
96 --- 1886,1898 ----
97   #endif
98                         continue;
99   
100 +           case 'u':   if (!checkforcmd(&ea.cmd, "unsilent", 3))
101 +                           break;
102 +                       if (save_msg_silent == -1)
103 +                           save_msg_silent = msg_silent;
104 +                       msg_silent = 0;
105 +                       continue;
106
107             case 'v':   if (checkforcmd(&ea.cmd, "vertical", 4))
108                         {
109   #ifdef FEAT_VERTSPLIT
110 ***************
111 *** 2684,2696 ****
112   
113       cmdmod = save_cmdmod;
114   
115 !     if (did_silent > 0)
116       {
117         /* messages could be enabled for a serious error, need to check if the
118          * counters don't become negative */
119 !       msg_silent -= did_silent;
120 !       if (msg_silent < 0)
121 !           msg_silent = 0;
122         emsg_silent -= did_esilent;
123         if (emsg_silent < 0)
124             emsg_silent = 0;
125 --- 2691,2702 ----
126   
127       cmdmod = save_cmdmod;
128   
129 !     if (save_msg_silent != -1)
130       {
131         /* messages could be enabled for a serious error, need to check if the
132          * counters don't become negative */
133 !       if (!did_emsg)
134 !           msg_silent = save_msg_silent;
135         emsg_silent -= did_esilent;
136         if (emsg_silent < 0)
137             emsg_silent = 0;
138 ***************
139 *** 2987,2992 ****
140 --- 2993,2999 ----
141       {"silent", 3, FALSE},
142       {"tab", 3, TRUE},
143       {"topleft", 2, FALSE},
144 +     {"unsilent", 3, FALSE},
145       {"verbose", 4, TRUE},
146       {"vertical", 4, FALSE},
147   };
148 *** ../vim-7.2.222/src/version.c        2009-07-01 20:18:43.000000000 +0200
149 --- src/version.c       2009-07-09 15:53:05.000000000 +0200
150 ***************
151 *** 678,679 ****
152 --- 678,681 ----
153   {   /* Add new patch number below this line */
154 + /**/
155 +     223,
156   /**/
157
158 -- 
159 Q: How many legs does a giraffe have?
160 A: Eight: two in front, two behind, two on the left and two on the right
161
162  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
163 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
164 \\\        download, build and distribute -- http://www.A-A-P.org        ///
165  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.05429 seconds and 3 git commands to generate.