updated for version 7.0189
diff --git a/src/diff.c b/src/diff.c
index b095854..22e18f3 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1893,6 +1893,7 @@
     buf_T	*buf;
     int		start_skip, end_skip;
     int		new_count;
+    int		buf_empty;
 
     /* Find the current buffer in the list of diff buffers. */
     idx_cur = diff_buf_idx(curbuf);
@@ -2047,9 +2048,12 @@
 		    end_skip = 0;
 	    }
 
+	    buf_empty = FALSE;
 	    added = 0;
 	    for (i = 0; i < count; ++i)
 	    {
+		/* remember deleting the last line of the buffer */
+		buf_empty = curbuf->b_ml.ml_line_count == 1;
 		ml_delete(lnum, FALSE);
 		--added;
 	    }
@@ -2066,6 +2070,13 @@
 		    ml_append(lnum + i - 1, p, 0, FALSE);
 		    vim_free(p);
 		    ++added;
+		    if (buf_empty && curbuf->b_ml.ml_line_count == 2)
+		    {
+			/* Added the first line into an empty buffer, need to
+			 * delete the dummy empty line. */
+			buf_empty = FALSE;
+			ml_delete((linenr_T)2, FALSE);
+		    }
 		}
 	    }
 	    new_count = dp->df_count[idx_to] + added;
diff --git a/src/edit.c b/src/edit.c
index e331c4c..f384229 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -111,8 +111,7 @@
 static int  ins_compl_make_cyclic __ARGS((void));
 static void ins_compl_upd_pum __ARGS((void));
 static void ins_compl_del_pum __ARGS((void));
-static int pum_wanted __ARGS((void));
-static void ins_compl_show_pum __ARGS((void));
+static int  pum_wanted __ARGS((void));
 static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
 static void ins_compl_free __ARGS((void));
 static void ins_compl_clear __ARGS((void));
@@ -2193,7 +2192,7 @@
 /*
  * Show the popup menu for the list of matches.
  */
-    static void
+    void
 ins_compl_show_pum()
 {
     compl_T     *compl;
@@ -2266,13 +2265,14 @@
 	pum_display(compl_match_array, compl_match_arraysize, cur,
 		  curwin->w_cline_row + W_WINROW(curwin),
 		  curwin->w_cline_height,
-		  curwin->w_wcol + W_WINCOL(curwin));
+		  curwin->w_wcol + W_WINCOL(curwin) - curwin->w_leftcol);
 	curwin->w_cursor.col = col;
     }
 }
 
 #define DICT_FIRST	(1)	/* use just first element in "dict" */
 #define DICT_EXACT	(2)	/* "dict" is the exact name of a file */
+
 /*
  * Add any identifiers that match the given pattern to the list of
  * completions.
@@ -2842,6 +2842,8 @@
 	    ((char_u **)ga.ga_data)[ga.ga_len] = vim_strsave(p);
 	    ++ga.ga_len;
 	}
+	else if (did_emsg)
+	    break;
     }
 
     list_unref(matchlist);
@@ -3367,9 +3369,6 @@
 	/* may undisplay the popup menu first */
 	ins_compl_upd_pum();
 
-	/* Display the current match. */
-	update_screen(0);
-
 	/* display the updated popup menu */
 	ins_compl_show_pum();
 
