updated for version 7.0057
diff --git a/src/globals.h b/src/globals.h
index 8251f18..d76eb6f 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1070,6 +1070,13 @@
 EXTERN int	no_hlsearch INIT(= FALSE);
 #endif
 
+#ifdef FEAT_BEVAL
+EXTERN BalloonEval	*balloonEval INIT(= NULL);
+EXTERN int bevalServers INIT(= 0);
+# define BEVAL_NETBEANS		0x01
+# define BEVAL_WORKSHOP		0x02
+#endif
+
 #ifdef CURSOR_SHAPE
 /* the table is in misc2.c, because of initializations */
 extern cursorentry_T shape_table[SHAPE_IDX_COUNT];
@@ -1412,12 +1419,7 @@
 #if defined(FEAT_EVAL) || defined(FEAT_SYN_HL) || defined(PROTO)
 EXTERN char_u e_intern2[]	INIT(=N_("E685: Internal error: %s"));
 #endif
-#if 0
-#if defined(HAVE_SETJMP_H) || defined(HAVE_TRY_EXCEPT) || defined(__MINGW32__)
-EXTERN char_u e_complex[]	INIT(=N_("E361: Crash intercepted; regexp too complex?"));
-#endif
-#endif
-EXTERN char_u e_outofstack[]	INIT(=N_("E363: pattern caused out-of-stack error"));
+EXTERN char_u e_maxmempat[]	INIT(=N_("E363: pattern uses more memory than 'maxmempattern'"));
 EXTERN char_u e_emptybuf[]	INIT(=N_("E749: empty buffer"));
 
 #ifdef MACOS_X_UNIX
diff --git a/src/option.c b/src/option.c
index e7210b3..30d7e89 100644
--- a/src/option.c
+++ b/src/option.c
@@ -448,12 +448,14 @@
     {"balloondelay","bdlay",P_NUM|P_VI_DEF,
 			    (char_u *)&p_bdlay, PV_NONE,
 			    {(char_u *)600L, (char_u *)0L}},
-#endif
-#if defined(FEAT_BEVAL) && (defined(FEAT_SUN_WORKSHOP) \
-	|| defined(FEAT_NETBEANS_INTG))
     {"ballooneval", "beval",P_BOOL|P_VI_DEF|P_NO_MKRC,
 			    (char_u *)&p_beval, PV_NONE,
-			    {(char_u*)FALSE, (char_u *)0L}},
+			    {(char_u *)FALSE, (char_u *)0L}},
+# ifdef FEAT_EVAL
+    {"balloonexpr", "bexpr",  P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
+			    (char_u *)&p_bexpr, PV_NONE,
+			    {(char_u *)"", (char_u *)0L}},
+# endif
 #endif
     {"beautify",    "bf",   P_BOOL|P_VI_DEF,
 			    (char_u *)NULL, PV_NONE,
@@ -1479,6 +1481,9 @@
     {"maxmem",	    "mm",   P_NUM|P_VI_DEF,
 			    (char_u *)&p_mm, PV_NONE,
 			    {(char_u *)DFLT_MAXMEM, (char_u *)0L}},
+    {"maxmempattern","mmp", P_NUM|P_VI_DEF,
+			    (char_u *)&p_mmp, PV_NONE,
+			    {(char_u *)1000L, (char_u *)0L}},
     {"maxmemtot",   "mmt",  P_NUM|P_VI_DEF,
 			    (char_u *)&p_mmt, PV_NONE,
 			    {(char_u *)DFLT_MAXMEMTOT, (char_u *)0L}},
@@ -5522,10 +5527,14 @@
     /* 'ttymouse' */
     else if (varp == &p_ttym)
     {
+	/* Switch the mouse off before changing the escape sequences used for
+	 * that. */
+	mch_setmouse(FALSE);
 	if (opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE) != OK)
 	    errmsg = e_invarg;
 	else
 	    check_mouse_termcode();
+	setmouse();	/* may switch it on again */
     }
 #endif
 
@@ -6551,24 +6560,23 @@
 	p_wiv = (*T_XS != NUL);
     }
 
-#if defined(FEAT_BEVAL) && (defined(FEAT_SUN_WORKSHOP) \
-	|| defined(FEAT_NETBEANS_INTG))
+#ifdef FEAT_BEVAL
     else if ((int *)varp == &p_beval)
     {
-	extern BalloonEval	*balloonEval;
-
 	if (p_beval == TRUE)
 	    gui_mch_enable_beval_area(balloonEval);
 	else
 	    gui_mch_disable_beval_area(balloonEval);
     }
 
+# if defined(FEAT_NETBEANS_INTG) || defined(FEAT_SUN_WORKSHOP)
     else if ((int *)varp == &p_acd)
     {
 	if (p_acd && curbuf->b_ffname != NULL
 				     && vim_chdirfile(curbuf->b_ffname) == OK)
 	    shorten_fnames(TRUE);
     }
+# endif
 #endif
 
 #ifdef FEAT_DIFF
diff --git a/src/option.h b/src/option.h
index cd05f53..0e19970 100644
--- a/src/option.h
+++ b/src/option.h
@@ -339,8 +339,9 @@
 #endif
 #ifdef FEAT_BEVAL
 EXTERN long	p_bdlay;	/* 'balloondelay' */
-# if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG)
 EXTERN int	p_beval;	/* 'ballooneval' */
+# ifdef FEAT_EVAL
+EXTERN char_u	*p_bexpr;
 # endif
 #endif
 #ifdef FEAT_BROWSE
@@ -586,6 +587,7 @@
 #endif
 EXTERN long	p_mmd;		/* 'maxmapdepth' */
 EXTERN long	p_mm;		/* 'maxmem' */
+EXTERN long	p_mmp;		/* 'maxmempattern' */
 EXTERN long	p_mmt;		/* 'maxmemtot' */
 #ifdef FEAT_MENU
 EXTERN long	p_mis;		/* 'menuitems' */
diff --git a/src/proto/term.pro b/src/proto/term.pro
index 3215b0e..f5bdfc4 100644
--- a/src/proto/term.pro
+++ b/src/proto/term.pro
@@ -44,7 +44,7 @@
 void scroll_region_set __ARGS((win_T *wp, int off));
 void scroll_region_reset __ARGS((void));
 void clear_termcodes __ARGS((void));
-void add_termcode __ARGS((char_u *name, char_u *string, int use_8bit));
+void add_termcode __ARGS((char_u *name, char_u *string, int flags));
 char_u *find_termcode __ARGS((char_u *name));
 char_u *get_termcode __ARGS((int i));
 void del_termcode __ARGS((char_u *name));