updated for version 7.0210
diff --git a/src/Makefile b/src/Makefile
index 66185ce..9345d10 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1270,6 +1270,10 @@
 
 ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(POST_DEFS)
 
+# Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
+# with "-E".
+OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
+
 LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) -Dinline= -D__extension__= -Dalloca=alloca
 
 LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
@@ -2219,7 +2223,7 @@
 	    $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@
 
 auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
-	CC="$(CC) $(ALL_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh
+	CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh
 
 QUOTESED = sed -e 's/"/\\"/g' -e 's/\\"/"/' -e 's/\\";$$/";/'
 auto/pathdef.c: Makefile auto/config.mk
diff --git a/src/auto/configure b/src/auto/configure
index ae30634..ad86242 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -2783,7 +2783,7 @@
 if test "$GCC" = yes; then
   gccversion=`"$CC" --version | sed -e '2,$d;s/^[^0-9]*\(darwin.[^0-9]*\)*\([0-9]\.[0-9.]*\).*$/\2/g'`
     if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
-    echo 'GCC 34.0.12 has a bug in the optimizer, disabling "-O#"'
+    echo 'GCC [34].0.[12] has a bug in the optimizer, disabling "-O#"'
     CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'`
   else
     if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
@@ -2874,17 +2874,17 @@
   MACARCH="$withval"; echo "$as_me:$LINENO: result: $MACARCH" >&5
 echo "${ECHO_T}$MACARCH" >&6
 else
-  MACARCH="both"; echo "$as_me:$LINENO: result: Defaulting to $MACARCH" >&5
-echo "${ECHO_T}Defaulting to $MACARCH" >&6
+  MACARCH="both"; echo "$as_me:$LINENO: result: defaulting to $MACARCH" >&5
+echo "${ECHO_T}defaulting to $MACARCH" >&6
 fi;
 
   if test "x$MACARCH" = "xboth"; then
-    echo "$as_me:$LINENO: checking if both architectures are supported" >&5
-echo $ECHO_N "checking if both architectures are supported... $ECHO_C" >&6
-    save_cppflags="$CPPFLAGS"
+    echo "$as_me:$LINENO: checking for 10.4 universal SDK" >&5
+echo $ECHO_N "checking for 10.4 universal SDK... $ECHO_C" >&6
+                            save_cppflags="$CPPFLAGS"
+    save_cflags="$CFLAGS"
     save_ldflags="$LDFLAGS"
-    CPPFLAGS="$CPPFLAGS -arch i386 -arch ppc"
-    LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
+    CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -2922,19 +2922,20 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-	    echo "$as_me:$LINENO: checking if Intel architecture is supported" >&5
+echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+	CFLAGS="save_cflags"
+	echo "$as_me:$LINENO: checking if Intel architecture is supported" >&5
 echo $ECHO_N "checking if Intel architecture is supported... $ECHO_C" >&6
-	    CPPFLAGS="$save_cppflags -arch i386"
-	    LDFLAGS="$save_ldflags -arch i386"
-	    cat >conftest.$ac_ext <<_ACEOF
+	CPPFLAGS="$CPPFLAGS -arch i386"
+	LDFLAGS="$save_ldflags -arch i386"
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -2978,36 +2979,34 @@
 sed 's/^/| /' conftest.$ac_ext >&5
 
 echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; MACARCH="ppc"
+echo "${ECHO_T}no" >&6
+	        MACARCH="ppc"
+		CPPFLAGS="$save_cppflags -arch ppc"
+		LDFLAGS="$save_ldflags -arch ppc"
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-    CPPFLAGS="$save_cppflags"
-    LDFLAGS="$save_ldflags"
+  elif test "x$MACARCH" = "xintel"; then
+    CPPFLAGS="$CPPFLAGS -arch intel"
+    LDFLAGS="$LDFLAGS -arch intel"
+  else
+    CPPFLAGS="$CPPFLAGS -arch ppc"
+    LDFLAGS="$LDFLAGS -arch ppc"
   fi
 