@@ -7216,7 +7215,7 @@
 	 */
 	if (	   mode == BACKSPACE_CHAR
 		&& ((p_sta && in_indent)
-		    || (curbuf->b_p_sts
+		    || (curbuf->b_p_sts != 0
 			&& (*(ml_get_cursor() - 1) == TAB
 			    || (*(ml_get_cursor() - 1) == ' '
 				&& (!*inserted_space_p
@@ -7228,7 +7227,7 @@
 	    int		extra = 0;
 
 	    *inserted_space_p = FALSE;
-	    if (p_sta)
+	    if (p_sta && in_indent)
 		ts = curbuf->b_p_sw;
 	    else
 		ts = curbuf->b_p_sts;
diff --git a/src/eval.c b/src/eval.c
index 47fccbc..cfcc9d4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -517,7 +517,6 @@
 static void f_getftime __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getftype __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getline __ARGS((typval_T *argvars, typval_T *rettv));
-static void f_getloclist __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getregtype __ARGS((typval_T *argvars, typval_T *rettv));
@@ -6866,7 +6865,7 @@
     {"getftime",	1, 1, f_getftime},
     {"getftype",	1, 1, f_getftype},
     {"getline",		1, 2, f_getline},
-    {"getloclist",	1, 1, f_getloclist},
+    {"getloclist",	1, 1, f_getqflist},
     {"getqflist",	0, 0, f_getqflist},
     {"getreg",		0, 2, f_getreg},
     {"getregtype",	0, 1, f_getregtype},
@@ -7179,7 +7178,8 @@
 
 /*
  * Call a function with its resolved parameters
- * Return OK or FAIL.
+ * Return OK when the function can't be called,  FAIL otherwise.
+ * Also returns OK when an error was encountered while executing the function.
  */
     static int
 call_func(name, len, rettv, argcount, argvars, firstline, lastline,
@@ -8829,7 +8829,7 @@
     int		rem;
     int		todo;
     char_u	*msg = map ? (char_u *)"map()" : (char_u *)"filter()";
-
+    int		save_called_emsg;
 
     rettv->vval.v_number = 0;
     if (argvars[0].v_type == VAR_LIST)
@@ -8859,6 +8859,12 @@
 	prepare_vimvar(VV_VAL, &save_val);
 	expr = skipwhite(expr);
 
+	/* We reset "called_emsg" to be able to detect whether an error
+	 * occurred during evaluation of the expression.  "did_emsg" can't be
+	 * used, because it is reset when calling a function. */
+	save_called_emsg = called_emsg;
+	called_emsg = FALSE;
+
 	if (argvars[0].v_type == VAR_DICT)
 	{
 	    prepare_vimvar(VV_KEY, &save_key);
@@ -8876,7 +8882,8 @@
 		    if (tv_check_lock(di->di_tv.v_lock, msg))
 			break;
 		    vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
-		    if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL)
+		    if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
+							       || called_emsg)
 			break;
 		    if (!map && rem)
 			dictitem_remove(d, di);
@@ -8894,7 +8901,8 @@
 		if (tv_check_lock(li->li_tv.v_lock, msg))
 		    break;
 		nli = li->li_next;
-		if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL)
+		if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
+							       || called_emsg)
 		    break;
 		if (!map && rem)
 		    listitem_remove(l, li);
@@ -8902,6 +8910,8 @@
 	}
 
 	restore_vimvar(VV_VAL, &save_val);
+
+	called_emsg |= save_called_emsg;
     }
 
     copy_tv(&argvars[0], rettv);
@@ -9795,18 +9805,18 @@
     get_buffer_lines(curbuf, lnum, end, retlist, rettv);
 }
 
-static void get_qf_ll_ist __ARGS((win_T *wp, typval_T *rettv));
-
 /*
- * Shared by getqflist() and getloclist() functions
+ * "getqflist()" and "getloclist()" functions
  */
+/*ARGSUSED*/
     static void
-get_qf_ll_ist(wp, rettv)
-    win_T	*wp;
+f_getqflist(argvars, rettv)
+    typval_T	*argvars;
     typval_T	*rettv;
 {
 #ifdef FEAT_QUICKFIX
     list_T	*l;
+    win_T	*wp;
 #endif
 
     rettv->vval.v_number = FALSE;
@@ -9817,40 +9827,17 @@
 	rettv->vval.v_list = l;
 	rettv->v_type = VAR_LIST;
 	++l->lv_refcount;
+	wp = NULL;
+	if (argvars[0].v_type != VAR_UNKNOWN)	/* getloclist() */
+	{
+	    wp = find_win_by_nr(&argvars[0]);
+	    if (wp == NULL)
+		return;
+	}
+
 	(void)get_errorlist(wp, l);
     }
 #endif
-
-}
-
-/*
- * "getloclist()" function
- */
-/*ARGSUSED*/
-    static void
-f_getloclist(argvars, rettv)
-    typval_T	*argvars;
-    typval_T	*rettv;
-{
-    win_T	*win;
-
-    rettv->vval.v_number = FALSE;
-
-    win = find_win_by_nr(&argvars[0]);
-    if (win != NULL)
-	get_qf_ll_ist(win, rettv);
-}
-
-/*
- * "getqflist()" function
- */
-/*ARGSUSED*/
-    static void
-f_getqflist(argvars, rettv)
-    typval_T	*argvars;
-    typval_T	*rettv;
-{
-    get_qf_ll_ist(NULL, rettv);
 }
 
 /*
diff --git a/src/os_unix.c b/src/os_unix.c
index 374d85e..4a339f9 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5122,10 +5122,7 @@
 	    for (j = 0; pat[i][j] != NUL; ++j)
 	    {
 		if (pat[i][j] == '`')
-		{
 		    intick = !intick;
-		    *p++ = pat[i][j];
-		}
 		else if (pat[i][j] == '\\' && pat[i][j + 1] != NUL)
 		{
 		    /* Remove a backslash, take char literally.  But keep
@@ -5134,19 +5131,16 @@
 		    if (intick
 			  || vim_strchr(SHELL_SPECIAL, pat[i][j + 1]) != NULL)
 			*p++ = '\\';
-		    *p++ = pat[i][++j];
+		    ++j;
 		}
 		else if (!intick && vim_strchr(SHELL_SPECIAL,
 							   pat[i][j]) != NULL)
-		{
 		    /* Put a backslash before a special character, but not
 		     * when inside ``. */
 		    *p++ = '\\';
-		    *p++ = pat[i][j];
-		}
-		else
-		    /* Simply copy the character. */
-		    *p++ = pat[i][++j];
+
+		/* Copy one character. */
+		*p++ = pat[i][j];
 	    }
 	    *p = NUL;
 #endif
