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 / 6.0.232 < prev    next >
Encoding:
Internet Message Format  |  2002-02-17  |  5.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.232
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.232
  11. Problem:    "vim --version" prints on stderr while "vim --help" prints on
  12.         stdout.
  13. Solution:   Make "vim --version" use stdout.
  14. Files:        runtime/doc/starting.txt, src/globals.h, src/main.c, src/message.c
  15.  
  16.  
  17. *** ../vim60.231/runtime/doc/starting.txt    Tue Sep 25 21:40:38 2001
  18. --- runtime/doc/starting.txt    Mon Feb 18 12:04:33 2002
  19. ***************
  20. *** 1,4 ****
  21. ! *starting.txt*  For Vim version 6.0.  Last change: 2001 Sep 20
  22.   
  23.   
  24.             VIM REFERENCE MANUAL    by Bram Moolenaar
  25. --- 1,4 ----
  26. ! *starting.txt*  For Vim version 6.0.  Last change: 2002 Feb 18
  27.   
  28.   
  29.             VIM REFERENCE MANUAL    by Bram Moolenaar
  30. ***************
  31. *** 122,131 ****
  32. --- 122,133 ----
  33.   
  34.   --help                            *-h* *--help*
  35.   -h        Give usage (help) message and exit.  {not in Vi}
  36. +         See |info-message| about capturing the text.
  37.   
  38.                               *--version*
  39.   --version    Print version information and exit.  Same output as for
  40.           |:version| command.  {not in Vi}
  41. +         See |info-message| about capturing the text.
  42.   
  43.                               *--noplugin*
  44.   --noplugin    Skip loading plugins.  Resets the 'loadplugins' option.
  45. ***************
  46. *** 860,865 ****
  47. --- 862,890 ----
  48.   redrawn in any way.  To see the message again, use the ":intro" command (if
  49.   there is not enough room, you will see only part of it).
  50.      To avoid the intro message on startup, add the 'I' flag to 'shortmess'.
  51. +                             *info-message*
  52. + The |--help| and |--version| arguments cause Vim to print a message and then
  53. + exit.  Normally the message is send to stdout, thus can be redirected to a
  54. + file with: >
  55. +     vim --help >file
  56. + From inside Vim: >
  57. +     :read !vim --help
  58. + When using gvim, it detects that it might have been started from the desktop,
  59. + without a terminal to show messages on.  This is detected when both stdout and
  60. + stderr are not a tty.  This breaks the ":read" command, as used in the example
  61. + above.  To make it work again, set 'shellredir' to ">" instead of the default
  62. + ">&": >
  63. +     :set shellredir=>
  64. +     :read !gvim --help
  65. + This still won't work for systems where gvim does not use stdout at all
  66. + though.
  67.   
  68.   ==============================================================================
  69.   5. $VIM and $VIMRUNTIME
  70. *** ../vim60.231/src/globals.h    Sun Feb 17 23:22:34 2002
  71. --- src/globals.h    Mon Feb 18 11:46:05 2002
  72. ***************
  73. *** 139,144 ****
  74. --- 139,145 ----
  75.   EXTERN int    msg_nowait INIT(= FALSE);   /* don't wait for this msg */
  76.   EXTERN int    emsg_off INIT(= 0);        /* don't display errors for now,
  77.                              unless 'debug' is set. */
  78. + EXTERN int    info_message INIT(= FALSE); /* printing informative message */
  79.   #ifdef FEAT_EVAL
  80.   EXTERN int    emsg_skip INIT(= 0);        /* don't display errors for
  81.                              expression that is skipped */
  82. *** ../vim60.231/src/main.c    Thu Feb  7 11:35:07 2002
  83. --- src/main.c    Mon Feb 18 11:54:08 2002
  84. ***************
  85. *** 521,526 ****
  86. --- 521,527 ----
  87.           else if (STRICMP(argv[0] + argv_idx, "version") == 0)
  88.           {
  89.               Columns = 80;    /* need to init Columns */
  90. +             info_message = TRUE; /* use mch_msg(), not mch_errmsg() */
  91.               list_version();
  92.               mch_exit(1);
  93.           }
  94. *** ../vim60.231/src/message.c    Sun Feb  3 17:31:23 2002
  95. --- src/message.c    Mon Feb 18 11:46:11 2002
  96. ***************
  97. *** 1545,1551 ****
  98.   #endif
  99.               *p++ = *s;
  100.           *p = '\0';
  101. !         mch_errmsg((char *)buf);
  102.           }
  103.   
  104.           /* primitive way to compute the current column */
  105. --- 1545,1554 ----
  106.   #endif
  107.               *p++ = *s;
  108.           *p = '\0';
  109. !         if (info_message)    /* informative message, not an error */
  110. !             mch_msg((char *)buf);
  111. !         else
  112. !             mch_errmsg((char *)buf);
  113.           }
  114.   
  115.           /* primitive way to compute the current column */
  116. ***************
  117. *** 1827,1834 ****
  118.   #endif
  119.   
  120.   /*
  121. !  * collect error messages until the GUI has started and they can be
  122. !  * displayed in a message box.
  123.    */
  124.       void
  125.   mch_errmsg(str)
  126. --- 1830,1838 ----
  127.   #endif
  128.   
  129.   /*
  130. !  * Give an error message.  To be used when the screen hasn't been initialized
  131. !  * yet.  When stderr can't be used, collect error messages until the GUI has
  132. !  * started and they can be displayed in a message box.
  133.    */
  134.       void
  135.   mch_errmsg(str)
  136. ***************
  137. *** 1890,1895 ****
  138. --- 1894,1904 ----
  139.       }
  140.   }
  141.   
  142. + /*
  143. +  * Give a message.  To be used when the screen hasn't been initialized yet.
  144. +  * When there is no tty, collect messages until the GUI has started and they
  145. +  * can be displayed in a message box.
  146. +  */
  147.       void
  148.   mch_msg(str)
  149.       char    *str;
  150. *** ../vim60.231/src/version.c    Mon Feb 18 11:29:13 2002
  151. --- src/version.c    Mon Feb 18 12:05:40 2002
  152. ***************
  153. *** 608,609 ****
  154. --- 608,611 ----
  155.   {   /* Add new patch number below this line */
  156. + /**/
  157. +     232,
  158.   /**/
  159.  
  160. -- 
  161. Mynd you, m00se bites Kan be pretty nasti ...
  162.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  163.  
  164.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  165. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  166. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  167.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  168.