-  case "$MACARCH" in
-    intel)	MAC_OSX_ARCH="-arch i386";;
-    both)	MAC_OSX_ARCH="-arch i386 -arch ppc";;
-    ppc)	MAC_OSX_ARCH="-arch ppc";;
-    *)		MAC_OSX_ARCH="";;
-  esac
-
-    if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
-    CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'`
-  fi
-
-  CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH"
-  LDFLAGS="$LDFLAGS $MAC_OSX_ARCH"
-
   if test "$enable_darwin" = "yes"; then
     MACOSX=yes
     OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
     OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
-        CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
+        CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
+    if test "x$MACARCH" = "xboth"; then
+      CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
+    else
+      CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
+    fi
 
                 echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
@@ -3396,6 +3395,13 @@
     fi
   fi
 
+    if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
+    CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-Oz/'`
+  fi
+
+  CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH"
+  LDFLAGS="$LDFLAGS $MAC_OSX_ARCH"
+
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
@@ -15222,6 +15228,9 @@
 echo "${ECHO_T}no" >&6
   fi
 fi
+if test "x$MACARCH" = "xboth"; then
+  LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+fi
 
 echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
 echo $ECHO_N "checking for GCC 3 or later... $ECHO_C" >&6
diff --git a/src/configure.in b/src/configure.in
index 574e2df..60609ec 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -32,7 +32,7 @@
   gccversion=`"$CC" --version | sed -e '2,$d;s/^[[^0-9]]*\(darwin.[[^0-9]]*\)*\([[0-9]]\.[[0-9.]]*\).*$/\2/g'`
   dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
   if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
-    echo 'GCC [34].0.[12] has a bug in the optimizer, disabling "-O#"'
+    echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
     CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
   else
     if test "$gccversion" = "3.1" -o "$gccversion" = "3.2" -o "$gccversion" = "3.2.1" && `echo "$CFLAGS" | grep -v fno-strength-reduce >/dev/null`; then
@@ -105,48 +105,53 @@
   AC_MSG_CHECKING(--with-mac-arch argument)
   AC_ARG_WITH(mac-arch, [  --with-mac-arch=ARCH    intel, ppc or both],
 	MACARCH="$withval"; AC_MSG_RESULT($MACARCH),
-	MACARCH="both"; AC_MSG_RESULT(Defaulting to $MACARCH))
+	MACARCH="both"; AC_MSG_RESULT(defaulting to $MACARCH))
 
   if test "x$MACARCH" = "xboth"; then
-    AC_MSG_CHECKING(if both architectures are supported)
+    AC_MSG_CHECKING(for 10.4 universal SDK)
+    dnl There is a terrible inconsistency (but we appear to get away with it):
+    dnl $CFLAGS uses the 10.4u SDK library for the headers, while $CPPFLAGS
+    dnl doesn't, because "gcc -E" doesn't grok it.  That means the configure
+    dnl tests using the preprocessor are actually done with the wrong header
+    dnl files. $LDFLAGS is set at the end, because configure uses it together
+    dnl with $CFLAGS and we can only have one -sysroot argument.
     save_cppflags="$CPPFLAGS"
+    save_cflags="$CFLAGS"
     save_ldflags="$LDFLAGS"
-    CPPFLAGS="$CPPFLAGS -arch i386 -arch ppc"
-    LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
+    CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
     AC_TRY_LINK([ ], [ ],
-	AC_MSG_RESULT(yes),
-	AC_MSG_RESULT(no)
-	    AC_MSG_CHECKING(if Intel architecture is supported)
-	    CPPFLAGS="$save_cppflags -arch i386"
-	    LDFLAGS="$save_ldflags -arch i386"
-	    AC_TRY_LINK([ ], [ ],
-		AC_MSG_RESULT(yes); MACARCH="intel",
-		AC_MSG_RESULT(no); MACARCH="ppc"))
-    CPPFLAGS="$save_cppflags"
-    LDFLAGS="$save_ldflags"
+	AC_MSG_RESULT(found, will make universal binary),
+
+	AC_MSG_RESULT(not found)
+	CFLAGS="save_cflags"
+	AC_MSG_CHECKING(if Intel architecture is supported)
+	CPPFLAGS="$CPPFLAGS -arch i386"
+	LDFLAGS="$save_ldflags -arch i386"
+	AC_TRY_LINK([ ], [ ],
+	    AC_MSG_RESULT(yes); MACARCH="intel",
+	    AC_MSG_RESULT(no, using PowerPC)
+	        MACARCH="ppc"
+		CPPFLAGS="$save_cppflags -arch ppc"
+		LDFLAGS="$save_ldflags -arch ppc"))
+  elif test "x$MACARCH" = "xintel"; then
+    CPPFLAGS="$CPPFLAGS -arch intel"
+    LDFLAGS="$LDFLAGS -arch intel"
+  else
+    CPPFLAGS="$CPPFLAGS -arch ppc"
+    LDFLAGS="$LDFLAGS -arch ppc"
   fi
 
