updated for version 7.0028
diff --git a/src/eval.c b/src/eval.c
index 13a5b1b..8a2c205 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -418,7 +418,7 @@
 static void list_one_var __ARGS((VAR v, char_u *prefix));
 static void list_vim_var __ARGS((int i));
 static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string));
-static void set_var __ARGS((char_u *name, VAR varp));
+static void set_var __ARGS((char_u *name, VAR varp, int copy));
 static void copy_var __ARGS((VAR from, VAR to));
 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
 static char_u *trans_function_name __ARGS((char_u **pp, int skip, int internal));
@@ -455,7 +455,7 @@
 	varp = alloc_string_var(val);
 	if (varp != NULL)
 	{
-	    set_var(name, varp);
+	    set_var(name, varp, FALSE);
 	    free_var(varp);
 	}
     }
@@ -1214,7 +1214,7 @@
 		    }
 		    else
 		    {
-			set_var(temp_string, &retvar);
+			set_var(temp_string, &retvar, TRUE);
 			vim_free(temp_string);
 		    }
 		}
@@ -1223,7 +1223,7 @@
 		{
 		    c1 = *p;
 		    *p = NUL;
-		    set_var(arg, &retvar);
+		    set_var(arg, &retvar, TRUE);
 		    *p = c1;		/* put char back for error messages */
 		}
 	    }
@@ -6879,7 +6879,7 @@
 	    {
 		STRCPY(bufvarname, "b:");
 		STRCPY(bufvarname + 2, varname);
-		set_var(bufvarname, varp);
+		set_var(bufvarname, varp, TRUE);
 		vim_free(bufvarname);
 	    }
 	}
@@ -7040,7 +7040,7 @@
 	    {
 		STRCPY(winvarname, "w:");
 		STRCPY(winvarname + 2, varname);
-		set_var(winvarname, varp);
+		set_var(winvarname, varp, TRUE);
 		vim_free(winvarname);
 	    }
 	}
@@ -7193,7 +7193,8 @@
     {
 	v.var_type = VAR_STRING;
 	v.var_val.var_string = vim_strsave(s);
-	set_var(get_var_string(&argvars[1]), &v);
+	set_var(get_var_string(&argvars[1]), &v, FALSE);
+	vim_free(v.var_val.var_string);
     }
 #else
     retvar->var_val.var_number = -1;
@@ -7313,7 +7314,8 @@
 	sprintf((char *)str, "0x%x", (unsigned int)w);
 	v.var_type = VAR_STRING;
 	v.var_val.var_string = vim_strsave(str);
-	set_var(get_var_string(&argvars[2]), &v);
+	set_var(get_var_string(&argvars[2]), &v, FALSE);
+	vim_free(v.var_val.var_string);
     }
 }
 #endif
@@ -9191,9 +9193,10 @@
  * Otherwise the variable is created.
  */
     static void
-set_var(name, varp)
+set_var(name, varp, copy)
     char_u	*name;
     VAR		varp;
+    int		copy;	    /* make copy of value in "varp" */
 {
     int		i;
     VAR		v;
@@ -9215,10 +9218,17 @@
 	    if (vimvars[i].type == VAR_STRING)
 	    {
 		vim_free(vimvars[i].val);
-		vimvars[i].val = vim_strsave(get_var_string(varp));
+		if (copy || varp->var_type != VAR_STRING)
+		    vimvars[i].val = vim_strsave(get_var_string(varp));
+		else
+		{
+		    /* Take over the string to avoid an extra alloc/free. */
+		    vimvars[i].val = varp->var_val.var_string;
+		    varp->var_val.var_string = NULL;
+		}
 	    }
 	    else
-		vimvars[i].val = (char_u *)(long)varp->var_val.var_number;
+		vimvars[i].val = (char_u *)get_var_number(varp);
 	}
 	return;
     }
@@ -9254,7 +9264,13 @@
 	if (i == gap->ga_len)
 	    ++gap->ga_len;
     }
-    copy_var(varp, v);
+    if (copy || varp->var_type != VAR_STRING)
+	copy_var(varp, v);
+    else
+    {
+	v->var_type = varp->var_type;
+	v->var_val.var_string = varp->var_val.var_string;
+    }
 }
 
     static void
