Changeset 734faf3 in clfs-sysroot


Ignore:
Timestamp:
Jul 26, 2009, 11:16:51 AM (15 years ago)
Author:
Joe Ciccone <jciccone@…>
Branches:
master
Children:
63c7a69
Parents:
c6124b0
Message:

Updated the Vim Branch Update patch to -19.

Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • BOOK/introduction/common/changelog.xml

    rc6124b0 r734faf3  
    4040      <para>July 26, 2009</para>
    4141      <itemizedlist>
     42        <listitem>
     43          <para>[jciccone] - Updated the Vim Branch Update Patch to -19.</para>
     44        </listitem>
    4245        <listitem>
    4346          <para>[jciccone] - Updated the Ncurses Branch Update Patch to
  • BOOK/patches.ent

    rc6124b0 r734faf3  
    9393<!ENTITY texinfo-new_compressors-patch-size "2 KB">
    9494
    95 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-15.patch">
    96 <!ENTITY vim-branch_update-patch-md5 "ac3194162931d0f4e38db05da9933377">
    97 <!ENTITY vim-branch_update-patch-size "636 KB">
     95<!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-19.patch">
     96<!ENTITY vim-branch_update-patch-md5 "6b17e03f6191a79f90666c25af0d758b">
     97<!ENTITY vim-branch_update-patch-size "1,822 KB">
    9898
    9999<!ENTITY zlib-fpic-patch "zlib-&zlib-version;-fPIC-2.patch">
  • patches/vim-7.2-branch_update-19.patch

    rc6124b0 r734faf3  
    11Submitted By: Jim Gifford (jim at cross-lfs dot org)
    2 Date: 06-05-2009
     2Date: 07-19-2009
    33Initial Package Version: 7.2
    44Origin: Upstream
    55Upstream Status: Applied
    6 Description: Contains all upstream patches up to 7.2.196
     6Description: Contains all upstream patches up to 7.2.234
    77             The following patches were skipped
    8              007 036 041 049 071 072 074 088 089 093 101 138 150 172 173 191 194
     8             007 036 041 049 071 072 074 088 089 093 101 138 150 172 173 191 194 204 205 212 216 219 233
    99
    1010diff -Naur vim72.orig/Filelist vim72/Filelist
    1111--- vim72.orig/Filelist 2008-07-06 11:02:23.000000000 -0700
    12 +++ vim72/Filelist      2009-06-05 14:26:12.000000000 -0700
     12+++ vim72/Filelist      2009-07-19 15:17:20.000000000 -0700
    1313@@ -285,6 +285,7 @@
    1414                src/proto/os_win32.pro \
     
    3131diff -Naur vim72.orig/runtime/doc/cmdline.txt vim72/runtime/doc/cmdline.txt
    3232--- vim72.orig/runtime/doc/cmdline.txt  2008-08-09 07:22:59.000000000 -0700
    33 +++ vim72/runtime/doc/cmdline.txt       2009-06-05 14:16:09.000000000 -0700
     33+++ vim72/runtime/doc/cmdline.txt       2009-07-19 15:19:00.000000000 -0700
    3434@@ -1,4 +1,4 @@
    3535-*cmdline.txt*   For Vim version 7.2.  Last change: 2008 Jul 29
     
    5050                Implementation detail: When using the |expression| register
    5151                and invoking setcmdpos(), this sets the position before
    52 @@ -730,19 +735,29 @@
     52@@ -436,13 +441,20 @@
     53 those files with an extension that is in the 'suffixes' option are ignored.
     54 The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
     55 in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
     56-It is impossible to ignore suffixes with two dots.  Examples:
     57+
     58+An empty entry, two consecutive commas, match a file name that does not
     59+contain a ".", thus has no suffix.  This is useful to ignore "prog" and prefer
     60+"prog.c".
     61+
     62+Examples:
     63 
     64   pattern:     files:                          match:  ~
     65    test*       test.c test.h test.o            test.c
     66    test*       test.h test.o                   test.h and test.o
     67    test*       test.i test.h test.c            test.i and test.c
     68 
     69+It is impossible to ignore suffixes with two dots.
     70+
     71 If there is more than one matching file (after ignoring the ones matching
     72 the 'suffixes' option) the first file name is inserted.  You can see that
     73 there is only one match when you type 'wildchar' twice and the completed
     74@@ -730,19 +742,29 @@
    5375 In Ex commands, at places where a file name can be used, the following
    5476 characters have a special meaning.  These can also be used in the expression
     
    90112diff -Naur vim72.orig/runtime/doc/eval.txt vim72/runtime/doc/eval.txt
    91113--- vim72.orig/runtime/doc/eval.txt     2008-08-09 07:22:59.000000000 -0700
    92 +++ vim72/runtime/doc/eval.txt  2009-06-05 14:23:32.000000000 -0700
     114+++ vim72/runtime/doc/eval.txt  2009-07-19 15:15:05.000000000 -0700
    93115@@ -1,4 +1,4 @@
    94116-*eval.txt*     For Vim version 7.2.  Last change: 2008 Aug 09
     
    226248diff -Naur vim72.orig/runtime/doc/if_cscop.txt vim72/runtime/doc/if_cscop.txt
    227249--- vim72.orig/runtime/doc/if_cscop.txt 2008-08-09 07:22:59.000000000 -0700
    228 +++ vim72/runtime/doc/if_cscop.txt      2009-06-05 14:23:20.000000000 -0700
     250+++ vim72/runtime/doc/if_cscop.txt      2009-07-19 15:18:44.000000000 -0700
    229251@@ -1,4 +1,4 @@
    230252-*if_cscop.txt*  For Vim version 7.2.  Last change: 2005 Mar 29
     
    258280            :cscope find 0 DEFAULT_TERM
    259281 <
     282@@ -344,13 +355,8 @@
     283 The DJGPP-built version from http://cscope.sourceforge.net is known to not
     284 work with Vim.
     285 
     286-There are a couple of hard-coded limitations:
     287-
     288-    1. The maximum number of cscope connections allowed is 8.  Do you
     289-    really need more?
     290-
     291-    2. Doing a |:tjump| when |:cstag| searches the tag files is not
     292-    configurable (e.g., you can't do a tselect instead).
     293+Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files
     294+is not configurable (e.g., you can't do a tselect instead).
     295 
     296 ==============================================================================
     297 6. Suggested usage                                     *cscope-suggestions*
    260298diff -Naur vim72.orig/runtime/doc/netbeans.txt vim72/runtime/doc/netbeans.txt
    261299--- vim72.orig/runtime/doc/netbeans.txt 2008-08-09 07:22:59.000000000 -0700
    262 +++ vim72/runtime/doc/netbeans.txt      2009-06-05 14:19:24.000000000 -0700
     300+++ vim72/runtime/doc/netbeans.txt      2009-07-19 15:12:02.000000000 -0700
    263301@@ -1,4 +1,4 @@
    264302-*netbeans.txt*  For Vim version 7.2.  Last change: 2008 Jun 28
     
    282320diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt
    283321--- vim72.orig/runtime/doc/options.txt  2008-08-09 07:22:59.000000000 -0700
    284 +++ vim72/runtime/doc/options.txt       2009-06-05 14:21:21.000000000 -0700
     322+++ vim72/runtime/doc/options.txt       2009-07-19 15:17:33.000000000 -0700
    285323@@ -1,4 +1,4 @@
    286324-*options.txt*  For Vim version 7.2.  Last change: 2008 Aug 06
     
    289327 
    290328                  VIM REFERENCE MANUAL    by Bram Moolenaar
    291 @@ -4175,9 +4175,6 @@
     329@@ -1443,6 +1443,14 @@
     330        autoselectml    Like "autoselect", but for the modeless selection
     331                        only.  Compare to the 'A' flag in 'guioptions'.
     332 
     333+       html            When the clipboard contains HTML, use this when
     334+                       pasting.  When putting text on the clipboard, mark it
     335+                       as HTML.  This works to copy rendered HTML from
     336+                       Firefox, paste it as raw HTML in Vim, select the HTML
     337+                       in Vim and paste it in a rich edit box in Firefox.
     338+                       Only supported for GTK version 2 and later.
     339+                       Only available with the |+multi_byte| feature.
     340+
     341        exclude:{pattern}
     342                        Defines a pattern that is matched against the name of
     343                        the terminal 'term'.  If there is a match, no
     344@@ -4175,9 +4183,6 @@
    292345        be able to execute Normal mode commands.
    293346        This is the opposite of the 'keymap' option, where characters are
     
    300353            :set langmap=ΑA,ΒB,ΚC,ΔD,ΕE,ΊF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,΀T,ΘU,ΩV,WW,ΧX,Î¥Y,ΖZ,αa,βb,ψc,ÎŽd,εe,φf,γg,ηh,ιi,Οj,κk,λl,ÎŒm,Îœn,οo,πp,qq,ρr,σs,τt,Ξu,ωv,ςw,χx,Ï
    301354y,ζz
    302 @@ -7472,7 +7469,9 @@
     355@@ -7472,7 +7477,9 @@
    303356                        {not available when compiled without the |+wildignore|
    304357                        feature}
     
    313366diff -Naur vim72.orig/runtime/doc/spell.txt vim72/runtime/doc/spell.txt
    314367--- vim72.orig/runtime/doc/spell.txt    2008-08-09 07:23:00.000000000 -0700
    315 +++ vim72/runtime/doc/spell.txt 2009-06-05 14:18:12.000000000 -0700
     368+++ vim72/runtime/doc/spell.txt 2009-07-19 15:11:11.000000000 -0700
    316369@@ -1,4 +1,4 @@
    317370-*spell.txt*    For Vim version 7.2.  Last change: 2008 Jun 21
     
    443496diff -Naur vim72.orig/runtime/doc/starting.txt vim72/runtime/doc/starting.txt
    444497--- vim72.orig/runtime/doc/starting.txt 2008-08-09 07:23:00.000000000 -0700
    445 +++ vim72/runtime/doc/starting.txt      2009-06-05 14:16:09.000000000 -0700
     498+++ vim72/runtime/doc/starting.txt      2009-07-19 15:09:53.000000000 -0700
    446499@@ -1,4 +1,4 @@
    447500-*starting.txt*  For Vim version 7.2.  Last change: 2008 Jun 21
     
    505558diff -Naur vim72.orig/runtime/doc/usr_21.txt vim72/runtime/doc/usr_21.txt
    506559--- vim72.orig/runtime/doc/usr_21.txt   2008-08-09 07:23:01.000000000 -0700
    507 +++ vim72/runtime/doc/usr_21.txt        2009-06-05 14:16:09.000000000 -0700
     560+++ vim72/runtime/doc/usr_21.txt        2009-07-19 15:09:53.000000000 -0700
    508561@@ -1,4 +1,4 @@
    509562-*usr_21.txt*   For Vim version 7.2.  Last change: 2007 May 01
     
    570623 
    571624 You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
     625diff -Naur vim72.orig/runtime/doc/various.txt vim72/runtime/doc/various.txt
     626--- vim72.orig/runtime/doc/various.txt  2008-08-09 07:23:01.000000000 -0700
     627+++ vim72/runtime/doc/various.txt       2009-07-19 15:18:31.000000000 -0700
     628@@ -508,6 +508,17 @@
     629                        messages though.  Use ":silent" in the command itself
     630                        to avoid that: ":silent menu .... :silent command".
     631 
     632+                                               *:uns* *:unsilent*
     633+:uns[ilent] {command}  Execute {command} not silently.  Only makes a
     634+                       difference when |:silent| was used to get to this
     635+                       command.
     636+                       Use this for giving a message even when |:silent| was
     637+                       used.  In this example |:silent| is used to avoid the
     638+                       message about reading the file and |:unsilent| to be
     639+                       able to list the first line of each file. >
     640+               :silent argdo unsilent echo expand('%') . ": " . getline(1)
     641+<
     642+
     643                                                *:verb* *:verbose*
     644 :[count]verb[ose] {command}
     645                        Execute {command} with 'verbose' set to [count].  If
    572646diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim
    573647--- vim72.orig/runtime/scripts.vim      2008-08-08 15:27:21.000000000 -0700
    574 +++ vim72/runtime/scripts.vim   2009-06-05 14:14:19.000000000 -0700
     648+++ vim72/runtime/scripts.vim   2009-07-19 15:08:47.000000000 -0700
    575649@@ -234,6 +234,10 @@
    576650   elseif s:line1 =~ '\<DTD\s\+XHTML\s'
     
    586660diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure
    587661--- vim72.orig/src/auto/configure       2008-07-24 05:40:36.000000000 -0700
    588 +++ vim72/src/auto/configure    2009-06-05 14:25:31.000000000 -0700
     662+++ vim72/src/auto/configure    2009-07-19 15:16:46.000000000 -0700
    589663@@ -1,6 +1,6 @@
    590664 #! /bin/sh
     
    19462020diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c
    19472021--- vim72.orig/src/buffer.c     2008-08-06 04:00:48.000000000 -0700
    1948 +++ vim72/src/buffer.c  2009-06-05 14:25:15.000000000 -0700
     2022+++ vim72/src/buffer.c  2009-07-19 15:16:33.000000000 -0700
    19492023@@ -44,6 +44,7 @@
    19502024 #ifdef FEAT_TITLE
     
    24732547diff -Naur vim72.orig/src/charset.c vim72/src/charset.c
    24742548--- vim72.orig/src/charset.c    2008-07-24 07:59:44.000000000 -0700
    2475 +++ vim72/src/charset.c 2009-06-05 14:24:27.000000000 -0700
     2549+++ vim72/src/charset.c 2009-07-19 15:15:54.000000000 -0700
    24762550@@ -17,7 +17,7 @@
    24772551 static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp));
     
    25622636diff -Naur vim72.orig/src/config.h.in vim72/src/config.h.in
    25632637--- vim72.orig/src/config.h.in  2008-06-21 08:01:41.000000000 -0700
    2564 +++ vim72/src/config.h.in       2009-06-05 14:25:31.000000000 -0700
     2638+++ vim72/src/config.h.in       2009-07-19 15:16:46.000000000 -0700
    25652639@@ -36,6 +36,9 @@
    25662640 /* Defined to the size of an int */
     
    25852659diff -Naur vim72.orig/src/configure.in vim72/src/configure.in
    25862660--- vim72.orig/src/configure.in 2008-07-24 05:40:26.000000000 -0700
    2587 +++ vim72/src/configure.in      2009-06-05 14:25:31.000000000 -0700
     2661+++ vim72/src/configure.in      2009-07-19 15:16:46.000000000 -0700
    25882662@@ -1193,6 +1193,28 @@
    25892663 
     
    27132787diff -Naur vim72.orig/src/diff.c vim72/src/diff.c
    27142788--- vim72.orig/src/diff.c       2008-03-05 03:16:56.000000000 -0800
    2715 +++ vim72/src/diff.c    2009-06-05 14:24:34.000000000 -0700
     2789+++ vim72/src/diff.c    2009-07-19 15:16:00.000000000 -0700
    27162790@@ -8,7 +8,7 @@
    27172791  */
     
    29162990diff -Naur vim72.orig/src/digraph.c vim72/src/digraph.c
    29172991--- vim72.orig/src/digraph.c    2008-06-23 14:12:51.000000000 -0700
    2918 +++ vim72/src/digraph.c 2009-06-05 14:24:27.000000000 -0700
     2992+++ vim72/src/digraph.c 2009-07-19 15:15:54.000000000 -0700
    29192993@@ -32,7 +32,7 @@
    29202994 static void printdigraph __ARGS((digr_T *));
     
    29883062diff -Naur vim72.orig/src/edit.c vim72/src/edit.c
    29893063--- vim72.orig/src/edit.c       2008-08-06 05:51:17.000000000 -0700
    2990 +++ vim72/src/edit.c    2009-06-05 14:25:48.000000000 -0700
     3064+++ vim72/src/edit.c    2009-07-19 15:18:33.000000000 -0700
    29913065@@ -57,7 +57,7 @@
    29923066     N_(" Keyword Local completion (^N^P)"),
     
    29983072 /*
    29993073  * Structure used to store one match for insert completion.
    3000 @@ -147,6 +147,7 @@
     3074@@ -114,6 +114,10 @@
     3075  * FALSE the word to be completed must be located. */
     3076 static int       compl_started = FALSE;
     3077 
     3078+/* Set when doing something for completion that may call edit() recursively,
     3079+ * which is not allowed. */
     3080+static int       compl_busy = FALSE;
     3081+
     3082 static int       compl_matches = 0;
     3083 static char_u    *compl_pattern = NULL;
     3084 static int       compl_direction = FORWARD;
     3085@@ -147,6 +151,7 @@
    30013086 static int  ins_compl_bs __ARGS((void));
    30023087 static void ins_compl_new_leader __ARGS((void));
     
    30063091 static void ins_compl_set_original_text __ARGS((char_u *str));
    30073092 static void ins_compl_addfrommatch __ARGS((void));
    3008 @@ -164,7 +165,7 @@
     3093@@ -164,7 +169,7 @@
    30093094 static int  ins_compl_key2count __ARGS((int c));
    30103095 static int  ins_compl_use_match __ARGS((int c));
     
    30153100 
    30163101 #define BACKSPACE_CHAR             1
    3017 @@ -197,7 +198,8 @@
     3102@@ -197,7 +202,8 @@
    30183103 static void mb_replace_pop_ins __ARGS((int cc));
    30193104 #endif
     
    30253110 static int cindent_on __ARGS((void));
    30263111 #endif
    3027 @@ -304,7 +306,7 @@
     3112@@ -304,7 +310,7 @@
    30283113     int                c = 0;
    30293114     char_u     *ptr;
     
    30343119     int                i;
    30353120     int                did_backspace = TRUE;       /* previous char was backspace */
    3036 @@ -385,7 +387,7 @@
     3121@@ -344,7 +350,7 @@
     3122 
     3123 #ifdef FEAT_INS_EXPAND
     3124     /* Don't allow recursive insert mode when busy with completion. */
     3125-    if (compl_started || pum_visible())
     3126+    if (compl_started || compl_busy || pum_visible())
     3127     {
     3128        EMSG(_(e_secure));
     3129        return FALSE;
     3130@@ -385,7 +391,7 @@
    30373131        if (startln)
    30383132            Insstart.col = 0;
     
    30433137     if (!did_ai)
    30443138        ai_col = 0;
    3045 @@ -651,7 +653,7 @@
     3139@@ -651,7 +657,7 @@
    30463140            mincol = curwin->w_wcol;
    30473141            validate_cursor_col();
     
    30523146                                                 + curwin->w_height - 1 - p_so
    30533147                    && (curwin->w_cursor.lnum != curwin->w_topline
    3054 @@ -751,7 +753,7 @@
     3148@@ -751,7 +757,7 @@
    30553149                 * there is nothing to add, CTRL-L works like CTRL-P then. */
    30563150                if (c == Ctrl_L
     
    30613155                {
    30623156                    ins_compl_addfrommatch();
    3063 @@ -1771,7 +1773,7 @@
     3157@@ -1338,8 +1344,10 @@
     3158                goto normalchar;
     3159 
     3160 docomplete:
     3161+           compl_busy = TRUE;
     3162            if (ins_complete(c) == FAIL)
     3163                compl_cont_status = 0;
     3164+           compl_busy = FALSE;
     3165            break;
     3166 #endif /* FEAT_INS_EXPAND */
     3167 
     3168@@ -1771,7 +1779,7 @@
    30643169         * Compute the screen column where the cursor should be.
    30653170         */
     
    30703175        /*
    30713176         * Advance the cursor until we reach the right screen column.
    3072 @@ -1798,9 +1800,9 @@
     3177@@ -1798,9 +1806,9 @@
    30733178         */
    30743179        if (vcol != (int)curwin->w_virtcol)
     
    30823187            {
    30833188                new_cursor_col += i;
    3084 @@ -1824,7 +1826,7 @@
     3189@@ -1824,7 +1832,7 @@
    30853190     if (new_cursor_col <= 0)
    30863191        curwin->w_cursor.col = 0;
     
    30913196     changed_cline_bef_curs();
    30923197 
    3093 @@ -1933,6 +1935,8 @@
     3198@@ -1933,6 +1941,8 @@
    30943199 /*
    30953200  * Backspace the cursor until the given column.  Handles REPLACE and VREPLACE
     
    31003205     void
    31013206 backspace_until_column(col)
    3102 @@ -1942,13 +1946,50 @@
     3207@@ -1942,13 +1952,50 @@
    31033208     {
    31043209        curwin->w_cursor.col--;
     
    31543259 /*
    31553260  * CTRL-X pressed in Insert mode.
    3156 @@ -2160,7 +2201,7 @@
     3261@@ -2160,7 +2207,7 @@
    31573262            actual_compl_length = compl_length;
    31583263 
     
    31633268        {
    31643269            p = str;
    3165 @@ -2418,7 +2459,7 @@
     3270@@ -2418,7 +2465,7 @@
    31663271        {
    31673272            had_match = (curwin->w_cursor.col > compl_col);
     
    31723277 
    31733278            /* When the match isn't there (to avoid matching itself) remove it
    3174 @@ -2470,7 +2511,7 @@
     3279@@ -2470,7 +2517,7 @@
    31753280            *p = NUL;
    31763281            had_match = (curwin->w_cursor.col > compl_col);
     
    31813286 
    31823287            /* When the match isn't there (to avoid matching itself) remove it
    3183 @@ -2539,7 +2580,7 @@
     3288@@ -2539,7 +2586,7 @@
    31843289  */
    31853290     void
     
    31903295 {
    31913296     /* If already doing completions stop it. */
    3192 @@ -2550,10 +2591,10 @@
     3297@@ -2550,10 +2597,10 @@
    31933298     if (stop_arrow() == FAIL)
    31943299        return;
     
    32033308     compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length);
    32043309     if (compl_orig_text == NULL || ins_compl_add(compl_orig_text,
    3205 @@ -2819,7 +2860,6 @@
     3310@@ -2819,7 +2866,6 @@
    32063311     regmatch_T regmatch;
    32073312     char_u     **files;
     
    32113316     int                dir = compl_direction;
    32123317 
    3213 @@ -2851,17 +2891,18 @@
     3318@@ -2851,17 +2897,18 @@
    32143319     if (ctrl_x_mode == CTRL_X_WHOLE_LINE)
    32153320     {
     
    32333338        vim_free(pat_esc);
    32343339        vim_free(ptr);
    3235 @@ -2952,7 +2993,7 @@
     3340@@ -2952,7 +2999,7 @@
    32363341        {
    32373342            vim_snprintf((char *)IObuff, IOSIZE,
     
    32423347 
    32433348        if (fp != NULL)
    3244 @@ -3209,7 +3250,7 @@
     3349@@ -3133,6 +3180,7 @@
     3350        vim_free(match);
     3351     } while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
     3352     compl_first_match = compl_curr_match = NULL;
     3353+    compl_shown_match = NULL;
     3354 }
     3355 
     3356     static void
     3357@@ -3209,7 +3257,7 @@
    32453358 {
    32463359     ins_compl_del_pum();
     
    32513364 
    32523365     if (compl_started)
    3253 @@ -3264,6 +3305,20 @@
     3366@@ -3264,6 +3312,20 @@
    32543367 }
    32553368 
     
    32723385  * matches.
    32733386  */
    3274 @@ -3292,7 +3347,7 @@
     3387@@ -3292,7 +3354,7 @@
    32753388 
    32763389     vim_free(compl_leader);
     
    32813394        ins_compl_new_leader();
    32823395 }
    3283 @@ -3340,7 +3395,7 @@
     3396@@ -3340,7 +3402,7 @@
    32843397 ins_compl_addfrommatch()
    32853398 {
     
    32903403     compl_T    *cp;
    32913404 
    3292 @@ -3621,10 +3676,9 @@
     3405@@ -3621,10 +3683,9 @@
    32933406            {
    32943407                ins_compl_delete();
     
    33033416            }
    33043417 
    3305 @@ -3907,7 +3961,7 @@
     3418@@ -3907,7 +3968,7 @@
    33063419                            : ins_buf->b_sfname == NULL
    33073420                                ? (char *)ins_buf->b_fname
     
    33123425            else if (*e_cpt == NUL)
    33133426                break;
    3314 @@ -3936,8 +3990,8 @@
     3427@@ -3936,8 +3997,8 @@
    33153428                else if (*e_cpt == ']' || *e_cpt == 't')
    33163429                {
     
    33233436                else
    33243437                    type = -1;
    3325 @@ -4035,7 +4089,7 @@
     3438@@ -4035,7 +4096,7 @@
    33263439        case CTRL_X_SPELL:
    33273440 #ifdef FEAT_SPELL
     
    33323445                ins_compl_add_matches(num_matches, matches, p_ic);
    33333446 #endif
    3334 @@ -4187,7 +4241,7 @@
     3447@@ -4187,7 +4248,7 @@
    33353448        }
    33363449 
     
    33413454            found_new_match = OK;
    33423455 
    3343 @@ -4256,7 +4310,7 @@
     3456@@ -4256,7 +4317,7 @@
    33443457     static void
    33453458 ins_compl_insert()
     
    33503463        compl_used_match = FALSE;
    33513464     else
    3352 @@ -4425,7 +4479,7 @@
     3465@@ -4425,7 +4486,7 @@
    33533466        if (!compl_get_longest || compl_used_match)
    33543467            ins_compl_insert();
     
    33593472     else
    33603473        compl_used_match = FALSE;
    3361 @@ -4688,7 +4742,7 @@
     3474@@ -4688,7 +4749,7 @@
    33623475                }
    33633476                compl_length = curwin->w_cursor.col - (int)compl_col;
     
    33683481                if (compl_length > (IOSIZE - MIN_SPACE))
    33693482                {
    3370 @@ -4745,10 +4799,9 @@
     3483@@ -4745,10 +4806,9 @@
    33713484            {
    33723485                char_u      *prefix = (char_u *)"\\<";
     
    33813494                    return FAIL;
    33823495                if (!vim_iswordp(line + compl_col)
    3383 @@ -4823,7 +4876,7 @@
     3496@@ -4823,7 +4883,7 @@
    33843497                else
    33853498                {
     
    33903503                        return FAIL;
    33913504                    STRCPY((char *)compl_pattern, "\\<");
    3392 @@ -4905,7 +4958,7 @@
     3505@@ -4905,7 +4965,7 @@
    33933506            if (col < 0)
    33943507                col = curs_col;
     
    33993512 
    34003513            /* Setup variables for completion.  Need to obtain "line" again,
    3401 @@ -5178,15 +5231,15 @@
     3514@@ -5178,15 +5238,15 @@
    34023515  * a backslash) the metachars, and dest would be NUL terminated.
    34033516  * Returns the length (needed) of dest
     
    34183531        switch (*src)
    34193532        {
    3420 @@ -6015,7 +6068,7 @@
     3533@@ -6015,7 +6075,7 @@
    34213534      * in 'formatoptions' and there is a single character before the cursor.
    34223535      * Otherwise the line would be broken and when typing another non-white
     
    34273540     {
    34283541        dec_cursor();
    3429 @@ -6192,7 +6245,7 @@
     3542@@ -6192,7 +6252,7 @@
    34303543      * three digits. */
    34313544     if (VIM_ISDIGIT(c))
     
    34363549     }
    34373550     else
    3438 @@ -6266,7 +6319,7 @@
     3551@@ -6266,7 +6326,7 @@
    34393552            ins_need_undo = FALSE;
    34403553        }
     
    34453558 #ifdef FEAT_VREPLACE
    34463559        if (State & VREPLACE_FLAG)
    3447 @@ -6369,13 +6422,17 @@
     3560@@ -6369,13 +6429,17 @@
    34483561 
    34493562        /* If we just did an auto-indent, remove the white space from the end
     
    34653578            {
    34663579                if (gchar_cursor() == NUL && curwin->w_cursor.col > 0)
    3467 @@ -6383,7 +6440,8 @@
     3580@@ -6383,7 +6447,8 @@
    34683581                cc = gchar_cursor();
    34693582                if (!vim_iswhite(cc))
     
    34753588            if (curwin->w_cursor.lnum != tpos.lnum)
    34763589                curwin->w_cursor = tpos;
    3477 @@ -6395,10 +6453,11 @@
     3590@@ -6395,10 +6460,11 @@
    34783591             * deleted characters. */
    34793592            if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
     
    34903603                    VIsual.coladd = 0;
    34913604 # endif
    3492 @@ -7123,9 +7182,12 @@
     3605@@ -7123,9 +7189,12 @@
    34933606  * cc == 0: character was inserted, delete it
    34943607  * cc > 0: character was replaced, put cc (first byte of original char) back
     
    35043617     int                cc;
    35053618 #ifdef FEAT_VREPLACE
    3506 @@ -7153,7 +7215,7 @@
     3619@@ -7153,7 +7222,7 @@
    35073620 #ifdef FEAT_MBYTE
    35083621        if (has_mbyte)
     
    35133626            if (State & VREPLACE_FLAG)
    35143627                orig_len = (int)STRLEN(ml_get_cursor());
    3515 @@ -7203,7 +7265,7 @@
     3628@@ -7203,7 +7272,7 @@
    35163629        changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
    35173630     }
     
    35223635 
    35233636 #ifdef FEAT_CINDENT
    3524 @@ -7646,9 +7708,7 @@
     3637@@ -7646,9 +7715,7 @@
    35253638      */
    35263639     ++no_mapping;
     
    35323645     {
    35333646        /* Get a third key for literal register insertion */
    3534 @@ -7657,9 +7717,7 @@
     3647@@ -7657,9 +7724,7 @@
    35353648        add_to_showcmd_c(literally);
    35363649 #endif
     
    35423655     --no_mapping;
    35433656 
    3544 @@ -8150,7 +8208,7 @@
     3657@@ -8150,7 +8215,7 @@
    35453658 /*
    35463659  * If the cursor is on an indent, ^T/^D insert/delete one
     
    35513664  * autoindent, we support it everywhere.
    35523665  */
    3553 @@ -8239,7 +8297,7 @@
     3666@@ -8239,7 +8304,7 @@
    35543667         * Replace mode */
    35553668        if (curwin->w_cursor.lnum != Insstart.lnum
     
    35603673     else
    35613674        (void)del_char(FALSE);
    3562 @@ -8258,6 +8316,7 @@
     3675@@ -8258,6 +8323,7 @@
    35633676     linenr_T   lnum;
    35643677     int                cc;
     
    35683681     int                did_backspace = FALSE;
    35693682     int                in_indent;
    3570 @@ -8415,13 +8474,13 @@
     3683@@ -8415,13 +8481,13 @@
    35713684                 */
    35723685                while (cc > 0)
     
    35843697                }
    35853698                /* restore the characters that NL replaced */
    3586 @@ -8453,11 +8512,11 @@
     3699@@ -8453,11 +8519,11 @@
    35873700 #endif
    35883701                            )
     
    35983711 
    35993712        /*
    3600 @@ -8556,7 +8615,7 @@
     3713@@ -8556,7 +8622,7 @@
    36013714                break;
    36023715            }
     
    36073720            {
    36083721 #ifdef FEAT_MBYTE
    3609 @@ -8931,7 +8990,10 @@
     3722@@ -8931,7 +8997,10 @@
    36103723        foldOpenCursor();
    36113724 #endif
     
    36213734diff -Naur vim72.orig/src/eval.c vim72/src/eval.c
    36223735--- vim72.orig/src/eval.c       2008-08-07 12:37:22.000000000 -0700
    3623 +++ vim72/src/eval.c    2009-06-05 14:26:02.000000000 -0700
     3736+++ vim72/src/eval.c    2009-07-19 15:17:12.000000000 -0700
    36243737@@ -32,6 +32,9 @@
    36253738 
     
    60586171diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
    60596172--- vim72.orig/src/ex_cmds2.c   2008-07-13 09:18:22.000000000 -0700
    6060 +++ vim72/src/ex_cmds2.c        2009-06-05 14:25:09.000000000 -0700
     6173+++ vim72/src/ex_cmds2.c        2009-07-19 15:16:28.000000000 -0700
    60616174@@ -28,7 +28,8 @@
    60626175 {
     
    61936306diff -Naur vim72.orig/src/ex_cmds.c vim72/src/ex_cmds.c
    61946307--- vim72.orig/src/ex_cmds.c    2008-08-04 12:15:00.000000000 -0700
    6195 +++ vim72/src/ex_cmds.c 2009-06-05 14:25:15.000000000 -0700
     6308+++ vim72/src/ex_cmds.c 2009-07-19 15:18:39.000000000 -0700
    61966309@@ -24,7 +24,7 @@
    61976310 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
     
    65136626 
    65146627     --RedrawingDisabled;
    6515 @@ -4022,8 +4034,10 @@
     6628@@ -3997,6 +4009,9 @@
     6629            break;
     6630        ml_delete(eap->line1, FALSE);
     6631     }
     6632+
     6633+    /* make sure the cursor is not beyond the end of the file now */
     6634+    check_cursor_lnum();
     6635     deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum));
     6636 
     6637     /* ":append" on the line above the deleted lines. */
     6638@@ -4022,8 +4037,10 @@
    65166639        bigness = curwin->w_height;
    65176640     else if (firstwin == lastwin)
     
    65246647        bigness = 1;
    65256648 
    6526 @@ -4472,7 +4486,7 @@
     6649@@ -4472,7 +4489,7 @@
    65276650            char_u      *p1;
    65286651            int         did_sub = FALSE;
     
    65336656            int         do_again;       /* do it again after joining lines */
    65346657            int         skip_match = FALSE;
    6535 @@ -4617,6 +4631,8 @@
     6658@@ -4617,6 +4634,8 @@
    65366659 
    65376660                if (do_ask)
     
    65426665                     * properly */
    65436666                    save_State = State;
    6544 @@ -4655,7 +4671,7 @@
     6667@@ -4655,7 +4674,7 @@
    65456668                            resp = getexmodeline('?', NULL, 0);
    65466669                            if (resp != NULL)
     
    65516674                            }
    65526675                        }
    6553 @@ -4707,7 +4723,7 @@
     6676@@ -4707,7 +4726,7 @@
    65546677 #endif
    65556678                            ++no_mapping;       /* don't map this key */
     
    65606683                            --no_mapping;
    65616684 
    6562 @@ -4718,35 +4734,35 @@
     6685@@ -4718,35 +4737,35 @@
    65636686                        }
    65646687 
     
    66046727 #endif
    66056728                    }
    6606 @@ -4757,7 +4773,7 @@
     6729@@ -4757,7 +4776,7 @@
    66076730                    if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
    66086731                        --no_u_sync;
     
    66136736                        /* For a multi-line match, put matchcol at the NUL at
    66146737                         * the end of the line and set nmatch to one, so that
    6615 @@ -4808,9 +4824,9 @@
     6738@@ -4808,9 +4827,9 @@
    66166739                    p1 = ml_get(sub_firstlnum + nmatch - 1);
    66176740                    nmatch_tl += nmatch - 1;
     
    66266749                {
    66276750                    /*
    6628 @@ -4833,7 +4849,7 @@
     6751@@ -4833,7 +4852,7 @@
    66296752                     */
    66306753                    len = (unsigned)STRLEN(new_start);
     
    66356758                        new_start_len = needed_len + 50;
    66366759                        if ((p1 = alloc_check(new_start_len)) == NULL)
    6637 @@ -4851,8 +4867,8 @@
     6760@@ -4851,8 +4870,8 @@
    66386761                /*
    66396762                 * copy the text up to the part that matched
     
    66466769                (void)vim_regsub_multi(&regmatch,
    66476770                                    sub_firstlnum - regmatch.startpos[0].lnum,
    6648 @@ -5059,6 +5075,7 @@
     6771@@ -5059,6 +5078,7 @@
    66496772 
    66506773            if (did_sub)
     
    66546777            sub_firstline = NULL;
    66556778        }
    6656 @@ -5769,7 +5786,7 @@
     6779@@ -5769,7 +5789,7 @@
    66576780      * Recognize a few exceptions to the rule. Some strings that contain '*'
    66586781      * with "star".  Otherwise '*' is recognized as a wildcard.
     
    66636786        {
    66646787            STRCPY(d, rtable[i]);
    6665 @@ -6519,22 +6536,11 @@
     6788@@ -6519,22 +6539,11 @@
    66666789 static sign_T  *first_sign = NULL;
    66676790 static int     last_sign_typenr = MAX_TYPENR;  /* is decremented */
     
    66896812 #define SIGNCMD_DEFINE 0
    66906813                        "undefine",
    6691 @@ -6547,22 +6553,51 @@
     6814@@ -6547,22 +6556,51 @@
    66926815 #define SIGNCMD_UNPLACE        4
    66936816                        "jump",
     
    67526875     arg = skipwhite(p);
    67536876 
    6754 @@ -6728,24 +6763,8 @@
     6877@@ -6728,24 +6766,8 @@
    67556878                /* ":sign list {name}" */
    67566879                sign_list_defined(sp);
     
    67786901     }
    67796902     else
    6780 @@ -6994,6 +7013,31 @@
     6903@@ -6994,6 +7016,31 @@
    67816904 }
    67826905 
     
    68106933  * If "line" is TRUE: line highl, if FALSE: text highl.
    68116934  */
    6812 @@ -7067,6 +7111,198 @@
     6935@@ -7067,6 +7114,198 @@
    68136936     return (char_u *)_("[Deleted]");
    68146937 }
     
    70117134diff -Naur vim72.orig/src/ex_cmds.h vim72/src/ex_cmds.h
    70127135--- vim72.orig/src/ex_cmds.h    2008-06-21 11:47:57.000000000 -0700
    7013 +++ vim72/src/ex_cmds.h 2009-06-05 14:16:09.000000000 -0700
     7136+++ vim72/src/ex_cmds.h 2009-07-19 15:18:31.000000000 -0700
    70147137@@ -278,7 +278,7 @@
    70157138 EX(CMD_crewind,                "crewind",      ex_cc,
     
    70577180                        TRLBAR|EXTRA|CMDWIN|SBOXOK),
    70587181 EX(CMD_setfiletype,    "setfiletype",  ex_setfiletype,
     7182@@ -987,6 +991,8 @@
     7183                        BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
     7184 EX(CMD_unmenu,         "unmenu",       ex_menu,
     7185                        BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
     7186+EX(CMD_unsilent,       "unsilent",     ex_wrongmodifier,
     7187+                       NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
     7188 EX(CMD_update,         "update",       ex_update,
     7189                        RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
     7190 EX(CMD_vglobal,                "vglobal",      ex_global,
    70597191diff -Naur vim72.orig/src/ex_docmd.c vim72/src/ex_docmd.c
    70607192--- vim72.orig/src/ex_docmd.c   2008-07-26 04:51:05.000000000 -0700
    7061 +++ vim72/src/ex_docmd.c        2009-06-05 14:25:02.000000000 -0700
     7193+++ vim72/src/ex_docmd.c        2009-07-19 15:18:41.000000000 -0700
    70627194@@ -364,6 +364,7 @@
    70637195 # define ex_function           ex_ni
     
    70937225 {
    70947226 # ifdef FEAT_EVAL
     7227@@ -1678,8 +1677,8 @@
     7228     char_u             *errormsg = NULL;       /* error message */
     7229     exarg_T            ea;                     /* Ex command arguments */
     7230     long               verbose_save = -1;
     7231-    int                        save_msg_scroll = 0;
     7232-    int                        did_silent = 0;
     7233+    int                        save_msg_scroll = msg_scroll;
     7234+    int                        save_msg_silent = -1;
     7235     int                        did_esilent = 0;
     7236 #ifdef HAVE_SANDBOX
     7237     int                        did_sandbox = FALSE;
    70957238@@ -1770,7 +1769,7 @@
    70967239                        }
     
    71027245 #endif
    71037246                            continue;
    7104 @@ -2698,6 +2697,11 @@
     7247@@ -1857,9 +1856,9 @@
     7248                        }
     7249                        if (!checkforcmd(&ea.cmd, "silent", 3))
     7250                            break;
     7251-                       ++did_silent;
     7252+                       if (save_msg_silent == -1)
     7253+                           save_msg_silent = msg_silent;
     7254                        ++msg_silent;
     7255-                       save_msg_scroll = msg_scroll;
     7256                        if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
     7257                        {
     7258                            /* ":silent!", but not "silent !cmd" */
     7259@@ -1887,6 +1886,13 @@
     7260 #endif
     7261                        continue;
     7262 
     7263+           case 'u':   if (!checkforcmd(&ea.cmd, "unsilent", 3))
     7264+                           break;
     7265+                       if (save_msg_silent == -1)
     7266+                           save_msg_silent = msg_silent;
     7267+                       msg_silent = 0;
     7268+                       continue;
     7269+
     7270            case 'v':   if (checkforcmd(&ea.cmd, "vertical", 4))
     7271                        {
     7272 #ifdef FEAT_VERTSPLIT
     7273@@ -2685,19 +2691,23 @@
     7274 
     7275     cmdmod = save_cmdmod;
     7276 
     7277-    if (did_silent > 0)
     7278+    if (save_msg_silent != -1)
     7279     {
     7280        /* messages could be enabled for a serious error, need to check if the
     7281         * counters don't become negative */
     7282-       msg_silent -= did_silent;
     7283-       if (msg_silent < 0)
     7284-           msg_silent = 0;
     7285+       if (!did_emsg)
     7286+           msg_silent = save_msg_silent;
     7287        emsg_silent -= did_esilent;
     7288        if (emsg_silent < 0)
     7289            emsg_silent = 0;
    71057290        /* Restore msg_scroll, it's set by file I/O commands, even when no
    71067291         * message is actually displayed. */
     
    71147299 
    71157300 #ifdef HAVE_SANDBOX
    7116 @@ -2731,7 +2735,7 @@
     7301@@ -2731,7 +2741,7 @@
    71177302     int                i;
    71187303 
     
    71237308     if (i >= len && !isalpha((*pp)[i]))
    71247309     {
    7125 @@ -2748,11 +2752,10 @@
     7310@@ -2748,11 +2758,10 @@
    71267311  * "full" is set to TRUE if the whole command name matched.
    71277312  * Returns NULL for an ambiguous user command.
     
    71367321     int                len;
    71377322     char_u     *p;
    7138 @@ -2797,7 +2800,7 @@
     7323@@ -2797,7 +2806,7 @@
    71397324            /* Check for ":dl", ":dell", etc. to ":deletel": that's
    71407325             * :delete with the 'l' flag.  Same for 'p'. */
     
    71457330            if (i == len - 1)
    71467331            {
    7147 @@ -2978,6 +2981,7 @@
     7332@@ -2978,11 +2987,13 @@
    71487333     {"keepmarks", 3, FALSE},
    71497334     {"leftabove", 5, FALSE},
     
    71537338     {"sandbox", 3, FALSE},
    71547339     {"silent", 3, FALSE},
    7155 @@ -3000,7 +3004,7 @@
     7340     {"tab", 3, TRUE},
     7341     {"topleft", 2, FALSE},
     7342+    {"unsilent", 3, FALSE},
     7343     {"verbose", 4, TRUE},
     7344     {"vertical", 4, FALSE},
     7345 };
     7346@@ -3000,7 +3011,7 @@
    71567347 
    71577348     if (VIM_ISDIGIT(*cmd))
     
    71627353        for (j = 0; p[j] != NUL; ++j)
    71637354            if (p[j] != cmdmods[i].name[j])
    7164 @@ -3028,7 +3032,7 @@
     7355@@ -3028,7 +3039,7 @@
    71657356     char_u     *p;
    71667357 
     
    71717362        for (j = 0; name[j] != NUL; ++j)
    71727363            if (name[j] != cmdmods[i].name[j])
    7173 @@ -3608,6 +3612,7 @@
     7364@@ -3608,6 +3619,7 @@
    71747365            return set_context_in_autocmd(xp, arg, FALSE);
    71757366 
     
    71797370 #endif
    71807371        case CMD_set:
    7181 @@ -3680,6 +3685,18 @@
     7372@@ -3680,6 +3692,18 @@
    71827373        case CMD_highlight:
    71837374            set_context_in_highlight_cmd(xp, arg);
     
    71987389        case CMD_bdelete:
    71997390        case CMD_bwipeout:
    7200 @@ -3803,7 +3820,7 @@
     7391@@ -3803,7 +3827,7 @@
    72017392     char_u     *cmd;
    72027393     int                *ctx;   /* pointer to xp_context or NULL */
     
    72077398     while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
    72087399     {
    7209 @@ -5033,10 +5050,9 @@
     7400@@ -5033,10 +5057,9 @@
    72107401 /*
    72117402  * Function given to ExpandGeneric() to obtain the list of command names.
     
    72197410 {
    72207411     if (idx >= (int)CMD_SIZE)
    7221 @@ -5121,7 +5137,11 @@
     7412@@ -5121,7 +5144,11 @@
    72227413            }
    72237414 
     
    72327423        }
    72337424 
    7234 @@ -5180,6 +5200,9 @@
     7425@@ -5180,6 +5207,9 @@
    72357426     {EXPAND_AUGROUP, "augroup"},
    72367427     {EXPAND_BUFFERS, "buffer"},
     
    72427433     {EXPAND_USER_DEFINED, "custom"},
    72437434     {EXPAND_USER_LIST, "customlist"},
    7244 @@ -5196,6 +5219,9 @@
     7435@@ -5196,6 +5226,9 @@
    72457436     {EXPAND_MENUS, "menu"},
    72467437     {EXPAND_SETTINGS, "option"},
     
    72527443     {EXPAND_TAGS_LISTFILES, "tag_listfiles"},
    72537444     {EXPAND_USER_VARS, "var"},
    7254 @@ -5479,6 +5505,9 @@
     7445@@ -5479,6 +5512,9 @@
    72557446     return OK;
    72567447 }
     
    72627453 ex_command(eap)
    72637454     exarg_T   *eap;
    7264 @@ -5540,10 +5569,9 @@
     7455@@ -5540,10 +5576,9 @@
    72657456  * ":comclear"
    72667457  * Clear all user commands, global and for current buffer.
     
    72747465     uc_clear(&ucmds);
    72757466     uc_clear(&curbuf->b_ucmds);
    7276 @@ -5910,7 +5938,8 @@
     7467@@ -5910,7 +5945,8 @@
    72777468     char_u     *q;
    72787469 
     
    72847475 
    72857476     size_t     split_len = 0;
    7286 @@ -5927,16 +5956,51 @@
     7477@@ -5927,16 +5963,51 @@
    72877478 
    72887479     /*
     
    73407531            ++end;
    73417532 
    7342 @@ -6003,10 +6067,9 @@
     7533@@ -6003,10 +6074,9 @@
    73437534 /*
    73447535  * Function given to ExpandGeneric() to obtain the list of user command names.
     
    73527543 {
    73537544     if (idx < curbuf->b_ucmds.ga_len)
    7354 @@ -6021,17 +6084,16 @@
     7545@@ -6021,17 +6091,16 @@
    73557546  * Function given to ExpandGeneric() to obtain the list of user command
    73567547  * attributes.
     
    73727563     return (char_u *)user_cmd_flags[idx];
    73737564 }
    7374 @@ -6039,15 +6101,14 @@
     7565@@ -6039,15 +6108,14 @@
    73757566 /*
    73767567  * Function given to ExpandGeneric() to obtain the list of values for -nargs.
     
    73907581     return (char_u *)user_cmd_nargs[idx];
    73917582 }
    7392 @@ -6055,10 +6116,9 @@
     7583@@ -6055,10 +6123,9 @@
    73937584 /*
    73947585  * Function given to ExpandGeneric() to obtain the list of values for -complete.
     
    74027593 {
    74037594     return (char_u *)command_complete[idx].name;
    7404 @@ -6236,10 +6296,9 @@
     7595@@ -6236,10 +6303,9 @@
    74057596 /*
    74067597  * ":cquit".
     
    74147605     getout(1); /* this does not always pass on the exit code to the Manx
    74157606                   compiler. why? */
    7416 @@ -6681,10 +6740,9 @@
     7607@@ -6681,10 +6747,9 @@
    74177608 /*
    74187609  * ":shell".
     
    74267617     do_shell(NULL, 0);
    74277618 }
    7428 @@ -6988,10 +7046,9 @@
     7619@@ -6988,10 +7053,9 @@
    74297620 /*
    74307621  * ":preserve".
     
    74387629     curbuf->b_flags |= BF_PRESERVED;
    74397630     ml_preserve(curbuf, TRUE);
    7440 @@ -7223,10 +7280,9 @@
     7631@@ -7223,10 +7287,9 @@
    74417632 /*
    74427633  * :tabs command: List tabs and their contents.
     
    74507641     tabpage_T  *tp;
    74517642     win_T      *wp;
    7452 @@ -7413,7 +7469,6 @@
     7643@@ -7413,7 +7476,6 @@
    74537644 /*
    74547645  * ":edit <file>" command and alikes.
     
    74587649 do_exedit(eap, old_curwin)
    74597650     exarg_T    *eap;
    7460 @@ -7624,10 +7679,9 @@
     7651@@ -7624,10 +7686,9 @@
    74617652 }
    74627653 #endif
     
    74707661     if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL)
    74717662        MSG(_("No swap file"));
    7472 @@ -7640,10 +7694,9 @@
     7663@@ -7640,10 +7701,9 @@
    74737664  * offset.
    74747665  * (1998-11-02 16:21:01  R. Edward Ralston <eralston@computer.org>)
     
    74827673 #ifdef FEAT_SCROLLBIND
    74837674     win_T      *wp;
    7484 @@ -7803,6 +7856,9 @@
     7675@@ -7784,10 +7844,10 @@
     7676                if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK)
     7677                {
     7678                    ml_delete(lnum, FALSE);
     7679-                   deleted_lines_mark(lnum, 1L);
     7680                    if (curwin->w_cursor.lnum > 1
     7681                                             && curwin->w_cursor.lnum >= lnum)
     7682                        --curwin->w_cursor.lnum;
     7683+                   deleted_lines_mark(lnum, 1L);
     7684                }
     7685            }
     7686            redraw_curbuf_later(VALID);
     7687@@ -7803,6 +7863,9 @@
    74857688 {
    74867689     vim_free(prev_dir);
     
    74927695 #endif
    74937696 
    7494 @@ -7825,6 +7881,10 @@
     7697@@ -7825,6 +7888,10 @@
    74957698     else
    74967699 #endif
     
    75037706                                                             && !eap->forceit)
    75047707        {
    7505 @@ -7906,10 +7966,9 @@
     7708@@ -7896,7 +7963,7 @@
     7709            shorten_fnames(TRUE);
     7710 
     7711            /* Echo the new current directory if the command was typed. */
     7712-           if (KeyTyped)
     7713+           if (KeyTyped || p_verbose >= 5)
     7714                ex_pwd(eap);
     7715        }
     7716        vim_free(tofree);
     7717@@ -7906,10 +7973,9 @@
    75067718 /*
    75077719  * ":pwd".
     
    75157727     if (mch_dirname(NameBuff, MAXPATHL) == OK)
    75167728     {
    7517 @@ -8340,10 +8399,9 @@
     7729@@ -8340,10 +8406,9 @@
    75187730 /*
    75197731  * ":undo".
     
    75277739     if (eap->addr_count == 1)      /* :undo 123 */
    75287740        undo_time(eap->line2, FALSE, TRUE);
    7529 @@ -8354,10 +8412,9 @@
     7741@@ -8354,10 +8419,9 @@
    75307742 /*
    75317743  * ":redo".
     
    75397751     u_redo(1);
    75407752 }
    7541 @@ -8365,7 +8422,6 @@
     7753@@ -8365,7 +8429,6 @@
    75427754 /*
    75437755  * ":earlier" and ":later".
     
    75477759 ex_later(eap)
    75487760     exarg_T    *eap;
    7549 @@ -8550,10 +8606,9 @@
     7761@@ -8550,10 +8613,9 @@
    75507762 /*
    75517763  * ":redrawstatus": force redraw of status line(s)
     
    75597771 #if defined(FEAT_WINDOWS)
    75607772     int                r = RedrawingDisabled;
    7561 @@ -8749,8 +8804,8 @@
     7773@@ -8630,6 +8692,8 @@
     7774     }
     7775 
     7776 #ifdef FEAT_SESSION
     7777+    /* Use the short file name until ":lcd" is used.  We also don't use the
     7778+     * short file name when 'acd' is set, that is checked later. */
     7779     did_lcd = FALSE;
     7780 
     7781     /* ":mkview" or ":mkview 9": generate file name with 'viewdir' */
     7782@@ -8749,8 +8813,8 @@
    75627783                else if (*dirnow != NUL
    75637784                        && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
     
    75707791 
    75717792                failed |= (makeopens(fd, dirnow) == FAIL);
    7572 @@ -8814,11 +8869,10 @@
     7793@@ -8814,11 +8878,10 @@
    75737794 
    75747795 #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
     
    75837804     if (vim_mkdir(name, prot) != 0)
    75847805     {
    7585 @@ -9089,10 +9143,9 @@
     7806@@ -9089,10 +9152,9 @@
    75867807 /*
    75877808  * ":stopinsert"
     
    75957816     restart_edit = 0;
    75967817     stop_insert_mode = TRUE;
    7597 @@ -9366,9 +9419,8 @@
     7818@@ -9366,9 +9428,8 @@
    75987819 # define SPEC_CLIENT 9
    75997820 #endif
     
    76067827        len = (int)STRLEN(spec_str[i]);
    76077828        if (STRNCMP(src, spec_str[i], len) == 0)
    7608 @@ -9506,24 +9558,50 @@
     7829@@ -9506,24 +9567,50 @@
    76097830                    break;
    76107831                }
     
    76677888 
    76687889 #ifdef FEAT_SEARCHPATH
    7669 @@ -9541,6 +9619,15 @@
     7890@@ -9541,6 +9628,15 @@
    76707891 #ifdef FEAT_AUTOCMD
    76717892        case SPEC_AFILE:        /* file name for autocommand */
     
    76837904                {
    76847905                    *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
    7685 @@ -9684,7 +9771,7 @@
     7906@@ -9684,7 +9780,7 @@
    76867907        }
    76877908 
     
    76927913            break;
    76937914     }
    7694 @@ -10067,7 +10154,7 @@
     7915@@ -10067,7 +10163,7 @@
    76957916      */
    76967917     if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL
     
    77017922        return FAIL;
    77027923 
    7703 @@ -10689,7 +10776,8 @@
     7924@@ -10485,6 +10581,9 @@
     7925     if (buf->b_sfname != NULL
     7926            && flagp == &ssop_flags
     7927            && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR))
     7928+#ifdef FEAT_AUTOCHDIR
     7929+           && !p_acd
     7930+#endif
     7931            && !did_lcd)
     7932        name = buf->b_sfname;
     7933     else
     7934@@ -10689,7 +10788,8 @@
    77047935        p_viminfo = (char_u *)"'100";
    77057936     if (eap->cmdidx == CMD_rviminfo)
     
    77117942     }
    77127943     else
    7713 @@ -10850,10 +10938,9 @@
     7944@@ -10850,10 +10950,9 @@
    77147945 }
    77157946 #endif
     
    77237954 #ifdef FEAT_DIGRAPHS
    77247955     if (*eap->arg != NUL)
    7725 @@ -10887,10 +10974,9 @@
     7956@@ -10887,10 +10986,9 @@
    77267957 /*
    77277958  * ":nohlsearch"
     
    77357966     no_hlsearch = TRUE;
    77367967     redraw_all_later(SOME_VALID);
    7737 @@ -10969,10 +11055,9 @@
     7968@@ -10969,10 +11067,9 @@
    77387969 /*
    77397970  * ":X": Get crypt key
     
    77497980diff -Naur vim72.orig/src/ex_eval.c vim72/src/ex_eval.c
    77507981--- vim72.orig/src/ex_eval.c    2007-11-24 07:34:09.000000000 -0800
    7751 +++ vim72/src/ex_eval.c 2009-06-05 14:25:02.000000000 -0700
     7982+++ vim72/src/ex_eval.c 2009-07-19 15:16:23.000000000 -0700
    77527983@@ -60,7 +60,9 @@
    77537984 #else
     
    77958026diff -Naur vim72.orig/src/ex_getln.c vim72/src/ex_getln.c
    77968027--- vim72.orig/src/ex_getln.c   2008-08-08 02:31:33.000000000 -0700
    7797 +++ vim72/src/ex_getln.c        2009-06-05 14:25:02.000000000 -0700
     8028+++ vim72/src/ex_getln.c        2009-07-19 15:18:07.000000000 -0700
    77988029@@ -31,6 +31,8 @@
    77998030     int                cmdattr;        /* attributes for prompt */
     
    80118242            {
    80128243                if (tab[i].ic)
     8244@@ -4831,14 +4874,14 @@
     8245     /* Loop over the items in the list. */
     8246     for (li = retlist->lv_first; li != NULL; li = li->li_next)
     8247     {
     8248-       if (li->li_tv.v_type != VAR_STRING)
     8249-           continue;  /* Skip non-string items */
     8250+       if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL)
     8251+           continue;  /* Skip non-string items and empty strings */
     8252 
     8253        if (ga_grow(&ga, 1) == FAIL)
     8254            break;
     8255 
     8256        ((char_u **)ga.ga_data)[ga.ga_len] =
     8257-           vim_strsave(li->li_tv.vval.v_string);
     8258+                                        vim_strsave(li->li_tv.vval.v_string);
     8259        ++ga.ga_len;
     8260     }
     8261     list_unref(retlist);
    80138262@@ -4871,7 +4914,7 @@
    80148263     if (s == NULL)
     
    80878336diff -Naur vim72.orig/src/farsi.c vim72/src/farsi.c
    80888337--- vim72.orig/src/farsi.c      2007-12-31 08:28:10.000000000 -0800
    8089 +++ vim72/src/farsi.c   2009-06-05 14:25:02.000000000 -0700
     8338+++ vim72/src/farsi.c   2009-07-19 15:16:23.000000000 -0700
    80908339@@ -103,7 +103,8 @@
    80918340        case F_HE:
     
    81408389diff -Naur vim72.orig/src/feature.h vim72/src/feature.h
    81418390--- vim72.orig/src/feature.h    2008-08-06 04:00:39.000000000 -0700
    8142 +++ vim72/src/feature.h 2009-06-05 14:16:09.000000000 -0700
     8391+++ vim72/src/feature.h 2009-07-19 15:09:53.000000000 -0700
    81438392@@ -767,9 +767,13 @@
    81448393 
     
    81598408diff -Naur vim72.orig/src/fileio.c vim72/src/fileio.c
    81608409--- vim72.orig/src/fileio.c     2008-08-06 04:01:03.000000000 -0700
    8161 +++ vim72/src/fileio.c  2009-06-05 14:25:02.000000000 -0700
     8410+++ vim72/src/fileio.c  2009-07-19 15:18:23.000000000 -0700
    81628411@@ -69,7 +69,7 @@
    81638412 static int au_find_group __ARGS((char_u *name));
     
    82228471                        filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
    82238472                    else
    8224 @@ -668,6 +697,17 @@
     8473@@ -668,9 +697,21 @@
    82258474 #endif
    82268475     {
     
    82398488 #ifdef UNIX
    82408489        /* Set swap file protection bits after creating it. */
    8241         if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
    8242 @@ -698,7 +738,6 @@
     8490-       if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
     8491+       if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL
     8492+                         && curbuf->b_ml.ml_mfp->mf_fname != NULL)
     8493            (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode);
     8494 #endif
     8495     }
     8496@@ -698,7 +739,6 @@
    82438497     {
    82448498        int     m = msg_scroll;
     
    82488502        /*
    82498503         * The file must be closed again, the autocommands may want to change
    8250 @@ -740,8 +779,13 @@
     8504@@ -740,8 +780,13 @@
    82518505        /*
    82528506         * Don't allow the autocommands to change the current buffer.
     
    82628516        {
    82638517            --no_wait_return;
    8264 @@ -932,7 +976,10 @@
     8518@@ -932,7 +977,10 @@
    82658519     else
    82668520     {
     
    82738527            fileformat = EOL_UNIX;              /* binary: use Unix format */
    82748528        else if (*p_ffs == NUL)
    8275 @@ -2211,7 +2258,7 @@
     8529@@ -2211,7 +2259,7 @@
    82768530     {
    82778531        /* Use stderr for stdin, makes shell commands work. */
     
    82828536 #endif
    82838537 
    8284 @@ -2341,11 +2388,6 @@
     8538@@ -2341,11 +2389,6 @@
    82858539                STRCAT(IObuff, _("[CR missing]"));
    82868540                c = TRUE;
     
    82948548            {
    82958549                STRCAT(IObuff, _("[long lines split]"));
    8296 @@ -2711,7 +2753,7 @@
     8550@@ -2711,7 +2754,7 @@
    82978551 {
    82988552     if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
     
    83038557     /* Always set b_marks_read; needed when 'viminfo' is changed to include
    83048558      * the ' parameter after opening a buffer. */
    8305 @@ -3451,12 +3493,12 @@
     8559@@ -3451,12 +3494,12 @@
    83068560                {
    83078561 # ifdef UNIX
     
    83188572 # endif
    83198573                    /* Close the file before removing it, on MS-Windows we
    8320 @@ -4367,14 +4409,14 @@
     8574@@ -4367,14 +4410,14 @@
    83218575                || st.st_uid != st_old.st_uid
    83228576                || st.st_gid != st_old.st_gid)
     
    83358589        buf_setino(buf);
    83368590 #endif
    8337 @@ -5246,13 +5288,16 @@
     8591@@ -4782,6 +4825,8 @@
     8592     char_u     *sfname;
     8593 {
     8594 #ifdef FEAT_AUTOCMD
     8595+    buf_T      *buf = curbuf;
     8596+
     8597     /* It's like the unnamed buffer is deleted.... */
     8598     if (curbuf->b_p_bl)
     8599        apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
     8600@@ -4790,6 +4835,12 @@
     8601     if (aborting())        /* autocmds may abort script processing */
     8602        return FAIL;
     8603 # endif
     8604+    if (curbuf != buf)
     8605+    {
     8606+       /* We are in another buffer now, don't do the renaming. */
     8607+       EMSG(_(e_auchangedbuf));
     8608+       return FAIL;
     8609+    }
     8610 #endif
     8611 
     8612     if (setfname(curbuf, fname, sfname, FALSE) == OK)
     8613@@ -5246,13 +5297,16 @@
    83388614            /* Convert with iconv(). */
    83398615            if (ip->bw_restlen > 0)
     
    83558631            }
    83568632            else
    8357 @@ -5550,9 +5595,10 @@
     8633@@ -5550,9 +5604,10 @@
    83588634            name = "ucs-4le";   /* FF FE 00 00 */
    83598635            len = 4;
     
    83688644     }
    83698645     else if (p[0] == 0xfe && p[1] == 0xff
    8370 @@ -5917,7 +5963,7 @@
     8646@@ -5917,7 +5972,7 @@
    83718647        else if (*ext == '.')
    83728648 #endif
     
    83778653                s = ptr + 8;
    83788654                *s = '\0';
    8379 @@ -6031,9 +6077,9 @@
     8655@@ -6031,9 +6086,9 @@
    83808656        {
    83818657            tbuf[FGETS_SIZE - 2] = NUL;
     
    83898665        } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
    83908666     }
    8391 @@ -6107,12 +6153,24 @@
     8667@@ -6107,12 +6162,24 @@
    83928668 #ifdef HAVE_ACL
    83938669     vim_acl_T  acl;            /* ACL from original file */
     
    84168692     /*
    84178693      * Fail if the "from" file doesn't exist.  Avoids that "to" is deleted.
    8418 @@ -6120,6 +6178,55 @@
     8694@@ -6120,6 +6187,55 @@
    84198695     if (mch_stat((char *)from, &st) < 0)
    84208696        return -1;
     
    84728748      * Delete the "to" file, this is required on some systems to make the
    84738749      * mch_rename() work, on other systems it makes sure that we don't have
    8474 @@ -6260,7 +6367,7 @@
     8750@@ -6260,7 +6376,7 @@
    84758751 
    84768752     if (!stuff_empty() || global_busy || !typebuf_typed()
     
    84818757                                        )
    84828758        need_check_timestamps = TRUE;           /* check later */
    8483 @@ -6353,11 +6460,10 @@
     8759@@ -6353,11 +6469,10 @@
    84848760  * return 2 if a message has been displayed.
    84858761  * return 0 otherwise.
     
    84948770     struct stat        st;
    84958771     int                stat_res;
    8496 @@ -6462,8 +6568,10 @@
     8772@@ -6462,8 +6577,10 @@
    84978773            set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1);
    84988774            set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1);
     
    85058781            if (n)
    85068782            {
    8507 @@ -6538,6 +6646,11 @@
     8783@@ -6511,7 +6628,10 @@
     8784                        mesg = _("W16: Warning: Mode of file \"%s\" has changed since editing started");
     8785                        mesg2 = _("See \":help W16\" for more info.");
     8786                    }
     8787-                   /* Else: only timestamp changed, ignored */
     8788+                   else
     8789+                       /* Only timestamp changed, store it to avoid a warning
     8790+                        * in check_mtime() later. */
     8791+                       buf->b_mtime_read = buf->b_mtime;
     8792                }
     8793            }
     8794        }
     8795@@ -6538,6 +6658,11 @@
    85088796            tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
    85098797                                                        + STRLEN(mesg2) + 2));
     
    85178805            if (can_reload)
    85188806            {
    8519 @@ -6732,10 +6845,11 @@
     8807@@ -6732,10 +6857,11 @@
    85208808 #endif
    85218809 #ifdef FEAT_FOLDING
     
    85318819                        && !foldmethodIsManual(wp))
    85328820                    foldUpdateAll(wp);
    8533 @@ -6753,12 +6867,11 @@
     8821@@ -6753,12 +6879,11 @@
    85348822     /* Careful: autocommands may have made "buf" invalid! */
    85358823 }
     
    85458833     buf->b_mtime = (long)st->st_mtime;
    85468834     buf->b_orig_size = (size_t)st->st_size;
    8547 @@ -6821,10 +6934,9 @@
     8835@@ -6821,10 +6946,9 @@
    85488836  * The returned pointer is to allocated memory.
    85498837  * The returned pointer is NULL if no valid name was found.
     
    85578845 #ifdef USE_TMPNAM
    85588846     char_u     itmp[L_tmpnam]; /* use tmpnam() */
    8559 @@ -6853,7 +6965,7 @@
     8847@@ -6853,7 +6977,7 @@
    85608848        /*
    85618849         * Try the entries in TEMPDIRNAMES to create the temp directory.
     
    85668854            /* expand $TMP, leave room for "/v1100000/999999999" */
    85678855            expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
    8568 @@ -8523,6 +8635,7 @@
     8856@@ -8245,7 +8369,7 @@
     8857 
     8858            /* Execute the modeline settings, but don't set window-local
     8859             * options if we are using the current window for another buffer. */
     8860-           do_modelines(aco.save_curwin == NULL ? OPT_NOWIN : 0);
     8861+           do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0);
     8862 
     8863            /* restore the current window */
     8864            aucmd_restbuf(&aco);
     8865@@ -8261,8 +8385,8 @@
     8866 
     8867 /*
     8868  * Prepare for executing autocommands for (hidden) buffer "buf".
     8869- * Search a window for the current buffer.  Save the cursor position and
     8870- * screen offset.
     8871+ * Search for a visible window containing the current buffer.  If there isn't
     8872+ * one then use "aucmd_win".
     8873  * Set "curbuf" and "curwin" to match "buf".
     8874  * When FEAT_AUTOCMD is not defined another version is used, see below.
     8875  */
     8876@@ -8272,8 +8396,9 @@
     8877     buf_T      *buf;           /* new curbuf */
     8878 {
     8879     win_T      *win;
     8880-
     8881-    aco->new_curbuf = buf;
     8882+#ifdef FEAT_WINDOWS
     8883+    int                save_ea;
     8884+#endif
     8885 
     8886     /* Find a window that is for the new buffer */
     8887     if (buf == curbuf)         /* be quick when buf is curbuf */
     8888@@ -8287,42 +8412,51 @@
     8889        win = NULL;
     8890 #endif
     8891 
     8892-    /*
     8893-     * Prefer to use an existing window for the buffer, it has the least side
     8894-     * effects (esp. if "buf" is curbuf).
     8895-     * Otherwise, use curwin for "buf".  It might make some items in the
     8896-     * window invalid.  At least save the cursor and topline.
     8897-     */
     8898+    /* Allocate "aucmd_win" when needed.  If this fails (out of memory) fall
     8899+     * back to using the current window. */
     8900+    if (win == NULL && aucmd_win == NULL)
     8901+    {
     8902+       win_alloc_aucmd_win();
     8903+       if (aucmd_win == NULL)
     8904+           win = curwin;
     8905+    }
     8906+
     8907+    aco->save_curwin = curwin;
     8908+    aco->save_curbuf = curbuf;
     8909     if (win != NULL)
     8910     {
     8911-       /* there is a window for "buf", make it the curwin */
     8912-       aco->save_curwin = curwin;
     8913+       /* There is a window for "buf" in the current tab page, make it the
     8914+        * curwin.  This is preferred, it has the least side effects (esp. if
     8915+        * "buf" is curbuf). */
     8916        curwin = win;
     8917-       aco->save_buf = win->w_buffer;
     8918-       aco->new_curwin = win;
     8919     }
     8920     else
     8921     {
     8922-       /* there is no window for "buf", use curwin */
     8923-       aco->save_curwin = NULL;
     8924-       aco->save_buf = curbuf;
     8925-       --curbuf->b_nwindows;
     8926-       curwin->w_buffer = buf;
     8927+       /* There is no window for "buf", use "aucmd_win".  To minimize the side
     8928+        * effects, insert it in a the current tab page.
     8929+        * Anything related to a window (e.g., setting folds) may have
     8930+        * unexpected results. */
     8931+       aucmd_win->w_buffer = buf;
     8932        ++buf->b_nwindows;
     8933+       win_init_empty(aucmd_win); /* set cursor and topline to safe values */
     8934 
     8935-       /* save cursor and topline, set them to safe values */
     8936-       aco->save_cursor = curwin->w_cursor;
     8937-       curwin->w_cursor.lnum = 1;
     8938-       curwin->w_cursor.col = 0;
     8939-       aco->save_topline = curwin->w_topline;
     8940-       curwin->w_topline = 1;
     8941-#ifdef FEAT_DIFF
     8942-       aco->save_topfill = curwin->w_topfill;
     8943-       curwin->w_topfill = 0;
     8944+#ifdef FEAT_WINDOWS
     8945+       /* Split the current window, put the aucmd_win in the upper half.
     8946+        * We don't want the BufEnter or WinEnter autocommands. */
     8947+       block_autocmds();
     8948+       make_snapshot(SNAP_AUCMD_IDX);
     8949+       save_ea = p_ea;
     8950+       p_ea = FALSE;
     8951+       (void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
     8952+       (void)win_comp_pos();   /* recompute window positions */
     8953+       p_ea = save_ea;
     8954+       unblock_autocmds();
     8955 #endif
     8956+       curwin = aucmd_win;
     8957     }
     8958-
     8959     curbuf = buf;
     8960+    aco->new_curwin = curwin;
     8961+    aco->new_curbuf = curbuf;
     8962 }
     8963 
     8964 /*
     8965@@ -8334,21 +8468,88 @@
     8966 aucmd_restbuf(aco)
     8967     aco_save_T *aco;           /* structure holding saved values */
     8968 {
     8969-    if (aco->save_curwin != NULL)
     8970+#ifdef FEAT_WINDOWS
     8971+    int dummy;
     8972+#endif
     8973+
     8974+    if (aco->new_curwin == aucmd_win)
     8975+    {
     8976+       --curbuf->b_nwindows;
     8977+#ifdef FEAT_WINDOWS
     8978+       /* Find "aucmd_win", it can't be closed, but it may be in another tab
     8979+        * page. Do not trigger autocommands here. */
     8980+       block_autocmds();
     8981+       if (curwin != aucmd_win)
     8982+       {
     8983+           tabpage_T   *tp;
     8984+           win_T       *wp;
     8985+
     8986+           FOR_ALL_TAB_WINDOWS(tp, wp)
     8987+           {
     8988+               if (wp == aucmd_win)
     8989+               {
     8990+                   if (tp != curtab)
     8991+                       goto_tabpage_tp(tp);
     8992+                   win_goto(aucmd_win);
     8993+                   break;
     8994+               }
     8995+           }
     8996+       }
     8997+
     8998+       /* Remove the window and frame from the tree of frames. */
     8999+       (void)winframe_remove(curwin, &dummy, NULL);
     9000+       win_remove(curwin, NULL);
     9001+       last_status(FALSE);         /* may need to remove last status line */
     9002+       restore_snapshot(SNAP_AUCMD_IDX, FALSE);
     9003+       (void)win_comp_pos();   /* recompute window positions */
     9004+       unblock_autocmds();
     9005+
     9006+       if (win_valid(aco->save_curwin))
     9007+           curwin = aco->save_curwin;
     9008+       else
     9009+           /* Hmm, original window disappeared.  Just use the first one. */
     9010+           curwin = firstwin;
     9011+# ifdef FEAT_EVAL
     9012+       vars_clear(&aucmd_win->w_vars.dv_hashtab);  /* free all w: variables */
     9013+# endif
     9014+#else
     9015+       curwin = aco->save_curwin;
     9016+#endif
     9017+       curbuf = curwin->w_buffer;
     9018+
     9019+       /* the buffer contents may have changed */
     9020+       check_cursor();
     9021+       if (curwin->w_topline > curbuf->b_ml.ml_line_count)
     9022+       {
     9023+           curwin->w_topline = curbuf->b_ml.ml_line_count;
     9024+#ifdef FEAT_DIFF
     9025+           curwin->w_topfill = 0;
     9026+#endif
     9027+       }
     9028+#if defined(FEAT_GUI)
     9029+       /* Hide the scrollbars from the aucmd_win and update. */
     9030+       gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE);
     9031+       gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE);
     9032+       gui_may_update_scrollbars();
     9033+#endif
     9034+    }
     9035+    else
     9036     {
     9037        /* restore curwin */
     9038 #ifdef FEAT_WINDOWS
     9039        if (win_valid(aco->save_curwin))
     9040 #endif
     9041        {
     9042-           /* restore the buffer which was previously edited by curwin, if
     9043-            * it's still the same window and it's valid */
     9044+           /* Restore the buffer which was previously edited by curwin, if
     9045+            * it was chagned, we are still the same window and the buffer is
     9046+            * valid. */
     9047            if (curwin == aco->new_curwin
     9048-                   && buf_valid(aco->save_buf)
     9049-                   && aco->save_buf->b_ml.ml_mfp != NULL)
     9050+                   && curbuf != aco->new_curbuf
     9051+                   && buf_valid(aco->new_curbuf)
     9052+                   && aco->new_curbuf->b_ml.ml_mfp != NULL)
     9053            {
     9054                --curbuf->b_nwindows;
     9055-               curbuf = aco->save_buf;
     9056+               curbuf = aco->new_curbuf;
     9057                curwin->w_buffer = curbuf;
     9058                ++curbuf->b_nwindows;
     9059            }
     9060@@ -8357,34 +8558,6 @@
     9061            curbuf = curwin->w_buffer;
     9062        }
     9063     }
     9064-    else
     9065-    {
     9066-       /* restore buffer for curwin if it still exists and is loaded */
     9067-       if (buf_valid(aco->save_buf) && aco->save_buf->b_ml.ml_mfp != NULL)
     9068-       {
     9069-           --curbuf->b_nwindows;
     9070-           curbuf = aco->save_buf;
     9071-           curwin->w_buffer = curbuf;
     9072-           ++curbuf->b_nwindows;
     9073-           curwin->w_cursor = aco->save_cursor;
     9074-           check_cursor();
     9075-           /* check topline < line_count, in case lines got deleted */
     9076-           if (aco->save_topline <= curbuf->b_ml.ml_line_count)
     9077-           {
     9078-               curwin->w_topline = aco->save_topline;
     9079-#ifdef FEAT_DIFF
     9080-               curwin->w_topfill = aco->save_topfill;
     9081-#endif
     9082-           }
     9083-           else
     9084-           {
     9085-               curwin->w_topline = curbuf->b_ml.ml_line_count;
     9086-#ifdef FEAT_DIFF
     9087-               curwin->w_topfill = 0;
     9088-#endif
     9089-           }
     9090-       }
     9091-    }
     9092 }
     9093 
     9094 static int     autocmd_nested = FALSE;
     9095@@ -8523,6 +8696,7 @@
    85699096     char_u     *save_sourcing_name;
    85709097     linenr_T   save_sourcing_lnum;
     
    85749101     char_u     *save_autocmd_match;
    85759102     int                save_autocmd_busy;
    8576 @@ -8601,6 +8714,7 @@
     9103@@ -8601,6 +8775,7 @@
    85779104      * Save the autocmd_* variables and info about the current buffer.
    85789105      */
     
    85829109     save_autocmd_match = autocmd_match;
    85839110     save_autocmd_busy = autocmd_busy;
    8584 @@ -8618,14 +8732,15 @@
     9111@@ -8618,14 +8793,15 @@
    85859112        if (fname != NULL && *fname != NUL)
    85869113            autocmd_fname = fname;
     
    86009127     /*
    86019128      * Set the buffer number to be used for <abuf>.
    8602 @@ -8667,9 +8782,11 @@
     9129@@ -8667,9 +8843,11 @@
    86039130     else
    86049131     {
     
    86139140                || event == EVENT_SPELLFILEMISSING
    86149141                || event == EVENT_QUICKFIXCMDPRE
    8615 @@ -8810,6 +8927,7 @@
     9142@@ -8810,6 +8988,7 @@
    86169143     sourcing_lnum = save_sourcing_lnum;
    86179144     vim_free(autocmd_fname);
     
    86219148     autocmd_match = save_autocmd_match;
    86229149 #ifdef FEAT_EVAL
    8623 @@ -8918,7 +9036,7 @@
     9150@@ -8918,7 +9097,7 @@
    86249151     {
    86259152        apc->curpat = NULL;
     
    86309157         * buffer number. */
    86319158        if (ap->pat != NULL && ap->cmds != NULL
    8632 @@ -8967,12 +9085,11 @@
     9159@@ -8967,12 +9146,11 @@
    86339160  * Called by do_cmdline() to get the next line for ":if".
    86349161  * Returns allocated string, or NULL for end of autocommands.
     
    86459172     AutoPatCmd     *acp = (AutoPatCmd *)cookie;
    86469173     char_u         *retval;
    8647 @@ -9083,10 +9200,9 @@
     9174@@ -9083,10 +9261,9 @@
    86489175  * Function given to ExpandGeneric() to obtain the list of autocommand group
    86499176  * names.
     
    86579184 {
    86589185     if (idx == augroups.ga_len)                /* add "END" add the end */
    8659 @@ -9104,7 +9220,7 @@
     9186@@ -9104,7 +9281,7 @@
    86609187 set_context_in_autocmd(xp, arg, doautocmd)
    86619188     expand_T   *xp;
     
    86669193     char_u     *p;
    86679194     int                group;
    8668 @@ -9152,10 +9268,9 @@
     9195@@ -9152,10 +9329,9 @@
    86699196 /*
    86709197  * Function given to ExpandGeneric() to obtain the list of event names.
     
    86789205 {
    86799206     if (idx < augroups.ga_len)         /* First list group names, if wanted */
    8680 @@ -9467,13 +9582,12 @@
     9207@@ -9296,9 +9472,11 @@
     9208     aco_save_T *aco;           /* structure to save values in */
     9209     buf_T      *buf;           /* new curbuf */
     9210 {
     9211-    aco->save_buf = curbuf;
     9212+    aco->save_curbuf = curbuf;
     9213+    --curbuf->b_nwindows;
     9214     curbuf = buf;
     9215     curwin->w_buffer = buf;
     9216+    ++curbuf->b_nwindows;
     9217 }
     9218 
     9219 /*
     9220@@ -9309,8 +9487,10 @@
     9221 aucmd_restbuf(aco)
     9222     aco_save_T *aco;           /* structure holding saved values */
     9223 {
     9224-    curbuf = aco->save_buf;
     9225+    --curbuf->b_nwindows;
     9226+    curbuf = aco->save_curbuf;
     9227     curwin->w_buffer = curbuf;
     9228+    ++curbuf->b_nwindows;
     9229 }
     9230 
     9231 #endif /* FEAT_AUTOCMD */
     9232@@ -9467,13 +9647,12 @@
    86819233  *
    86829234  * Returns NULL when out of memory.
     
    86959247diff -Naur vim72.orig/src/fold.c vim72/src/fold.c
    86969248--- vim72.orig/src/fold.c       2008-08-06 04:01:12.000000000 -0700
    8697 +++ vim72/src/fold.c    2009-06-05 14:19:21.000000000 -0700
     9249+++ vim72/src/fold.c    2009-07-19 15:11:59.000000000 -0700
    86989250@@ -48,7 +48,7 @@
    86999251 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
     
    87849336diff -Naur vim72.orig/src/getchar.c vim72/src/getchar.c
    87859337--- vim72.orig/src/getchar.c    2008-07-22 09:57:48.000000000 -0700
    8786 +++ vim72/src/getchar.c 2009-06-05 14:22:17.000000000 -0700
    8787 @@ -3816,7 +3816,11 @@
     9338+++ vim72/src/getchar.c 2009-07-19 15:18:49.000000000 -0700
     9339@@ -1309,6 +1309,9 @@
     9340     return OK;
     9341 }
     9342 
     9343+static int old_char = -1;      /* character put back by vungetc() */
     9344+static int old_mod_mask;       /* mod_mask for ungotten character */
     9345+
     9346 #if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
     9347 
     9348 /*
     9349@@ -1323,6 +1326,10 @@
     9350     if (!tp->typebuf_valid)
     9351        typebuf = tp->save_typebuf;
     9352 
     9353+    tp->old_char = old_char;
     9354+    tp->old_mod_mask = old_mod_mask;
     9355+    old_char = -1;
     9356+
     9357     tp->save_stuffbuff = stuffbuff;
     9358     stuffbuff.bh_first.b_next = NULL;
     9359 # ifdef USE_INPUT_BUF
     9360@@ -1344,6 +1351,9 @@
     9361        typebuf = tp->save_typebuf;
     9362     }
     9363 
     9364+    old_char = tp->old_char;
     9365+    old_mod_mask = tp->old_mod_mask;
     9366+
     9367     free_buff(&stuffbuff);
     9368     stuffbuff = tp->save_stuffbuff;
     9369 # ifdef USE_INPUT_BUF
     9370@@ -1499,9 +1509,6 @@
     9371 #define KL_PART_KEY -1         /* keylen value for incomplete key-code */
     9372 #define KL_PART_MAP -2         /* keylen value for incomplete mapping */
     9373 
     9374-static int old_char = -1;      /* character put back by vungetc() */
     9375-static int old_mod_mask;       /* mod_mask for ungotten character */
     9376-
     9377 /*
     9378  * Get the next input character.
     9379  * Can return a special key or a multi-byte character.
     9380@@ -3701,11 +3708,10 @@
     9381  * Clear all mappings or abbreviations.
     9382  * 'abbr' should be FALSE for mappings, TRUE for abbreviations.
     9383  */
     9384-/*ARGSUSED*/
     9385     void
     9386 map_clear(cmdp, arg, forceit, abbr)
     9387     char_u     *cmdp;
     9388-    char_u     *arg;
     9389+    char_u     *arg UNUSED;
     9390     int                forceit;
     9391     int                abbr;
     9392 {
     9393@@ -3734,13 +3740,12 @@
     9394 /*
     9395  * Clear all mappings in "mode".
     9396  */
     9397-/*ARGSUSED*/
     9398     void
     9399 map_clear_int(buf, mode, local, abbr)
     9400-    buf_T      *buf;       /* buffer for local mappings */
     9401-    int                mode;       /* mode in which to delete */
     9402-    int                local;      /* TRUE for buffer-local mappings */
     9403-    int                abbr;       /* TRUE for abbreviations */
     9404+    buf_T      *buf UNUSED;    /* buffer for local mappings */
     9405+    int                mode;           /* mode in which to delete */
     9406+    int                local UNUSED;   /* TRUE for buffer-local mappings */
     9407+    int                abbr;           /* TRUE for abbreviations */
     9408 {
     9409     mapblock_T *mp, **mpp;
     9410     int                hash;
     9411@@ -3816,7 +3821,11 @@
    87889412     int len = 1;
    87899413 
     
    87979421        msg_putchar('!');                       /* :map! */
    87989422     else if (mp->m_mode & INSERT)
    8799 @@ -4702,7 +4706,7 @@
     9423@@ -4702,7 +4711,7 @@
    88009424                        return FAIL;
    88019425                    if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0)
     
    88069430                    if (buf != NULL && fputs(" <buffer>", fd) < 0)
    88079431                        return FAIL;
    8808 @@ -4801,7 +4805,7 @@
     9432@@ -4801,7 +4810,7 @@
    88099433            }
    88109434            if (IS_SPECIAL(c) || modifiers)     /* special key */
     
    88179441diff -Naur vim72.orig/src/globals.h vim72/src/globals.h
    88189442--- vim72.orig/src/globals.h    2008-07-26 04:53:29.000000000 -0700
    8819 +++ vim72/src/globals.h 2009-06-05 14:24:27.000000000 -0700
     9443+++ vim72/src/globals.h 2009-07-19 15:17:39.000000000 -0700
    88209444@@ -482,8 +482,10 @@
    88219445 /*
     
    88309454 /*
    88319455  * When resizing the shell is postponed, remember the new size, and call
    8832 @@ -522,7 +524,7 @@
     9456@@ -507,6 +509,7 @@
     9457 EXTERN int     clip_unnamed INIT(= FALSE);
     9458 EXTERN int     clip_autoselect INIT(= FALSE);
     9459 EXTERN int     clip_autoselectml INIT(= FALSE);
     9460+EXTERN int     clip_html INIT(= FALSE);
     9461 EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
     9462 #endif
     9463 
     9464@@ -522,7 +525,7 @@
    88339465 EXTERN win_T   *prevwin INIT(= NULL);  /* previous window */
    88349466 # define W_NEXT(wp) ((wp)->w_next)
     
    88399471        for ((wp) = ((tp) == curtab) \
    88409472                ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
    8841 @@ -597,7 +599,8 @@
     9473@@ -536,6 +539,10 @@
     9474 
     9475 EXTERN win_T   *curwin;        /* currently active window */
     9476 
     9477+#ifdef FEAT_AUTOCMD
     9478+EXTERN win_T   *aucmd_win;     /* window used in aucmd_prepbuf() */
     9479+#endif
     9480+
     9481 /*
     9482  * The window layout is kept in a tree of frames.  topframe points to the top
     9483  * of the tree.
     9484@@ -597,7 +604,8 @@
    88429485 EXTERN int     really_exiting INIT(= FALSE);
    88439486                                /* TRUE when we are sure to exit, e.g., after
     
    88499492                                 * otherwise only writing some messages */
    88509493 
    8851 @@ -616,6 +619,11 @@
     9494@@ -616,6 +624,11 @@
    88529495 EXTERN int     curbuf_lock INIT(= 0);
    88539496                                /* non-zero when the current buffer can't be
     
    88619504 #ifdef FEAT_EVAL
    88629505 # define HAVE_SANDBOX
    8863 @@ -710,7 +718,7 @@
     9506@@ -710,7 +723,7 @@
    88649507 
    88659508 EXTERN pos_T   saved_cursor            /* w_cursor before formatting text. */
     
    88709513        ;
    88719514 
    8872 @@ -739,10 +747,12 @@
     9515@@ -739,10 +752,12 @@
    88739516  */
    88749517 EXTERN JMP_BUF lc_jump_env;    /* argument to SETJMP() */
     
    88869529 
    88879530 #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
    8888 @@ -986,7 +996,8 @@
     9531@@ -800,11 +815,14 @@
     9532  */
     9533 /* length of char in bytes, including following composing chars */
     9534 EXTERN int (*mb_ptr2len) __ARGS((char_u *p)) INIT(= latin_ptr2len);
     9535+/* idem, with limit on string length */
     9536+EXTERN int (*mb_ptr2len_len) __ARGS((char_u *p, int size)) INIT(= latin_ptr2len_len);
     9537 /* byte length of char */
     9538 EXTERN int (*mb_char2len) __ARGS((int c)) INIT(= latin_char2len);
     9539 /* convert char to bytes, return the length */
     9540 EXTERN int (*mb_char2bytes) __ARGS((int c, char_u *buf)) INIT(= latin_char2bytes);
     9541 EXTERN int (*mb_ptr2cells) __ARGS((char_u *p)) INIT(= latin_ptr2cells);
     9542+EXTERN int (*mb_ptr2cells_len) __ARGS((char_u *p, int size)) INIT(= latin_ptr2cells_len);
     9543 EXTERN int (*mb_char2cells) __ARGS((int c)) INIT(= latin_char2cells);
     9544 EXTERN int (*mb_off2cells) __ARGS((unsigned off, unsigned max_off)) INIT(= latin_off2cells);
     9545 EXTERN int (*mb_ptr2char) __ARGS((char_u *p)) INIT(= latin_ptr2char);
     9546@@ -950,7 +968,7 @@
     9547                    ;
     9548 EXTERN typebuf_T typebuf               /* typeahead buffer */
     9549 #ifdef DO_INIT
     9550-                   = {NULL, NULL}
     9551+                   = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0}
     9552 #endif
     9553                    ;
     9554 #ifdef FEAT_EX_EXTRA
     9555@@ -986,7 +1004,8 @@
    88899556 EXTERN FILE    *scriptout  INIT(= NULL);   /* stream to write script to */
    88909557 EXTERN int     read_cmd_fd INIT(= 0);      /* fd to read commands from */
     
    88969563 #ifdef USE_TERM_CONSOLE
    88979564 EXTERN int     term_console INIT(= FALSE); /* set to TRUE when console used */
    8898 @@ -1022,12 +1033,13 @@
     9565@@ -1022,12 +1041,13 @@
    88999566 #endif
    89009567 #ifdef FEAT_AUTOCMD
     
    89119578                        ;
    89129579 #endif
    8913 @@ -1339,7 +1351,6 @@
     9580@@ -1339,7 +1359,6 @@
    89149581 
    89159582 #ifdef FEAT_NETBEANS_INTG
     
    89199586 EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */
    89209587 EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */
    8921 @@ -1548,6 +1559,14 @@
     9588@@ -1548,6 +1567,14 @@
    89229589 EXTERN time_t starttime;
    89239590 
     
    89369603diff -Naur vim72.orig/src/gui_at_fs.c vim72/src/gui_at_fs.c
    89379604--- vim72.orig/src/gui_at_fs.c  2006-05-12 02:26:24.000000000 -0700
    8938 +++ vim72/src/gui_at_fs.c       2009-06-05 14:25:31.000000000 -0700
     9605+++ vim72/src/gui_at_fs.c       2009-07-19 15:16:46.000000000 -0700
    89399606@@ -829,7 +829,7 @@
    89409607     text.format = FMT8BIT;
     
    92229889diff -Naur vim72.orig/src/gui_athena.c vim72/src/gui_athena.c
    92239890--- vim72.orig/src/gui_athena.c 2008-06-21 12:38:58.000000000 -0700
    9224 +++ vim72/src/gui_athena.c      2009-06-05 14:25:31.000000000 -0700
     9891+++ vim72/src/gui_athena.c      2009-07-19 15:16:46.000000000 -0700
    92259892@@ -86,10 +86,9 @@
    92269893  * Scrollbar callback (XtNjumpProc) for when the scrollbar is dragged with the
     
    947910146diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c
    948010147--- vim72.orig/src/gui_at_sb.c  2004-06-07 07:32:25.000000000 -0700
    9481 +++ vim72/src/gui_at_sb.c       2009-06-05 14:25:31.000000000 -0700
     10148+++ vim72/src/gui_at_sb.c       2009-07-19 15:16:46.000000000 -0700
    948210149@@ -198,10 +198,13 @@
    948310150     /* extension       */  NULL
     
    972910396diff -Naur vim72.orig/src/gui_beval.c vim72/src/gui_beval.c
    973010397--- vim72.orig/src/gui_beval.c  2007-05-07 12:33:41.000000000 -0700
    9731 +++ vim72/src/gui_beval.c       2009-06-05 14:25:31.000000000 -0700
     10398+++ vim72/src/gui_beval.c       2009-07-19 15:16:46.000000000 -0700
    973210399@@ -15,11 +15,10 @@
    973310400 /*
     
    983010497diff -Naur vim72.orig/src/gui.c vim72/src/gui.c
    983110498--- vim72.orig/src/gui.c        2008-07-27 12:32:14.000000000 -0700
    9832 +++ vim72/src/gui.c     2009-06-05 14:25:31.000000000 -0700
     10499+++ vim72/src/gui.c     2009-07-19 15:18:18.000000000 -0700
    983310500@@ -139,7 +139,7 @@
    983410501                /* The read returns when the child closes the pipe (or when
     
    985310520 #define FONTLEN 320
    985410521     char_u     font_name[FONTLEN];
     10522@@ -960,7 +959,7 @@
     10523                guicolor_T fg, bg;
     10524 
     10525                if (
     10526-# ifdef HAVE_GTK2
     10527+# if defined(HAVE_GTK2) && !defined(FEAT_HANGULIN)
     10528                        preedit_get_status()
     10529 # else
     10530                        im_get_status()
    985510531@@ -1138,10 +1137,9 @@
    985610532  * Position the various GUI components (text area, menu).  The vertical
     
    997010646        }
    997110647 #ifdef FEAT_WINDOWS
    9972 @@ -4407,7 +4407,7 @@
     10648@@ -3879,6 +3879,21 @@
     10649  * Scrollbar stuff:
     10650  */
     10651 
     10652+/*
     10653+ * Called when something in the window layout has changed.
     10654+ */
     10655+    void
     10656+gui_may_update_scrollbars()
     10657+{
     10658+    if (gui.in_use && starting == 0)
     10659+    {
     10660+       out_flush();
     10661+       gui_init_which_components(NULL);
     10662+       gui_update_scrollbars(TRUE);
     10663+    }
     10664+    need_mouse_correct = TRUE;
     10665+}
     10666+
     10667     void
     10668 gui_update_scrollbars(force)
     10669     int                force;      /* Force all scrollbars to get updated */
     10670@@ -4407,7 +4422,7 @@
    997310671     if (curwin->w_p_wrap)
    997410672        return FALSE;
     
    997910677 
    998010678     curwin->w_leftcol = (colnr_T)scrollbar_value;
    9981 @@ -4420,7 +4420,7 @@
     10679@@ -4420,7 +4435,7 @@
    998210680            && longest_lnum < curwin->w_botline
    998310681            && !virtual_active())
     
    998810686            curwin->w_cursor.lnum = longest_lnum;
    998910687            curwin->w_cursor.col = 0;
    9990 @@ -4666,11 +4666,10 @@
     10688@@ -4666,11 +4681,10 @@
    999110689 /*
    999210690  * Find window where the mouse pointer "y" coordinate is in.
     
    1000210700 #ifdef FEAT_WINDOWS
    1000310701     int                row;
    10004 @@ -5120,11 +5119,10 @@
     10702@@ -5120,11 +5134,10 @@
    1000510703  * of dropped files, they will be freed in this function, and caller can't use
    1000610704  * fnames after call this function.
     
    1001810716diff -Naur vim72.orig/src/gui_gtk.c vim72/src/gui_gtk.c
    1001910717--- vim72.orig/src/gui_gtk.c    2008-07-31 12:48:20.000000000 -0700
    10020 +++ vim72/src/gui_gtk.c 2009-06-05 14:25:19.000000000 -0700
     10718+++ vim72/src/gui_gtk.c 2009-07-19 15:16:36.000000000 -0700
    1002110719@@ -285,14 +285,14 @@
    1002210720     return image;
     
    1022210920diff -Naur vim72.orig/src/gui_gtk_f.c vim72/src/gui_gtk_f.c
    1022310921--- vim72.orig/src/gui_gtk_f.c  2007-05-07 12:38:02.000000000 -0700
    10224 +++ vim72/src/gui_gtk_f.c       2009-06-05 14:25:22.000000000 -0700
     10922+++ vim72/src/gui_gtk_f.c       2009-07-19 15:16:39.000000000 -0700
    1022510923@@ -227,14 +227,14 @@
    1022610924 
     
    1030611004diff -Naur vim72.orig/src/gui_gtk_x11.c vim72/src/gui_gtk_x11.c
    1030711005--- vim72.orig/src/gui_gtk_x11.c        2008-07-04 03:46:24.000000000 -0700
    10308 +++ vim72/src/gui_gtk_x11.c     2009-06-05 14:26:08.000000000 -0700
    10309 @@ -412,6 +412,7 @@
     11006+++ vim72/src/gui_gtk_x11.c     2009-07-19 15:18:26.000000000 -0700
     11007@@ -107,6 +107,7 @@
     11008     TARGET_UTF8_STRING,
     11009     TARGET_STRING,
     11010     TARGET_COMPOUND_TEXT,
     11011+    TARGET_HTML,
     11012     TARGET_TEXT,
     11013     TARGET_TEXT_URI_LIST,
     11014     TARGET_TEXT_PLAIN,
     11015@@ -123,6 +124,7 @@
     11016     {VIMENC_ATOM_NAME, 0, TARGET_VIMENC},
     11017     {VIM_ATOM_NAME,    0, TARGET_VIM},
     11018 #ifdef FEAT_MBYTE
     11019+    {"text/html",      0, TARGET_HTML},
     11020     {"UTF8_STRING",    0, TARGET_UTF8_STRING},
     11021 #endif
     11022     {"COMPOUND_TEXT",  0, TARGET_COMPOUND_TEXT},
     11023@@ -140,6 +142,7 @@
     11024 {
     11025     {"text/uri-list",  0, TARGET_TEXT_URI_LIST},
     11026 # ifdef FEAT_MBYTE
     11027+    {"text/html",      0, TARGET_HTML},
     11028     {"UTF8_STRING",    0, TARGET_UTF8_STRING},
     11029 # endif
     11030     {"STRING",         0, TARGET_STRING},
     11031@@ -178,6 +181,7 @@
     11032  * Atoms used to control/reference X11 selections.
     11033  */
     11034 #ifdef FEAT_MBYTE
     11035+static GdkAtom html_atom = GDK_NONE;
     11036 static GdkAtom utf8_string_atom = GDK_NONE;
     11037 #endif
     11038 #ifndef HAVE_GTK2
     11039@@ -412,6 +416,7 @@
    1031011040 #endif
    1031111041 #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
     
    1031511045 static int found_iconic_arg = FALSE;
    1031611046 
    10317 @@ -449,8 +450,10 @@
     11047@@ -449,8 +454,10 @@
    1031811048        char_u buf[MAXPATHL];
    1031911049 
     
    1032811058 #endif
    1032911059 
    10330 @@ -611,6 +614,9 @@
     11060@@ -611,6 +618,9 @@
    1033111061 gui_mch_free_all()
    1033211062 {
     
    1033811068 #endif
    1033911069 
    10340 @@ -619,9 +625,10 @@
     11070@@ -619,9 +629,10 @@
    1034111071  * Doesn't seem possible, since check_copy_area() relies on
    1034211072  * this information.  --danielk
     
    1035111081     gui.visibility = event->state;
    1035211082     /*
    10353 @@ -638,9 +645,10 @@
     11083@@ -638,9 +649,10 @@
    1035411084 /*
    1035511085  * Redraw the corresponding portions of the screen.
     
    1036411094     /* Skip this when the GUI isn't set up yet, will redraw later. */
    1036511095     if (gui.starting)
    10366 @@ -668,9 +676,10 @@
     11096@@ -668,9 +680,10 @@
    1036711097 /*
    1036811098  * Handle changes to the "Comm" property
     
    1037711107     if (event->type == GDK_PROPERTY_NOTIFY
    1037811108            && event->state == (int)GDK_PROPERTY_NEW_VALUE
    10379 @@ -740,9 +749,8 @@
     11109@@ -740,9 +753,8 @@
    1038011110     blink_state = BLINK_NONE;
    1038111111 }
     
    1038811118     if (blink_state == BLINK_ON)
    1038911119     {
    10390 @@ -781,9 +789,10 @@
     11120@@ -781,9 +793,10 @@
    1039111121     }
    1039211122 }
     
    1040111131     if (blink_state == BLINK_NONE)
    1040211132        gui_mch_start_blink();
    10403 @@ -795,9 +804,10 @@
     11133@@ -795,9 +808,10 @@
    1040411134     return FALSE;
    1040511135 }
     
    1041411144     if (blink_state != BLINK_NONE)
    1041511145        gui_mch_stop_blink();
    10416 @@ -805,9 +815,10 @@
     11146@@ -805,9 +819,10 @@
    1041711147     return FALSE;
    1041811148 }
     
    1042711157     gui_focus_change(TRUE);
    1042811158 
    10429 @@ -826,9 +837,10 @@
     11159@@ -826,9 +841,10 @@
    1043011160     return TRUE;
    1043111161 }
     
    1044011170     gui_focus_change(FALSE);
    1044111171 
    10442 @@ -956,9 +968,10 @@
     11172@@ -956,9 +972,10 @@
    1044311173 /*
    1044411174  * Main keyboard handler:
     
    1045311183 #ifdef HAVE_GTK2
    1045411184     /* 256 bytes is way over the top, but for safety let's reduce it only
    10455 @@ -1225,9 +1238,10 @@
     11185@@ -1225,9 +1242,10 @@
    1045611186 }
    1045711187 
     
    1046611196     /*
    1046711197      * GTK+ 2 input methods may do fancy stuff on key release events too.
    10468 @@ -1243,11 +1257,10 @@
     11198@@ -1243,11 +1261,10 @@
    1046911199  * Selection handlers:
    1047011200  */
     
    1048011210     if (event->selection == clip_plus.gtk_sel_atom)
    1048111211        clip_lose_selection(&clip_plus);
    10482 @@ -1265,12 +1278,11 @@
     11212@@ -1265,12 +1282,11 @@
    1048311213 #define RS_FAIL        2       /* selection_received_cb() called and failed */
    1048411214 static int received_selection = RS_NONE;
     
    1049611226     VimClipboard    *cbd;
    1049711227     char_u         *text;
    10498 @@ -1414,13 +1426,12 @@
     11228@@ -1352,6 +1368,24 @@
     11229            else
     11230                text = tmpbuf_utf8;
     11231        }
     11232+       else if (len >= 2 && text[0] == 0xff && text[1] == 0xfe)
     11233+       {
     11234+           vimconv_T conv;
     11235+
     11236+           /* UTF-16, we get this for HTML */
     11237+           conv.vc_type = CONV_NONE;
     11238+           convert_setup_ext(&conv, (char_u *)"utf-16le", FALSE, p_enc, TRUE);
     11239+
     11240+           if (conv.vc_type != CONV_NONE)
     11241+           {
     11242+               text += 2;
     11243+               len -= 2;
     11244+               tmpbuf = string_convert(&conv, text, &len);
     11245+               convert_setup(&conv, NULL, NULL);
     11246+           }
     11247+           if (tmpbuf != NULL)
     11248+               text = tmpbuf;
     11249+       }
     11250     }
     11251 #else /* !HAVE_GTK2 */
     11252 # ifdef FEAT_MBYTE
     11253@@ -1414,13 +1448,12 @@
    1049911254  * Prepare our selection data for passing it to the external selection
    1050011255  * client.
     
    1051311268     char_u         *string;
    1051411269     char_u         *tmpbuf;
    10515 @@ -1678,7 +1689,7 @@
     11270@@ -1440,6 +1473,7 @@
     11271 
     11272     if (info != (guint)TARGET_STRING
     11273 #ifdef FEAT_MBYTE
     11274+           && (!clip_html || info != (guint)TARGET_HTML)
     11275            && info != (guint)TARGET_UTF8_STRING
     11276            && info != (guint)TARGET_VIMENC
     11277 #endif
     11278@@ -1475,6 +1509,40 @@
     11279     }
     11280 
     11281 #ifdef FEAT_MBYTE
     11282+    else if (info == (guint)TARGET_HTML)
     11283+    {
     11284+       vimconv_T conv;
     11285+
     11286+       /* Since we get utf-16, we probably should set it as well. */
     11287+       conv.vc_type = CONV_NONE;
     11288+       convert_setup_ext(&conv, p_enc, TRUE, (char_u *)"utf-16le", FALSE);
     11289+       if (conv.vc_type != CONV_NONE)
     11290+       {
     11291+           tmpbuf = string_convert(&conv, string, &length);
     11292+           convert_setup(&conv, NULL, NULL);
     11293+           vim_free(string);
     11294+           string = tmpbuf;
     11295+       }
     11296+
     11297+       /* Prepend the BOM: "fffe" */
     11298+       if (string != NULL)
     11299+       {
     11300+           tmpbuf = alloc(length + 2);
     11301+           tmpbuf[0] = 0xff;
     11302+           tmpbuf[1] = 0xfe;
     11303+           mch_memmove(tmpbuf + 2, string, (size_t)length);
     11304+           vim_free(string);
     11305+           string = tmpbuf;
     11306+           length += 2;
     11307+
     11308+           selection_data->type = selection_data->target;
     11309+           selection_data->format = 16;        /* 16 bits per char */
     11310+           gtk_selection_data_set(selection_data, html_atom, 16,
     11311+                                                             string, length);
     11312+           vim_free(string);
     11313+       }
     11314+       return;
     11315+    }
     11316     else if (info == (guint)TARGET_VIMENC)
     11317     {
     11318        int l = STRLEN(p_enc);
     11319@@ -1678,7 +1746,7 @@
    1051611320 
    1051711321        offshoot = dx > dy ? dx : dy;
     
    1052211326         *
    1052311327         * One could think endlessly about the most ergonomic variant here.
    10524 @@ -1707,9 +1718,8 @@
     11328@@ -1707,9 +1775,8 @@
    1052511329 /*
    1052611330  * Timer used to recognize multiple clicks of the mouse button.
     
    1053311337     int                    x;
    1053411338     int                    y;
    10535 @@ -1749,9 +1759,10 @@
     11339@@ -1749,9 +1816,10 @@
    1053611340     return FALSE;
    1053711341 }
     
    1054611350     if (event->is_hint)
    1054711351     {
    10548 @@ -1777,9 +1788,10 @@
     11352@@ -1777,9 +1845,10 @@
    1054911353  * by our own timeout mechanism instead of the one provided by GTK+ itself.
    1055011354  * This is due to the way the generic VIM code is recognizing multiple clicks.
     
    1055911363     int button;
    1056011364     int repeated_click = FALSE;
    10561 @@ -1855,9 +1867,10 @@
     11365@@ -1855,9 +1924,10 @@
    1056211366  * GTK+ 2 doesn't handle mouse buttons 4, 5, 6 and 7 the same way as GTK+ 1.
    1056311367  * Instead, it abstracts scrolling via the new GdkEventScroll.
     
    1057211376     int            button;
    1057311377     int_u   vim_modifiers;
    10574 @@ -1896,9 +1909,10 @@
     11378@@ -1896,9 +1966,10 @@
    1057511379 #endif /* HAVE_GTK2 */
    1057611380 
     
    1058511389     int x, y;
    1058611390     int_u vim_modifiers;
    10587 @@ -2100,7 +2114,6 @@
     11391@@ -2100,7 +2171,6 @@
    1058811392 /*
    1058911393  * DND receiver.
     
    1059311397 drag_data_received_cb(GtkWidget                *widget,
    1059411398                      GdkDragContext    *context,
    10595 @@ -2109,7 +2122,7 @@
     11399@@ -2109,7 +2179,7 @@
    1059611400                      GtkSelectionData  *data,
    1059711401                      guint             info,
     
    1060211406     GdkModifierType state;
    1060311407 
    10604 @@ -2143,7 +2156,6 @@
     11408@@ -2143,7 +2213,6 @@
    1060511409  * be abandoned and pop up a dialog asking the user for confirmation if
    1060611410  * necessary.
     
    1061011414 sm_client_check_changed_any(GnomeClient            *client,
    1061111415                            gint            key,
    10612 @@ -2251,7 +2263,6 @@
     11416@@ -2251,7 +2320,6 @@
    1061311417  * for confirmation if necessary.  Save the current editing session and tell
    1061411418  * the session manager how to restart Vim.
     
    1061811422 sm_client_save_yourself(GnomeClient        *client,
    1061911423                        gint                phase,
    10620 @@ -2339,7 +2350,6 @@
     11424@@ -2339,7 +2407,6 @@
    1062111425  * here since "save_yourself" has been emitted before (unless serious trouble
    1062211426  * is happening).
     
    1062611430 sm_client_die(GnomeClient *client, gpointer data)
    1062711431 {
    10628 @@ -2379,10 +2389,9 @@
     11432@@ -2379,10 +2446,9 @@
    1062911433 /*
    1063011434  * GTK tells us that XSMP needs attention
     
    1063811442     gpointer           data;
    1063911443 {
    10640 @@ -2480,16 +2489,18 @@
     11444@@ -2480,16 +2546,18 @@
    1064111445  * WM_SAVE_YOURSELF hack it actually stores the session...  And yes,
    1064211446  * it should work with KDE as well.
     
    1066011464        out_flush();
    1066111465        ml_sync_all(FALSE, FALSE); /* preserve all swap files */
    10662 @@ -2512,7 +2523,6 @@
     11466@@ -2512,7 +2580,6 @@
    1066311467 /*
    1066411468  * GDK handler for X ClientMessage events.
     
    1066811472 gdk_wm_protocols_filter(GdkXEvent *xev, GdkEvent *event, gpointer data)
    1066911473 {
    10670 @@ -2558,9 +2568,8 @@
     11474@@ -2558,9 +2625,8 @@
    1067111475 /*
    1067211476  * Setup the window icon & xcmdsrv comm after the main window has been realized.
     
    1067911483 /* If you get an error message here, you still need to unpack the runtime
    1068011484  * archive! */
    10681 @@ -2712,11 +2721,10 @@
     11485@@ -2712,11 +2778,10 @@
    1068211486 }
    1068311487 
     
    1069311497     if (!gtk_widget_has_screen(widget))
    1069411498        return;
    10695 @@ -2757,9 +2765,8 @@
     11499@@ -2757,9 +2822,8 @@
    1069611500  * Don't try to set any VIM scrollbar sizes anywhere here. I'm relying on the
    1069711501  * fact that the main VIM engine doesn't take them into account anywhere.
     
    1070411508     GtkWidget *sbar;
    1070511509 
    10706 @@ -2789,9 +2796,8 @@
     11510@@ -2789,9 +2853,8 @@
    1070711511 /*
    1070811512  * Properly clean up on shutdown.
     
    1071511519     /* Don't write messages to the GUI anymore */
    1071611520     full_screen = FALSE;
    10717 @@ -2827,11 +2833,10 @@
     11521@@ -2827,11 +2890,10 @@
    1071811522 #endif
    1071911523 }
     
    1073011534     gui_mch_new_colors();
    1073111535 }
    10732 @@ -2840,9 +2845,10 @@
     11536@@ -2840,9 +2902,10 @@
    1073311537  * Callback routine for the "delete_event" signal on the toplevel window.
    1073411538  * Tries to vim gracefully, or refuses to exit with changed buffers.
     
    1074311547     gui_shell_closed();
    1074411548     return TRUE;
    10745 @@ -2964,7 +2970,7 @@
     11549@@ -2964,7 +3027,7 @@
    1074611550 
    1074711551     /* At start-up, don't try to set the hints until the initial
     
    1075211556     if (!(force_width && force_height)  &&  init_window_hints_state > 0)
    1075311557     {
    10754 @@ -3142,9 +3148,8 @@
     11558@@ -3142,9 +3205,8 @@
    1075511559 /*
    1075611560  * Handle selecting an item in the tab line popup menu.
     
    1076311567     /* Add the string cmd into input buffer */
    1076411568     send_tabline_menu_event(clicked_page, (int)(long)user_data);
    10765 @@ -3244,13 +3249,12 @@
     11569@@ -3244,13 +3306,12 @@
    1076611570 /*
    1076711571  * Handle selecting one of the tabs.
     
    1078011584     if (!ignore_tabline_evt)
    1078111585     {
    10782 @@ -3784,7 +3788,7 @@
     11586@@ -3460,6 +3521,7 @@
     11587 
     11588     /* Initialise atoms */
     11589 #ifdef FEAT_MBYTE
     11590+    html_atom = gdk_atom_intern("text/html", FALSE);
     11591     utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
     11592 #endif
     11593 #ifndef HAVE_GTK2
     11594@@ -3784,7 +3846,7 @@
    1078311595 #endif
    1078411596 
     
    1078911601 
    1079011602     /*
    10791 @@ -3922,10 +3926,10 @@
     11603@@ -3922,10 +3984,10 @@
    1079211604 /*
    1079311605  * This signal informs us about the need to rearrange our sub-widgets.
     
    1080311615     int usable_height = event->height;
    1080411616 
    10805 @@ -3948,9 +3952,8 @@
     11617@@ -3948,9 +4010,8 @@
    1080611618  * We can't do much more here than to trying to preserve what had been done,
    1080711619  * since the window is already inevitably going away.
     
    1081411626     /* Don't write messages to the GUI anymore */
    1081511627     full_screen = FALSE;
    10816 @@ -3980,9 +3983,8 @@
     11628@@ -3980,9 +4041,8 @@
    1081711629  * scrollbar init.), actually do the standard hinst and stop the timer.
    1081811630  * We'll not let the default hints be set while this timer's active.
     
    1082511637     if (init_window_hints_state == 1)
    1082611638     {
    10827 @@ -4055,7 +4057,7 @@
     11639@@ -4055,7 +4115,7 @@
    1082811640            Columns = w;
    1082911641        if (mask & HeightValue)
     
    1083411646            Rows = h;
    1083511647        }
    10836 @@ -4070,14 +4072,14 @@
     11648@@ -4070,14 +4130,14 @@
    1083711649 
    1083811650        if (mask & (XValue | YValue))
     
    1085511667            gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
    1085611668 #else
    10857 @@ -4229,9 +4231,8 @@
     11669@@ -4229,9 +4289,8 @@
    1085811670 }
    1085911671 
     
    1086611678     if (gui.mainwin != NULL)
    1086711679        gtk_widget_destroy(gui.mainwin);
    10868 @@ -4286,7 +4287,6 @@
     11680@@ -4286,7 +4345,6 @@
    1086911681  * report the new size through form_configure_event().  That caused the window
    1087011682  * layout to be messed up.
     
    1087411686 force_shell_resize_idle(gpointer data)
    1087511687 {
    10876 @@ -4314,12 +4314,11 @@
     11688@@ -4314,12 +4372,11 @@
    1087711689 /*
    1087811690  * Set the windows size.
     
    1089011702 #ifndef HAVE_GTK2
    1089111703     /* Hack: When the form already is at the desired size, the window might
    10892 @@ -4413,9 +4412,8 @@
     11704@@ -4413,9 +4470,8 @@
    1089311705 }
    1089411706 
     
    1090111713 # ifdef HAVE_GTK2
    1090211714     if (title != NULL && output_conv.vc_type != CONV_NONE)
    10903 @@ -4493,7 +4491,6 @@
     11715@@ -4493,7 +4549,6 @@
    1090411716  * Get a font structure for highlighting.
    1090511717  * "cbdata" is a pointer to the global gui structure.
     
    1090911721 font_sel_ok(GtkWidget *wgt, gpointer cbdata)
    1091011722 {
    10911 @@ -4509,7 +4506,6 @@
     11723@@ -4509,7 +4564,6 @@
    1091211724        gtk_main_quit();
    1091311725 }
     
    1091711729 font_sel_cancel(GtkWidget *wgt, gpointer cbdata)
    1091811730 {
    10919 @@ -4520,7 +4516,6 @@
     11731@@ -4520,7 +4574,6 @@
    1092011732        gtk_main_quit();
    1092111733 }
     
    1092511737 font_sel_destroy(GtkWidget *wgt, gpointer cbdata)
    1092611738 {
    10927 @@ -4620,7 +4615,6 @@
     11739@@ -4620,7 +4673,6 @@
    1092811740 /*
    1092911741  * Try to load the requested fontset.
     
    1093311745 gui_mch_get_fontset(char_u *name, int report_error, int fixed_width)
    1093411746 {
    10935 @@ -4863,7 +4857,7 @@
     11747@@ -4863,7 +4915,7 @@
    1093611748     styled_font[1] = &gui.ital_font;
    1093711749     styled_font[2] = &gui.boldital_font;
     
    1094211754        if (*styled_font[i])
    1094311755        {
    10944 @@ -5012,9 +5006,8 @@
     11756@@ -5012,9 +5064,8 @@
    1094511757  * Initialize Vim to use the font or fontset with the given name.
    1094611758  * Return FAIL if the font could not be loaded, OK otherwise.
     
    1095311765 #ifdef HAVE_GTK2
    1095411766     PangoFontDescription    *font_desc;
    10955 @@ -5326,9 +5319,8 @@
     11767@@ -5326,9 +5377,8 @@
    1095611768 /*
    1095711769  * Return the name of font "font" in allocated memory.
     
    1096411776 # ifdef HAVE_GTK2
    1096511777     if (font != NOFONT)
    10966 @@ -5732,7 +5724,7 @@
     11778@@ -5732,7 +5782,7 @@
    1096711779 {
    1096811780     int                        i;
     
    1097311785 
    1097411786     /* Undercurl: draw curl at the bottom of the character cell. */
    10975 @@ -6402,7 +6394,6 @@
     11787@@ -6085,12 +6135,15 @@
     11788 # ifdef FEAT_MBYTE
     11789            if (enc_utf8)
     11790            {
     11791-               c = utf_ptr2char(p);
     11792+               int pcc[MAX_MCO];
     11793+
     11794+               /* TODO: use the composing characters */
     11795+               c = utfc_ptr2char_len(p, &pcc, len - (p - s));
     11796                if (c >= 0x10000)       /* show chars > 0xffff as ? */
     11797                    c = 0xbf;
     11798                buf[textlen].byte1 = c >> 8;
     11799                buf[textlen].byte2 = c;
     11800-               p += utf_ptr2len(p);
     11801+               p += utfc_ptr2len_len(p, len - (p - s));
     11802                width += utf_char2cells(c);
     11803            }
     11804            else
     11805@@ -6114,8 +6167,8 @@
     11806        if (has_mbyte)
     11807        {
     11808            width = 0;
     11809-           for (p = s; p < s + len; p += (*mb_ptr2len)(p))
     11810-               width += (*mb_ptr2cells)(p);
     11811+           for (p = s; p < s + len; p += (*mb_ptr2len_len)(p, len - (p - s)))
     11812+               width += (*mb_ptr2cells_len)(p, len - (p - s));
     11813        }
     11814        else
     11815 # endif
     11816@@ -6402,7 +6455,6 @@
    1097611817 /*
    1097711818  * Callback function, used when data is available on the SNiFF connection.
     
    1098111822 sniff_request_cb(
    1098211823     gpointer   data,
    10983 @@ -6711,9 +6702,8 @@
     11824@@ -6665,12 +6717,14 @@
     11825 {
     11826     GdkAtom    target;
     11827     unsigned   i;
     11828-    int                nbytes;
     11829-    char_u     *buffer;
     11830     time_t     start;
     11831 
     11832     for (i = 0; i < N_SELECTION_TARGETS; ++i)
     11833     {
     11834+#ifdef FEAT_MBYTE
     11835+       if (!clip_html && selection_targets[i].info == TARGET_HTML)
     11836+           continue;
     11837+#endif
     11838        received_selection = RS_NONE;
     11839        target = gdk_atom_intern(selection_targets[i].target, FALSE);
     11840 
     11841@@ -6690,30 +6744,14 @@
     11842     }
     11843 
     11844     /* Final fallback position - use the X CUT_BUFFER0 store */
     11845-    nbytes = 0;
     11846-    buffer = (char_u *)XFetchBuffer(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
     11847-                                   &nbytes, 0);
     11848-    if (nbytes > 0)
     11849-    {
     11850-       /* Got something */
     11851-       clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
     11852-       if (p_verbose > 0)
     11853-       {
     11854-           verbose_enter();
     11855-           smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
     11856-           verbose_leave();
     11857-       }
     11858-    }
     11859-    if (buffer != NULL)
     11860-       XFree(buffer);
     11861+    yank_cut_buffer0(GDK_WINDOW_XDISPLAY(gui.mainwin->window), cbd);
     11862 }
     11863 
    1098411864 /*
    1098511865  * Disown the selection.
     
    1099211872     /* WEIRD: when using NULL to actually disown the selection, we lose the
    1099311873      * selection the first time we own it. */
    10994 @@ -6741,9 +6731,8 @@
     11874@@ -6741,9 +6779,8 @@
    1099511875  * Send the current selection to the clipboard.  Do nothing for X because we
    1099611876  * will fill in the selection only when requested by another app.
     
    1100311883 }
    1100411884 
    11005 @@ -6950,7 +6939,7 @@
     11885@@ -6950,7 +6987,7 @@
    1100611886            else
    1100711887                id &= ~1;       /* they are always even (why?) */
     
    1101411894diff -Naur vim72.orig/src/gui_motif.c vim72/src/gui_motif.c
    1101511895--- vim72.orig/src/gui_motif.c  2008-06-07 06:06:33.000000000 -0700
    11016 +++ vim72/src/gui_motif.c       2009-06-05 14:25:31.000000000 -0700
     11896+++ vim72/src/gui_motif.c       2009-07-19 15:16:46.000000000 -0700
    1101711897@@ -117,10 +117,9 @@
    1101811898  * Call-back routines.
     
    1137712257diff -Naur vim72.orig/src/gui_x11.c vim72/src/gui_x11.c
    1137812258--- vim72.orig/src/gui_x11.c    2008-06-08 08:13:45.000000000 -0700
    11379 +++ vim72/src/gui_x11.c 2009-06-05 14:25:31.000000000 -0700
     12259+++ vim72/src/gui_x11.c 2009-07-19 15:16:46.000000000 -0700
    1138012260@@ -570,22 +570,20 @@
    1138112261  * Call-back routines.
     
    1182212702diff -Naur vim72.orig/src/gui_xmdlg.c vim72/src/gui_xmdlg.c
    1182312703--- vim72.orig/src/gui_xmdlg.c  2008-06-21 09:05:32.000000000 -0700
    11824 +++ vim72/src/gui_xmdlg.c       2009-06-05 14:25:31.000000000 -0700
     12704+++ vim72/src/gui_xmdlg.c       2009-07-19 15:16:46.000000000 -0700
    1182512705@@ -369,10 +369,10 @@
    1182612706     char       buf[TEMP_BUF_SIZE];
     
    1204412924diff -Naur vim72.orig/src/gui_xmebw.c vim72/src/gui_xmebw.c
    1204512925--- vim72.orig/src/gui_xmebw.c  2007-09-06 03:57:51.000000000 -0700
    12046 +++ vim72/src/gui_xmebw.c       2009-06-05 14:25:31.000000000 -0700
     12926+++ vim72/src/gui_xmebw.c       2009-07-19 15:16:46.000000000 -0700
    1204712927@@ -235,13 +235,12 @@
    1204812928     return tmp;
     
    1217113051diff -Naur vim72.orig/src/hardcopy.c vim72/src/hardcopy.c
    1217213052--- vim72.orig/src/hardcopy.c   2008-01-11 12:46:20.000000000 -0800
    12173 +++ vim72/src/hardcopy.c        2009-06-05 14:25:02.000000000 -0700
     13053+++ vim72/src/hardcopy.c        2009-07-19 15:16:23.000000000 -0700
    1217413054@@ -442,12 +442,11 @@
    1217513055 /*
     
    1225413134diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c
    1225513135--- vim72.orig/src/if_cscope.c  2008-06-24 09:32:34.000000000 -0700
    12256 +++ vim72/src/if_cscope.c       2009-06-05 14:25:02.000000000 -0700
    12257 @@ -74,7 +74,7 @@
     13136+++ vim72/src/if_cscope.c       2009-07-19 15:18:44.000000000 -0700
     13137@@ -46,7 +46,6 @@
     13138 static int         cs_find __ARGS((exarg_T *eap));
     13139 static int         cs_find_common __ARGS((char *opt, char *pat, int, int, int));
     13140 static int         cs_help __ARGS((exarg_T *eap));
     13141-static void        cs_init __ARGS((void));
     13142 static void        clear_csinfo __ARGS((int i));
     13143 static int         cs_insert_filelist __ARGS((char *, char *, char *,
     13144                        struct stat *));
     13145@@ -66,7 +65,10 @@
     13146 static int         cs_show __ARGS((exarg_T *eap));
     13147 
     13148 
     13149-static csinfo_T            csinfo[CSCOPE_MAX_CONNECTIONS];
     13150+static csinfo_T *   csinfo = NULL;
     13151+static int         csinfo_size = 0;    /* number of items allocated in
     13152+                                          csinfo[] */
     13153+
     13154 static int         eap_arg_len;    /* length of eap->arg, set in
     13155                                       cs_lookup_cmd() */
     13156 static cscmd_T     cs_cmds[] =
     13157@@ -74,7 +76,7 @@
    1225813158     { "add",   cs_add,
    1225913159                N_("Add a new database"),     "add file|dir [pre-path] [flags]", 0 },
     
    1226413164                N_("Show this message"),      "help", 0 },
    1226513165     { "kill",  cs_kill,
    12266 @@ -83,7 +83,7 @@
     13166@@ -83,7 +85,7 @@
    1226713167                N_("Reinit all connections"), "reset", 0 },
    1226813168     { "show",  cs_show,
     
    1227313173 
    1227413174     static void
    12275 @@ -93,12 +93,128 @@
     13175@@ -93,12 +95,125 @@
    1227613176     (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
    1227713177 }
     
    1232813228+    case EXP_CSCOPE_KILL:
    1232913229+       {
    12330 +           static char_u       connection[2];
     13230+           static char connection[5];
    1233113231+
    1233213232+           /* ":cscope kill" accepts connection numbers or partial names of
     
    1233413234+            * with connection numbers. -1 can also be used to kill all
    1233513235+            * connections. */
    12336 +           for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13236+           for (i = 0, current_idx = 0; i < csinfo_size; i++)
    1233713237+           {
    1233813238+               if (csinfo[i].fname == NULL)
     
    1234013240+               if (current_idx++ == idx)
    1234113241+               {
    12342 +                   /* Connection number fits in one character since
    12343 +                    * CSCOPE_MAX_CONNECTIONS is < 10 */
    12344 +                   connection[0] = i + '0';
    12345 +                   connection[1] = NUL;
    12346 +                   return connection;
     13242+                   vim_snprintf(connection, sizeof(connection), "%d", i);
     13243+                   return (char_u *)connection;
    1234713244+               }
    1234813245+           }
     
    1240513302     static void
    1240613303 do_cscope_general(eap, make_split)
    12407 @@ -379,10 +495,9 @@
     13304@@ -107,7 +222,6 @@
     13305 {
     13306     cscmd_T *cmdp;
     13307 
     13308-    cs_init();
     13309     if ((cmdp = cs_lookup_cmd(eap)) == NULL)
     13310     {
     13311        cs_help(eap);
     13312@@ -168,8 +282,6 @@
     13313 {
     13314     int ret = FALSE;
     13315 
     13316-    cs_init();
     13317-
     13318     if (*eap->arg == NUL)
     13319     {
     13320        (void)EMSG(_("E562: Usage: cstag <ident>"));
     13321@@ -325,7 +437,7 @@
     13322     if (num < 0 || num > 4 || (num > 0 && !dbpath))
     13323        return FALSE;
     13324 
     13325-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13326+    for (i = 0; i < csinfo_size; i++)
     13327     {
     13328        if (!csinfo[i].fname)
     13329            continue;
     13330@@ -379,10 +491,9 @@
    1240813331  *
    1240913332  * MAXPATHL 256
     
    1241713340     char *fname, *ppath, *flags = NULL;
    1241813341 
    12419 @@ -659,6 +774,7 @@
     13342@@ -569,7 +680,7 @@
     13343     short i;
     13344     short cnt = 0;
     13345 
     13346-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13347+    for (i = 0; i < csinfo_size; i++)
     13348     {
     13349        if (csinfo[i].fname != NULL)
     13350            cnt++;
     13351@@ -659,6 +770,7 @@
    1242013352 {
    1242113353     char *cmd;
     
    1242513357     switch (csoption[0])
    1242613358     {
    12427 @@ -692,10 +808,17 @@
     13359@@ -692,10 +804,17 @@
    1242813360        return NULL;
    1242913361     }
     
    1244513377     return cmd;
    1244613378 } /* cs_create_cmd */
    12447 @@ -869,7 +992,7 @@
     13379@@ -869,7 +988,7 @@
    1244813380        vim_free(ppath);
    1244913381 
     
    1245413386 
    1245513387        exit(127);
    12456 @@ -1167,20 +1290,36 @@
     13388@@ -989,7 +1108,8 @@
     13389 {
     13390     int i;
     13391     char *cmd;
     13392-    int nummatches[CSCOPE_MAX_CONNECTIONS], totmatches;
     13393+    int *nummatches;
     13394+    int totmatches;
     13395 #ifdef FEAT_QUICKFIX
     13396     char cmdletter;
     13397     char *qfpos;
     13398@@ -1000,13 +1120,17 @@
     13399     if (cmd == NULL)
     13400        return FALSE;
     13401 
     13402+    nummatches = (int *)alloc(sizeof(int)*csinfo_size);
     13403+    if (nummatches == NULL)
     13404+       return FALSE;
     13405+
     13406     /* send query to all open connections, then count the total number
     13407      * of matches so we can alloc matchesp all in one swell foop
     13408      */
     13409-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13410+    for (i = 0; i < csinfo_size; i++)
     13411        nummatches[i] = 0;
     13412     totmatches = 0;
     13413-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13414+    for (i = 0; i < csinfo_size; i++)
     13415     {
     13416        if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL)
     13417            continue;
     13418@@ -1031,7 +1155,10 @@
     13419        char *buf;
     13420 
     13421        if (!verbose)
     13422+       {
     13423+           vim_free(nummatches);
     13424            return FALSE;
     13425+       }
     13426 
     13427        buf = (char *)alloc((unsigned)(strlen(opt) + strlen(pat) + strlen(nf)));
     13428        if (buf == NULL)
     13429@@ -1042,6 +1169,7 @@
     13430            (void)EMSG(buf);
     13431            vim_free(buf);
     13432        }
     13433+       vim_free(nummatches);
     13434        return FALSE;
     13435     }
     13436 
     13437@@ -1094,6 +1222,7 @@
     13438                (void)EMSG(buf);
     13439                vim_free(buf);
     13440            }
     13441+           vim_free(nummatches);
     13442            return FALSE;
     13443        }
     13444     }
     13445@@ -1141,6 +1270,7 @@
     13446        }
     13447        mch_remove(tmp);
     13448        vim_free(tmp);
     13449+       vim_free(nummatches);
     13450        return TRUE;
     13451     }
     13452     else
     13453@@ -1152,6 +1282,7 @@
     13454        /* read output */
     13455        cs_fill_results((char *)pat, totmatches, nummatches, &matches,
     13456                                                         &contexts, &matched);
     13457+       vim_free(nummatches);
     13458        if (matches == NULL)
     13459            return FALSE;
     13460 
     13461@@ -1167,20 +1298,36 @@
    1245713462  *
    1245813463  * print help
     
    1249613501     }
    1249713502 
    12498 @@ -1257,13 +1396,12 @@
     13503@@ -1189,26 +1336,6 @@
     13504 } /* cs_help */
     13505 
     13506 
     13507-/*
     13508- * PRIVATE: cs_init
     13509- *
     13510- * initialize cscope structure if not already
     13511- */
     13512-    static void
     13513-cs_init()
     13514-{
     13515-    short i;
     13516-    static int init_already = FALSE;
     13517-
     13518-    if (init_already)
     13519-       return;
     13520-
     13521-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13522-       clear_csinfo(i);
     13523-
     13524-    init_already = TRUE;
     13525-} /* cs_init */
     13526-
     13527     static void
     13528 clear_csinfo(i)
     13529     int            i;
     13530@@ -1257,13 +1384,12 @@
    1249913531  *
    1250013532  * insert a new cscope database filename into the filelist
     
    1251113543     short      i, j;
    1251213544 #ifndef UNIX
    12513 @@ -1419,10 +1557,9 @@
     13545@@ -1306,7 +1432,7 @@
     13546 #endif
     13547 
     13548     i = -1; /* can be set to the index of an empty item in csinfo */
     13549-    for (j = 0; j < CSCOPE_MAX_CONNECTIONS; j++)
     13550+    for (j = 0; j < csinfo_size; j++)
     13551     {
     13552        if (csinfo[j].fname != NULL
     13553 #if defined(UNIX)
     13554@@ -1333,9 +1459,25 @@
     13555 
     13556     if (i == -1)
     13557     {
     13558-       if (p_csverbose)
     13559-           (void)EMSG(_("E569: maximum number of cscope connections reached"));
     13560-       return -1;
     13561+       i = csinfo_size;
     13562+       if (csinfo_size == 0)
     13563+       {
     13564+           /* First time allocation: allocate only 1 connection. It should
     13565+            * be enough for most users.  If more is needed, csinfo will be
     13566+            * reallocated. */
     13567+           csinfo_size = 1;
     13568+           csinfo = (csinfo_T *)alloc_clear(sizeof(csinfo_T));
     13569+       }
     13570+       else
     13571+       {
     13572+           /* Reallocate space for more connections. */
     13573+           csinfo_size *= 2;
     13574+           csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size);
     13575+       }
     13576+       if (csinfo == NULL)
     13577+           return -1;
     13578+       for (j = csinfo_size/2; j < csinfo_size; j++)
     13579+           clear_csinfo(j);
     13580     }
     13581 
     13582     if ((csinfo[i].fname = (char *)alloc((unsigned)strlen(fname)+1)) == NULL)
     13583@@ -1419,10 +1561,9 @@
    1251413584  *
    1251513585  * nuke em
     
    1252313593     char *stok;
    1252413594     short i;
    12525 @@ -2099,7 +2236,6 @@
     13595@@ -1443,15 +1584,14 @@
     13596        /* It must be part of a name.  We will try to find a match
     13597         * within all the names in the csinfo data structure
     13598         */
     13599-       for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13600+       for (i = 0; i < csinfo_size; i++)
     13601        {
     13602            if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok))
     13603                break;
     13604        }
     13605     }
     13606 
     13607-    if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL)
     13608-           && i != -1)
     13609+    if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL))
     13610     {
     13611        if (p_csverbose)
     13612            (void)EMSG2(_("E261: cscope connection %s not found"), stok);
     13613@@ -1460,7 +1600,7 @@
     13614     {
     13615        if (i == -1)
     13616        {
     13617-           for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13618+           for (i = 0; i < csinfo_size; i++)
     13619            {
     13620                if (csinfo[i].fname)
     13621                    cs_kill_execute(i, csinfo[i].fname);
     13622@@ -1720,7 +1860,7 @@
     13623     if (buf == NULL)
     13624        return;
     13625 
     13626-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13627+    for (i = 0; i < csinfo_size; i++)
     13628     {
     13629        if (nummatches_a[i] < 1)
     13630            continue;
     13631@@ -1792,7 +1932,7 @@
     13632     if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL)
     13633        goto parse_out;
     13634 
     13635-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13636+    for (i = 0; i < csinfo_size; i++)
     13637     {
     13638        if (nummatches_a[i] < 1)
     13639            continue;
     13640@@ -2099,7 +2239,6 @@
    1252613641 /*
    1252713642  * Used to catch and ignore SIGALRM below.
     
    1253113646 sig_handler SIGDEFARG(sigarg)
    1253213647 {
    12533 @@ -2239,10 +2375,9 @@
     13648@@ -2239,19 +2378,21 @@
    1253413649  *
    1253513650  * calls cs_kill on all cscope connections then reinits
     
    1254313658     char       **dblist = NULL, **pplist = NULL, **fllist = NULL;
    1254413659     int        i;
    12545 @@ -2355,10 +2490,9 @@
     13660     char buf[20]; /* for sprintf " (#%d)" */
     13661 
     13662+    if (csinfo_size == 0)
     13663+       return CSCOPE_SUCCESS;
     13664+
     13665     /* malloc our db and ppath list */
     13666-    dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
     13667-    pplist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
     13668-    fllist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
     13669+    dblist = (char **)alloc(csinfo_size * sizeof(char *));
     13670+    pplist = (char **)alloc(csinfo_size * sizeof(char *));
     13671+    fllist = (char **)alloc(csinfo_size * sizeof(char *));
     13672     if (dblist == NULL || pplist == NULL || fllist == NULL)
     13673     {
     13674        vim_free(dblist);
     13675@@ -2260,7 +2401,7 @@
     13676        return CSCOPE_FAILURE;
     13677     }
     13678 
     13679-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13680+    for (i = 0; i < csinfo_size; i++)
     13681     {
     13682        dblist[i] = csinfo[i].fname;
     13683        pplist[i] = csinfo[i].ppath;
     13684@@ -2270,7 +2411,7 @@
     13685     }
     13686 
     13687     /* rebuild the cscope connection list */
     13688-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13689+    for (i = 0; i < csinfo_size; i++)
     13690     {
     13691        if (dblist[i] != NULL)
     13692        {
     13693@@ -2355,10 +2496,9 @@
    1254613694  *
    1254713695  * show all cscope connections
     
    1255513703     short i;
    1255613704     if (cs_cnt_connections() == 0)
     13705@@ -2368,7 +2508,7 @@
     13706        MSG_PUTS_ATTR(
     13707            _(" # pid    database name                       prepend path\n"),
     13708            hl_attr(HLF_T));
     13709-       for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13710+       for (i = 0; i < csinfo_size; i++)
     13711        {
     13712            if (csinfo[i].fname == NULL)
     13713                continue;
     13714@@ -2397,8 +2537,10 @@
     13715 {
     13716     int i;
     13717 
     13718-    for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
     13719+    for (i = 0; i < csinfo_size; i++)
     13720        cs_release_csp(i, TRUE);
     13721+    vim_free(csinfo);
     13722+    csinfo_size = 0;
     13723 }
     13724 
     13725 #endif /* FEAT_CSCOPE */
    1255713726diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h
    1255813727--- vim72.orig/src/if_cscope.h  2007-09-02 07:51:08.000000000 -0700
    12559 +++ vim72/src/if_cscope.h       2009-06-05 14:14:12.000000000 -0700
    12560 @@ -42,17 +42,6 @@
     13728+++ vim72/src/if_cscope.h       2009-07-19 15:18:44.000000000 -0700
     13729@@ -25,7 +25,6 @@
     13730 
     13731 #define CSCOPE_SUCCESS         0
     13732 #define CSCOPE_FAILURE         -1
     13733-#define CSCOPE_MAX_CONNECTIONS 8   /* you actually need more? */
     13734 
     13735 #define        CSCOPE_DBFILE           "cscope.out"
     13736 #define        CSCOPE_PROMPT           ">> "
     13737@@ -42,17 +41,6 @@
    1256113738  * f 7name     Find this file
    1256213739  * i 8name     Find files #including this file
     
    1257813755diff -Naur vim72.orig/src/if_mzsch.c vim72/src/if_mzsch.c
    1257913756--- vim72.orig/src/if_mzsch.c   2007-07-01 09:44:49.000000000 -0700
    12580 +++ vim72/src/if_mzsch.c        2009-06-05 14:25:19.000000000 -0700
     13757+++ vim72/src/if_mzsch.c        2009-07-19 15:18:39.000000000 -0700
    1258113758@@ -667,13 +667,11 @@
    1258213759     static void CALLBACK
     
    1259513772     pascal void
    1259613773 timer_proc(EventLoopTimerRef theTimer, void *userData)
     13774@@ -1958,9 +1956,9 @@
     13775            curbuf = savebuf;
     13776            raise_vim_exn(_("cannot delete line"));
     13777        }
     13778-       deleted_lines_mark((linenr_T)n, 1L);
     13779        if (buf->buf == curwin->w_buffer)
     13780            mz_fix_cursor(n, n + 1, -1);
     13781+       deleted_lines_mark((linenr_T)n, 1L);
     13782 
     13783        curbuf = savebuf;
     13784 
     13785@@ -2065,9 +2063,9 @@
     13786                    curbuf = savebuf;
     13787                    raise_vim_exn(_("cannot delete line"));
     13788                }
     13789-           deleted_lines_mark((linenr_T)lo, (long)old_len);
     13790            if (buf->buf == curwin->w_buffer)
     13791                mz_fix_cursor(lo, hi, -old_len);
     13792+           deleted_lines_mark((linenr_T)lo, (long)old_len);
     13793        }
     13794 
     13795        curbuf = savebuf;
    1259713796diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs
    1259813797--- vim72.orig/src/if_perl.xs   2008-07-17 13:55:09.000000000 -0700
    12599 +++ vim72/src/if_perl.xs        2009-06-05 14:18:24.000000000 -0700
     13798+++ vim72/src/if_perl.xs        2009-07-19 15:18:52.000000000 -0700
    1260013799@@ -136,6 +136,9 @@
    1260113800 #  define Perl_newXS_flags dll_Perl_newXS_flags
     
    1264613845     perl_interp = perl_alloc();
    1264713846     perl_construct(perl_interp);
     13847@@ -715,9 +720,11 @@
     13848 #ifdef HAVE_SANDBOX
     13849     if (sandbox)
     13850     {
     13851+# ifndef MAKE_TEST  /* avoid a warning for unreachable code */
     13852        if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe))
     13853            EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
     13854        else
     13855+# endif
     13856        {
     13857            PUSHMARK(SP);
     13858            XPUSHs(safe);
     13859@@ -1228,9 +1235,8 @@
     13860                    if (u_savedel(lnum, 1) == OK)
     13861                    {
     13862                        ml_delete(lnum, 0);
     13863+                       check_cursor();
     13864                        deleted_lines_mark(lnum, 1L);
     13865-                       if (aco.save_buf == curbuf)
     13866-                           check_cursor();
     13867                    }
     13868 
     13869                    /* restore curwin/curbuf and a few other things */
    1264813870diff -Naur vim72.orig/src/if_python.c vim72/src/if_python.c
    1264913871--- vim72.orig/src/if_python.c  2008-07-17 14:09:32.000000000 -0700
    12650 +++ vim72/src/if_python.c       2009-06-05 14:25:31.000000000 -0700
     13872+++ vim72/src/if_python.c       2009-07-19 15:18:39.000000000 -0700
    1265113873@@ -531,6 +531,12 @@
    1265213874        if (PythonMod_Init())
     
    1283614058     /* Fixups... */
    1283714059     BufferType.ob_type = &PyType_Type;
     14060@@ -2489,9 +2497,9 @@
     14061            PyErr_SetVim(_("cannot delete line"));
     14062        else
     14063        {
     14064-           deleted_lines_mark((linenr_T)n, 1L);
     14065            if (buf == curwin->w_buffer)
     14066                py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
     14067+           deleted_lines_mark((linenr_T)n, 1L);
     14068        }
     14069 
     14070        curbuf = savebuf;
     14071@@ -2588,10 +2596,9 @@
     14072                    break;
     14073                }
     14074            }
     14075-           deleted_lines_mark((linenr_T)lo, (long)i);
     14076-
     14077            if (buf == curwin->w_buffer)
     14078                py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
     14079+           deleted_lines_mark((linenr_T)lo, (long)i);
     14080        }
     14081 
     14082        curbuf = savebuf;
    1283814083diff -Naur vim72.orig/src/if_ruby.c vim72/src/if_ruby.c
    1283914084--- vim72.orig/src/if_ruby.c    2007-09-10 01:40:38.000000000 -0700
    12840 +++ vim72/src/if_ruby.c 2009-06-05 14:25:34.000000000 -0700
     14085+++ vim72/src/if_ruby.c 2009-07-19 15:16:49.000000000 -0700
    1284114086@@ -492,7 +492,7 @@
    1284214087     }
     
    1293014175diff -Naur vim72.orig/src/if_tcl.c vim72/src/if_tcl.c
    1293114176--- vim72.orig/src/if_tcl.c     2007-05-07 12:50:14.000000000 -0700
    12932 +++ vim72/src/if_tcl.c  2009-06-05 14:25:41.000000000 -0700
     14177+++ vim72/src/if_tcl.c  2009-07-19 15:16:54.000000000 -0700
    1293314178@@ -161,7 +161,7 @@
    1293414179 # endif
     
    1314514390diff -Naur vim72.orig/src/if_xcmdsrv.c vim72/src/if_xcmdsrv.c
    1314614391--- vim72.orig/src/if_xcmdsrv.c 2008-07-18 06:05:03.000000000 -0700
    13147 +++ vim72/src/if_xcmdsrv.c      2009-06-05 14:25:02.000000000 -0700
     14392+++ vim72/src/if_xcmdsrv.c      2009-07-19 15:16:23.000000000 -0700
    1314814393@@ -682,7 +682,7 @@
    1314914394      * Scan all of the names out of the property.
     
    1326114506diff -Naur vim72.orig/src/macros.h vim72/src/macros.h
    1326214507--- vim72.orig/src/macros.h     2007-08-04 04:44:18.000000000 -0700
    13263 +++ vim72/src/macros.h  2009-06-05 14:25:15.000000000 -0700
     14508+++ vim72/src/macros.h  2009-07-19 15:16:33.000000000 -0700
    1326414509@@ -127,15 +127,31 @@
    1326514510 #ifdef FEAT_LANGMAP
     
    1331014555diff -Naur vim72.orig/src/main.c vim72/src/main.c
    1331114556--- vim72.orig/src/main.c       2008-07-24 01:40:56.000000000 -0700
    13312 +++ vim72/src/main.c    2009-06-05 14:25:15.000000000 -0700
     14557+++ vim72/src/main.c    2009-07-19 15:16:33.000000000 -0700
    1331314558@@ -645,11 +645,12 @@
    1331414559 
     
    1340214647diff -Naur vim72.orig/src/Makefile vim72/src/Makefile
    1340314648--- vim72.orig/src/Makefile     2008-08-09 07:50:04.000000000 -0700
    13404 +++ vim72/src/Makefile  2009-06-05 14:25:34.000000000 -0700
     14649+++ vim72/src/Makefile  2009-07-19 15:16:49.000000000 -0700
    1340514650@@ -105,8 +105,8 @@
    1340614651 # 4. "make test"  {{{1
     
    1351614761diff -Naur vim72.orig/src/mark.c vim72/src/mark.c
    1351714762--- vim72.orig/src/mark.c       2008-08-08 15:06:49.000000000 -0700
    13518 +++ vim72/src/mark.c    2009-06-05 14:25:02.000000000 -0700
     14763+++ vim72/src/mark.c    2009-07-19 15:16:23.000000000 -0700
    1351914764@@ -884,10 +884,9 @@
    1352014765 /*
     
    1363714882diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c
    1363814883--- vim72.orig/src/mbyte.c      2008-07-14 05:38:05.000000000 -0700
    13639 +++ vim72/src/mbyte.c   2009-06-05 14:25:15.000000000 -0700
    13640 @@ -717,7 +717,7 @@
     14884+++ vim72/src/mbyte.c   2009-07-19 15:17:33.000000000 -0700
     14885@@ -127,7 +127,10 @@
     14886 static int dbcs_char2len __ARGS((int c));
     14887 static int dbcs_char2bytes __ARGS((int c, char_u *buf));
     14888 static int dbcs_ptr2len __ARGS((char_u *p));
     14889+static int dbcs_ptr2len_len __ARGS((char_u *p, int size));
     14890+static int utf_ptr2cells_len __ARGS((char_u *p, int size));
     14891 static int dbcs_char2cells __ARGS((int c));
     14892+static int dbcs_ptr2cells_len __ARGS((char_u *p, int size));
     14893 static int dbcs_ptr2char __ARGS((char_u *p));
     14894 
     14895 /* Lookup table to quickly get the length in bytes of a UTF-8 character from
     14896@@ -606,9 +609,11 @@
     14897     if (enc_utf8)
     14898     {
     14899        mb_ptr2len = utfc_ptr2len;
     14900+       mb_ptr2len_len = utfc_ptr2len_len;
     14901        mb_char2len = utf_char2len;
     14902        mb_char2bytes = utf_char2bytes;
     14903        mb_ptr2cells = utf_ptr2cells;
     14904+       mb_ptr2cells_len = utf_ptr2cells_len;
     14905        mb_char2cells = utf_char2cells;
     14906        mb_off2cells = utf_off2cells;
     14907        mb_ptr2char = utf_ptr2char;
     14908@@ -617,9 +622,11 @@
     14909     else if (enc_dbcs != 0)
     14910     {
     14911        mb_ptr2len = dbcs_ptr2len;
     14912+       mb_ptr2len_len = dbcs_ptr2len_len;
     14913        mb_char2len = dbcs_char2len;
     14914        mb_char2bytes = dbcs_char2bytes;
     14915        mb_ptr2cells = dbcs_ptr2cells;
     14916+       mb_ptr2cells_len = dbcs_ptr2cells_len;
     14917        mb_char2cells = dbcs_char2cells;
     14918        mb_off2cells = dbcs_off2cells;
     14919        mb_ptr2char = dbcs_ptr2char;
     14920@@ -628,9 +635,11 @@
     14921     else
     14922     {
     14923        mb_ptr2len = latin_ptr2len;
     14924+       mb_ptr2len_len = latin_ptr2len_len;
     14925        mb_char2len = latin_char2len;
     14926        mb_char2bytes = latin_char2bytes;
     14927        mb_ptr2cells = latin_ptr2cells;
     14928+       mb_ptr2cells_len = latin_ptr2cells_len;
     14929        mb_char2cells = latin_char2cells;
     14930        mb_off2cells = latin_off2cells;
     14931        mb_ptr2char = latin_ptr2char;
     14932@@ -717,7 +726,7 @@
    1364114933                     * where mblen() returns 0 for invalid character.
    1364214934                     * Therefore, following condition includes 0.
     
    1364714939                        n = 2;
    1364814940                    else
    13649 @@ -1015,10 +1015,9 @@
     14941@@ -1015,10 +1024,9 @@
    1365014942  * Return length in bytes of character "c".
    1365114943  * Returns 1 for a single-byte character.
     
    1365914951     return 1;
    1366014952 }
    13661 @@ -1248,10 +1247,9 @@
     14953@@ -1070,7 +1078,6 @@
     14954  * Get byte length of character at "*p" but stop at a NUL.
     14955  * For UTF-8 this includes following composing characters.
     14956  * Returns 0 when *p is NUL.
     14957- *
     14958  */
     14959     int
     14960 latin_ptr2len(p)
     14961@@ -1092,6 +1099,40 @@
     14962     return len;
     14963 }
     14964 
     14965+/*
     14966+ * mb_ptr2len_len() function pointer.
     14967+ * Like mb_ptr2len(), but limit to read "size" bytes.
     14968+ * Returns 0 for an empty string.
     14969+ * Returns 1 for an illegal char or an incomplete byte sequence.
     14970+ */
     14971+    int
     14972+latin_ptr2len_len(p, size)
     14973+    char_u     *p;
     14974+    int                size;
     14975+{
     14976+    if (size < 1 || *p == NUL)
     14977+       return 0;
     14978+    return 1;
     14979+}
     14980+
     14981+    static int
     14982+dbcs_ptr2len_len(p, size)
     14983+    char_u     *p;
     14984+    int                size;
     14985+{
     14986+    int                len;
     14987+
     14988+    if (size < 1 || *p == NUL)
     14989+       return 0;
     14990+    if (size == 1)
     14991+       return 1;
     14992+    /* Check that second byte is not missing. */
     14993+    len = MB_BYTE2LEN(*p);
     14994+    if (len == 2 && p[1] == NUL)
     14995+       len = 1;
     14996+    return len;
     14997+}
     14998+
     14999 struct interval
     15000 {
     15001     unsigned short first;
     15002@@ -1248,10 +1289,9 @@
    1366215003  * Return the number of display cells character at "*p" occupies.
    1366315004  * This doesn't take care of unprintable characters, use ptr2cells() for that.
     
    1367115012     return 1;
    1367215013 }
    13673 @@ -1293,10 +1291,9 @@
     15014@@ -1289,14 +1329,62 @@
     15015 }
     15016 
     15017 /*
     15018+ * mb_ptr2cells_len() function pointer.
     15019+ * Like mb_ptr2cells(), but limit string length to "size".
     15020+ * For an empty string or truncated character returns 1.
     15021+ */
     15022+    int
     15023+latin_ptr2cells_len(p, size)
     15024+    char_u     *p UNUSED;
     15025+    int                size UNUSED;
     15026+{
     15027+    return 1;
     15028+}
     15029+
     15030+    static int
     15031+utf_ptr2cells_len(p, size)
     15032+    char_u     *p;
     15033+    int                size;
     15034+{
     15035+    int                c;
     15036+
     15037+    /* Need to convert to a wide character. */
     15038+    if (size > 0 && *p >= 0x80)
     15039+    {
     15040+       if (utf_ptr2len_len(p, size) < utf8len_tab[*p])
     15041+           return 1;
     15042+       c = utf_ptr2char(p);
     15043+       /* An illegal byte is displayed as <xx>. */
     15044+       if (utf_ptr2len(p) == 1 || c == NUL)
     15045+           return 4;
     15046+       /* If the char is ASCII it must be an overlong sequence. */
     15047+       if (c < 0x80)
     15048+           return char2cells(c);
     15049+       return utf_char2cells(c);
     15050+    }
     15051+    return 1;
     15052+}
     15053+
     15054+    static int
     15055+dbcs_ptr2cells_len(p, size)
     15056+    char_u     *p;
     15057+    int                size;
     15058+{
     15059+    /* Number of cells is equal to number of bytes, except for euc-jp when
     15060+     * the first byte is 0x8e. */
     15061+    if (size <= 1 || (enc_dbcs == DBCS_JPNU && *p == 0x8e))
     15062+       return 1;
     15063+    return MB_BYTE2LEN(*p);
     15064+}
     15065+
     15066+/*
     15067  * mb_char2cells() function pointer.
    1367415068  * Return the number of display cells character "c" occupies.
    1367515069  * Only takes care of multi-byte chars, not "^C" and such.
     
    1368315077     return 1;
    1368415078 }
    13685 @@ -1318,11 +1315,10 @@
     15079@@ -1318,11 +1406,10 @@
    1368615080  * Return number of display cells for char at ScreenLines[off].
    1368715081  * We make sure that the offset used is less than "max_off".
     
    1369715091     return 1;
    1369815092 }
    13699 @@ -2419,11 +2415,10 @@
     15093@@ -1720,6 +1807,7 @@
     15094 /*
     15095  * Return the number of bytes the UTF-8 encoding of the character at "p[size]"
     15096  * takes.  This includes following composing characters.
     15097+ * Returns 0 for an empty string.
     15098  * Returns 1 for an illegal char or an incomplete byte sequence.
     15099  */
     15100     int
     15101@@ -1732,7 +1820,7 @@
     15102     int                prevlen;
     15103 #endif
     15104 
     15105-    if (*p == NUL)
     15106+    if (size < 1 || *p == NUL)
     15107        return 0;
     15108     if (p[0] < 0x80 && (size == 1 || p[1] < 0x80)) /* be quick for ASCII */
     15109        return 1;
     15110@@ -2419,11 +2507,10 @@
    1370015111  * Return offset from "p" to the first byte of the character it points into.
    1370115112  * Returns 0 when already at the first byte of a character.
     
    1371115122     return 0;
    1371215123 }
    13713 @@ -2540,7 +2535,6 @@
     15124@@ -2540,7 +2627,6 @@
    1371415125     return (int)(p - q);
    1371515126 }
     
    1371915130  * Copy a character from "*fp" to "*tp" and advance the pointers.
    1372015131  */
    13721 @@ -2555,7 +2549,6 @@
     15132@@ -2555,7 +2641,6 @@
    1372215133     *tp += l;
    1372315134     *fp += l;
     
    1372715138 /*
    1372815139  * Return the offset from "p" to the first byte of a character.  When "p" is
    13729 @@ -3133,7 +3126,7 @@
     15140@@ -3133,7 +3218,7 @@
    1373015141        else
    1373115142            s = p + 1;
     
    1373615147        if (s[i] == '_' || s[i] == '-')
    1373715148            buf[i] = '-';
    13738 @@ -3584,9 +3577,10 @@
     15149@@ -3180,7 +3265,7 @@
     15150 
     15151 # if defined(USE_ICONV) || defined(PROTO)
     15152 
     15153-static char_u *iconv_string __ARGS((vimconv_T *vcp, char_u *str, int slen, int *unconvlenp));
     15154+static char_u *iconv_string __ARGS((vimconv_T *vcp, char_u *str, int slen, int *unconvlenp, int *resultlenp));
     15155 
     15156 /*
     15157  * Call iconv_open() with a check if iconv() works properly (there are broken
     15158@@ -3241,13 +3326,15 @@
     15159  * If "unconvlenp" is not NULL handle the string ending in an incomplete
     15160  * sequence and set "*unconvlenp" to the length of it.
     15161  * Returns the converted string in allocated memory.  NULL for an error.
     15162+ * If resultlenp is not NULL, sets it to the result length in bytes.
     15163  */
     15164     static char_u *
     15165-iconv_string(vcp, str, slen, unconvlenp)
     15166+iconv_string(vcp, str, slen, unconvlenp, resultlenp)
     15167     vimconv_T  *vcp;
     15168     char_u     *str;
     15169     int                slen;
     15170     int                *unconvlenp;
     15171+    int                *resultlenp;
     15172 {
     15173     const char *from;
     15174     size_t     fromlen;
     15175@@ -3333,6 +3420,9 @@
     15176        /* Not enough room or skipping illegal sequence. */
     15177        done = to - (char *)result;
     15178     }
     15179+
     15180+    if (resultlenp != NULL)
     15181+       *resultlenp = (int)(to - (char *)result);
     15182     return result;
     15183 }
     15184 
     15185@@ -3584,9 +3674,10 @@
    1373915186  * Callback invoked when the user finished preediting.
    1374015187  * Put the final string into the input buffer.
     
    1374915196     int        slen = (int)STRLEN(str);
    1375015197     int        add_to_input = TRUE;
    13751 @@ -3672,9 +3666,8 @@
     15198@@ -3672,9 +3763,8 @@
    1375215199 /*
    1375315200  * Callback invoked after start to the preedit.
     
    1376015207 #ifdef XIM_DEBUG
    1376115208     xim_log("im_preedit_start_cb()\n");
    13762 @@ -3689,9 +3682,8 @@
     15209@@ -3689,9 +3779,8 @@
    1376315210 /*
    1376415211  * Callback invoked after end to the preedit.
     
    1377115218 #ifdef XIM_DEBUG
    1377215219     xim_log("im_preedit_end_cb()\n");
    13773 @@ -3750,9 +3742,8 @@
     15220@@ -3750,9 +3839,8 @@
    1377415221  * remaining input from within the "retrieve_surrounding" signal handler, this
    1377515222  * might not be necessary.  Gotta ask on vim-dev for opinions.
     
    1378215229     char    *preedit_string = NULL;
    1378315230     int            cursor_index    = 0;
    13784 @@ -4618,11 +4609,10 @@
     15231@@ -4618,11 +4706,10 @@
    1378515232     }
    1378615233 }
     
    1379615243     xim_set_preedit();
    1379715244 }
    13798 @@ -4929,12 +4919,11 @@
     15245@@ -4929,12 +5016,11 @@
    1379915246 static void xim_instantiate_cb __ARGS((Display *display, XPointer client_data, XPointer        call_data));
    1380015247 static void xim_destroy_cb __ARGS((XIM im, XPointer client_data, XPointer call_data));
     
    1381115258     Window     x11_window;
    1381215259     Display    *x11_display;
    13813 @@ -4954,12 +4943,11 @@
     15260@@ -4954,12 +5040,11 @@
    1381415261                                         xim_instantiate_cb, NULL);
    1381515262 }
     
    1382715274     Window     x11_window;
    1382815275     Display    *x11_display;
    13829 @@ -5278,9 +5266,10 @@
     15276@@ -5278,9 +5363,10 @@
    1383015277     }
    1383115278 }
     
    1384015287 #ifdef XIM_DEBUG
    1384115288     xim_log("xim_decide_input_style()\n");
    13842 @@ -5312,9 +5301,10 @@
     15289@@ -5312,9 +5398,10 @@
    1384315290 static GSList *key_press_event_queue = NULL;
    1384415291 static gboolean processing_queued_event = FALSE;
     
    1385315300     XIMPreeditDrawCallbackStruct *draw_data;
    1385415301     XIMText    *text;
    13855 @@ -5386,7 +5376,7 @@
     15302@@ -5386,7 +5473,7 @@
    1385615303                        draw_feedback = (char *)alloc(draw_data->chg_first
    1385715304                                                              + text->length);
     
    1386215309                    if (draw_feedback != NULL)
    1386315310                    {
    13864 @@ -5453,18 +5443,20 @@
     15311@@ -5453,18 +5540,20 @@
    1386515312     return -1;
    1386615313 }
     
    1388715334 #ifdef XIM_DEBUG
    1388815335     xim_log("preedit_done_cbproc()\n");
    13889 @@ -5503,9 +5495,8 @@
     15336@@ -5503,9 +5592,8 @@
    1389015337     }
    1389115338 }
     
    1389815345 #ifdef XIM_DEBUG
    1389915346     xim_log("xim_queue_key_press_event()\n");
    13900 @@ -5521,9 +5512,8 @@
     15347@@ -5521,9 +5609,8 @@
    1390115348     return TRUE;
    1390215349 }
     
    1390915356     XIC xxic;
    1391015357     XVaNestedList preedit_attr;
    13911 @@ -5548,9 +5538,8 @@
     15358@@ -5548,9 +5635,8 @@
    1391215359     XFree(preedit_attr);
    1391315360 }
     
    1392015367 #ifdef USE_X11R6_XIM
    1392115368     /* don't change the input context when we call reset */
     15369@@ -5756,8 +5842,25 @@
     15370     char_u     *from;
     15371     char_u     *to;
     15372 {
     15373+    return convert_setup_ext(vcp, from, TRUE, to, TRUE);
     15374+}
     15375+
     15376+/*
     15377+ * As convert_setup(), but only when from_unicode_is_utf8 is TRUE will all
     15378+ * "from" unicode charsets be considered utf-8.  Same for "to".
     15379+ */
     15380+    int
     15381+convert_setup_ext(vcp, from, from_unicode_is_utf8, to, to_unicode_is_utf8)
     15382+    vimconv_T  *vcp;
     15383+    char_u     *from;
     15384+    int                from_unicode_is_utf8;
     15385+    char_u     *to;
     15386+    int                to_unicode_is_utf8;
     15387+{
     15388     int                from_prop;
     15389     int                to_prop;
     15390+    int                from_is_utf8;
     15391+    int                to_is_utf8;
     15392 
     15393     /* Reset to no conversion. */
     15394 # ifdef USE_ICONV
     15395@@ -5775,37 +5878,46 @@
     15396 
     15397     from_prop = enc_canon_props(from);
     15398     to_prop = enc_canon_props(to);
     15399-    if ((from_prop & ENC_LATIN1) && (to_prop & ENC_UNICODE))
     15400+    if (from_unicode_is_utf8)
     15401+       from_is_utf8 = from_prop & ENC_UNICODE;
     15402+    else
     15403+       from_is_utf8 = from_prop == ENC_UNICODE;
     15404+    if (to_unicode_is_utf8)
     15405+       to_is_utf8 = to_prop & ENC_UNICODE;
     15406+    else
     15407+       to_is_utf8 = to_prop == ENC_UNICODE;
     15408+
     15409+    if ((from_prop & ENC_LATIN1) && to_is_utf8)
     15410     {
     15411        /* Internal latin1 -> utf-8 conversion. */
     15412        vcp->vc_type = CONV_TO_UTF8;
     15413        vcp->vc_factor = 2;     /* up to twice as long */
     15414     }
     15415-    else if ((from_prop & ENC_LATIN9) && (to_prop & ENC_UNICODE))
     15416+    else if ((from_prop & ENC_LATIN9) && to_is_utf8)
     15417     {
     15418        /* Internal latin9 -> utf-8 conversion. */
     15419        vcp->vc_type = CONV_9_TO_UTF8;
     15420        vcp->vc_factor = 3;     /* up to three as long (euro sign) */
     15421     }
     15422-    else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_LATIN1))
     15423+    else if (from_is_utf8 && (to_prop & ENC_LATIN1))
     15424     {
     15425        /* Internal utf-8 -> latin1 conversion. */
     15426        vcp->vc_type = CONV_TO_LATIN1;
     15427     }
     15428-    else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_LATIN9))
     15429+    else if (from_is_utf8 && (to_prop & ENC_LATIN9))
     15430     {
     15431        /* Internal utf-8 -> latin9 conversion. */
     15432        vcp->vc_type = CONV_TO_LATIN9;
     15433     }
     15434 #ifdef WIN3264
     15435     /* Win32-specific codepage <-> codepage conversion without iconv. */
     15436-    else if (((from_prop & ENC_UNICODE) || encname2codepage(from) > 0)
     15437-           && ((to_prop & ENC_UNICODE) || encname2codepage(to) > 0))
     15438+    else if ((from_is_utf8 || encname2codepage(from) > 0)
     15439+           && (to_is_utf8 || encname2codepage(to) > 0))
     15440     {
     15441        vcp->vc_type = CONV_CODEPAGE;
     15442        vcp->vc_factor = 2;     /* up to twice as long */
     15443-       vcp->vc_cpfrom = (from_prop & ENC_UNICODE) ? 0 : encname2codepage(from);
     15444-       vcp->vc_cpto = (to_prop & ENC_UNICODE) ? 0 : encname2codepage(to);
     15445+       vcp->vc_cpfrom = from_is_utf8 ? 0 : encname2codepage(from);
     15446+       vcp->vc_cpto = to_is_utf8 ? 0 : encname2codepage(to);
     15447     }
     15448 #endif
     15449 #ifdef MACOS_X
     15450@@ -5813,7 +5925,7 @@
     15451     {
     15452        vcp->vc_type = CONV_MAC_LATIN1;
     15453     }
     15454-    else if ((from_prop & ENC_MACROMAN) && (to_prop & ENC_UNICODE))
     15455+    else if ((from_prop & ENC_MACROMAN) && to_is_utf8)
     15456     {
     15457        vcp->vc_type = CONV_MAC_UTF8;
     15458        vcp->vc_factor = 2;     /* up to twice as long */
     15459@@ -5822,7 +5934,7 @@
     15460     {
     15461        vcp->vc_type = CONV_LATIN1_MAC;
     15462     }
     15463-    else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_MACROMAN))
     15464+    else if (from_is_utf8 && (to_prop & ENC_MACROMAN))
     15465     {
     15466        vcp->vc_type = CONV_UTF8_MAC;
     15467     }
     15468@@ -5832,8 +5944,8 @@
     15469     {
     15470        /* Use iconv() for conversion. */
     15471        vcp->vc_fd = (iconv_t)my_iconv_open(
     15472-               (to_prop & ENC_UNICODE) ? (char_u *)"utf-8" : to,
     15473-               (from_prop & ENC_UNICODE) ? (char_u *)"utf-8" : from);
     15474+               to_is_utf8 ? (char_u *)"utf-8" : to,
     15475+               from_is_utf8 ? (char_u *)"utf-8" : from);
     15476        if (vcp->vc_fd != (iconv_t)-1)
     15477        {
     15478            vcp->vc_type = CONV_ICONV;
     15479@@ -6089,9 +6201,7 @@
     15480 
     15481 # ifdef USE_ICONV
     15482        case CONV_ICONV:        /* conversion with output_conv.vc_fd */
     15483-           retval = iconv_string(vcp, ptr, len, unconvlenp);
     15484-           if (retval != NULL && lenp != NULL)
     15485-               *lenp = (int)STRLEN(retval);
     15486+           retval = iconv_string(vcp, ptr, len, unconvlenp, lenp);
     15487            break;
     15488 # endif
     15489 # ifdef WIN3264
    1392215490diff -Naur vim72.orig/src/memline.c vim72/src/memline.c
    1392315491--- vim72.orig/src/memline.c    2008-07-13 09:19:22.000000000 -0700
    13924 +++ vim72/src/memline.c 2009-06-05 14:23:47.000000000 -0700
     15492+++ vim72/src/memline.c 2009-07-19 15:15:19.000000000 -0700
    1392515493@@ -1554,10 +1554,15 @@
    1392615494            for (i = 0; i < num_files; ++i)
     
    1398215550diff -Naur vim72.orig/src/menu.c vim72/src/menu.c
    1398315551--- vim72.orig/src/menu.c       2008-06-21 12:53:43.000000000 -0700
    13984 +++ vim72/src/menu.c    2009-06-05 14:25:15.000000000 -0700
     15552+++ vim72/src/menu.c    2009-07-19 15:16:33.000000000 -0700
    1398515553@@ -231,7 +231,7 @@
    1398615554                if (skipdigits(menu_path + 7) == p)
     
    1405915627diff -Naur vim72.orig/src/message.c vim72/src/message.c
    1406015628--- vim72.orig/src/message.c    2008-07-09 11:24:55.000000000 -0700
    14061 +++ vim72/src/message.c 2009-06-05 14:25:15.000000000 -0700
     15629+++ vim72/src/message.c 2009-07-19 15:18:26.000000000 -0700
     15630@@ -107,7 +107,7 @@
     15631 }
     15632 
     15633 #if defined(FEAT_EVAL) || defined(FEAT_X11) || defined(USE_XSMP) \
     15634-    || defined(PROTO)
     15635+    || defined(FEAT_GUI_GTK) || defined(PROTO)
     15636 /*
     15637  * Like msg() but keep it silent when 'verbosefile' is set.
     15638  */
    1406215639@@ -818,10 +818,9 @@
    1406315640 /*
     
    1437115948diff -Naur vim72.orig/src/misc1.c vim72/src/misc1.c
    1437215949--- vim72.orig/src/misc1.c      2008-07-12 12:20:53.000000000 -0700
    14373 +++ vim72/src/misc1.c   2009-06-05 14:25:15.000000000 -0700
     15950+++ vim72/src/misc1.c   2009-07-19 15:19:00.000000000 -0700
    1437415951@@ -2188,12 +2188,11 @@
    1437515952  *
     
    1438615963     char_u     *oldp, *newp;
    1438715964     colnr_T    oldlen;
    14388 @@ -2717,6 +2716,9 @@
     15965@@ -2346,12 +2345,13 @@
     15966     int                undo;           /* if TRUE, prepare for undo */
     15967 {
     15968     long       n;
     15969+    linenr_T   first = curwin->w_cursor.lnum;
     15970 
     15971     if (nlines <= 0)
     15972        return;
     15973 
     15974     /* save the deleted lines for undo */
     15975-    if (undo && u_savedel(curwin->w_cursor.lnum, nlines) == FAIL)
     15976+    if (undo && u_savedel(first, nlines) == FAIL)
     15977        return;
     15978 
     15979     for (n = 0; n < nlines; )
     15980@@ -2359,18 +2359,21 @@
     15981        if (curbuf->b_ml.ml_flags & ML_EMPTY)       /* nothing to delete */
     15982            break;
     15983 
     15984-       ml_delete(curwin->w_cursor.lnum, TRUE);
     15985+       ml_delete(first, TRUE);
     15986        ++n;
     15987 
     15988        /* If we delete the last line in the file, stop */
     15989-       if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
     15990+       if (first > curbuf->b_ml.ml_line_count)
     15991            break;
     15992     }
     15993-    /* adjust marks, mark the buffer as changed and prepare for displaying */
     15994-    deleted_lines_mark(curwin->w_cursor.lnum, n);
     15995 
     15996+    /* Correct the cursor position before calling deleted_lines_mark(), it may
     15997+     * trigger a callback to display the cursor. */
     15998     curwin->w_cursor.col = 0;
     15999     check_cursor_lnum();
     16000+
     16001+    /* adjust marks, mark the buffer as changed and prepare for displaying */
     16002+    deleted_lines_mark(first, n);
     16003 }
     16004 
     16005     int
     16006@@ -2622,6 +2625,8 @@
     16007 
     16008 /*
     16009  * Like deleted_lines(), but adjust marks first.
     16010+ * Make sure the cursor is on a valid line before calling, a GUI callback may
     16011+ * be triggered to display the cursor.
     16012  */
     16013     void
     16014 deleted_lines_mark(lnum, count)
     16015@@ -2717,6 +2722,9 @@
    1438916016     long       xtra;
    1439016017 {
     
    1439616023 #ifdef FEAT_JUMPLIST
    1439716024     int                cols;
    14398 @@ -2769,7 +2771,7 @@
     16025@@ -2769,7 +2777,7 @@
    1439916026                    curbuf->b_changelistlen = JUMPLISTSIZE - 1;
    1440016027                    mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1,
     
    1440516032                        /* Correct position in changelist for other windows on
    1440616033                         * this buffer. */
    14407 @@ -2777,7 +2779,7 @@
     16034@@ -2777,7 +2785,7 @@
    1440816035                            --wp->w_changelistidx;
    1440916036                    }
     
    1441416041                    /* For other windows, if the position in the changelist is
    1441516042                     * at the end it stays at the end. */
    14416 @@ -2796,7 +2798,7 @@
     16043@@ -2796,7 +2804,7 @@
    1441716044 #endif
    1441816045     }
     
    1442316050        if (wp->w_buffer == curbuf)
    1442416051        {
    14425 @@ -2955,6 +2957,8 @@
     16052@@ -2955,6 +2963,8 @@
    1442616053     int            col;                /* column for message; non-zero when in insert
    1442716054                                   mode and 'showmode' is on */
     
    1443216059            && curbufIsChanged() == 0
    1443316060 #ifdef FEAT_AUTOCMD
    14434 @@ -2977,8 +2981,10 @@
     16061@@ -2977,8 +2987,10 @@
    1443516062        if (msg_row == Rows - 1)
    1443616063            msg_col = col;
     
    1444516072        (void)msg_end();
    1444616073        if (msg_silent == 0 && !silent_mode)
    14447 @@ -3245,9 +3251,9 @@
     16074@@ -3245,9 +3257,9 @@
    1444816075 
    1444916076     /* When using ":silent" assume that <CR> was entered. */
     
    1445716084     /* Set the state such that text can be selected/copied/pasted and we still
    1445816085      * get mouse events. */
    14459 @@ -4141,10 +4147,9 @@
     16086@@ -4141,10 +4153,9 @@
    1446016087 /*
    1446116088  * Function given to ExpandGeneric() to obtain an environment variable name.
     
    1446916096 {
    1447016097 # if defined(AMIGA) || defined(__MRC__) || defined(__SC__)
    14471 @@ -4736,9 +4741,9 @@
     16098@@ -4736,9 +4747,9 @@
    1447216099         * If it is then restrict the search to below this line and try again.
    1447316100         */
     
    1448116108        cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1;
    1448216109        if (cur_maxcomment <= 0)
    14483 @@ -6269,7 +6274,7 @@
     16110@@ -6269,7 +6280,7 @@
    1448416111      * check for that.
    1448516112      */
     
    1449016117        linecopy[curwin->w_cursor.col] = NUL;
    1449116118 
     16119@@ -8522,11 +8533,25 @@
     16120     for (setsuf = p_su; *setsuf; )
     16121     {
     16122        setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
     16123-       if (fnamelen >= setsuflen
     16124-               && fnamencmp(suf_buf, fname + fnamelen - setsuflen,
     16125-                                             (size_t)setsuflen) == 0)
     16126-           break;
     16127-       setsuflen = 0;
     16128+       if (setsuflen == 0)
     16129+       {
     16130+           char_u *tail = gettail(fname);
     16131+
     16132+           /* empty entry: match name without a '.' */
     16133+           if (vim_strchr(tail, '.') == NULL)
     16134+           {
     16135+               setsuflen = 1;
     16136+               break;
     16137+           }
     16138+       }
     16139+       else
     16140+       {
     16141+           if (fnamelen >= setsuflen
     16142+                   && fnamencmp(suf_buf, fname + fnamelen - setsuflen,
     16143+                                                 (size_t)setsuflen) == 0)
     16144+               break;
     16145+           setsuflen = 0;
     16146+       }
     16147     }
     16148     return (setsuflen != 0);
     16149 }
     16150@@ -9188,7 +9213,7 @@
     16151                else if (vim_strpbrk(p, (char_u *)"$~") != NULL)
     16152                {
     16153                    vim_free(p);
     16154-                   ga_clear(&ga);
     16155+                   ga_clear_strings(&ga);
     16156                    i = mch_expand_wildcards(num_pat, pat, num_file, file,
     16157                                                                       flags);
     16158                    recursive = FALSE;
    1449216159diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c
    1449316160--- vim72.orig/src/misc2.c      2008-07-23 12:12:56.000000000 -0700
    14494 +++ vim72/src/misc2.c   2009-06-05 14:25:06.000000000 -0700
     16161+++ vim72/src/misc2.c   2009-07-19 15:16:25.000000000 -0700
    1449516162@@ -496,7 +496,8 @@
    1449616163 {
     
    1469816365diff -Naur vim72.orig/src/move.c vim72/src/move.c
    1469916366--- vim72.orig/src/move.c       2008-07-12 09:26:47.000000000 -0700
    14700 +++ vim72/src/move.c    2009-06-05 14:24:51.000000000 -0700
     16367+++ vim72/src/move.c    2009-07-19 15:16:14.000000000 -0700
    1470116368@@ -280,18 +280,20 @@
    1470216369 
     
    1477416441diff -Naur vim72.orig/src/nbdebug.c vim72/src/nbdebug.c
    1477516442--- vim72.orig/src/nbdebug.c    2008-06-22 08:38:58.000000000 -0700
    14776 +++ vim72/src/nbdebug.c 2009-06-05 14:21:41.000000000 -0700
     16443+++ vim72/src/nbdebug.c 2009-07-19 15:13:36.000000000 -0700
    1477716444@@ -33,7 +33,6 @@
    1477816445 u_int           nb_dlevel = 0;         /* nb_debug verbosity level */
     
    1483516502diff -Naur vim72.orig/src/nbdebug.h vim72/src/nbdebug.h
    1483616503--- vim72.orig/src/nbdebug.h    2008-06-22 07:31:50.000000000 -0700
    14837 +++ vim72/src/nbdebug.h 2009-06-05 14:21:41.000000000 -0700
     16504+++ vim72/src/nbdebug.h 2009-07-19 15:13:36.000000000 -0700
    1483816505@@ -43,8 +43,6 @@
    1483916506 
     
    1486716534diff -Naur vim72.orig/src/netbeans.c vim72/src/netbeans.c
    1486816535--- vim72.orig/src/netbeans.c   2008-07-13 09:19:54.000000000 -0700
    14869 +++ vim72/src/netbeans.c        2009-06-05 14:25:22.000000000 -0700
    14870 @@ -700,7 +700,6 @@
     16536+++ vim72/src/netbeans.c        2009-07-19 15:18:05.000000000 -0700
     16537@@ -32,6 +32,7 @@
     16538 /* WinSock API is separated from C API, thus we can't use read(), write(),
     16539  * errno... */
     16540 # define sock_errno WSAGetLastError()
     16541+# undef ECONNREFUSED
     16542 # define ECONNREFUSED WSAECONNREFUSED
     16543 # ifdef EINTR
     16544 #  undef EINTR
     16545@@ -700,7 +701,6 @@
    1487116546 /*
    1487216547  * Read and process a command from netbeans.
     
    1487616551 /* Use this one when generating prototypes, the others are static. */
    1487716552     void
    14878 @@ -708,12 +707,15 @@
     16553@@ -708,12 +708,15 @@
    1487916554 #else
    1488016555 # ifdef FEAT_GUI_MOTIF
     
    1489516570 #endif
    1489616571 {
    14897 @@ -1043,7 +1045,7 @@
     16572@@ -1043,7 +1046,7 @@
    1489816573        nbdebug(("EVT: %s", buf));
    1489916574 /*     nb_send(buf, "netbeans_end");    avoid "write failed" messages */
     
    1490416579 }
    1490516580 
    14906 @@ -1582,7 +1584,9 @@
     16581@@ -1582,7 +1585,9 @@
    1490716582                            buf_delsign(buf->bufp, id);
    1490816583                        }
     
    1491416589 
    1491516590                    nbdebug(("    Deleting lines %d through %d\n", del_from_lnum, del_to_lnum));
    14916 @@ -1921,7 +1925,7 @@
     16591@@ -1921,7 +1926,7 @@
    1491716592            vim_free(path);
    1491816593            if (bufp == NULL)
     
    1492316598                return FAIL;
    1492416599            }
    14925 @@ -2141,7 +2145,9 @@
     16600@@ -2141,7 +2146,9 @@
    1492616601 #endif
    1492716602            }
     
    1493316608            /* gui_update_cursor(TRUE, FALSE); */
    1493416609            /* update_curbuf(NOT_VALID); */
    14935 @@ -2277,9 +2283,6 @@
     16610@@ -2277,9 +2284,6 @@
    1493616611            int serNum;
    1493716612            int localTypeNum;
     
    1494316618 
    1494416619            if (buf == NULL || buf->bufp == NULL)
    14945 @@ -2303,13 +2306,10 @@
     16620@@ -2303,13 +2307,10 @@
    1494616621            pos = get_off_or_lnum(buf->bufp, &args);
    1494716622 
     
    1495916634                nbdebug(("    partial line annotation -- Not Yet Implemented!\n"));
    1496016635            }
    14961 @@ -2321,7 +2321,7 @@
     16636@@ -2321,7 +2322,7 @@
    1496216637            }
    1496316638            if (pos)
     
    1496816643                if (typeNum == curPCtype)
    1496916644                    coloncmd(":sign jump %d buffer=%d", serNum,
    14970 @@ -2425,7 +2425,7 @@
     16645@@ -2425,7 +2426,7 @@
    1497116646                                GUARDED) == 0)
    1497216647                            {
     
    1497716652                                     buf->bufp->b_fnum);
    1497816653                            }
    14979 @@ -2747,11 +2747,10 @@
     16654@@ -2582,7 +2583,7 @@
     16655     va_list ap;
     16656 
     16657     va_start(ap, cmd);
     16658-    vsprintf(buf, cmd, ap);
     16659+    vim_vsnprintf(buf, sizeof(buf), cmd, ap, NULL);
     16660     va_end(ap);
     16661 
     16662     nbdebug(("    COLONCMD %s\n", buf));
     16663@@ -2747,11 +2748,10 @@
    1498016664  * cursor and sends it to the debugger for evaluation.  The debugger should
    1498116665  * respond with a showBalloon command when there is a useful result.
     
    1499016674     win_T      *wp;
    1499116675     char_u     *text;
    14992 @@ -2924,44 +2923,26 @@
     16676@@ -2924,44 +2924,26 @@
    1499316677 }
    1499416678 
     
    1504116725     if (nbbuf != NULL)
    1504216726        nbbuf->bufp = NULL;
    15043 @@ -3082,9 +3063,8 @@
     16727@@ -3082,9 +3064,8 @@
    1504416728 /*
    1504516729  * Send netbeans an unmodufied command.
     
    1505216736 #if 0
    1505316737     char_u     buf[128];
    15054 @@ -3391,13 +3371,12 @@
     16738@@ -3391,13 +3372,12 @@
    1505516739  * buf->signmapused[]  maps buffer-local annotation IDs to an index in
    1505616740  *                     globalsignmap[].
     
    1506916753diff -Naur vim72.orig/src/normal.c vim72/src/normal.c
    1507016754--- vim72.orig/src/normal.c     2008-07-31 13:03:08.000000000 -0700
    15071 +++ vim72/src/normal.c  2009-06-05 14:25:15.000000000 -0700
     16755+++ vim72/src/normal.c  2009-07-19 15:16:33.000000000 -0700
    1507216756@@ -183,6 +183,8 @@
    1507316757 static void    nv_cursorhold __ARGS((cmdarg_T *cap));
     
    1549517179diff -Naur vim72.orig/src/ops.c vim72/src/ops.c
    1549617180--- vim72.orig/src/ops.c        2008-06-21 13:08:59.000000000 -0700
    15497 +++ vim72/src/ops.c     2009-06-05 14:25:51.000000000 -0700
     17181+++ vim72/src/ops.c     2009-07-19 15:18:26.000000000 -0700
    1549817182@@ -72,11 +72,11 @@
    1549917183  */
     
    1580517489                    (int)y_regs[i].y_width
    1580617490 #else
    15807 @@ -6258,11 +6299,20 @@
     17491@@ -5550,6 +5591,29 @@
     17492     if (dpy != NULL && str != NULL && motion_type >= 0
     17493                                               && len < 1024*1024 && len > 0)
     17494     {
     17495+#ifdef FEAT_MBYTE
     17496+       /* The CUT_BUFFER0 is supposed to always contain latin1.  Convert from
     17497+        * 'enc' when it is a multi-byte encoding.  When 'enc' is an 8-bit
     17498+        * encoding conversion usually doesn't work, so keep the text as-is.
     17499+        */
     17500+       if (has_mbyte)
     17501+       {
     17502+           char_u      *conv_str = str;
     17503+           vimconv_T   vc;
     17504+
     17505+           vc.vc_type = CONV_NONE;
     17506+           if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
     17507+           {
     17508+               conv_str = string_convert(&vc, str, (int*)&len);
     17509+               if (conv_str != NULL)
     17510+               {
     17511+                   vim_free(str);
     17512+                   str = conv_str;
     17513+               }
     17514+               convert_setup(&vc, NULL, NULL);
     17515+           }
     17516+       }
     17517+#endif
     17518        XStoreBuffer(dpy, (char *)str, (int)len, 0);
     17519        XFlush(dpy);
     17520     }
     17521@@ -6258,11 +6322,20 @@
    1580817522 
    1580917523            if (VIsual_mode == Ctrl_V)
     
    1582617540                    oparg.end_vcol = MAXCOL;
    1582717541                /* Swap the start, end vcol if needed */
    15828 @@ -6366,7 +6416,7 @@
     17542@@ -6366,7 +6439,7 @@
    1582917543            {
    1583017544                getvcols(curwin, &min_pos, &max_pos, &min_pos.col,
     
    1583517549            }
    1583617550            else
    15837 @@ -6374,13 +6424,15 @@
     17551@@ -6374,13 +6447,15 @@
    1583817552 
    1583917553            if (char_count_cursor == byte_count_cursor
     
    1585317567                        (long)curbuf->b_ml.ml_line_count,
    1585417568                        word_count_cursor, word_count,
    15855 @@ -6392,20 +6444,22 @@
     17569@@ -6392,20 +6467,22 @@
    1585617570        {
    1585717571            p = ml_get_curline();
     
    1588217596diff -Naur vim72.orig/src/option.c vim72/src/option.c
    1588317597--- vim72.orig/src/option.c     2008-07-18 06:05:33.000000000 -0700
    15884 +++ vim72/src/option.c  2009-06-05 14:25:15.000000000 -0700
     17598+++ vim72/src/option.c  2009-07-19 15:17:52.000000000 -0700
    1588517599@@ -387,6 +387,9 @@
    1588617600     char_u     *def_val[2];    /* default values for variable (vi and vim) */
     
    1832720041 
    1832820042 #define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption))
     20043@@ -3984,7 +4006,7 @@
     20044        else
     20045        {
     20046            prefix = 1;
     20047-           if (STRNCMP(arg, "no", 2) == 0)
     20048+           if (STRNCMP(arg, "no", 2) == 0 && STRNCMP(arg, "novice", 6) != 0)
     20049            {
     20050                prefix = 0;
     20051                arg += 2;
    1832920052@@ -4119,11 +4141,23 @@
    1833020053                                           && options[opt_idx].var == VAR_WIN)
     
    1856020283     return errmsg;
    1856120284 }
    18562 @@ -7105,22 +7197,28 @@
     20285@@ -6932,6 +7024,7 @@
     20286     int                new_unnamed = FALSE;
     20287     int                new_autoselect = FALSE;
     20288     int                new_autoselectml = FALSE;
     20289+    int                new_html = FALSE;
     20290     regprog_T  *new_exclude_prog = NULL;
     20291     char_u     *errmsg = NULL;
     20292     char_u     *p;
     20293@@ -6955,6 +7048,11 @@
     20294            new_autoselectml = TRUE;
     20295            p += 12;
     20296        }
     20297+       else if (STRNCMP(p, "html", 4) == 0 && (p[4] == ',' || p[4] == NUL))
     20298+       {
     20299+           new_html = TRUE;
     20300+           p += 4;
     20301+       }
     20302        else if (STRNCMP(p, "exclude:", 8) == 0 && new_exclude_prog == NULL)
     20303        {
     20304            p += 8;
     20305@@ -6976,6 +7074,7 @@
     20306        clip_unnamed = new_unnamed;
     20307        clip_autoselect = new_autoselect;
     20308        clip_autoselectml = new_autoselectml;
     20309+       clip_html = new_html;
     20310        vim_free(clip_exclude_prog);
     20311        clip_exclude_prog = new_exclude_prog;
     20312     }
     20313@@ -7105,22 +7204,28 @@
    1856320314            curbuf->b_did_warn = FALSE;
    1856420315 
     
    1859620347 
    1859720348     /* when 'bin' is set also set some other options */
    18598 @@ -7128,7 +7226,7 @@
     20349@@ -7128,7 +7233,7 @@
    1859920350     {
    1860020351        set_options_bin(old_value, curbuf->b_p_bin, opt_flags);
     
    1860520356     }
    1860620357 
    18607 @@ -7279,7 +7377,7 @@
     20358@@ -7279,7 +7384,7 @@
    1860820359        if (!value)
    1860920360            save_file_ff(curbuf);       /* Buffer is unchanged */
     
    1861420365 #ifdef FEAT_AUTOCMD
    1861520366        modified_was_set = value;
    18616 @@ -7486,9 +7584,13 @@
     20367@@ -7486,9 +7591,13 @@
    1861720368             * set. */
    1861820369            if (STRCMP(p_enc, "utf-8") != 0)
     
    1863020381 
    1863120382 # ifdef FEAT_MBYTE
    18632 @@ -7714,7 +7816,7 @@
     20383@@ -7714,7 +7823,7 @@
    1863320384        newFoldLevel();
    1863420385     }
     
    1863920390     {
    1864020391        foldUpdateAll(curwin);
    18641 @@ -7974,6 +8076,11 @@
     20392@@ -7974,6 +8083,11 @@
    1864220393        else /* curwin->w_p_scr > curwin->w_height */
    1864320394            curwin->w_p_scr = curwin->w_height;
     
    1865120402     {
    1865220403        errmsg = e_positive;
    18653 @@ -8227,13 +8334,13 @@
     20404@@ -8227,13 +8341,13 @@
    1865420405            {
    1865520406                if (number == 0 && string != NULL)
     
    1866820419                        /* There's another character after zeros or the string
    1866920420                         * is empty.  In both cases, we are trying to set a
    18670 @@ -8323,7 +8430,7 @@
     20421@@ -8323,7 +8437,7 @@
    1867120422     {
    1867220423        --arg;                      /* put arg at the '<' */
     
    1867720428            key = 0;
    1867820429     }
    18679 @@ -9271,10 +9378,9 @@
     20430@@ -9271,10 +9385,9 @@
    1868020431 /*
    1868120432  * Check for NULL pointers in a winopt_T and replace them with empty_option.
     
    1868920440 #ifdef FEAT_FOLDING
    1869020441     check_string_option(&wop->wo_fdi);
    18691 @@ -9296,10 +9402,9 @@
     20442@@ -9296,10 +9409,9 @@
    1869220443 /*
    1869320444  * Free the allocated memory inside a winopt_T.
     
    1870120452 #ifdef FEAT_FOLDING
    1870220453     clear_string_option(&wop->wo_fdi);
    18703 @@ -9834,7 +9939,8 @@
     20454@@ -9645,7 +9757,7 @@
     20455        }
     20456        --p;
     20457     }
     20458-    if (STRNCMP(p, "no", 2) == 0)
     20459+    if (STRNCMP(p, "no", 2) == 0 && STRNCMP(p, "novice", 6) != 0)
     20460     {
     20461        xp->xp_context = EXPAND_BOOL_SETTINGS;
     20462        p += 2;
     20463@@ -9834,7 +9946,8 @@
    1870420464        regmatch->rm_ic = ic;
    1870520465        if (xp->xp_context != EXPAND_BOOL_SETTINGS)
     
    1871120471                {
    1871220472                    if (loop == 0)
    18713 @@ -10093,25 +10199,110 @@
     20473@@ -10093,25 +10206,110 @@
    1871420474 
    1871520475 #ifdef FEAT_LANGMAP
     
    1872920489+ * langmap_entry_T.  This does the same as langmap_mapchar[] for characters >=
    1873020490+ * 256.
    18731 + */
     20491  */
    1873220492+# ifdef FEAT_MBYTE
    1873320493+/*
     
    1874220502+static garray_T langmap_mapga;
    1874320503+static void langmap_set_entry __ARGS((int from, int to));
    18744 +
    18745 +/*
     20504 
     20505 /*
     20506- * char_u langmap_mapchar[256];
     20507- * Normally maps each of the 128 upper chars to an <128 ascii char; used to
     20508- * "translate" native lang chars in normal mode or some cases of
     20509- * insert mode without having to tediously switch lang mode back&forth.
    1874620510+ * Search for an entry in "langmap_mapga" for "from".  If found set the "to"
    1874720511+ * field.  If not found insert a new entry at the appropriate location.
     
    1878420548+    entries[0].to = to;
    1878520549+}
    18786  
    18787  /*
    18788 - * char_u langmap_mapchar[256];
    18789 - * Normally maps each of the 128 upper chars to an <128 ascii char; used to
    18790 - * "translate" native lang chars in normal mode or some cases of
    18791 - * insert mode without having to tediously switch lang mode back&forth.
     20550+
     20551+/*
    1879220552+ * Apply 'langmap' to multi-byte character "c" and return the result.
    18793   */
     20553+ */
    1879420554+    int
    1879520555+langmap_adjust_mb(c)
     
    1883120591 
    1883220592 /*
    18833 @@ -10125,7 +10316,10 @@
     20593@@ -10125,7 +10323,10 @@
    1883420594     char_u  *p2;
    1883520595     int            from, to;
     
    1884320603     for (p = p_langmap; p[0] != NUL; )
    1884420604     {
    18845 @@ -10175,7 +10369,13 @@
     20605@@ -10175,7 +10376,13 @@
    1884620606                                                             transchar(from));
    1884720607                return;
     
    1886020620diff -Naur vim72.orig/src/os_unix.c vim72/src/os_unix.c
    1886120621--- vim72.orig/src/os_unix.c    2008-08-06 04:01:40.000000000 -0700
    18862 +++ vim72/src/os_unix.c 2009-06-05 14:25:15.000000000 -0700
     20622+++ vim72/src/os_unix.c 2009-07-19 15:18:55.000000000 -0700
    1886320623@@ -181,7 +181,8 @@
    1886420624        && defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK)
     
    1889120651 static int curr_tmode = TMODE_COOK;    /* contains current terminal mode */
    1889220652 
    18893 @@ -315,12 +319,15 @@
     20653@@ -315,12 +319,32 @@
    1889420654     {-1,           "Unknown!", FALSE}
    1889520655 };
    1889620656 
     20657+    int
     20658+mch_chdir(path)
     20659+    char *path;
     20660+{
     20661+    if (p_verbose >= 5)
     20662+    {
     20663+       verbose_enter();
     20664+       smsg((char_u *)"chdir(%s)", path);
     20665+       verbose_leave();
     20666+    }
     20667+# ifdef VMS
     20668+    return chdir(vms_fixfilename(path));
     20669+# else
     20670+    return chdir(path);
     20671+# endif
     20672+}
     20673+
    1889720674+/*
    1889820675+ * Write s[len] to the screen.
     
    1890820685        RealWaitForChar(read_cmd_fd, p_wd, NULL);
    1890920686 }
    18910 @@ -447,10 +454,9 @@
     20687@@ -447,10 +471,9 @@
    1891120688  * Return total amount of memory available in Kbyte.
    1891220689  * Doesn't change when memory has been allocated.
     
    1892020697 # ifdef __EMX__
    1892120698     return ulimit(3, 0L) >> 10;   /* always 32MB? */
    18922 @@ -799,12 +805,11 @@
     20699@@ -799,12 +822,11 @@
    1892320700 #endif
    1892420701 
     
    1893420711 sig_winch SIGDEFARG(sigarg)
    1893520712 {
    18936 @@ -816,7 +821,6 @@
     20713@@ -816,7 +838,6 @@
    1893720714 #endif
    1893820715 
     
    1894220719 catch_sigint SIGDEFARG(sigarg)
    1894320720 {
    18944 @@ -828,7 +832,6 @@
     20721@@ -828,7 +849,6 @@
    1894520722 #endif
    1894620723 
     
    1895020727 catch_sigpwr SIGDEFARG(sigarg)
    1895120728 {
    18952 @@ -848,7 +851,6 @@
     20729@@ -848,7 +868,6 @@
    1895320730 /*
    1895420731  * signal function for alarm().
     
    1895820735 sig_alarm SIGDEFARG(sigarg)
    1895920736 {
    18960 @@ -1065,19 +1067,23 @@
     20737@@ -1065,19 +1084,23 @@
    1896120738     SIGRETURN;
    1896220739 }
     
    1898520762 sigcont_handler SIGDEFARG(sigarg)
    1898620763 {
    18987 @@ -1115,15 +1121,28 @@
     20764@@ -1115,15 +1138,28 @@
    1898820765     }
    1898920766 # endif
     
    1901220789+     */
    1901320790+    {
    19014 +       long wait;
    19015 +       for (wait = 0; !sigcont_received && wait <= 3L; wait++)
     20791+       long wait_time;
     20792+       for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++)
    1901620793+           /* Loop is not entered most of the time */
    19017 +           mch_delay(wait, FALSE);
     20794+           mch_delay(wait_time, FALSE);
    1901820795+    }
    1901920796 # endif
    1902020797 
    1902120798 # ifdef FEAT_TITLE
    19022 @@ -1172,7 +1191,7 @@
     20799@@ -1172,7 +1208,7 @@
    1902320800 #ifdef SIGTSTP
    1902420801     signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
     
    1902920806 #endif
    1903020807 
    19031 @@ -1231,7 +1250,7 @@
     20808@@ -1231,7 +1267,7 @@
    1903220809 reset_signals()
    1903320810 {
     
    1903820815     signal(SIGCONT, SIG_DFL);
    1903920816 #endif
    19040 @@ -1326,11 +1345,10 @@
     20817@@ -1326,11 +1362,10 @@
    1904120818 /*
    1904220819  * Check_win checks whether we have an interactive stdout.
     
    1905220829 #ifdef OS2
    1905320830     /*
    19054 @@ -1414,11 +1432,10 @@
     20831@@ -1414,11 +1449,10 @@
    1905520832 /*
    1905620833  * Another X Error handler, just used to check for errors.
     
    1906620843     got_x_error = TRUE;
    1906720844     return 0;
    19068 @@ -1431,15 +1448,12 @@
     20845@@ -1431,15 +1465,12 @@
    1906920846  */
    1907020847 static int x_IOerror_check __ARGS((Display *dpy));
     
    1908320860 # endif
    1908420861 
    19085 @@ -1448,10 +1462,9 @@
     20862@@ -1448,10 +1479,9 @@
    1908620863  */
    1908720864 static int x_IOerror_handler __ARGS((Display *dpy));
     
    1909520872     xterm_dpy = NULL;
    1909620873     x11_window = 0;
    19097 @@ -1460,8 +1473,6 @@
     20874@@ -1460,8 +1490,6 @@
    1909820875 
    1909920876     /* This function should not return, it causes exit().  Longjump instead. */
     
    1910420881 #endif
    1910520882 
    19106 @@ -1897,10 +1908,9 @@
     20883@@ -1897,10 +1925,9 @@
    1910720884 
    1910820885 #else  /* FEAT_X11 */
     
    1911620893     return FALSE;
    1911720894 }
    19118 @@ -2438,7 +2448,7 @@
     20895@@ -2414,6 +2441,12 @@
     20896 #ifdef HAVE_FCHDIR
     20897            if (fd >= 0)
     20898            {
     20899+               if (p_verbose >= 5)
     20900+               {
     20901+                   verbose_enter();
     20902+                   MSG("fchdir() to previous dir");
     20903+                   verbose_leave();
     20904+               }
     20905                l = fchdir(fd);
     20906                close(fd);
     20907            }
     20908@@ -2438,7 +2471,7 @@
    1911920909     }
    1912020910 
     
    1912520915 
    1912620916     /* Do not append ".", "/dir/." is equal to "/dir". */
    19127 @@ -2475,11 +2485,10 @@
     20917@@ -2475,11 +2508,10 @@
    1912820918  * file name to remain exactly the same.
    1912920919  * Only required for file systems where case is ignored and preserved.
     
    1913820928     struct stat st;
    1913920929     char_u     *slash, *tail;
    19140 @@ -2657,7 +2666,7 @@
     20930@@ -2657,7 +2689,7 @@
    1914120931  */
    1914220932     vim_acl_T
     
    1914720937     vim_acl_T  ret = NULL;
    1914820938 #ifdef HAVE_POSIX_ACL
    19149 @@ -2717,7 +2726,7 @@
     20939@@ -2717,7 +2749,7 @@
    1915020940  */
    1915120941     void
     
    1915620946 {
    1915720947     if (aclent == NULL)
    19158 @@ -2760,10 +2769,9 @@
     20948@@ -2760,10 +2792,9 @@
    1915920949 /*
    1916020950  * Set hidden flag for "name".
     
    1916820958     /* can't hide a file */
    1916920959 }
    19170 @@ -2905,7 +2913,7 @@
     20960@@ -2905,7 +2936,7 @@
    1917120961      * Ignore any errors.
    1917220962      */
     
    1917720967 #endif
    1917820968 }
    19179 @@ -2936,7 +2944,8 @@
     20969@@ -2936,7 +2967,8 @@
    1918020970     }
    1918120971 #  endif
     
    1918720977 #  ifdef FEAT_XCLIPBOARD
    1918820978            && x11_display != xterm_dpy
    19189 @@ -3451,10 +3460,9 @@
     20979@@ -3451,10 +3483,9 @@
    1919020980 /*
    1919120981  * set screen mode, always fails.
     
    1919920989     EMSG(_(e_screenmode));
    1920020990     return FAIL;
    19201 @@ -3926,9 +3934,9 @@
     20991@@ -3926,9 +3957,9 @@
    1920220992                 */
    1920320993                if (fd >= 0)
     
    1921221002                    /* Don't need this now that we've duplicated it */
    1921321003                    close(fd);
    19214 @@ -3946,7 +3954,17 @@
     21004@@ -3946,7 +3977,17 @@
    1921521005                 * children can be kill()ed.  Don't do this when using pipes,
    1921621006                 * because stdin is not a tty, we would lose /dev/tty. */
     
    1923021020 # ifdef FEAT_GUI
    1923121021                if (pty_slave_fd >= 0)
    19232 @@ -3996,13 +4014,13 @@
     21022@@ -3996,13 +4037,13 @@
    1923321023 
    1923421024                    /* set up stdin/stdout/stderr for the child */
     
    1924721037 
    1924821038                    close(pty_slave_fd);    /* has been dupped, close it now */
    19249 @@ -4013,13 +4031,13 @@
     21039@@ -4013,13 +4054,13 @@
    1925021040                    /* set up stdin for the child */
    1925121041                    close(fd_toshell[1]);
     
    1926321053 
    1926421054 # ifdef FEAT_GUI
    19265 @@ -4027,7 +4045,7 @@
     21055@@ -4027,7 +4068,7 @@
    1926621056                    {
    1926721057                        /* set up stderr for the child */
     
    1927221062 # endif
    1927321063                }
    19274 @@ -4078,6 +4096,9 @@
     21064@@ -4078,6 +4119,9 @@
    1927521065                int         fromshell_fd;
    1927621066                garray_T    ga;
     
    1928221072 # ifdef FEAT_GUI
    1928321073                if (pty_master_fd >= 0)
    19284 @@ -4146,9 +4167,10 @@
     21074@@ -4146,9 +4190,10 @@
    1928521075                            {
    1928621076                                s = vim_strchr(lp + written, NL);
     
    1929521085                                /* Finished a line, add a NL, unless this line
    1929621086                                 * should not have one. */
    19297 @@ -4158,7 +4180,8 @@
     21087@@ -4158,7 +4203,8 @@
    1929821088                                            && (lnum !=
    1929921089                                                    curbuf->b_ml.ml_line_count
     
    1930521095                                if (lnum > curbuf->b_op_end.lnum)
    1930621096                                {
    19307 @@ -4186,7 +4209,9 @@
     21097@@ -4186,7 +4232,9 @@
    1930821098                    ga_init2(&ga, 1, BUFLEN);
    1930921099 
     
    1931621106                {
    1931721107                    /*
    19318 @@ -4199,25 +4224,34 @@
     21108@@ -4199,25 +4247,34 @@
    1931921109                     * that a typed password is echoed for ssh or gpg command.
    1932021110                     * Don't get characters when the child has already
     
    1935921149                         * For pipes:
    1936021150                         * Check for CTRL-C: send interrupt signal to child.
    19361 @@ -4319,9 +4353,9 @@
     21151@@ -4271,7 +4328,8 @@
     21152                                ta_buf[i] = '\n';
     21153 # ifdef FEAT_MBYTE
     21154                            if (has_mbyte)
     21155-                               i += (*mb_ptr2len)(ta_buf + i) - 1;
     21156+                               i += (*mb_ptr2len_len)(ta_buf + i,
     21157+                                                       ta_len + len - i) - 1;
     21158 # endif
     21159                        }
     21160 
     21161@@ -4319,9 +4377,9 @@
    1936221162                            {
    1936321163                                ta_len -= len;
     
    1937021170 
    1937121171                    if (got_int)
    19372 @@ -4429,6 +4463,25 @@
     21172@@ -4429,6 +4487,25 @@
    1937321173                        out_flush();
    1937421174                        if (got_int)
     
    1939621196 
    1939721197                    /* If we already detected the child has finished break the
    19398 @@ -4672,7 +4725,6 @@
     21198@@ -4672,7 +4749,6 @@
    1939921199  * Returns also, when a request from Sniff is waiting -- toni.
    1940021200  * Or when a Linux GPM mouse event is waiting.
     
    1940421204     int
    1940521205 #else
    19406 @@ -4681,7 +4733,7 @@
     21206@@ -4681,7 +4757,7 @@
    1940721207 RealWaitForChar(fd, msec, check_for_gpm)
    1940821208     int                fd;
     
    1941321213     int                ret;
    1941421214 #if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) || defined(FEAT_MZSCHEME)
    19415 @@ -5076,7 +5128,6 @@
     21215@@ -5076,7 +5152,6 @@
    1941621216 
    1941721217 #define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|"
     
    1942121221 mch_expand_wildcards(num_pat, pat, num_file, file, flags)
    1942221222     int                   num_pat;
    19423 @@ -5498,7 +5549,7 @@
     21223@@ -5498,7 +5573,7 @@
    1942421224     i = fread((char *)buffer, 1, len, fd);
    1942521225     fclose(fd);
     
    1943021230        /* unexpected read error */
    1943121231        EMSG2(_(e_notread), tempname);
    19432 @@ -5559,7 +5610,7 @@
     21232@@ -5559,7 +5634,7 @@
    1943321233        if (shell_style == STYLE_PRINT && !did_find_nul)
    1943421234        {
     
    1943921239            else
    1944021240                check_spaces = TRUE;
    19441 @@ -5851,7 +5902,9 @@
     21241@@ -5851,7 +5926,9 @@
    1944221242             * we are going to suspend or starting an external process
    1944321243             * so we shouldn't  have problem with this
     
    1944921249        }
    1945021250        if (gpm_fd == -2)
    19451 @@ -6001,7 +6054,6 @@
     21251@@ -6001,7 +6078,6 @@
    1945221252 /*
    1945321253  * Gets info from sysmouse and adds special keys to input buf.
     
    1945721257 sig_sysmouse SIGDEFARG(sigarg)
    1945821258 {
    19459 @@ -6565,11 +6617,10 @@
     21259@@ -6565,11 +6641,10 @@
    1946021260  * This is our chance to ask the user if they want to save,
    1946121261  * or abort the logout
     
    1947021270     cmdmod_T   save_cmdmod;
    1947121271     int                cancel_shutdown = False;
    19472 @@ -6602,16 +6653,15 @@
     21272@@ -6602,16 +6677,15 @@
    1947321273 /*
    1947421274  * Callback that starts save-yourself.
     
    1949121291     /* Handle already being in saveyourself */
    1949221292     if (xsmp.save_yourself)
    19493 @@ -6645,11 +6695,10 @@
     21293@@ -6645,11 +6719,10 @@
    1949421294 /*
    1949521295  * Callback to warn us of imminent death.
     
    1950521305     xsmp_close();
    1950621306 
    19507 @@ -6661,11 +6710,10 @@
     21307@@ -6661,11 +6734,10 @@
    1950821308 /*
    1950921309  * Callback to tell us that save-yourself has completed.
     
    1951921319     xsmp.save_yourself = False;
    1952021320 }
    19521 @@ -6675,11 +6723,10 @@
     21321@@ -6675,11 +6747,10 @@
    1952221322  * Callback to tell us that an instigated shutdown was cancelled
    1952321323  * (maybe even by us)
     
    1953221332     if (xsmp.save_yourself)
    1953321333        SmcSaveYourselfDone(smc_conn, True);
    19534 @@ -6691,13 +6738,12 @@
     21334@@ -6691,13 +6762,12 @@
    1953521335 /*
    1953621336  * Callback to tell us that a new ICE connection has been established.
     
    1954821348     /* Intercept creation of ICE connection fd */
    1954921349     if (opening)
    19550 @@ -6814,7 +6860,8 @@
     21350@@ -6814,7 +6884,8 @@
    1955121351     if (xsmp_icefd != -1)
    1955221352     {
     
    1956021360diff -Naur vim72.orig/src/os_unix.h vim72/src/os_unix.h
    1956121361--- vim72.orig/src/os_unix.h    2008-06-17 11:01:17.000000000 -0700
    19562 +++ vim72/src/os_unix.h 2009-06-05 14:24:58.000000000 -0700
     21362+++ vim72/src/os_unix.h 2009-07-19 15:18:55.000000000 -0700
    1956321363@@ -124,7 +124,7 @@
    1956421364 #  define SIGDUMMYARG  0, 0, (struct sigcontext *)0
     
    1957021370 # endif
    1957121371 #else
     21372@@ -482,11 +482,6 @@
     21373 # else
     21374 int mch_rename __ARGS((const char *src, const char *dest));
     21375 # endif
     21376-# ifdef VMS
     21377-#  define mch_chdir(s) chdir(vms_fixfilename(s))
     21378-# else
     21379-#  define mch_chdir(s) chdir(s)
     21380-# endif
     21381 # ifndef VMS
     21382 #  ifdef __MVS__
     21383   /* on OS390 Unix getenv() doesn't return a pointer to persistent
    1957221384diff -Naur vim72.orig/src/proto/buffer.pro vim72/src/proto/buffer.pro
    1957321385--- vim72.orig/src/proto/buffer.pro     2008-08-09 07:31:21.000000000 -0700
    19574 +++ vim72/src/proto/buffer.pro  2009-06-05 14:24:27.000000000 -0700
     21386+++ vim72/src/proto/buffer.pro  2009-07-19 15:15:54.000000000 -0700
    1957521387@@ -37,13 +37,12 @@
    1957621388 int otherfile __ARGS((char_u *ffname));
     
    1960221414diff -Naur vim72.orig/src/proto/edit.pro vim72/src/proto/edit.pro
    1960321415--- vim72.orig/src/proto/edit.pro       2008-08-09 07:31:24.000000000 -0700
    19604 +++ vim72/src/proto/edit.pro    2009-06-05 14:24:27.000000000 -0700
     21416+++ vim72/src/proto/edit.pro    2009-07-19 15:15:54.000000000 -0700
    1960521417@@ -8,7 +8,7 @@
    1960621418 void backspace_until_column __ARGS((int col));
     
    1961421426diff -Naur vim72.orig/src/proto/eval.pro vim72/src/proto/eval.pro
    1961521427--- vim72.orig/src/proto/eval.pro       2008-08-09 07:31:25.000000000 -0700
    19616 +++ vim72/src/proto/eval.pro    2009-06-05 14:17:16.000000000 -0700
     21428+++ vim72/src/proto/eval.pro    2009-07-19 15:10:37.000000000 -0700
    1961721429@@ -17,7 +17,7 @@
    1961821430 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
     
    1965621468diff -Naur vim72.orig/src/proto/ex_cmds.pro vim72/src/proto/ex_cmds.pro
    1965721469--- vim72.orig/src/proto/ex_cmds.pro    2008-08-09 07:31:25.000000000 -0700
    19658 +++ vim72/src/proto/ex_cmds.pro 2009-06-05 14:24:34.000000000 -0700
     21470+++ vim72/src/proto/ex_cmds.pro 2009-07-19 15:16:00.000000000 -0700
    1965921471@@ -9,9 +9,9 @@
    1966021472 void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
     
    1968021492diff -Naur vim72.orig/src/proto/ex_getln.pro vim72/src/proto/ex_getln.pro
    1968121493--- vim72.orig/src/proto/ex_getln.pro   2008-08-09 07:31:28.000000000 -0700
    19682 +++ vim72/src/proto/ex_getln.pro        2009-06-05 14:22:42.000000000 -0700
     21494+++ vim72/src/proto/ex_getln.pro        2009-07-19 15:14:20.000000000 -0700
    1968321495@@ -4,6 +4,7 @@
    1968421496 int text_locked __ARGS((void));
     
    1969821510 int get_histtype __ARGS((char_u *name));
    1969921511 void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
     21512diff -Naur vim72.orig/src/proto/gui.pro vim72/src/proto/gui.pro
     21513--- vim72.orig/src/proto/gui.pro        2008-08-09 07:31:56.000000000 -0700
     21514+++ vim72/src/proto/gui.pro     2009-07-19 15:17:39.000000000 -0700
     21515@@ -43,6 +43,7 @@
     21516 void gui_create_scrollbar __ARGS((scrollbar_T *sb, int type, win_T *wp));
     21517 scrollbar_T *gui_find_scrollbar __ARGS((long ident));
     21518 void gui_drag_scrollbar __ARGS((scrollbar_T *sb, long value, int still_dragging));
     21519+void gui_may_update_scrollbars __ARGS((void));
     21520 void gui_update_scrollbars __ARGS((int force));
     21521 int gui_do_scroll __ARGS((void));
     21522 int gui_do_horiz_scroll __ARGS((void));
    1970021523diff -Naur vim72.orig/src/proto/if_cscope.pro vim72/src/proto/if_cscope.pro
    1970121524--- vim72.orig/src/proto/if_cscope.pro  2008-08-09 07:31:33.000000000 -0700
    19702 +++ vim72/src/proto/if_cscope.pro       2009-06-05 14:23:53.000000000 -0700
     21525+++ vim72/src/proto/if_cscope.pro       2009-07-19 15:15:24.000000000 -0700
    1970321526@@ -1,4 +1,6 @@
    1970421527 /* if_cscope.c */
     
    1971021533diff -Naur vim72.orig/src/proto/mark.pro vim72/src/proto/mark.pro
    1971121534--- vim72.orig/src/proto/mark.pro       2008-08-09 07:31:36.000000000 -0700
    19712 +++ vim72/src/proto/mark.pro    2009-06-05 14:16:09.000000000 -0700
     21535+++ vim72/src/proto/mark.pro    2009-07-19 15:09:53.000000000 -0700
    1971321536@@ -26,5 +26,5 @@
    1971421537 void write_viminfo_filemarks __ARGS((FILE *fp));
     
    1971821541+void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags));
    1971921542 /* vim: set ft=c : */
     21543diff -Naur vim72.orig/src/proto/mbyte.pro vim72/src/proto/mbyte.pro
     21544--- vim72.orig/src/proto/mbyte.pro      2008-08-09 07:31:41.000000000 -0700
     21545+++ vim72/src/proto/mbyte.pro   2009-07-19 15:17:30.000000000 -0700
     21546@@ -7,10 +7,12 @@
     21547 int latin_char2len __ARGS((int c));
     21548 int latin_char2bytes __ARGS((int c, char_u *buf));
     21549 int latin_ptr2len __ARGS((char_u *p));
     21550+int latin_ptr2len_len __ARGS((char_u *p, int size));
     21551 int utf_char2cells __ARGS((int c));
     21552 int latin_ptr2cells __ARGS((char_u *p));
     21553 int utf_ptr2cells __ARGS((char_u *p));
     21554 int dbcs_ptr2cells __ARGS((char_u *p));
     21555+int latin_ptr2cells_len __ARGS((char_u *p, int size));
     21556 int latin_char2cells __ARGS((int c));
     21557 int latin_off2cells __ARGS((unsigned off, unsigned max_off));
     21558 int dbcs_off2cells __ARGS((unsigned off, unsigned max_off));
     21559@@ -85,6 +87,7 @@
     21560 int preedit_get_status __ARGS((void));
     21561 int im_is_preediting __ARGS((void));
     21562 int convert_setup __ARGS((vimconv_T *vcp, char_u *from, char_u *to));
     21563+int convert_setup_ext __ARGS((vimconv_T *vcp, char_u *from, int from_unicode_is_utf8, char_u *to, int to_unicode_is_utf8));
     21564 int convert_input __ARGS((char_u *ptr, int len, int maxlen));
     21565 int convert_input_safe __ARGS((char_u *ptr, int len, int maxlen, char_u **restp, int *restlenp));
     21566 char_u *string_convert __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp));
    1972021567diff -Naur vim72.orig/src/proto/message.pro vim72/src/proto/message.pro
    1972121568--- vim72.orig/src/proto/message.pro    2008-08-09 07:31:39.000000000 -0700
    19722 +++ vim72/src/proto/message.pro 2009-06-05 14:23:41.000000000 -0700
     21569+++ vim72/src/proto/message.pro 2009-07-19 15:15:14.000000000 -0700
    1972321570@@ -54,6 +54,7 @@
    1972421571 void msg_clr_cmdline __ARGS((void));
     
    1973121578diff -Naur vim72.orig/src/proto/misc2.pro vim72/src/proto/misc2.pro
    1973221579--- vim72.orig/src/proto/misc2.pro      2008-08-09 07:31:40.000000000 -0700
    19733 +++ vim72/src/proto/misc2.pro   2009-06-05 14:19:07.000000000 -0700
     21580+++ vim72/src/proto/misc2.pro   2009-07-19 15:11:46.000000000 -0700
    1973421581@@ -59,7 +59,7 @@
    1973521582 int handle_x_keys __ARGS((int key));
     
    1974321590diff -Naur vim72.orig/src/proto/netbeans.pro vim72/src/proto/netbeans.pro
    1974421591--- vim72.orig/src/proto/netbeans.pro   2008-08-09 07:31:56.000000000 -0700
    19745 +++ vim72/src/proto/netbeans.pro        2009-06-05 14:19:24.000000000 -0700
     21592+++ vim72/src/proto/netbeans.pro        2009-07-19 15:12:02.000000000 -0700
    1974621593@@ -11,7 +11,7 @@
    1974721594 void netbeans_frame_moved __ARGS((int new_x, int new_y));
     
    1975521602diff -Naur vim72.orig/src/proto/option.pro vim72/src/proto/option.pro
    1975621603--- vim72.orig/src/proto/option.pro     2008-08-09 07:31:43.000000000 -0700
    19757 +++ vim72/src/proto/option.pro  2009-06-05 14:21:21.000000000 -0700
     21604+++ vim72/src/proto/option.pro  2009-07-19 15:13:20.000000000 -0700
    1975821605@@ -44,6 +44,7 @@
    1975921606 void set_context_in_set_cmd __ARGS((expand_T *xp, char_u *arg, int opt_flags));
     
    1976421611 int shortmess __ARGS((int x));
    1976521612 void vimrc_found __ARGS((char_u *fname, char_u *envname));
     21613diff -Naur vim72.orig/src/proto/os_unix.pro vim72/src/proto/os_unix.pro
     21614--- vim72.orig/src/proto/os_unix.pro    2008-08-09 07:31:44.000000000 -0700
     21615+++ vim72/src/proto/os_unix.pro 2009-07-19 15:18:55.000000000 -0700
     21616@@ -1,4 +1,5 @@
     21617 /* os_unix.c */
     21618+int mch_chdir __ARGS((char *path));
     21619 void mch_write __ARGS((char_u *s, int len));
     21620 int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
     21621 int mch_char_avail __ARGS((void));
    1976621622diff -Naur vim72.orig/src/proto/spell.pro vim72/src/proto/spell.pro
    1976721623--- vim72.orig/src/proto/spell.pro      2008-08-09 07:31:48.000000000 -0700
    19768 +++ vim72/src/proto/spell.pro   2009-06-05 14:24:34.000000000 -0700
     21624+++ vim72/src/proto/spell.pro   2009-07-19 15:16:00.000000000 -0700
    1976921625@@ -22,5 +22,5 @@
    1977021626 char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
     
    1977421630+int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp));
    1977521631 /* vim: set ft=c : */
     21632diff -Naur vim72.orig/src/proto/ui.pro vim72/src/proto/ui.pro
     21633--- vim72.orig/src/proto/ui.pro 2008-08-09 07:31:52.000000000 -0700
     21634+++ vim72/src/proto/ui.pro      2009-07-19 15:18:26.000000000 -0700
     21635@@ -48,6 +48,7 @@
     21636 void open_app_context __ARGS((void));
     21637 void x11_setup_atoms __ARGS((Display *dpy));
     21638 void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd));
     21639+void yank_cut_buffer0 __ARGS((Display *dpy, VimClipboard *cbd));
     21640 void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd));
     21641 int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd));
     21642 void clip_x11_set_selection __ARGS((VimClipboard *cbd));
     21643diff -Naur vim72.orig/src/proto/window.pro vim72/src/proto/window.pro
     21644--- vim72.orig/src/proto/window.pro     2008-08-09 07:31:54.000000000 -0700
     21645+++ vim72/src/proto/window.pro  2009-07-19 15:18:10.000000000 -0700
     21646@@ -1,6 +1,7 @@
     21647 /* window.c */
     21648 void do_window __ARGS((int nchar, long Prenum, int xchar));
     21649 int win_split __ARGS((int size, int flags));
     21650+int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
     21651 int win_valid __ARGS((win_T *win));
     21652 int win_count __ARGS((void));
     21653 int make_windows __ARGS((int count, int vertical));
     21654@@ -10,9 +11,12 @@
     21655 void win_close __ARGS((win_T *win, int free_buf));
     21656 void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
     21657 void win_free_all __ARGS((void));
     21658+win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
     21659 void close_others __ARGS((int message, int forceit));
     21660 void curwin_init __ARGS((void));
     21661+void win_init_empty __ARGS((win_T *wp));
     21662 int win_alloc_first __ARGS((void));
     21663+void win_alloc_aucmd_win __ARGS((void));
     21664 void win_init_size __ARGS((void));
     21665 void free_tabpage __ARGS((tabpage_T *tp));
     21666 int win_new_tabpage __ARGS((int after));
     21667@@ -30,6 +34,8 @@
     21668 void win_enter __ARGS((win_T *wp, int undo_sync));
     21669 win_T *buf_jump_open_win __ARGS((buf_T *buf));
     21670 win_T *buf_jump_open_tab __ARGS((buf_T *buf));
     21671+void win_append __ARGS((win_T *after, win_T *wp));
     21672+void win_remove __ARGS((win_T *wp, tabpage_T *tp));
     21673 int win_alloc_lines __ARGS((win_T *wp));
     21674 void win_free_lsize __ARGS((win_T *wp));
     21675 void shell_new_rows __ARGS((void));
     21676@@ -58,6 +64,8 @@
     21677 int min_rows __ARGS((void));
     21678 int only_one_window __ARGS((void));
     21679 void check_lnums __ARGS((int do_curwin));
     21680+void make_snapshot __ARGS((int idx));
     21681+void restore_snapshot __ARGS((int idx, int close_curwin));
     21682 int win_hasvertsplit __ARGS((void));
     21683 int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id));
     21684 int match_delete __ARGS((win_T *wp, int id, int perr));
    1977621685diff -Naur vim72.orig/src/pty.c vim72/src/pty.c
    1977721686--- vim72.orig/src/pty.c        2008-06-21 11:52:58.000000000 -0700
    19778 +++ vim72/src/pty.c     2009-06-05 14:13:54.000000000 -0700
     21687+++ vim72/src/pty.c     2009-07-19 15:08:34.000000000 -0700
    1977921688@@ -270,9 +270,10 @@
    1978021689 }
     
    1979221701diff -Naur vim72.orig/src/quickfix.c vim72/src/quickfix.c
    1979321702--- vim72.orig/src/quickfix.c   2008-07-18 05:53:02.000000000 -0700
    19794 +++ vim72/src/quickfix.c        2009-06-05 14:25:15.000000000 -0700
     21703+++ vim72/src/quickfix.c        2009-07-19 15:18:10.000000000 -0700
    1979521704@@ -1419,6 +1419,7 @@
    1979621705     int                        opened_window = FALSE;
     
    1994121850                }
    1994221851                line_breakcheck();
     21852@@ -3397,14 +3406,15 @@
     21853     /* Init the options. */
     21854     buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP);
     21855 
     21856-    /* set curwin/curbuf to buf and save a few things */
     21857-    aucmd_prepbuf(&aco, newbuf);
     21858+    /* need to open the memfile before putting the buffer in a window */
     21859+    if (ml_open(newbuf) == OK)
     21860+    {
     21861+       /* set curwin/curbuf to buf and save a few things */
     21862+       aucmd_prepbuf(&aco, newbuf);
     21863 
     21864-    /* Need to set the filename for autocommands. */
     21865-    (void)setfname(curbuf, fname, NULL, FALSE);
     21866+       /* Need to set the filename for autocommands. */
     21867+       (void)setfname(curbuf, fname, NULL, FALSE);
     21868 
     21869-    if (ml_open(curbuf) == OK)
     21870-    {
     21871        /* Create swap file now to avoid the ATTENTION message. */
     21872        check_need_swap(TRUE);
     21873 
     21874@@ -3427,10 +3437,10 @@
     21875                newbuf = curbuf;
     21876            }
     21877        }
     21878-    }
     21879 
     21880-    /* restore curwin/curbuf and a few other things */
     21881-    aucmd_restbuf(&aco);
     21882+       /* restore curwin/curbuf and a few other things */
     21883+       aucmd_restbuf(&aco);
     21884+    }
     21885 
     21886     if (!buf_valid(newbuf))
     21887        return NULL;
    1994321888diff -Naur vim72.orig/src/regexp.c vim72/src/regexp.c
    1994421889--- vim72.orig/src/regexp.c     2008-08-07 12:58:50.000000000 -0700
    19945 +++ vim72/src/regexp.c  2009-06-05 14:24:51.000000000 -0700
     21890+++ vim72/src/regexp.c  2009-07-19 15:16:14.000000000 -0700
    1994621891@@ -471,7 +471,7 @@
    1994721892 
     
    2000321948diff -Naur vim72.orig/src/screen.c vim72/src/screen.c
    2000421949--- vim72.orig/src/screen.c     2008-07-24 07:45:07.000000000 -0700
    20005 +++ vim72/src/screen.c  2009-06-05 14:25:15.000000000 -0700
     21950+++ vim72/src/screen.c  2009-07-19 15:17:49.000000000 -0700
    2000621951@@ -270,11 +270,10 @@
    2000721952  * Note that when also inserting/deleting lines w_redraw_top and w_redraw_bot
     
    2019422139             * and for some xterms. */
    2019522140            if (
    20196 @@ -6076,7 +6096,7 @@
     22141@@ -5723,6 +5743,13 @@
     22142     int                fillchar;
     22143     int                attr;
     22144     int                this_ru_col;
     22145+    static int  busy = FALSE;
     22146+
     22147+    /* It's possible to get here recursively when 'statusline' (indirectly)
     22148+     * invokes ":redrawstatus".  Simply ignore the call then. */
     22149+    if (busy)
     22150+       return;
     22151+    busy = TRUE;
     22152 
     22153     wp->w_redr_status = FALSE;
     22154     if (wp->w_status_height == 0)
     22155@@ -5861,6 +5888,7 @@
     22156                                                                        attr);
     22157     }
     22158 #endif
     22159+    busy = FALSE;
     22160 }
     22161 
     22162 #ifdef FEAT_STL_OPT
     22163@@ -6076,7 +6104,7 @@
    2019722164                                fillchar, maxwidth, hltab, tabtab);
    2019822165     len = (int)STRLEN(buf);
     
    2020322170 #ifdef FEAT_MBYTE
    2020422171        len += (*mb_char2bytes)(fillchar, buf + len);
    20205 @@ -6263,9 +6283,15 @@
     22172@@ -6263,9 +6291,15 @@
    2020622173     int                pcc[MAX_MCO];
    2020722174 # endif
     
    2021922186 #ifdef FEAT_MBYTE
    2022022187     /* When drawing over the right halve of a double-wide char clear out the
    20221 @@ -6275,10 +6301,21 @@
     22188@@ -6275,10 +6309,21 @@
    2022222189            && !gui.in_use
    2022322190 # endif
     
    2024322210     max_off = LineOffset[row] + screen_Columns;
    2024422211 #endif
    20245 @@ -6342,7 +6379,12 @@
     22212@@ -6342,7 +6387,12 @@
    2024622213        }
    2024722214 #endif
     
    2025722224                || (mbyte_cells == 2
    2025822225                    && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
    20259 @@ -6350,24 +6392,24 @@
     22226@@ -6350,24 +6400,24 @@
    2026022227                    && c == 0x8e
    2026122228                    && ScreenLines2[off] != ptr[1])
     
    2029122258                    gui.in_use
    2029222259 # endif
    20293 @@ -6377,23 +6419,14 @@
     22260@@ -6377,23 +6427,14 @@
    2029422261 # ifdef UNIX
    2029522262                    term_is_xterm
     
    2032122288 #endif
    2032222289 #ifdef FEAT_MBYTE
    20323 @@ -6480,6 +6513,20 @@
     22290@@ -6480,6 +6521,20 @@
    2032422291            ++ptr;
    2032522292        }
     
    2034222309 
    2034322310 #ifdef FEAT_SEARCH_EXTRA
    20344 @@ -7356,7 +7403,11 @@
     22311@@ -7356,7 +7411,11 @@
    2034522312 #endif
    2034622313     static int     entered = FALSE;            /* avoid recursiveness */
     
    2035422321      * Allocation of the screen buffers is done only when the size changes and
    2035522322      * when Rows and Columns have been set and we have started doing full
    20356 @@ -7440,10 +7491,13 @@
     22323@@ -7440,10 +7499,17 @@
    2035722324        {
    2035822325            outofmem = TRUE;
     
    2036322330        }
    2036422331     }
     22332+#ifdef FEAT_AUTOCMD
     22333+    if (aucmd_win != NULL && win_alloc_lines(aucmd_win) == FAIL)
     22334+       outofmem = TRUE;
     22335+#endif
    2036522336+#ifdef FEAT_WINDOWS
    2036622337+give_up:
     
    2036922340 #ifdef FEAT_MBYTE
    2037022341     for (i = 0; i < p_mco; ++i)
    20371 @@ -7628,8 +7682,17 @@
     22342@@ -7628,8 +7694,17 @@
    2037222343     --RedrawingDisabled;
    2037322344 
     
    2038822359 }
    2038922360 
    20390 @@ -8590,7 +8653,6 @@
     22361@@ -8590,7 +8665,6 @@
    2039122362  *
    2039222363  * Return OK for success, FAIL if the lines are not deleted.
     
    2039622367 screen_del_lines(off, row, line_count, end, force, wp)
    2039722368     int                off;
    20398 @@ -8598,7 +8660,7 @@
     22369@@ -8598,7 +8672,7 @@
    2039922370     int                line_count;
    2040022371     int                end;
     
    2040522376     int                j;
    2040622377     int                i;
    20407 @@ -9416,13 +9478,15 @@
     22378@@ -9416,13 +9490,15 @@
    2040822379     win_T      *wp;
    2040922380     int                always;
     
    2042222393 #ifdef FEAT_VERTSPLIT
    2042322394     int                this_ru_col;
    20424 @@ -9537,11 +9601,12 @@
     22395@@ -9537,11 +9613,12 @@
    2042522396         * Some sprintfs return the length, some return a pointer.
    2042622397         * To avoid portability problems we use strlen() here.
     
    2043722408                        (int)virtcol + 1);
    2043822409 
    20439 @@ -9551,7 +9616,7 @@
     22410@@ -9551,7 +9628,7 @@
    2044022411         * screen up on some terminals).
    2044122412         */
     
    2044622417 #ifdef FEAT_WINDOWS
    2044722418        if (wp->w_status_height == 0)   /* can't use last char of screen */
    20448 @@ -9578,7 +9643,7 @@
     22419@@ -9578,7 +9655,7 @@
    2044922420                    buffer[i++] = fillchar;
    2045022421                ++o;
     
    2045722428diff -Naur vim72.orig/src/search.c vim72/src/search.c
    2045822429--- vim72.orig/src/search.c     2008-07-13 11:18:27.000000000 -0700
    20459 +++ vim72/src/search.c  2009-06-05 14:25:15.000000000 -0700
     22430+++ vim72/src/search.c  2009-07-19 15:16:33.000000000 -0700
    2046022431@@ -345,6 +345,15 @@
    2046122432 {
     
    2059822569diff -Naur vim72.orig/src/spell.c vim72/src/spell.c
    2059922570--- vim72.orig/src/spell.c      2008-07-12 12:20:55.000000000 -0700
    20600 +++ vim72/src/spell.c   2009-06-05 14:25:15.000000000 -0700
     22571+++ vim72/src/spell.c   2009-07-19 15:16:33.000000000 -0700
    2060122572@@ -77,7 +77,7 @@
    2060222573 
     
    2155023521diff -Naur vim72.orig/src/structs.h vim72/src/structs.h
    2155123522--- vim72.orig/src/structs.h    2008-07-30 13:02:50.000000000 -0700
    21552 +++ vim72/src/structs.h 2009-06-05 14:24:58.000000000 -0700
     23523+++ vim72/src/structs.h 2009-07-19 15:18:36.000000000 -0700
    2155323524@@ -16,7 +16,7 @@
    2155423525  */
     
    2158123552 # endif
    2158223553 # ifdef FEAT_WINDOWS
    21583 @@ -1166,7 +1166,8 @@
     23554@@ -882,6 +882,8 @@
     23555 {
     23556     typebuf_T          save_typebuf;
     23557     int                        typebuf_valid;      /* TRUE when save_typebuf valid */
     23558+    int                        old_char;
     23559+    int                        old_mod_mask;
     23560     struct buffheader  save_stuffbuff;
     23561 #ifdef USE_INPUT_BUF
     23562     char_u             *save_inputbuf;
     23563@@ -1166,7 +1168,8 @@
    2158423564     char_u     *b_fname;       /* current file name */
    2158523565 
     
    2159123571 #endif
    2159223572 #ifdef FEAT_CW_EDITOR
    21593 @@ -1784,10 +1785,15 @@
     23573@@ -1620,6 +1623,14 @@
     23574 };
     23575 #endif
     23576 
     23577+#define SNAP_HELP_IDX  0
     23578+#ifdef FEAT_AUTOCMD
     23579+# define SNAP_AUCMD_IDX 1
     23580+# define SNAP_COUNT    2
     23581+#else
     23582+# define SNAP_COUNT    1
     23583+#endif
     23584+
     23585 /*
     23586  * Tab pages point to the top frame of each tab page.
     23587  * Note: Most values are NOT valid for the current tab page!  Use "curwin",
     23588@@ -1648,7 +1659,7 @@
     23589     buf_T          *(tp_diffbuf[DB_COUNT]);
     23590     int                    tp_diff_invalid;    /* list of diffs is outdated */
     23591 #endif
     23592-    frame_T        *tp_snapshot;    /* window layout snapshot */
     23593+    frame_T        *(tp_snapshot[SNAP_COUNT]);  /* window layout snapshots */
     23594 #ifdef FEAT_EVAL
     23595     dictitem_T     tp_winvar;      /* variable for "t:" Dictionary */
     23596     dict_T         tp_vars;        /* internal variables, local to tab page */
     23597@@ -1784,10 +1795,15 @@
    2159423598 #endif
    2159523599 
     
    2160823612     int                w_topfill;          /* number of filler lines above w_topline */
    2160923613     int                w_old_topfill;      /* w_topfill at last redraw */
     23614@@ -2270,16 +2286,11 @@
     23615  */
     23616 typedef struct
     23617 {
     23618-    buf_T      *save_buf;      /* saved curbuf */
     23619+    buf_T      *save_curbuf;   /* saved curbuf */
     23620 #ifdef FEAT_AUTOCMD
     23621-    buf_T      *new_curbuf;    /* buffer to be used */
     23622-    win_T      *save_curwin;   /* saved curwin, NULL if it didn't change */
     23623-    win_T      *new_curwin;    /* new curwin if save_curwin != NULL */
     23624-    pos_T      save_cursor;    /* saved cursor pos of save_curwin */
     23625-    linenr_T   save_topline;   /* saved topline of save_curwin */
     23626-# ifdef FEAT_DIFF
     23627-    int                save_topfill;   /* saved topfill of save_curwin */
     23628-# endif
     23629+    win_T      *save_curwin;   /* saved curwin */
     23630+    win_T      *new_curwin;    /* new curwin */
     23631+    buf_T      *new_curbuf;    /* new curbuf */
     23632 #endif
     23633 } aco_save_T;
     23634 
    2161023635diff -Naur vim72.orig/src/syntax.c vim72/src/syntax.c
    2161123636--- vim72.orig/src/syntax.c     2008-08-08 14:47:48.000000000 -0700
    21612 +++ vim72/src/syntax.c  2009-06-05 14:25:15.000000000 -0700
     23637+++ vim72/src/syntax.c  2009-07-19 15:16:33.000000000 -0700
    2161323638@@ -3224,11 +3224,10 @@
    2161423639 /*
     
    2179823823diff -Naur vim72.orig/src/tag.c vim72/src/tag.c
    2179923824--- vim72.orig/src/tag.c        2008-07-16 14:31:30.000000000 -0700
    21800 +++ vim72/src/tag.c     2009-06-05 14:25:15.000000000 -0700
     23825+++ vim72/src/tag.c     2009-07-19 15:16:33.000000000 -0700
    2180123826@@ -100,7 +100,7 @@
    2180223827  * Tag for preview window is remembered separately, to avoid messing up the
     
    2197223997diff -Naur vim72.orig/src/term.c vim72/src/term.c
    2197323998--- vim72.orig/src/term.c       2008-07-27 04:48:06.000000000 -0700
    21974 +++ vim72/src/term.c    2009-06-05 14:25:15.000000000 -0700
     23999+++ vim72/src/term.c    2009-07-19 15:17:27.000000000 -0700
    2197524000@@ -2906,7 +2906,7 @@
    2197624001     int            i;
     
    2200824033        {
    2200924034            string[new_slen++] = K_SPECIAL;
     24035@@ -5547,7 +5555,7 @@
     24036  * respects the current B/k/< settings of 'cpoption'.
     24037  *
     24038  * This function is called when expanding mappings/abbreviations on the
     24039- * command-line, and for building the "Ambiguous mapping..." error messæge.
     24040+ * command-line, and for building the "Ambiguous mapping..." error message.
     24041  *
     24042  * It uses a growarray to build the translation string since the
     24043  * latter can be wider than the original description. The caller has to
    2201024044diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
    2201124045--- vim72.orig/src/testdir/Makefile     2008-06-19 13:29:46.000000000 -0700
    22012 +++ vim72/src/testdir/Makefile  2009-06-05 14:22:57.000000000 -0700
    22013 @@ -20,21 +20,23 @@
     24046+++ vim72/src/testdir/Makefile  2009-07-19 15:18:15.000000000 -0700
     24047@@ -4,9 +4,11 @@
     24048 
     24049 VIMPROG = ../vim
     24050 
     24051-# Uncomment this line for using valgrind.
     24052-# The output goes into a file "valgrind.$PID" (sorry, no test number).
     24053-# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --logfile=valgrind
     24054+# Uncomment this line to use valgrind for memory leaks and extra warnings.
     24055+#   The output goes into a file "valgrind.testN"
     24056+#   Vim should be compiled with EXITFREE to avoid false warnings.
     24057+#   This will make testing about 10 times as slow.
     24058+# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*
     24059 
     24060 SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
     24061                test7.out test8.out test9.out test10.out test11.out \
     24062@@ -20,21 +22,23 @@
    2201424063                test48.out test49.out test51.out test52.out test53.out \
    2201524064                test54.out test55.out test56.out test57.out test58.out \
     
    2204324092 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
    2204424093 
    22045 @@ -71,4 +73,4 @@
     24094@@ -71,4 +75,4 @@
    2204624095 test60.out: test60.vim
    2204724096 
     
    2205124100diff -Naur vim72.orig/src/testdir/Make_ming.mak vim72/src/testdir/Make_ming.mak
    2205224101--- vim72.orig/src/testdir/Make_ming.mak        1969-12-31 16:00:00.000000000 -0800
    22053 +++ vim72/src/testdir/Make_ming.mak     2009-06-05 14:15:34.000000000 -0700
     24102+++ vim72/src/testdir/Make_ming.mak     2009-07-19 15:09:28.000000000 -0700
    2205424103@@ -0,0 +1,91 @@
    2205524104+# Makefile to run tests for Vim, on Dos-like machines
     
    2214624195diff -Naur vim72.orig/src/testdir/test42.ok vim72/src/testdir/test42.ok
    2214724196--- vim72.orig/src/testdir/test42.ok    2008-02-20 04:27:37.000000000 -0800
    22148 +++ vim72/src/testdir/test42.ok 2009-06-05 14:16:16.000000000 -0700
     24197+++ vim72/src/testdir/test42.ok 2009-07-19 15:09:58.000000000 -0700
    2214924198@@ -20,7 +20,7 @@
    2215024199 ucs-2
     
    2215824207diff -Naur vim72.orig/src/testdir/test66.in vim72/src/testdir/test66.in
    2215924208--- vim72.orig/src/testdir/test66.in    1969-12-31 16:00:00.000000000 -0800
    22160 +++ vim72/src/testdir/test66.in 2009-06-05 14:22:57.000000000 -0700
     24209+++ vim72/src/testdir/test66.in 2009-07-19 15:14:34.000000000 -0700
    2216124210@@ -0,0 +1,25 @@
    2216224211+
     
    2218724236diff -Naur vim72.orig/src/testdir/test66.ok vim72/src/testdir/test66.ok
    2218824237--- vim72.orig/src/testdir/test66.ok    1969-12-31 16:00:00.000000000 -0800
    22189 +++ vim72/src/testdir/test66.ok 2009-06-05 14:22:57.000000000 -0700
     24238+++ vim72/src/testdir/test66.ok 2009-07-19 15:14:34.000000000 -0700
    2219024239@@ -0,0 +1,10 @@
    2219124240+    abcdefghijklmnopqrstuvwxyz
     
    2220124250diff -Naur vim72.orig/src/ui.c vim72/src/ui.c
    2220224251--- vim72.orig/src/ui.c 2008-07-14 11:14:56.000000000 -0700
    22203 +++ vim72/src/ui.c      2009-06-05 14:25:15.000000000 -0700
     24252+++ vim72/src/ui.c      2009-07-19 15:18:26.000000000 -0700
    2220424253@@ -320,10 +320,9 @@
    2220524254  * The gui_set_shellsize() or mch_set_shellsize() function will try to set the
     
    2227824327                                                         &text_list, &n_text);
    2227924328        if (status != Success || n_text < 1)
    22280 @@ -2110,6 +2106,8 @@
     24329@@ -2108,8 +2104,8 @@
     24330     Atom       type;
     24331     static int success;
    2228124332     int                i;
    22282      int                nbytes = 0;
    22283      char_u     *buffer;
     24333-    int                nbytes = 0;
     24334-    char_u     *buffer;
    2228424335+    time_t     start_time;
    2228524336+    int                timed_out = FALSE;
     
    2228724338     for (i =
    2228824339 #ifdef FEAT_MBYTE
    22289 @@ -2129,6 +2127,7 @@
     24340@@ -2129,6 +2125,7 @@
    2229024341            case 3:  type = text_atom;          break;
    2229124342            default: type = XA_STRING;
     
    2229524346            clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime);
    2229624347 
    22297 @@ -2141,27 +2140,48 @@
     24348@@ -2141,47 +2138,59 @@
    2229824349         * characters, then they will appear before the one that requested the
    2229924350         * paste!  Don't worry, we will catch up with any other events later.
     
    2235624407 
    2235724408     /* Final fallback position - use the X CUT_BUFFER0 store */
    22358 @@ -2178,10 +2198,9 @@
     24409-    buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
     24410-    if (nbytes > 0)
     24411-    {
     24412-       /* Got something */
     24413-       clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
     24414-       XFree((void *)buffer);
     24415-       if (p_verbose > 0)
     24416-           verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
     24417-    }
     24418+    yank_cut_buffer0(dpy, cbd);
     24419 }
    2235924420 
    2236024421 static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *));
     
    2236824429     Atom       *target;
    2236924430     Atom       *type;
    22370 @@ -2308,10 +2327,9 @@
     24431@@ -2308,10 +2317,9 @@
    2237124432 
    2237224433 static void  clip_x11_lose_ownership_cb __ARGS((Widget, Atom *));
     
    2238024441 {
    2238124442     if (*sel_atom == clip_plus.sel_atom)
    22382 @@ -2344,10 +2362,9 @@
     24443@@ -2344,14 +2352,67 @@
    2238324444  * Send the current selection to the clipboard.  Do nothing for X because we
    2238424445  * will fill in the selection only when requested by another app.
     
    2239224453 }
    2239324454 #endif
    22394 @@ -2898,11 +2915,10 @@
     24455 
     24456+#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \
     24457+    || defined(FEAT_GUI_GTK) || defined(PROTO)
     24458+/*
     24459+ * Get the contents of the X CUT_BUFFER0 and put it in "cbd".
     24460+ */
     24461+    void
     24462+yank_cut_buffer0(dpy, cbd)
     24463+    Display            *dpy;
     24464+    VimClipboard       *cbd;
     24465+{
     24466+    int                nbytes = 0;
     24467+    char_u     *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
     24468+
     24469+    if (nbytes > 0)
     24470+    {
     24471+#ifdef FEAT_MBYTE
     24472+       int  done = FALSE;
     24473+
     24474+       /* CUT_BUFFER0 is supposed to be always latin1.  Convert to 'enc' when
     24475+        * using a multi-byte encoding.  Conversion between two 8-bit
     24476+        * character sets usually fails and the text might actually be in
     24477+        * 'enc' anyway. */
     24478+       if (has_mbyte)
     24479+       {
     24480+           char_u      *conv_buf = buffer;
     24481+           vimconv_T   vc;
     24482+
     24483+           vc.vc_type = CONV_NONE;
     24484+           if (convert_setup(&vc, (char_u *)"latin1", p_enc) == OK)
     24485+           {
     24486+               conv_buf = string_convert(&vc, buffer, &nbytes);
     24487+               if (conv_buf != NULL)
     24488+               {
     24489+                   clip_yank_selection(MCHAR, conv_buf, (long)nbytes, cbd);
     24490+                   vim_free(conv_buf);
     24491+                   done = TRUE;
     24492+               }
     24493+               convert_setup(&vc, NULL, NULL);
     24494+           }
     24495+       }
     24496+       if (!done)  /* use the text without conversion */
     24497+#endif
     24498+           clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
     24499+       XFree((void *)buffer);
     24500+       if (p_verbose > 0)
     24501+       {
     24502+           verbose_enter();
     24503+           verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
     24504+           verbose_leave();
     24505+       }
     24506+    }
     24507+}
     24508+#endif
     24509+
     24510 #if defined(FEAT_MOUSE) || defined(PROTO)
     24511 
     24512 /*
     24513@@ -2898,11 +2959,10 @@
    2239524514  * Find the window at screen position "*rowp" and "*colp".  The positions are
    2239624515  * updated to become relative to the top-left of the window.
     
    2240724526diff -Naur vim72.orig/src/version.c vim72/src/version.c
    2240824527--- vim72.orig/src/version.c    2008-08-09 07:24:52.000000000 -0700
    22409 +++ vim72/src/version.c 2009-06-05 14:26:12.000000000 -0700
    22410 @@ -677,9 +677,380 @@
     24528+++ vim72/src/version.c 2009-07-19 15:19:00.000000000 -0700
     24529@@ -677,9 +677,444 @@
    2241124530 static int included_patches[] =
    2241224531 {   /* Add new patch number below this line */
    2241324532 /**/
     24533+    234,
     24534+/**/
     24535+    232,
     24536+/**/
     24537+    231,
     24538+/**/
     24539+    230,
     24540+/**/
     24541+    229,
     24542+/**/
     24543+    228,
     24544+/**/
     24545+    227,
     24546+/**/
     24547+    226,
     24548+/**/
     24549+    225,
     24550+/**/
     24551+    224,
     24552+/**/
     24553+    223,
     24554+/**/
     24555+    222,
     24556+/**/
     24557+    221,
     24558+/**/
     24559+    220,
     24560+/**/
     24561+    218,
     24562+/**/
     24563+    217,
     24564+/**/
     24565+    215,
     24566+/**/
     24567+    214,
     24568+/**/
     24569+    213,
     24570+/**/
     24571+    211,
     24572+/**/
     24573+    210,
     24574+/**/
     24575+    209,
     24576+/**/
     24577+    208,
     24578+/**/
     24579+    207,
     24580+/**/
     24581+    206,
     24582+/**/
     24583+    203,
     24584+/**/
     24585+    202,
     24586+/**/
     24587+    201,
     24588+/**/
     24589+    200,
     24590+/**/
     24591+    199,
     24592+/**/
     24593+    198,
     24594+/**/
     24595+    197,
     24596+/**/
    2241424597+    196,
    2241524598+/**/
     
    2278924972 highest_patch()
    2279024973 {
    22791 @@ -786,7 +1157,7 @@
     24974@@ -786,7 +1221,7 @@
    2279224975     MSG_PUTS(_("\nRISC OS version"));
    2279324976 #endif
     
    2279824981     if (*compiled_arch != NUL)
    2279924982     {
    22800 @@ -825,6 +1196,19 @@
     24983@@ -825,6 +1260,19 @@
    2280124984        }
    2280224985     }
     
    2282025003diff -Naur vim72.orig/src/vim.h vim72/src/vim.h
    2282125004--- vim72.orig/src/vim.h        2008-08-09 09:03:38.000000000 -0700
    22822 +++ vim72/src/vim.h     2009-06-05 14:24:34.000000000 -0700
     25005+++ vim72/src/vim.h     2009-07-19 15:17:25.000000000 -0700
    2282325006@@ -341,8 +341,14 @@
    2282425007 #ifdef BACKSLASH_IN_FILENAME
     
    2286425047 /*
    2286525048  * arguments for gui_set_shellsize()
     25049@@ -1328,11 +1337,11 @@
     25050 # define MSG_BUF_CLEN  MSG_BUF_LEN         /* cell length */
     25051 #endif
     25052 
     25053-#if defined(AMIGA) || defined(__linux__) || defined(__QNX__) || defined(__CYGWIN32__) || defined(_AIX)
     25054-# define TBUFSZ 2048           /* buffer size for termcap entry */
     25055-#else
     25056-# define TBUFSZ 1024           /* buffer size for termcap entry */
     25057-#endif
     25058+/* Size of the buffer used for tgetent().  Unfortunately this is largely
     25059+ * undocumented, some systems use 1024.  Using a buffer that is too small
     25060+ * causes a buffer overrun and a crash.  Use the maximum known value to stay
     25061+ * on the safe side. */
     25062+#define TBUFSZ 2048            /* buffer size for termcap entry */
     25063 
     25064 /*
     25065  * Maximum length of key sequence to be mapped.
    2286625066@@ -1451,8 +1460,8 @@
    2286725067 # define PERROR(msg)               perror(msg)
     
    2290825108diff -Naur vim72.orig/src/window.c vim72/src/window.c
    2290925109--- vim72.orig/src/window.c     2008-08-06 04:00:30.000000000 -0700
    22910 +++ vim72/src/window.c  2009-06-05 14:25:31.000000000 -0700
    22911 @@ -12,7 +12,7 @@
     25110+++ vim72/src/window.c  2009-07-19 15:18:10.000000000 -0700
     25111@@ -11,8 +11,8 @@
     25112 
    2291225113 static int path_is_url __ARGS((char_u *p));
    2291325114 #if defined(FEAT_WINDOWS) || defined(PROTO)
    22914  static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
     25115-static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
    2291525116-static void win_init __ARGS((win_T *newp, win_T *oldp));
    2291625117+static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
     25118+static void win_init_some __ARGS((win_T *newp, win_T *oldp));
    2291725119 static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
    2291825120 static void frame_setheight __ARGS((frame_T *curfrp, int height));
    2291925121 #ifdef FEAT_VERTSPLIT
    22920 @@ -593,9 +593,7 @@
     25122@@ -23,8 +23,8 @@
     25123 static void win_totop __ARGS((int size, int flags));
     25124 static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
     25125 static int last_window __ARGS((void));
     25126+static int one_window __ARGS((void));
     25127 static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp));
     25128-static win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
     25129 static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp));
     25130 static tabpage_T *alt_tabpage __ARGS((void));
     25131 static win_T *frame2win __ARGS((frame_T *frp));
     25132@@ -41,6 +41,7 @@
     25133 #endif
     25134 #endif
     25135 static int win_alloc_firstwin __ARGS((win_T *oldwin));
     25136+static void new_frame __ARGS((win_T *wp));
     25137 #if defined(FEAT_WINDOWS) || defined(PROTO)
     25138 static tabpage_T *alloc_tabpage __ARGS((void));
     25139 static int leave_tabpage __ARGS((buf_T *new_curbuf));
     25140@@ -49,8 +50,6 @@
     25141 static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin));
     25142 static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin));
     25143 static void win_free __ARGS((win_T *wp, tabpage_T *tp));
     25144-static void win_append __ARGS((win_T *, win_T *));
     25145-static void win_remove __ARGS((win_T *, tabpage_T *tp));
     25146 static void frame_append __ARGS((frame_T *after, frame_T *frp));
     25147 static void frame_insert __ARGS((frame_T *before, frame_T *frp));
     25148 static void frame_remove __ARGS((frame_T *frp));
     25149@@ -62,17 +61,15 @@
     25150 static void frame_add_height __ARGS((frame_T *frp, int n));
     25151 static void last_status_rec __ARGS((frame_T *fr, int statusline));
     25152 
     25153-static void make_snapshot __ARGS((void));
     25154 static void make_snapshot_rec __ARGS((frame_T *fr, frame_T **frp));
     25155-static void clear_snapshot __ARGS((tabpage_T *tp));
     25156+static void clear_snapshot __ARGS((tabpage_T *tp, int idx));
     25157 static void clear_snapshot_rec __ARGS((frame_T *fr));
     25158-static void restore_snapshot __ARGS((int close_curwin));
     25159 static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
     25160 static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
     25161 
     25162 #endif /* FEAT_WINDOWS */
     25163 
     25164-static win_T *win_alloc __ARGS((win_T *after));
     25165+static win_T *win_alloc __ARGS((win_T *after, int hidden));
     25166 static void win_new_height __ARGS((win_T *, int));
     25167 
     25168 #define URL_SLASH      1               /* path_is_url() has found "://" */
     25169@@ -259,7 +256,7 @@
     25170 /* cursor to previous window with wrap around */
     25171     case 'W':
     25172                CHECK_CMDWIN
     25173-               if (lastwin == firstwin && Prenum != 1) /* just one window */
     25174+               if (firstwin == lastwin && Prenum != 1) /* just one window */
     25175                    beep_flush();
     25176                else
     25177                {
     25178@@ -343,7 +340,7 @@
     25179 
     25180 /* move window to new tab page */
     25181     case 'T':
     25182-               if (firstwin == lastwin)
     25183+               if (one_window())
     25184                    MSG(_(m_onlyone));
     25185                else
     25186                {
     25187@@ -593,9 +590,7 @@
    2292125188                ++allow_keys;   /* no mapping for xchar, but allow key codes */
    2292225189                if (xchar == NUL)
     
    2292825195                --allow_keys;
    2292925196 #ifdef FEAT_CMDL_INFO
    22930 @@ -912,7 +910,7 @@
     25197@@ -680,9 +675,9 @@
     25198     /* When creating the help window make a snapshot of the window layout.
     25199      * Otherwise clear the snapshot, it's now invalid. */
     25200     if (flags & WSP_HELP)
     25201-       make_snapshot();
     25202+       make_snapshot(SNAP_HELP_IDX);
     25203     else
     25204-       clear_snapshot(curtab);
     25205+       clear_snapshot(curtab, SNAP_HELP_IDX);
     25206 
     25207     return win_split_ins(size, flags, NULL, 0);
     25208 }
     25209@@ -693,7 +688,7 @@
     25210  * top/left/right/bottom.
     25211  * return FAIL for failure, OK otherwise
     25212  */
     25213-    static int
     25214+    int
     25215 win_split_ins(size, flags, newwin, dir)
     25216     int                size;
     25217     int                flags;
     25218@@ -894,14 +889,14 @@
     25219     {
     25220        /* new window below/right of current one */
     25221        if (newwin == NULL)
     25222-           wp = win_alloc(oldwin);
     25223+           wp = win_alloc(oldwin, FALSE);
     25224        else
     25225            win_append(oldwin, wp);
     25226     }
     25227     else
     25228     {
     25229        if (newwin == NULL)
     25230-           wp = win_alloc(oldwin->w_prev);
     25231+           wp = win_alloc(oldwin->w_prev, FALSE);
     25232        else
     25233            win_append(oldwin->w_prev, wp);
     25234     }
     25235@@ -911,8 +906,15 @@
     25236        if (wp == NULL)
    2293125237            return FAIL;
    2293225238 
     25239+       new_frame(wp);
     25240+       if (wp->w_frame == NULL)
     25241+       {
     25242+           win_free(wp, NULL);
     25243+           return FAIL;
     25244+       }
     25245+
    2293325246        /* make the contents of the new window the same as the current one */
    2293425247-       win_init(wp, curwin);
     
    2293725250 
    2293825251     /*
    22939 @@ -1161,11 +1159,14 @@
     25252@@ -971,13 +973,7 @@
     25253     }
     25254 
     25255     if (newwin == NULL)
     25256-    {
     25257-       /* Create a frame for the new window. */
     25258-       frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
     25259-       frp->fr_layout = FR_LEAF;
     25260-       frp->fr_win = wp;
     25261-       wp->w_frame = frp;
     25262-    }
     25263+       frp = wp->w_frame;
     25264     else
     25265        frp = newwin->w_frame;
     25266     frp->fr_parent = curfrp->fr_parent;
     25267@@ -1157,15 +1153,19 @@
     25268     return OK;
     25269 }
     25270 
     25271+
     25272 /*
    2294025273  * Initialize window "newp" from window "oldp".
    2294125274  * Used when splitting a window and when creating a new tab page.
     
    2295325286     int                i;
    2295425287 
    22955 @@ -1190,7 +1191,14 @@
     25288@@ -1190,19 +1190,19 @@
    2295625289     copy_jumplist(oldp, newp);
    2295725290 #endif
     
    2296925302     if (oldp->w_localdir != NULL)
    2297025303        newp->w_localdir = vim_strsave(oldp->w_localdir);
    22971 @@ -1258,11 +1266,10 @@
     25304 
     25305-    /* Use the same argument list. */
     25306-    newp->w_alist = oldp->w_alist;
     25307-    ++newp->w_alist->al_refcount;
     25308-    newp->w_arg_idx = oldp->w_arg_idx;
     25309-
     25310-    /*
     25311-     * copy tagstack and options from existing window
     25312-     */
     25313+    /* copy tagstack and folds */
     25314     for (i = 0; i < oldp->w_tagstacklen; i++)
     25315     {
     25316        newp->w_tagstack[i] = oldp->w_tagstack[i];
     25317@@ -1212,10 +1212,29 @@
     25318     }
     25319     newp->w_tagstackidx = oldp->w_tagstackidx;
     25320     newp->w_tagstacklen = oldp->w_tagstacklen;
     25321-    win_copy_options(oldp, newp);
     25322 # ifdef FEAT_FOLDING
     25323     copyFoldingState(oldp, newp);
     25324 # endif
     25325+
     25326+    win_init_some(newp, oldp);
     25327+}
     25328+
     25329+/*
     25330+ * Initialize window "newp" from window"old".
     25331+ * Only the essential things are copied.
     25332+ */
     25333+    static void
     25334+win_init_some(newp, oldp)
     25335+    win_T      *newp;
     25336+    win_T      *oldp;
     25337+{
     25338+    /* Use the same argument list. */
     25339+    newp->w_alist = oldp->w_alist;
     25340+    ++newp->w_alist->al_refcount;
     25341+    newp->w_arg_idx = oldp->w_arg_idx;
     25342+
     25343+    /* copy options from existing window */
     25344+    win_copy_options(oldp, newp);
     25345 }
     25346 
     25347 #endif /* FEAT_WINDOWS */
     25348@@ -1258,11 +1277,10 @@
    2297225349  * Must be called when there is just one window, filling the whole screen
    2297325350  * (excluding the command line).
     
    2298225359     int                maxcount;
    2298325360     int                todo;
    22984 @@ -2343,11 +2350,10 @@
     25361@@ -1557,15 +1575,8 @@
     25362 #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
     25363     /* When 'guioptions' includes 'L' or 'R' may have to remove or add
     25364      * scrollbars.  Have to update them anyway. */
     25365-    if (gui.in_use)
     25366-    {
     25367-       out_flush();
     25368-       gui_init_which_components(NULL);
     25369-       gui_update_scrollbars(TRUE);
     25370-    }
     25371-    need_mouse_correct = TRUE;
     25372+    gui_may_update_scrollbars();
     25373 #endif
     25374-
     25375 }
     25376 
     25377 /*
     25378@@ -2040,13 +2051,40 @@
     25379 }
     25380 
     25381 /*
     25382- * Return TRUE if the current window is the only window that exists.
     25383+ * Return TRUE if the current window is the only window that exists (ignoring
     25384+ * "aucmd_win").
     25385  * Returns FALSE if there is a window, possibly in another tab page.
     25386  */
     25387     static int
     25388 last_window()
     25389 {
     25390-    return (lastwin == firstwin && first_tabpage->tp_next == NULL);
     25391+    return (one_window() && first_tabpage->tp_next == NULL);
     25392+}
     25393+
     25394+/*
     25395+ * Return TRUE if there is only one window other than "aucmd_win" in the
     25396+ * current tab page.
     25397+ */
     25398+    static int
     25399+one_window()
     25400+{
     25401+#ifdef FEAT_AUTOCMD
     25402+    win_T      *wp;
     25403+    int                seen_one = FALSE;
     25404+
     25405+    FOR_ALL_WINDOWS(wp)
     25406+    {
     25407+       if (wp != aucmd_win)
     25408+       {
     25409+           if (seen_one)
     25410+               return FALSE;
     25411+           seen_one = TRUE;
     25412+       }
     25413+    }
     25414+    return TRUE;
     25415+#else
     25416+    return firstwin == lastwin;
     25417+#endif
     25418 }
     25419 
     25420 /*
     25421@@ -2075,6 +2113,19 @@
     25422        return;
     25423     }
     25424 
     25425+#ifdef FEAT_AUTOCMD
     25426+    if (win == aucmd_win)
     25427+    {
     25428+       EMSG(_("E813: Cannot close autocmd window"));
     25429+       return;
     25430+    }
     25431+    if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
     25432+    {
     25433+       EMSG(_("E814: Cannot close window, only autocmd window would remain"));
     25434+       return;
     25435+    }
     25436+#endif
     25437+
     25438     /*
     25439      * When closing the last window in a tab page first go to another tab
     25440      * page and then close the window and the tab page.  This avoids that
     25441@@ -2104,7 +2155,7 @@
     25442     if (win->w_buffer->b_help)
     25443        help_window = TRUE;
     25444     else
     25445-       clear_snapshot(curtab);
     25446+       clear_snapshot(curtab, SNAP_HELP_IDX);
     25447 
     25448 #ifdef FEAT_AUTOCMD
     25449     if (win == curwin)
     25450@@ -2221,7 +2272,7 @@
     25451     /* After closing the help window, try restoring the window layout from
     25452      * before it was opened. */
     25453     if (help_window)
     25454-       restore_snapshot(close_curwin);
     25455+       restore_snapshot(SNAP_HELP_IDX, close_curwin);
     25456 
     25457 #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
     25458     /* When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. */
     25459@@ -2302,13 +2353,6 @@
     25460     frame_T    *frp;
     25461     win_T      *wp;
     25462 
     25463-#ifdef FEAT_FOLDING
     25464-    clearFolding(win);
     25465-#endif
     25466-
     25467-    /* reduce the reference count to the argument list. */
     25468-    alist_unlink(win->w_alist);
     25469-
     25470     /* Remove the window and its frame from the tree of frames. */
     25471     frp = win->w_frame;
     25472     wp = winframe_remove(win, dirp, tp);
     25473@@ -2334,6 +2378,14 @@
     25474        tabpage_close(TRUE);
     25475 # endif
     25476 
     25477+# ifdef FEAT_AUTOCMD
     25478+    if (aucmd_win != NULL)
     25479+    {
     25480+       (void)win_free_mem(aucmd_win, &dummy, NULL);
     25481+       aucmd_win = NULL;
     25482+    }
     25483+# endif
     25484+
     25485     while (firstwin != NULL)
     25486        (void)win_free_mem(firstwin, &dummy, NULL);
     25487 }
     25488@@ -2343,11 +2395,10 @@
    2298525489  * Remove a window and its frame from the tree of frames.
    2298625490  * Returns a pointer to the window that got the freed up space.
    2298725491  */
    2298825492-/*ARGSUSED*/
    22989      static win_T *
     25493-    static win_T *
     25494+    win_T *
    2299025495 winframe_remove(win, dirp, tp)
    2299125496     win_T      *win;
     
    2299525500 {
    2299625501     frame_T    *frp, *frp2, *frp3;
    22997 @@ -3220,7 +3226,7 @@
     25502@@ -3083,7 +3134,7 @@
     25503     win_T      *nextwp;
     25504     int                r;
     25505 
     25506-    if (lastwin == firstwin)
     25507+    if (one_window())
     25508     {
     25509        if (message
     25510 #ifdef FEAT_AUTOCMD
     25511@@ -3145,27 +3196,34 @@
     25512     void
     25513 curwin_init()
     25514 {
     25515-    redraw_win_later(curwin, NOT_VALID);
     25516-    curwin->w_lines_valid = 0;
     25517-    curwin->w_cursor.lnum = 1;
     25518-    curwin->w_curswant = curwin->w_cursor.col = 0;
     25519+    win_init_empty(curwin);
     25520+}
     25521+
     25522+    void
     25523+win_init_empty(wp)
     25524+    win_T *wp;
     25525+{
     25526+    redraw_win_later(wp, NOT_VALID);
     25527+    wp->w_lines_valid = 0;
     25528+    wp->w_cursor.lnum = 1;
     25529+    wp->w_curswant = wp->w_cursor.col = 0;
     25530 #ifdef FEAT_VIRTUALEDIT
     25531-    curwin->w_cursor.coladd = 0;
     25532+    wp->w_cursor.coladd = 0;
     25533 #endif
     25534-    curwin->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */
     25535-    curwin->w_pcmark.col = 0;
     25536-    curwin->w_prev_pcmark.lnum = 0;
     25537-    curwin->w_prev_pcmark.col = 0;
     25538-    curwin->w_topline = 1;
     25539+    wp->w_pcmark.lnum = 1;     /* pcmark not cleared but set to line 1 */
     25540+    wp->w_pcmark.col = 0;
     25541+    wp->w_prev_pcmark.lnum = 0;
     25542+    wp->w_prev_pcmark.col = 0;
     25543+    wp->w_topline = 1;
     25544 #ifdef FEAT_DIFF
     25545-    curwin->w_topfill = 0;
     25546+    wp->w_topfill = 0;
     25547 #endif
     25548-    curwin->w_botline = 2;
     25549+    wp->w_botline = 2;
     25550 #ifdef FEAT_FKMAP
     25551-    if (curwin->w_p_rl)
     25552-       curwin->w_farsi = W_CONV + W_R_L;
     25553+    if (wp->w_p_rl)
     25554+       wp->w_farsi = W_CONV + W_R_L;
     25555     else
     25556-       curwin->w_farsi = W_CONV;
     25557+       wp->w_farsi = W_CONV;
     25558 #endif
     25559 }
     25560 
     25561@@ -3187,9 +3245,30 @@
     25562     first_tabpage->tp_topframe = topframe;
     25563     curtab = first_tabpage;
     25564 #endif
     25565+
     25566     return OK;
     25567 }
     25568 
     25569+#if defined(FEAT_AUTOCMD) || defined(PROTO)
     25570+/*
     25571+ * Init "aucmd_win".  This can only be done after the first
     25572+ * window is fully initialized, thus it can't be in win_alloc_first().
     25573+ */
     25574+    void
     25575+win_alloc_aucmd_win()
     25576+{
     25577+    aucmd_win = win_alloc(NULL, TRUE);
     25578+    if (aucmd_win != NULL)
     25579+    {
     25580+       win_init_some(aucmd_win, curwin);
     25581+# ifdef FEAT_SCROLLBIND
     25582+       aucmd_win->w_p_scb = FALSE;
     25583+# endif
     25584+       new_frame(aucmd_win);
     25585+    }
     25586+}
     25587+#endif
     25588+
     25589 /*
     25590  * Allocate the first window or the first window in a new tab page.
     25591  * When "oldwin" is NULL create an empty buffer for it.
     25592@@ -3201,7 +3280,7 @@
     25593 win_alloc_firstwin(oldwin)
     25594     win_T      *oldwin;
     25595 {
     25596-    curwin = win_alloc(NULL);
     25597+    curwin = win_alloc(NULL, FALSE);
     25598     if (oldwin == NULL)
     25599     {
     25600        /* Very first window, need to create an empty buffer for it and
     25601@@ -3220,7 +3299,7 @@
    2299825602     else
    2299925603     {
     
    2300425608 # ifdef FEAT_SCROLLBIND
    2300525609        /* We don't want scroll-binding in the first window. */
    23006 @@ -3490,10 +3496,9 @@
     25610@@ -3229,21 +3308,36 @@
     25611     }
     25612 #endif
     25613 
     25614-    topframe = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
     25615-    if (topframe == NULL)
     25616+    new_frame(curwin);
     25617+    if (curwin->w_frame == NULL)
     25618        return FAIL;
     25619-    topframe->fr_layout = FR_LEAF;
     25620+    topframe = curwin->w_frame;
     25621 #ifdef FEAT_VERTSPLIT
     25622     topframe->fr_width = Columns;
     25623 #endif
     25624     topframe->fr_height = Rows - p_ch;
     25625     topframe->fr_win = curwin;
     25626-    curwin->w_frame = topframe;
     25627 
     25628     return OK;
     25629 }
     25630 
     25631 /*
     25632+ * Create a frame for window "wp".
     25633+ */
     25634+    static void
     25635+new_frame(win_T *wp)
     25636+{
     25637+    frame_T *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T));
     25638+
     25639+    wp->w_frame = frp;
     25640+    if (frp != NULL)
     25641+    {
     25642+       frp->fr_layout = FR_LEAF;
     25643+       frp->fr_win = wp;
     25644+    }
     25645+}
     25646+
     25647+/*
     25648  * Initialize the window and frame size to the maximum.
     25649  */
     25650     void
     25651@@ -3293,10 +3387,13 @@
     25652 free_tabpage(tp)
     25653     tabpage_T  *tp;
     25654 {
     25655+    int idx;
     25656+
     25657 # ifdef FEAT_DIFF
     25658     diff_clear(tp);
     25659 # endif
     25660-    clear_snapshot(tp);
     25661+    for (idx = 0; idx < SNAP_COUNT; ++idx)
     25662+       clear_snapshot(tp, idx);
     25663 #ifdef FEAT_EVAL
     25664     vars_clear(&tp->tp_vars.dv_hashtab);       /* free all t: variables */
     25665 #endif
     25666@@ -3363,12 +3460,7 @@
     25667 #if defined(FEAT_GUI)
     25668        /* When 'guioptions' includes 'L' or 'R' may have to remove or add
     25669         * scrollbars.  Have to update them anyway. */
     25670-       if (gui.in_use && starting == 0)
     25671-       {
     25672-           gui_init_which_components(NULL);
     25673-           gui_update_scrollbars(TRUE);
     25674-       }
     25675-       need_mouse_correct = TRUE;
     25676+       gui_may_update_scrollbars();
     25677 #endif
     25678 
     25679        redraw_all_later(CLEAR);
     25680@@ -3490,10 +3582,9 @@
    2300725681  * FAIL.
    2300825682  * Careful: When OK is returned need to get a new tab page very very soon!
     
    2301625690 {
    2301725691     tabpage_T  *tp = curtab;
    23018 @@ -3535,11 +3540,10 @@
     25692@@ -3535,11 +3626,10 @@
    2301925693  * Start using tab page "tp".
    2302025694  * Only to be used after leave_tabpage() or freeing the current tab page.
     
    2302925703     int                old_off = tp->tp_firstwin->w_winrow;
    2303025704     win_T      *next_prevwin = tp->tp_prevwin;
    23031 @@ -4028,14 +4032,14 @@
     25705@@ -3588,12 +3678,7 @@
     25706 #if defined(FEAT_GUI)
     25707     /* When 'guioptions' includes 'L' or 'R' may have to remove or add
     25708      * scrollbars.  Have to update them anyway. */
     25709-    if (gui.in_use && starting == 0)
     25710-    {
     25711-       gui_init_which_components(NULL);
     25712-       gui_update_scrollbars(TRUE);
     25713-    }
     25714-    need_mouse_correct = TRUE;
     25715+    gui_may_update_scrollbars();
     25716 #endif
     25717 
     25718     redraw_all_later(CLEAR);
     25719@@ -4028,14 +4113,14 @@
    2303225720            if (mch_dirname(cwd, MAXPATHL) == OK)
    2303325721                globaldir = vim_strsave(cwd);
     
    2304725735        globaldir = NULL;
    2304825736        shorten_fnames(TRUE);
    23049 @@ -4147,10 +4151,9 @@
    23050  /*
    23051   * allocate a window structure and link it in the window list
     25737@@ -4145,12 +4230,13 @@
     25738 #endif
     25739 
     25740 /*
     25741- * allocate a window structure and link it in the window list
     25742+ * Allocate a window structure and link it in the window list when "hidden" is
     25743+ * FALSE.
    2305225744  */
    2305325745-/*ARGSUSED*/
    2305425746     static win_T *
    23055  win_alloc(after)
     25747-win_alloc(after)
    2305625748-    win_T      *after;
     25749+win_alloc(after, hidden)
    2305725750+    win_T      *after UNUSED;
     25751+    int                hidden UNUSED;
    2305825752 {
    2305925753     win_T      *newwin;
    2306025754 
     25755@@ -4176,7 +4262,8 @@
     25756         * link the window in the window list
     25757         */
     25758 #ifdef FEAT_WINDOWS
     25759-       win_append(after, newwin);
     25760+       if (!hidden)
     25761+           win_append(after, newwin);
     25762 #endif
     25763 #ifdef FEAT_VERTSPLIT
     25764        newwin->w_wincol = 0;
     25765@@ -4237,6 +4324,13 @@
     25766 {
     25767     int                i;
     25768 
     25769+#ifdef FEAT_FOLDING
     25770+    clearFolding(wp);
     25771+#endif
     25772+
     25773+    /* reduce the reference count to the argument list. */
     25774+    alist_unlink(wp->w_alist);
     25775+
     25776 #ifdef FEAT_AUTOCMD
     25777     /* Don't execute autocommands while the window is halfway being deleted.
     25778      * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
     25779@@ -4299,7 +4393,10 @@
     25780     }
     25781 #endif /* FEAT_GUI */
     25782 
     25783-    win_remove(wp, tp);
     25784+#ifdef FEAT_AUTOCMD
     25785+    if (wp != aucmd_win)
     25786+#endif
     25787+       win_remove(wp, tp);
     25788     vim_free(wp);
     25789 
     25790 #ifdef FEAT_AUTOCMD
     25791@@ -4310,7 +4407,7 @@
     25792 /*
     25793  * Append window "wp" in the window list after window "after".
     25794  */
     25795-    static void
     25796+    void
     25797 win_append(after, wp)
     25798     win_T      *after, *wp;
     25799 {
     25800@@ -4336,7 +4433,7 @@
     25801 /*
     25802  * Remove a window from the window list.
     25803  */
     25804-    static void
     25805+    void
     25806 win_remove(wp, tp)
     25807     win_T      *wp;
     25808     tabpage_T  *tp;            /* tab page "win" is in, NULL for current */
     25809@@ -6036,6 +6133,7 @@
     25810 /*
     25811  * Return TRUE if there is only one window (in the current tab page), not
     25812  * counting a help or preview window, unless it is the current window.
     25813+ * Does not count "aucmd_win".
     25814  */
     25815     int
     25816 only_one_window()
     25817@@ -6049,11 +6147,15 @@
     25818        return FALSE;
     25819 
     25820     for (wp = firstwin; wp != NULL; wp = wp->w_next)
     25821-       if (!((wp->w_buffer->b_help && !curbuf->b_help)
     25822+       if ((!((wp->w_buffer->b_help && !curbuf->b_help)
     25823 # ifdef FEAT_QUICKFIX
     25824                    || wp->w_p_pvw
     25825 # endif
     25826             ) || wp == curwin)
     25827+# ifdef FEAT_AUTOCMD
     25828+               && wp != aucmd_win
     25829+# endif
     25830+          )
     25831            ++count;
     25832     return (count <= 1);
     25833 #else
     25834@@ -6108,11 +6210,12 @@
     25835 /*
     25836  * Create a snapshot of the current frame sizes.
     25837  */
     25838-    static void
     25839-make_snapshot()
     25840+    void
     25841+make_snapshot(idx)
     25842+    int idx;
     25843 {
     25844-    clear_snapshot(curtab);
     25845-    make_snapshot_rec(topframe, &curtab->tp_snapshot);
     25846+    clear_snapshot(curtab, idx);
     25847+    make_snapshot_rec(topframe, &curtab->tp_snapshot[idx]);
     25848 }
     25849 
     25850     static void
     25851@@ -6140,11 +6243,12 @@
     25852  * Remove any existing snapshot.
     25853  */
     25854     static void
     25855-clear_snapshot(tp)
     25856+clear_snapshot(tp, idx)
     25857     tabpage_T  *tp;
     25858+    int                idx;
     25859 {
     25860-    clear_snapshot_rec(tp->tp_snapshot);
     25861-    tp->tp_snapshot = NULL;
     25862+    clear_snapshot_rec(tp->tp_snapshot[idx]);
     25863+    tp->tp_snapshot[idx] = NULL;
     25864 }
     25865 
     25866     static void
     25867@@ -6164,26 +6268,27 @@
     25868  * This is only done if the screen size didn't change and the window layout is
     25869  * still the same.
     25870  */
     25871-    static void
     25872-restore_snapshot(close_curwin)
     25873+    void
     25874+restore_snapshot(idx, close_curwin)
     25875+    int                idx;
     25876     int                close_curwin;       /* closing current window */
     25877 {
     25878     win_T      *wp;
     25879 
     25880-    if (curtab->tp_snapshot != NULL
     25881+    if (curtab->tp_snapshot[idx] != NULL
     25882 # ifdef FEAT_VERTSPLIT
     25883-           && curtab->tp_snapshot->fr_width == topframe->fr_width
     25884+           && curtab->tp_snapshot[idx]->fr_width == topframe->fr_width
     25885 # endif
     25886-           && curtab->tp_snapshot->fr_height == topframe->fr_height
     25887-           && check_snapshot_rec(curtab->tp_snapshot, topframe) == OK)
     25888+           && curtab->tp_snapshot[idx]->fr_height == topframe->fr_height
     25889+           && check_snapshot_rec(curtab->tp_snapshot[idx], topframe) == OK)
     25890     {
     25891-       wp = restore_snapshot_rec(curtab->tp_snapshot, topframe);
     25892+       wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe);
     25893        win_comp_pos();
     25894        if (wp != NULL && close_curwin)
     25895            win_goto(wp);
     25896        redraw_all_later(CLEAR);
     25897     }
     25898-    clear_snapshot(curtab);
     25899+    clear_snapshot(curtab, idx);
     25900 }
     25901 
     25902 /*
    2306125903diff -Naur vim72.orig/src/workshop.c vim72/src/workshop.c
    2306225904--- vim72.orig/src/workshop.c   2008-06-21 11:53:26.000000000 -0700
    23063 +++ vim72/src/workshop.c        2009-06-05 14:25:31.000000000 -0700
     25905+++ vim72/src/workshop.c        2009-07-19 15:16:46.000000000 -0700
    2306425906@@ -204,12 +204,11 @@
    2306525907  * Function:
     
    2319726039 }
    2319826040 
     26041diff -Naur vim72.orig/src/xxd/xxd.c vim72/src/xxd/xxd.c
     26042--- vim72.orig/src/xxd/xxd.c    2007-11-29 12:05:16.000000000 -0800
     26043+++ vim72/src/xxd/xxd.c 2009-07-19 15:17:54.000000000 -0700
     26044@@ -64,6 +64,9 @@
     26045 # define _CRT_SECURE_NO_DEPRECATE
     26046 # define _CRT_NONSTDC_NO_DEPRECATE
     26047 #endif
     26048+#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__))
     26049+# define CYGWIN
     26050+#endif
     26051 
     26052 #include <stdio.h>
     26053 #ifdef VAXC
     26054@@ -77,7 +80,8 @@
     26055 #if !defined(OS2) && defined(__EMX__)
     26056 # define OS2
     26057 #endif
     26058-#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(__BORLANDC__)
     26059+#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(__BORLANDC__) \
     26060+  || defined(CYGWIN)
     26061 # include <io.h>       /* for setmode() */
     26062 #else
     26063 # ifdef UNIX
     26064@@ -150,9 +154,6 @@
     26065 # endif
     26066 #endif
     26067 
     26068-#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__))
     26069-# define CYGWIN
     26070-#endif
     26071 #if defined(MSDOS) || defined(WIN32) || defined(OS2)
     26072 # define BIN_READ(yes)  ((yes) ? "rb" : "rt")
     26073 # define BIN_WRITE(yes) ((yes) ? "wb" : "wt")
Note: See TracChangeset for help on using the changeset viewer.