-  case "$MACARCH" in
-    intel)	MAC_OSX_ARCH="-arch i386";;
-    both)	MAC_OSX_ARCH="-arch i386 -arch ppc";;
-    ppc)	MAC_OSX_ARCH="-arch ppc";;
-    *)		MAC_OSX_ARCH="";;
-  esac
-
-  dnl avoid a bug with -O2 for intel
-  if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
-    CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'`
-  fi
-
-  CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH"
-  LDFLAGS="$LDFLAGS $MAC_OSX_ARCH"
-
   if test "$enable_darwin" = "yes"; then
     MACOSX=yes
     OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
     OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
     dnl TODO: use -arch i386 on Intel machines
-    CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
+    CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
+    if test "x$MACARCH" = "xboth"; then
+      CPPFLAGS="$CPPFLAGS -I/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon"
+    else
+      CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon"
+    fi
 
     dnl If Carbon is found, assume we don't want X11
     dnl unless it was specifically asked for (--with-x)
@@ -159,6 +164,14 @@
     fi
   fi
 
+  dnl avoid a bug with -O2 for intel
+  if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then
+    CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'`
+  fi
+
+  CPPFLAGS="$CPPFLAGS $MAC_OSX_ARCH"
+  LDFLAGS="$LDFLAGS $MAC_OSX_ARCH"
+
 else
   AC_MSG_RESULT(no)
 fi
@@ -2794,6 +2807,9 @@
     AC_MSG_RESULT(no)
   fi
 fi
+if test "x$MACARCH" = "xboth"; then
+  LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+fi
 
 dnl gcc 3.1 changed the meaning of -MM.  The only solution appears to be to
 dnl use "-isystem" instead of "-I" for all non-Vim include dirs.
diff --git a/src/edit.c b/src/edit.c
index 25a10be..dcf19b5 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3253,14 +3253,13 @@
     /* Go through the List with matches and add each of them. */
     for (li = matchlist->lv_first; li != NULL; li = li->li_next)
     {
+	icase = p_ic;
 	if (li->li_tv.v_type == VAR_DICT && li->li_tv.vval.v_dict != NULL)
 	{
 	    p = get_dict_string(li->li_tv.vval.v_dict, (char_u *)"word", FALSE);
 	    x = get_dict_string(li->li_tv.vval.v_dict, (char_u *)"menu", FALSE);
 	    if (get_dict_string(li->li_tv.vval.v_dict, (char_u *)"icase",
-							       FALSE) == NULL)
-		icase = p_ic;
-	    else
+							       FALSE) != NULL)
 		icase = get_dict_number(li->li_tv.vval.v_dict,
 							   (char_u *)"icase");
 	}
diff --git a/src/eval.c b/src/eval.c
index ee5f0c9..d1e2b19 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -15612,7 +15612,7 @@
 	pos.col = get_tv_number(&li->li_tv);
 	len = (long)STRLEN(ml_get(pos.lnum));
 	if (pos.col <= 0 || ((len == 0 && pos.col > 1)
-					       || (len > 0 && pos.col > len)))
+					  || (len > 0 && (int)pos.col > len)))
 	    return NULL;	/* invalid column number */
 
 	pos.col--;
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 393f714..9dcf0d5 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -941,6 +941,8 @@
 			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
 EX(CMD_undo,		"undo",		ex_undo,
 			TRLBAR|CMDWIN),
