updated for version 7.0167
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index f23e59b..8535d5c 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 10
+*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 11
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -30,12 +30,6 @@
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-When a buffer has no name, ":w >>fname" uses "fname" for the buffer, that is
-not logical.
-
-SwapExists with editexisting plugin: Is there a simple way to detect ":tag
-function" and have the remote Vim jump to the tag?
-
 When editing a file "a" that is a symbolic link to "b", while another Vim is
 editing "b", there is no warning.  Follow symlink to make swap file name?
 Patch from Stefano Zacchiroli.  Updated by James Vega, Dec 2.
@@ -156,6 +150,8 @@
 Complete command names by searching in $PATH.  When completing file names
 escape special characters ";&<>(){}". (Adri Verhoef)
 
+Are there more commands where v:swapcommand can be set to something useful?
+
 Awaiting response:
 -   Win32: tearoff menu window should have a scrollbar when it's taller than
     the screen.
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 0970249..a8acdda 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Dec 09
+*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Dec 11
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -400,12 +400,8 @@
 |:diffoff|		Switch off diff mode in the current window or in all
 			windows.
 
-|:keepalt|		Do not change the alternate file.
-
 |:delmarks|		Delete marks.
 
-|:sandbox|		Command modifier: execute the argument in the sandbox.
-
 |:exusage|		Help for Ex commands (Nvi command).
 
 |:viusage|		Help for Vi commands (Nvi command).
@@ -422,6 +418,14 @@
 |:cexpr|		Read error messages from a Vim expression (Yegappan
 			Lakshmanan).
 
+Ex command modifiers: ~
+
+|:keepalt|		Do not change the alternate file.
+
+|:noautocmd|		Do not trigger autocommand events.
+
+|:sandbox|		Execute a command in the sandbox.
+
 
 New and extended functions: ~
 
@@ -607,6 +611,12 @@
 The |v:scrollstart| variable has been added to help finding the location in
 your script that causes the hit-enter prompt.
 
+To make it possible to handle the situation that a file is being edited that
+is already being edited by another Vim instance, the |SwapExists| event has
+been added.  The |v:swapname|, |v:swapchoice| and |v:swapcommand| variables
+can be used, for example to use the |client-server| functionality to bring the
+other Vim to the foreground.
+
 ==============================================================================
 IMPROVEMENTS						*improvements-7*
 
@@ -854,6 +864,11 @@
 In the ATTENTION prompt put the "Delete it" choice before "Quit" to make it
 more logical.  (Robert Webb)
 
+When appending to a file while the buffer has no name the name of the appended
+file would be used for the current buffer.  But the buffer contents is
+actually different from the file content.  Don't set the file name, unless the
+'P' flag is present in 'cpoptions'.
+
 ==============================================================================
 COMPILE TIME CHANGES					*compile-changes-7*
 
@@ -1350,7 +1365,7 @@
 given.  Now report the first encountered error.
 
 When using ":e ++enc=name file" and iconv() was used for conversion an error
-caused a fallback to no conversion.  Now replace a character with '?' and
+caused a fall-back to no conversion.  Now replace a character with '?' and
 continue.
 
 When opening a new buffer the local value of 'bomb' was not initialized from
@@ -1417,4 +1432,10 @@
 
 Unix: ":w a;b~c" caused an error in expanding wildcards.
 
+When appending to a file with ":w >>fname" in a buffer without a name, causing
+the buffer to use "fname", the modified flag was reset.
+
+When appending to to current file the "not edited" flag would be reset.
+":w" would overwrite the file accidentally.
+
  vim:tw=78:ts=8:ft=help:norl:
diff --git a/src/eval.c b/src/eval.c
index 0477222..a3bf58d 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -340,6 +340,7 @@
     {VV_NAME("scrollstart",	 VAR_STRING), 0},
     {VV_NAME("swapname",	 VAR_STRING), VV_RO},
     {VV_NAME("swapchoice",	 VAR_STRING), 0},
+    {VV_NAME("swapcommand",	 VAR_STRING), VV_RO},
 };
 
 /* shorthand */
diff --git a/src/main.c b/src/main.c
index 19bdb09..bd40c6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3492,6 +3492,15 @@
     redir_off = save_ro;
     --emsg_skip;
 
+    /* A client can tell us to redraw, but not to display the cursor, so do
+     * that here. */
+    setcursor();
+    out_flush();
+#ifdef FEAT_GUI
+    if (gui.in_use)
+	gui_update_cursor(FALSE, FALSE);
+#endif
+
     return res;
 }