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.1.384 < prev    next >
Encoding:
Internet Message Format  |  2003-03-08  |  4.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.384
  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.1.384
  11. Problem:    It is not possible to find if a certain patch has been included.
  12.         (Lubomir Host)
  13. Solution:   Support using has() to check if a patch was included.
  14. Files:        runtime/doc/eval.txt, src/eval.c, src/proto/version.pro,
  15.         src/version.c
  16.  
  17.  
  18. *** ../vim61.383/runtime/doc/eval.txt    Tue Jan 28 22:17:41 2003
  19. --- runtime/doc/eval.txt    Sun Mar  9 22:21:25 2003
  20. ***************
  21. *** 1,4 ****
  22. ! *eval.txt*      For Vim version 6.1.  Last change: 2003 Jan 28
  23.   
  24.   
  25.             VIM REFERENCE MANUAL    by Bram Moolenaar
  26. --- 1,4 ----
  27. ! *eval.txt*      For Vim version 6.1.  Last change: 2003 Mar 09
  28.   
  29.   
  30.             VIM REFERENCE MANUAL    by Bram Moolenaar
  31. ***************
  32. *** 730,735 ****
  33. --- 734,744 ----
  34.           minor version number.  Version 5.0 is 500.  Version 5.1 (5.01)
  35.           is 501.  Read-only.  "version" also works, for backwards
  36.           compatibility.
  37. +         Use |has()| to check if a certain patch was included, e.g.: >
  38. +             if has("patch123")
  39. + <        Note that patch numbers are specific to the version, thus both
  40. +         version 5.0 and 5.1 may have a patch 123, but these are
  41. +         completely different.
  42.   
  43.                       *v:warningmsg* *warningmsg-variable*
  44.   v:warningmsg    Last given warning message.  It's allowed to set this variable.
  45. ***************
  46. *** 2451,2463 ****
  47.   <
  48.   
  49.                               *feature-list*
  50. ! There are two types of features:
  51.   1.  Features that are only supported when they have been enabled when Vim
  52.       was compiled |+feature-list|.  Example: >
  53.       :if has("cindent")
  54.   2.  Features that are only supported when certain conditions have been met.
  55.       Example: >
  56.       :if has("gui_running")
  57.   
  58.   all_builtin_terms    Compiled with all builtin terminals enabled.
  59.   amiga            Amiga version of Vim.
  60. --- 2493,2508 ----
  61.   <
  62.   
  63.                               *feature-list*
  64. ! There are three types of features:
  65.   1.  Features that are only supported when they have been enabled when Vim
  66.       was compiled |+feature-list|.  Example: >
  67.       :if has("cindent")
  68.   2.  Features that are only supported when certain conditions have been met.
  69.       Example: >
  70.       :if has("gui_running")
  71. + 3.  Included patches.  First check |v:version| for the version of Vim.
  72. +     Then the "patch123" feature means that patch 123 has been included for
  73. +     this version.
  74.   
  75.   all_builtin_terms    Compiled with all builtin terminals enabled.
  76.   amiga            Amiga version of Vim.
  77. *** ../vim61.383/src/eval.c    Mon Feb 24 11:29:14 2003
  78. --- src/eval.c    Sun Mar  9 22:15:22 2003
  79. ***************
  80. *** 4572,4578 ****
  81.   
  82.       if (n == FALSE)
  83.       {
  84. !     if (STRICMP(name, "vim_starting") == 0)
  85.           n = (starting != 0);
  86.   #ifdef DYNAMIC_TCL
  87.       else if (STRICMP(name, "tcl") == 0)
  88. --- 4576,4584 ----
  89.   
  90.       if (n == FALSE)
  91.       {
  92. !     if (STRNICMP(name, "patch", 5) == 0)
  93. !         n = has_patch(atoi(name + 5));
  94. !     else if (STRICMP(name, "vim_starting") == 0)
  95.           n = (starting != 0);
  96.   #ifdef DYNAMIC_TCL
  97.       else if (STRICMP(name, "tcl") == 0)
  98. *** ../vim61.383/src/proto/version.pro    Fri Mar 22 21:41:24 2002
  99. --- src/proto/version.pro    Sun Mar  9 22:14:42 2003
  100. ***************
  101. *** 1,6 ****
  102. --- 1,7 ----
  103.   /* version.c */
  104.   void make_version __ARGS((void));
  105.   int highest_patch __ARGS((void));
  106. + int has_patch __ARGS((int n));
  107.   void ex_version __ARGS((exarg_T *eap));
  108.   void list_version __ARGS((void));
  109.   void intro_message __ARGS((int colon));
  110. *** ../vim61.383/src/version.c    Sun Mar  9 17:49:38 2003
  111. --- src/version.c    Sun Mar  9 22:22:27 2003
  112. ***************
  113. *** 613,614 ****
  114. --- 613,616 ----
  115.   {   /* Add new patch number below this line */
  116. + /**/
  117. +     384,
  118.   /**/
  119. ***************
  120. *** 1391,1396 ****
  121. --- 1393,1413 ----
  122.       if (included_patches[i] > h)
  123.           h = included_patches[i];
  124.       return h;
  125. + }
  126. + /*
  127. +  * Return TRUE if patch "n" has been included.
  128. +  */
  129. +     int
  130. + has_patch(n)
  131. +     int        n;
  132. + {
  133. +     int        i;
  134. +     for (i = 0; included_patches[i] != 0; ++i)
  135. +     if (included_patches[i] == n)
  136. +         return TRUE;
  137. +     return FALSE;
  138.   }
  139.   
  140.       void
  141.  
  142. -- 
  143. hundred-and-one symptoms of being an internet addict:
  144. 11. You find yourself typing "com" after every period when using a word
  145.     processor.com
  146.  
  147.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  148. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  149. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  150.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  151.