home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.2 / 7.2.223 < prev    next >
Encoding:
Internet Message Format  |  2009-07-08  |  5.0 KB

  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.                           *:verb* *:verbose*
  36.   :[count]verb[ose] {command}
  37.               Execute {command} with 'verbose' set to [count].  If
  38. *** ../vim-7.2.222/src/ex_cmds.h    2008-11-09 13:43:25.000000000 +0100
  39. --- src/ex_cmds.h    2009-07-01 18:12:55.000000000 +0200
  40. ***************
  41. *** 991,996 ****
  42. --- 991,998 ----
  43.               BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
  44.   EX(CMD_unmenu,        "unmenu",    ex_menu,
  45.               BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
  46. + EX(CMD_unsilent,    "unsilent",    ex_wrongmodifier,
  47. +             NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
  48.   EX(CMD_update,        "update",    ex_update,
  49.               RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
  50.   EX(CMD_vglobal,        "vglobal",    ex_global,
  51. *** ../vim-7.2.222/src/ex_docmd.c    2009-07-01 20:18:43.000000000 +0200
  52. --- src/ex_docmd.c    2009-07-09 15:24:03.000000000 +0200
  53. ***************
  54. *** 1677,1684 ****
  55.       char_u        *errormsg = NULL;    /* error message */
  56.       exarg_T        ea;            /* Ex command arguments */
  57.       long        verbose_save = -1;
  58. !     int            save_msg_scroll = 0;
  59. !     int            did_silent = 0;
  60.       int            did_esilent = 0;
  61.   #ifdef HAVE_SANDBOX
  62.       int            did_sandbox = FALSE;
  63. --- 1677,1684 ----
  64.       char_u        *errormsg = NULL;    /* error message */
  65.       exarg_T        ea;            /* Ex command arguments */
  66.       long        verbose_save = -1;
  67. !     int            save_msg_scroll = msg_scroll;
  68. !     int            save_msg_silent = -1;
  69.       int            did_esilent = 0;
  70.   #ifdef HAVE_SANDBOX
  71.       int            did_sandbox = FALSE;
  72. ***************
  73. *** 1856,1864 ****
  74.               }
  75.               if (!checkforcmd(&ea.cmd, "silent", 3))
  76.                   break;
  77. !             ++did_silent;
  78.               ++msg_silent;
  79. -             save_msg_scroll = msg_scroll;
  80.               if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
  81.               {
  82.                   /* ":silent!", but not "silent !cmd" */
  83. --- 1856,1864 ----
  84.               }
  85.               if (!checkforcmd(&ea.cmd, "silent", 3))
  86.                   break;
  87. !             if (save_msg_silent == -1)
  88. !                 save_msg_silent = msg_silent;
  89.               ++msg_silent;
  90.               if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
  91.               {
  92.                   /* ":silent!", but not "silent !cmd" */
  93. ***************
  94. *** 1886,1891 ****
  95. --- 1886,1898 ----
  96.   #endif
  97.               continue;
  98.   
  99. +         case 'u':    if (!checkforcmd(&ea.cmd, "unsilent", 3))
  100. +                 break;
  101. +             if (save_msg_silent == -1)
  102. +                 save_msg_silent = msg_silent;
  103. +             msg_silent = 0;
  104. +             continue;
  105.           case 'v':    if (checkforcmd(&ea.cmd, "vertical", 4))
  106.               {
  107.   #ifdef FEAT_VERTSPLIT
  108. ***************
  109. *** 2684,2696 ****
  110.   
  111.       cmdmod = save_cmdmod;
  112.   
  113. !     if (did_silent > 0)
  114.       {
  115.       /* messages could be enabled for a serious error, need to check if the
  116.        * counters don't become negative */
  117. !     msg_silent -= did_silent;
  118. !     if (msg_silent < 0)
  119. !         msg_silent = 0;
  120.       emsg_silent -= did_esilent;
  121.       if (emsg_silent < 0)
  122.           emsg_silent = 0;
  123. --- 2691,2702 ----
  124.   
  125.       cmdmod = save_cmdmod;
  126.   
  127. !     if (save_msg_silent != -1)
  128.       {
  129.       /* messages could be enabled for a serious error, need to check if the
  130.        * counters don't become negative */
  131. !     if (!did_emsg)
  132. !         msg_silent = save_msg_silent;
  133.       emsg_silent -= did_esilent;
  134.       if (emsg_silent < 0)
  135.           emsg_silent = 0;
  136. ***************
  137. *** 2987,2992 ****
  138. --- 2993,2999 ----
  139.       {"silent", 3, FALSE},
  140.       {"tab", 3, TRUE},
  141.       {"topleft", 2, FALSE},
  142. +     {"unsilent", 3, FALSE},
  143.       {"verbose", 4, TRUE},
  144.       {"vertical", 4, FALSE},
  145.   };
  146. *** ../vim-7.2.222/src/version.c    2009-07-01 20:18:43.000000000 +0200
  147. --- src/version.c    2009-07-09 15:53:05.000000000 +0200
  148. ***************
  149. *** 678,679 ****
  150. --- 678,681 ----
  151.   {   /* Add new patch number below this line */
  152. + /**/
  153. +     223,
  154.   /**/
  155.  
  156. -- 
  157. Q: How many legs does a giraffe have?
  158. A: Eight: two in front, two behind, two on the left and two on the right
  159.  
  160.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  161. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  162. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  163.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  164.