+EX(CMD_undojoin,	"undojoin",	ex_undojoin,
+			TRLBAR|CMDWIN),
 EX(CMD_unabbreviate,	"unabbreviate",	ex_abbreviate,
 			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
 EX(CMD_unhide,		"unhide",	ex_buffer_all,
diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro
index 185c8ad..179dd5e 100644
--- a/src/proto/os_win32.pro
+++ b/src/proto/os_win32.pro
@@ -19,6 +19,7 @@
 int mch_setperm __ARGS((char_u *name, long perm));
 void mch_hide __ARGS((char_u *name));
 int mch_isdir __ARGS((char_u *name));
+int mch_is_linked __ARGS((char_u *fname));
 int mch_writable __ARGS((char_u *name));
 int mch_can_exe __ARGS((char_u *name));
 int mch_nodetype __ARGS((char_u *name));
diff --git a/src/syntax.c b/src/syntax.c
index 5a50b59..a96dc77 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6128,7 +6128,7 @@
 	"SpellRare term=reverse ctermbg=Magenta guisp=Magenta gui=undercurl",
 	"SpellLocal term=underline ctermbg=Cyan guisp=Cyan gui=undercurl",
 	"Pmenu ctermbg=Magenta guibg=Magenta",
-	"PmenuSel ctermbg=Grey guibg=Grey",
+	"PmenuSel ctermbg=DarkGrey guibg=DarkGrey",
 	"Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta",
 	"WarningMsg term=standout ctermfg=LightRed guifg=Red",
 	"WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black",
diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim
index 092c0c8..19ef949 100644
--- a/src/testdir/test49.vim
+++ b/src/testdir/test49.vim
@@ -1,6 +1,6 @@
 " Vim script language tests
 " Author:	Servatius Brandt <Servatius.Brandt@fujitsu-siemens.com>
-" Last Change:	2005 Jun 18
+" Last Change:	2006 Feb 28
 
 "-------------------------------------------------------------------------------
 " Test environment							    {{{1
@@ -382,11 +382,6 @@
 	    let func_start = line(".")
 	    let func_name = substitute(theline,
 		\ '^\s*fu\%[nction]!\=\s*\(\%(\u\|s:\)\w*\).*', '\1', "")
-	    let func_conts = 0
-	elseif theline =~ '^\s*\\'
-	    if in_func
-		let func_conts = func_conts + 1
-	    endif
 	elseif theline =~ '^\s*endf'
 	    " End of function definition.
 	    let in_func = 0
@@ -411,7 +406,7 @@
 		    " Add the function breakpoint and note the number of quits
 		    " to be used, if specified, or one for every call else.
 		    let breakpoints = breakpoints . " -c 'breakadd func " .
-			\ (line(".") - func_start - func_conts) . " " .
+			\ (line(".") - func_start) . " " .
 			\ func_name . "'"
 		    if quits != ""
 			let debug_quits = debug_quits . quits
diff --git a/src/undo.c b/src/undo.c
index 1ead156..0c7cbd7 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -845,6 +845,28 @@
 }
 
 /*
+ * ":undojoin": continue adding to the last entry list
+ */
+/*ARGSUSED*/
+    void
+ex_undojoin(eap)
+    exarg_T *eap;
+{
+    if (!curbuf->b_u_synced)
+	return;		    /* already unsynced */
+    if (curbuf->b_u_newhead == NULL)
+	return;		    /* nothing changed before */
+    if (p_ul < 0)
+	return;		    /* no entries, nothing to do */
+    else
+    {
+	/* Go back to the last entry */
+	curbuf->b_u_curhead = curbuf->b_u_newhead;
+	curbuf->b_u_synced = FALSE;  /* no entries, nothing to do */
+    }
+}
+
+/*
  * Called after writing the file and setting b_changed to FALSE.
  * Now an undo means that the buffer is modified.
  */
diff --git a/src/version.h b/src/version.h
index 0869768..33aedab 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 27)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 27, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 28)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 28, compiled "