@@ -10663,7 +10679,7 @@
 		/* assign the value to the variable */
 		if (varp != NULL)
 		{
-		    set_var(virp->vir_line + 1, varp);
+		    set_var(virp->vir_line + 1, varp, FALSE);
 		    free_var(varp);
 		}
 	    }
diff --git a/src/gui_x11.c b/src/gui_x11.c
index 90e793c..88ee91c 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -1286,8 +1286,8 @@
     open_app_context();
     if (app_context != NULL)
 	gui.dpy = XtOpenDisplay(app_context, 0, VIM_NAME, VIM_CLASS,
-	    cmdline_options, XtNumber(cmdline_options),
-	    CARDINAL &gui_argc, gui_argv);
+		cmdline_options, XtNumber(cmdline_options),
+		CARDINAL &gui_argc, gui_argv);
 
     if (app_context == NULL || gui.dpy == NULL)
     {
@@ -1565,9 +1565,7 @@
 gui_mch_uninit()
 {
     gui_x11_destroy_widgets();
-#ifndef LESSTIF_VERSION
     XtCloseDisplay(gui.dpy);
-#endif
     gui.dpy = NULL;
     vimShell = (Widget)0;
 }
@@ -1787,6 +1785,9 @@
     int		base_width;
     int		base_height;
 {
+#ifdef FEAT_XIM
+    height += xim_get_status_area_height(),
+#endif
     XtVaSetValues(vimShell,
 	XtNwidthInc,	gui.char_width,
 	XtNheightInc,	gui.char_height,
@@ -1797,11 +1798,7 @@
 	XtNminWidth,	min_width,
 	XtNminHeight,	min_height,
 	XtNwidth,	width,
-#ifdef FEAT_XIM
-	XtNheight,	height + xim_get_status_area_height(),
-#else
 	XtNheight,	height,
-#endif
 	NULL);
 }
 
@@ -3505,244 +3502,6 @@
 }
 #endif
 