diff --git a/src/proto/edit.pro b/src/proto/edit.pro
index 84ad8fb..27594f0 100644
--- a/src/proto/edit.pro
+++ b/src/proto/edit.pro
@@ -9,6 +9,7 @@
 int vim_is_ctrl_x_key __ARGS((int c));
 int ins_compl_add_infercase __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
 int ins_compl_add __ARGS((char_u *str, int len, char_u *fname, int dir, int flags));
+void ins_compl_show_pum __ARGS((void));
 char_u *find_word_start __ARGS((char_u *ptr));
 char_u *find_word_end __ARGS((char_u *ptr));
 void ins_compl_check_keys __ARGS((int frequency));
diff --git a/src/quickfix.c b/src/quickfix.c
index ff3e4ce..ca6cc40 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3318,7 +3318,7 @@
 
     if (wp != NULL)
     {
-	qi = ll_get_or_alloc_list(curwin);
+	qi = ll_get_or_alloc_list(wp);
 	if (qi == NULL)
 	    return FAIL;
     }
diff --git a/src/search.c b/src/search.c
index 5e370b8..bcb23aa 100644
--- a/src/search.c
+++ b/src/search.c
@@ -521,6 +521,7 @@
     int		match_ok;
     long	nmatched;
     int		submatch = 0;
+    int		save_called_emsg = called_emsg;
 #ifdef FEAT_SEARCH_EXTRA
     int		break_loop = FALSE;
 #else
@@ -552,9 +553,9 @@
     else
 	extra_col = 1;
 
-/*
- * find the string
- */
+    /*
+     * find the string
+     */
     called_emsg = FALSE;
     do	/* loop for count */
     {
@@ -865,6 +866,8 @@
 
     vim_free(regmatch.regprog);
 
+    called_emsg |= save_called_emsg;
+
     if (!found)		    /* did not find it */
     {
 	if (got_int)
diff --git a/src/term.c b/src/term.c
index 2dbe555..e5f2c9a 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3140,7 +3140,15 @@
 	else
 	{
 	    update_topline();
-	    update_screen(NOT_VALID);
+#if defined(FEAT_INS_EXPAND)
+	    if (pum_visible())
+	    {
+		redraw_later(NOT_VALID);
+		ins_compl_show_pum(); /* This includes the redraw. */
+	    }
+	    else
+#endif
+		update_screen(NOT_VALID);
 	    if (redrawing())
 		setcursor();
 	}
diff --git a/src/version.h b/src/version.h
index 522ec90..e625318 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 Jan 26)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 26, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 29, compiled "