-#if defined(FEAT_TOOLBAR) || defined(PROTO)
-/*
- * Icons used by the toolbar code.
- */
-#include "../pixmaps/tb_new.xpm"
-#include "../pixmaps/tb_open.xpm"
-#include "../pixmaps/tb_close.xpm"
-#include "../pixmaps/tb_save.xpm"
-#include "../pixmaps/tb_print.xpm"
-#include "../pixmaps/tb_cut.xpm"
-#include "../pixmaps/tb_copy.xpm"
-#include "../pixmaps/tb_paste.xpm"
-#include "../pixmaps/tb_find.xpm"
-#include "../pixmaps/tb_find_next.xpm"
-#include "../pixmaps/tb_find_prev.xpm"
-#include "../pixmaps/tb_find_help.xpm"
-#include "../pixmaps/tb_exit.xpm"
-#include "../pixmaps/tb_undo.xpm"
-#include "../pixmaps/tb_redo.xpm"
-#include "../pixmaps/tb_help.xpm"
-#include "../pixmaps/tb_macro.xpm"
-#include "../pixmaps/tb_make.xpm"
-#include "../pixmaps/tb_save_all.xpm"
-#include "../pixmaps/tb_jump.xpm"
-#include "../pixmaps/tb_ctags.xpm"
-#include "../pixmaps/tb_load_session.xpm"
-#include "../pixmaps/tb_save_session.xpm"
-#include "../pixmaps/tb_new_session.xpm"
-#include "../pixmaps/tb_blank.xpm"
-#include "../pixmaps/tb_maximize.xpm"
-#include "../pixmaps/tb_split.xpm"
-#include "../pixmaps/tb_minimize.xpm"
-#include "../pixmaps/tb_shell.xpm"
-#include "../pixmaps/tb_replace.xpm"
-#include "../pixmaps/tb_vsplit.xpm"
-#include "../pixmaps/tb_maxwidth.xpm"
-#include "../pixmaps/tb_minwidth.xpm"
-
-/*
- * Those are the pixmaps used for the default buttons.
- */
-static char **(built_in_pixmaps[]) =
-{
-    tb_new_xpm,
-    tb_open_xpm,
-    tb_save_xpm,
-    tb_undo_xpm,
-    tb_redo_xpm,
-    tb_cut_xpm,
-    tb_copy_xpm,
-    tb_paste_xpm,
-    tb_print_xpm,
-    tb_help_xpm,
-    tb_find_xpm,
-    tb_save_all_xpm,
-    tb_save_session_xpm,
-    tb_new_session_xpm,
-    tb_load_session_xpm,
-    tb_macro_xpm,
-    tb_replace_xpm,
-    tb_close_xpm,
-    tb_maximize_xpm,
-    tb_minimize_xpm,
-    tb_split_xpm,
-    tb_shell_xpm,
-    tb_find_prev_xpm,
-    tb_find_next_xpm,
-    tb_find_help_xpm,
-    tb_make_xpm,
-    tb_jump_xpm,
-    tb_ctags_xpm,
-    tb_vsplit_xpm,
-    tb_maxwidth_xpm,
-    tb_minwidth_xpm,
-    tb_exit_xpm
-};
-
-static void createXpmImages __ARGS((char_u *path, char **xpm, Pixmap *sen, Pixmap *insen));
-
-/*
- * Allocated a pixmap for toolbar menu "menu".
- * Return in "sen" and "insen".  "insen" can be NULL.
- */
-    void
-get_toolbar_pixmap(menu, sen, insen)
-    vimmenu_T	*menu;
-    Pixmap	*sen;
-    Pixmap	*insen;
-{
-    char_u	buf[MAXPATHL];		/* buffer storing expanded pathname */
-    char	**xpm = NULL;		/* xpm array */
-
-    buf[0] = NUL;			/* start with NULL path */
-
-    if (menu->iconfile != NULL)
-    {
-	/* Use the "icon="  argument. */
-	gui_find_iconfile(menu->iconfile, buf, "xpm");
-	createXpmImages(buf, NULL, sen, insen);
-
-	/* If it failed, try using the menu name. */
-	if (*sen == (Pixmap)0 && gui_find_bitmap(menu->name, buf, "xpm") == OK)
-	    createXpmImages(buf, NULL, sen, insen);
-	if (*sen != (Pixmap)0)
-	    return;
-    }
-
-    if (menu->icon_builtin || gui_find_bitmap(menu->name, buf, "xpm") == FAIL)
-    {
-	if (menu->iconidx >= 0 && menu->iconidx
-		   < (sizeof(built_in_pixmaps) / sizeof(built_in_pixmaps[0])))
-	    xpm = built_in_pixmaps[menu->iconidx];
-	else
-	    xpm = tb_blank_xpm;
-    }
-
-    if (xpm != NULL || buf[0] != NUL)
-	createXpmImages(buf, xpm, sen, insen);
-}
-
-/* Indices for named colors */
-#define BACKGROUND	0
-#define FOREGROUND	1
-#define BOTTOM_SHADOW	2
-#define TOP_SHADOW	3
-#define HIGHLIGHT	4
-
-/*
- * Read an Xpm file, doing color substitutions for the foreground and
- * background colors. If there is an error reading a color xpm file,
- * drop back and read the monochrome file. If successful, create the
- * insensitive Pixmap too.
- */
-    static void
-createXpmImages(path, xpm, sen, insen)
-    char_u	*path;
-    char	**xpm;
-    Pixmap	*sen;
-    Pixmap	*insen;	    /* can be NULL */
-{
-    Window	rootWindow;
-    XpmAttributes attrs;
-    XpmColorSymbol color[5] =
-    {
-	{"none", "none", 0},
-	{"iconColor1", NULL, 0},
-	{"bottomShadowColor", NULL, 0},
-	{"topShadowColor", NULL, 0},
-	{"selectColor", NULL, 0}
-    };
-    int		screenNum;
-    int		status;
-    Pixmap	mask;
-    Pixmap	map;
-
-    gui_mch_get_toolbar_colors(
-	    &color[BACKGROUND].pixel,
-	    &color[FOREGROUND].pixel,
-	    &color[BOTTOM_SHADOW].pixel,
-	    &color[TOP_SHADOW].pixel,
-	    &color[HIGHLIGHT].pixel);
-
-    /* Setup the color subsititution table */
-    attrs.valuemask = XpmColorSymbols;
-    attrs.colorsymbols = color;
-    attrs.numsymbols = 5;
-
-    screenNum = DefaultScreen(gui.dpy);
-    rootWindow = RootWindow(gui.dpy, screenNum);
-
-    /* Create the "sensitive" pixmap */
-    if (xpm != NULL)
-	status = XpmCreatePixmapFromData(gui.dpy, rootWindow, xpm,
-							 &map, &mask, &attrs);
-    else
-	status = XpmReadFileToPixmap(gui.dpy, rootWindow, (char *)path,
-							 &map, &mask, &attrs);
-    if (status == XpmSuccess && map != 0)
-    {
-	XGCValues   gcvalues;
-	GC	    back_gc;
-	GC	    mask_gc;
-
-	/* Need to create new Pixmaps with the mask applied. */
-	gcvalues.foreground = color[BACKGROUND].pixel;
-	back_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
-	mask_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
-	XSetClipMask(gui.dpy, mask_gc, mask);
-
-	/* Create the "sensitive" pixmap. */
-	*sen = XCreatePixmap(gui.dpy, rootWindow,
-		 attrs.width, attrs.height,
-		 DefaultDepth(gui.dpy, screenNum));
-	XFillRectangle(gui.dpy, *sen, back_gc, 0, 0,
-		attrs.width, attrs.height);
-	XCopyArea(gui.dpy, map, *sen, mask_gc, 0, 0,
-		attrs.width, attrs.height, 0, 0);
-
-#ifdef FEAT_GUI_MOTIF	/* not used for Athena */
-	if (insen != NULL)
-	{
-	    int		x, y;
-	    int		startX;
-
-	    /* Create the "insensitive" pixmap.  It's a copy of the "sensitive"
-	     * pixmap with half the pixels set to the background color. */
-	    *insen = XCreatePixmap(gui.dpy, rootWindow,
-		    attrs.width, attrs.height,
-		    DefaultDepth(gui.dpy, screenNum));
-	    XCopyArea(gui.dpy, *sen, *insen, back_gc, 0, 0,
-		    attrs.width, attrs.height, 0, 0);
-	    for (y = 0; y < attrs.height; y++)
-	    {
-		if (y % 2 == 0)
-		    startX = 0;
-		else
-		    startX = 1;
-		for (x = startX; x < attrs.width; x += 2)
-		    XDrawPoint(gui.dpy, *insen, back_gc, x, y);
-	    }
-
-	}
-#endif
-	XFreeGC(gui.dpy, back_gc);
-	XFreeGC(gui.dpy, mask_gc);
-	XFreePixmap(gui.dpy, map);
-    }
-    else
-    {
-	*sen = 0;
-	if (insen != NULL)
-	    *insen = 0;
-    }
-
-    XpmFreeAttributes(&attrs);
-}
-#endif
-
 #if (defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL)) || defined(PROTO)
 /*
  * Set the balloon-eval used for the tooltip of a toolbar menu item.
diff --git a/src/proto/gui_x11.pro b/src/proto/gui_x11.pro
index 035c27f..f14e26f 100644
--- a/src/proto/gui_x11.pro
+++ b/src/proto/gui_x11.pro
@@ -66,6 +66,5 @@
 void gui_mch_destroy_sign __ARGS((void *sign));
 void gui_mch_mousehide __ARGS((int hide));
 void mch_set_mouse_shape __ARGS((int shape));
-void get_toolbar_pixmap __ARGS((vimmenu_T *menu, Pixmap *sen, Pixmap *insen));
 void gui_mch_menu_set_tip __ARGS((vimmenu_T *menu));
 /* vim: set ft=c : */
diff --git a/src/testdir/test54.in b/src/testdir/test54.in
index b3fbe72..82a8bdd 100644
--- a/src/testdir/test54.in
+++ b/src/testdir/test54.in
@@ -4,7 +4,7 @@
 :so small.vim
 :e xx
 :!rm -f test.out
-:au BufLeave <buffer> :!echo "buffer-local autommand in %" >> test.out
+:au BufLeave <buffer> :!echo buffer-local autommand in %>> test.out
 :e somefile           " here, autocommand for xx shall write test.out 
 :                     " but autocommand shall not apply to buffer named <buffer>
 :bwipe xx             " here, autocommand shall be auto-deleted