Update runtime files
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index e4433d6..714bc65 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 8.0.  Last change: 2017 Aug 01
+*editing.txt*   For Vim version 8.0.  Last change: 2017 Aug 21
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1109,6 +1109,7 @@
 			window in the current tab page the current tab page is
 			closed |tab-page|.
 			Triggers the |QuitPre| autocommand event.
+			See |CTRL-W_q| for quitting another window.
 
 :conf[irm] q[uit]	Quit, but give prompt when changes have been made, or
 			the last file in the argument list has not been
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a1a76f9..7205c89 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 8.0.  Last change: 2017 Aug 11
+*eval.txt*	For Vim version 8.0.  Last change: 2017 Aug 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -5225,6 +5225,7 @@
 job_start({command} [, {options}])			*job_start()*
 		Start a job and return a Job object.  Unlike |system()| and
 		|:!cmd| this does not wait for the job to finish.
+		To start a job in a terminal window see |term_start()|.
 
 		{command} can be a String.  This works best on MS-Windows.  On
 		Unix it is split up in white-separated parts to be passed to
@@ -5963,7 +5964,7 @@
 		a non-empty String (|non-zero-arg|), then the full mode is
 		returned, otherwise only the first letter is returned.
 
-			n	Normal
+			n	Normal, Terminal-Normal
 			no	Operator-pending
 			v	Visual by character
 			V	Visual by line
@@ -5985,6 +5986,7 @@
 			rm	The -- more -- prompt
 			r?	A |:confirm| query of some sort
 			!	Shell or external command is executing
+			t	Terminal-Job mode: keys go to the job
 		This is useful in the 'statusline' option or when used
 		with |remote_expr()| In most other places it always returns
 		"c" or "n".
@@ -7720,12 +7722,12 @@
 		   the text is "123456" and both "23" and "45" are concealed
 		   and replace by the character "X", then:
 			call			returns ~
-		   	synconcealed(lnum, 1)   [0, '', 0]
-		   	synconcealed(lnum, 2)   [1, 'X', 1]
-		   	synconcealed(lnum, 3)   [1, 'X', 1]
-		   	synconcealed(lnum, 4)   [1, 'X', 2]
-		   	synconcealed(lnum, 5)   [1, 'X', 2]
-		   	synconcealed(lnum, 6)   [0, '', 0]
+			synconcealed(lnum, 1)   [0, '', 0]
+			synconcealed(lnum, 2)   [1, 'X', 1]
+			synconcealed(lnum, 3)   [1, 'X', 1]
+			synconcealed(lnum, 4)   [1, 'X', 2]
+			synconcealed(lnum, 5)   [1, 'X', 2]
+			synconcealed(lnum, 6)   [0, '', 0]
 
 
 synstack({lnum}, {col})					*synstack()*
@@ -8633,7 +8635,7 @@
 					(only in Visual mode)
 			visual_chars    Number of chars visually selected
 					(only in Visual mode)
-			visual_words    Number of chars visually selected
+			visual_words    Number of words visually selected
 					(only in Visual mode)
 
 
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 10c729d..a66fbb3 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -1,4 +1,4 @@
-*gui.txt*       For Vim version 8.0.  Last change: 2017 Jul 15
+*gui.txt*       For Vim version 8.0.  Last change: 2017 Aug 27
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -67,7 +67,7 @@
     executed as an Ex command.
   - If the user gvimrc file exists, it is sourced.  The name of this file is
     normally "$HOME/.gvimrc".  You can check this with ":version".
-  - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
+  - For Win32, $HOME is set by Vim if needed, see |$HOME-windows|.
   - When a "_gvimrc" file is not found, ".gvimrc" is tried too.  And vice
     versa.
   The name of the first file found is stored in $MYGVIMRC, unless it was
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index 27f0cc6..287a1d6 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -1,4 +1,4 @@
-*intro.txt*     For Vim version 8.0.  Last change: 2017 Aug 05
+*intro.txt*     For Vim version 8.0.  Last change: 2017 Aug 24
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -839,10 +839,12 @@
 ==============================================================================
 8. Definitions						*definitions*
 
+  buffer		Contains lines of text, usually read from a file.
   screen		The whole area that Vim uses to work in.  This can be
 			a terminal emulator window.  Also called "the Vim
 			window".
-  window		A view on a buffer.
+  window		A view on a buffer.  There can be multiple windows for
+			one buffer.
 
 A screen contains one or more windows, separated by status lines and with the
 command line at the bottom.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ff7bb8f..943bdce 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 8.0.  Last change: 2017 Jul 31
+*options.txt*	For Vim version 8.0.  Last change: 2017 Aug 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -417,12 +417,13 @@
 contain non-id characters then.  Note that if you want to use this for the
 "gf" command, you need to add the '{' and '}' characters to 'isfname'.
 
-On MS-Windows, if $HOME is not defined as an environment variable, then
-at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
-
 NOTE: expanding environment variables and "~/" is only done with the ":set"
 command, not when assigning a value to an option with ":let".
 
+							*$HOME-windows*
+On MS-Windows, if $HOME is not defined as an environment variable, then
+at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
+
 
 Note the maximum length of an expanded option is limited.  How much depends on
 the system, mostly it is something like 256 or 1024 characters.
@@ -889,6 +890,10 @@
 	"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
 	background.  Otherwise the default is "light".
 
+	The |:terminal| command and the |term_start()| function use the
+	'background' value to decide whether the terminal window will start
+	with a white or black background.
+
 	Normally this option would be set in the .vimrc file.  Possibly
 	depending on the terminal name.  Example: >
 		:if &term == "pcterm"
@@ -4041,7 +4046,7 @@
 				     x:PmenuSbar,X:PmenuThumb,*:TabLine,
 				     #:TabLineSel,_:TabLineFill,!:CursorColumn,
 				     .:CursorLine,o:ColorColumn,q:QuickFixLine,
-				     $:StatusLineTerm")
+				     z:StatusLineTerm,Z:StatusLineTermNC")
 			global
 			{not in Vi}
 	This option can be used to set highlighting mode for various
@@ -5723,18 +5728,6 @@
 <	Replace the ';' with a ':' or whatever separator is used.  Note that
 	this doesn't work when $INCL contains a comma or white space.
 
-						*'perldll'*
-'perldll'		string	(default depends on the build)
-			global
-			{not in Vi}
-			{only available when compiled with the |+perl/dyn|
-			feature}
-	Specifies the name of the Perl shared library. The default is
-	DYNAMIC_PERL_DLL, which was specified at compile time.
-	Environment variables are expanded |:set_env|.
-	This option cannot be set from a |modeline| or in the |sandbox|, for
-	security reasons.
-
 			*'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
 'preserveindent' 'pi'	boolean	(default off)
 			local to buffer
@@ -8839,7 +8832,7 @@
 			feature on MS-Windows}
 	Specifies the name of the winpty shared library, used for the
 	|:terminal| command. The default depends on whether was build as a
-	32-bit or 64-bit executable.  If not found, "win32pty.dll" is tried as
+	32-bit or 64-bit executable.  If not found, "winpty.dll" is tried as
 	a fallback.
 	Environment variables are expanded |:set_env|.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 00075b3..326b405 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt*  For Vim version 8.0.  Last change: 2017 Aug 01
+*quickref.txt*  For Vim version 8.0.  Last change: 2017 Aug 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -974,6 +974,7 @@
 'winfixwidth'	  'wfw'     keep window width when opening/closing windows
 'winminheight'	  'wmh'     minimum number of lines for any window
 'winminwidth'	  'wmw'     minimal number of columns for any window
+'winptydll'		    name of the winpty dynamic library
 'winwidth'	  'wiw'     minimal number of columns for current window
 'wrap'			    long lines wrap and continue on the next line
 'wrapmargin'	  'wm'	    chars from the right where wrapping starts
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index dda2e66..feeadb3 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 8.0.  Last change: 2017 Jul 14
+*syntax.txt*	For Vim version 8.0.  Last change: 2017 Aug 12
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -2138,6 +2138,16 @@
 	:let msql_minlines = 200
 
 
+N1QL						*n1ql.vim* *ft-n1ql-syntax*
+
+N1QL is a SQL-like declarative language for manipulating JSON documents in
+Couchbase Server databases.
+
+Vim syntax highlights N1QL statements, keywords, operators, types, comments,
+and special values.  Vim ignores syntactical elements specific to SQL or its
+many dialects, like COLUMN or CHAR, that don't exist in N1QL.
+
+
 NCF						*ncf.vim* *ft-ncf-syntax*
 
 There is one option for NCF syntax highlighting.
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 2068f9e..f2c2518 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -746,7 +746,6 @@
 'path'	options.txt	/*'path'*
 'pdev'	options.txt	/*'pdev'*
 'penc'	options.txt	/*'penc'*
-'perldll'	options.txt	/*'perldll'*
 'pex'	options.txt	/*'pex'*
 'pexpr'	options.txt	/*'pexpr'*
 'pfn'	options.txt	/*'pfn'*
@@ -935,6 +934,7 @@
 't_Co'	term.txt	/*'t_Co'*
 't_Cs'	term.txt	/*'t_Cs'*
 't_DL'	term.txt	/*'t_DL'*
+'t_EC'	term.txt	/*'t_EC'*
 't_EI'	term.txt	/*'t_EI'*
 't_F1'	term.txt	/*'t_F1'*
 't_F2'	term.txt	/*'t_F2'*
@@ -972,11 +972,15 @@
 't_PS'	term.txt	/*'t_PS'*
 't_RB'	term.txt	/*'t_RB'*
 't_RI'	term.txt	/*'t_RI'*
+'t_RS'	term.txt	/*'t_RS'*
 't_RV'	term.txt	/*'t_RV'*
+'t_SC'	term.txt	/*'t_SC'*
+'t_SH'	term.txt	/*'t_SH'*
 't_SI'	term.txt	/*'t_SI'*
 't_SR'	term.txt	/*'t_SR'*
 't_Sb'	term.txt	/*'t_Sb'*
 't_Sf'	term.txt	/*'t_Sf'*
+'t_VS'	term.txt	/*'t_VS'*
 't_WP'	term.txt	/*'t_WP'*
 't_WS'	term.txt	/*'t_WS'*
 't_ZH'	term.txt	/*'t_ZH'*
@@ -1167,6 +1171,7 @@
 'winheight'	options.txt	/*'winheight'*
 'winminheight'	options.txt	/*'winminheight'*
 'winminwidth'	options.txt	/*'winminwidth'*
+'winptydll'	options.txt	/*'winptydll'*
 'winwidth'	options.txt	/*'winwidth'*
 'wiv'	options.txt	/*'wiv'*
 'wiw'	options.txt	/*'wiw'*
@@ -4537,6 +4542,7 @@
 E945	pattern.txt	/*E945*
 E946	terminal.txt	/*E946*
 E947	terminal.txt	/*E947*
+E948	terminal.txt	/*E948*
 E95	message.txt	/*E95*
 E96	diff.txt	/*E96*
 E97	diff.txt	/*E97*
@@ -6134,6 +6140,7 @@
 ft-mma-syntax	syntax.txt	/*ft-mma-syntax*
 ft-moo-syntax	syntax.txt	/*ft-moo-syntax*
 ft-msql-syntax	syntax.txt	/*ft-msql-syntax*
+ft-n1ql-syntax	syntax.txt	/*ft-n1ql-syntax*
 ft-nasm-syntax	syntax.txt	/*ft-nasm-syntax*
 ft-ncf-syntax	syntax.txt	/*ft-ncf-syntax*
 ft-nroff-syntax	syntax.txt	/*ft-nroff-syntax*
@@ -7377,6 +7384,7 @@
 mzscheme-vimext	if_mzsch.txt	/*mzscheme-vimext*
 mzscheme-window	if_mzsch.txt	/*mzscheme-window*
 n	pattern.txt	/*n*
+n1ql.vim	syntax.txt	/*n1ql.vim*
 nasm.vim	syntax.txt	/*nasm.vim*
 navigation	motion.txt	/*navigation*
 nb-commands	netbeans.txt	/*nb-commands*
@@ -7720,6 +7728,7 @@
 no_buffers_menu	gui.txt	/*no_buffers_menu*
 no_mail_maps	filetype.txt	/*no_mail_maps*
 no_plugin_maps	filetype.txt	/*no_plugin_maps*
+nocombine	syntax.txt	/*nocombine*
 non-greedy	pattern.txt	/*non-greedy*
 non-zero-arg	eval.txt	/*non-zero-arg*
 none-variable	eval.txt	/*none-variable*
@@ -8537,12 +8546,14 @@
 t_BD	term.txt	/*t_BD*
 t_BE	term.txt	/*t_BE*
 t_CS	term.txt	/*t_CS*
+t_CTRL-W_CTRL-C	terminal.txt	/*t_CTRL-W_CTRL-C*
 t_CTRL-\_CTRL-N	terminal.txt	/*t_CTRL-\\_CTRL-N*
 t_CV	term.txt	/*t_CV*
 t_Ce	term.txt	/*t_Ce*
 t_Co	term.txt	/*t_Co*
 t_Cs	term.txt	/*t_Cs*
 t_DL	term.txt	/*t_DL*
+t_EC	term.txt	/*t_EC*
 t_EI	term.txt	/*t_EI*
 t_F1	term.txt	/*t_F1*
 t_F2	term.txt	/*t_F2*
@@ -8580,11 +8591,15 @@
 t_PS	term.txt	/*t_PS*
 t_RB	term.txt	/*t_RB*
 t_RI	term.txt	/*t_RI*
+t_RS	term.txt	/*t_RS*
 t_RV	term.txt	/*t_RV*
+t_SC	term.txt	/*t_SC*
+t_SH	term.txt	/*t_SH*
 t_SI	term.txt	/*t_SI*
 t_SR	term.txt	/*t_SR*
 t_Sb	term.txt	/*t_Sb*
 t_Sf	term.txt	/*t_Sf*
+t_VS	term.txt	/*t_VS*
 t_WP	term.txt	/*t_WP*
 t_WS	term.txt	/*t_WS*
 t_ZH	term.txt	/*t_ZH*
@@ -8827,6 +8842,7 @@
 terminal	terminal.txt	/*terminal*
 terminal-colors	os_unix.txt	/*terminal-colors*
 terminal-debug	terminal.txt	/*terminal-debug*
+terminal-functions	usr_41.txt	/*terminal-functions*
 terminal-info	term.txt	/*terminal-info*
 terminal-key-codes	term.txt	/*terminal-key-codes*
 terminal-options	term.txt	/*terminal-options*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 999a5f0..df11525 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -1,4 +1,4 @@
-*term.txt*      For Vim version 8.0.  Last change: 2017 Jul 21
+*term.txt*      For Vim version 8.0.  Last change: 2017 Aug 26
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -301,7 +301,7 @@
 	t_vb	visual bell					*t_vb* *'t_vb'*
 	t_ve	cursor visible					*t_ve* *'t_ve'*
 	t_vi	cursor invisible				*t_vi* *'t_vi'*
-	t_vs	cursor very visible				*t_vs* *'t_vs'*
+	t_vs	cursor very visible (blink)			*t_vs* *'t_vs'*
 								*t_xs* *'t_xs'*
 	t_xs	if non-empty, standout not erased by overwriting (hpterm)
 								*t_xn* *'t_xn'*
@@ -316,6 +316,7 @@
 	t_WP	set window position (Y, X) in pixels		*t_WP* *'t_WP'*
 	t_GP	get window position (Y, X) in pixels		*t_GP* *'t_GP'*
 	t_WS	set window size (height, width in cells)	*t_WS* *'t_WS'*
+	t_VS	cursor normally visible (no blink)		*t_VS* *'t_VS'*
 	t_SI	start insert mode (bar cursor shape)		*t_SI* *'t_SI'*
 	t_SR	start replace mode (underline cursor shape)	*t_SR* *'t_SR'*
 	t_EI	end insert or replace mode (block cursor shape)	*t_EI* *'t_EI'*
@@ -333,6 +334,28 @@
 		|xterm-bracketed-paste|
 	t_BD	disable bracketed paste mode			*t_BD* *'t_BD'*
 		|xterm-bracketed-paste|
+	t_SC	set cursor color start				*t_SC* *'t_SC'*
+	t_EC	set cursor color end				*t_EC* *'t_EC'*
+	t_SH	set cursor shape				*t_SH* *'t_SH'*
+	t_RS	request terminal cursor style			*t_RS* *'t_RS'*
+
+Some codes have a start, middle and end part.  The start and end are defined
+by the termcap option, the middle part is text.
+	set title text:     t_ts {title text} t_fs
+	set icon text:      t_IS {icon text} t_IE
+	set cursor color:   t_SC  {color name}  t_EC
+
+t_SH must take one argument:
+	0, 1 or none  	blinking block cursor
+	2	      	block cursor
+	3		blinking underline cursor
+	4		underline cursor
+	5		blinking vertical bar cursor
+	6		vertical bar cursor
+
+t_RS is sent only if the response to t_RV has been received.  It is not used
+on Mac OS when Terminal.app could be recognized from the termresponse.
+
 
 KEY CODES						*terminal-key-codes*
 Note: Use the <> form if possible
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index c7c3f85..fd0a0ac 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt*	For Vim version 8.0.  Last change: 2017 Aug 20
+*terminal.txt*	For Vim version 8.0.  Last change: 2017 Aug 26
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -19,6 +19,9 @@
 3. Debugging			|terminal-debug|
 
 {Vi does not have any of these commands}
+{only available when compiled with the |+terminal| feature}
+
+The terminal feature requires the |+multi_byte|, |+job| and |+channel| features.
 
 ==============================================================================
 1. Basic use						*terminal-use*
@@ -95,6 +98,8 @@
 			If [command] is provided run it as a job and connect
 			the input and output to the terminal.
 			If [command] is not given the 'shell' option is used.
+			if [command] is NONE no job is started, the pty of the
+			terminal can be used by a command like gdb.
 
 			A new buffer will be created, using [command] or
 			'shell' as the name, prefixed with a "!".  If a buffer
@@ -207,6 +212,19 @@
 It is not possible to enter Insert mode from Terminal-Job mode.
 
 
+Cursor style ~
+
+By default the cursor in the terminal window uses a not blinking block.  The
+normal xterm escape sequences can be used to change the blinking state and the
+shape.  Once focus leaves the terminal window Vim will restore the original
+cursor.
+
+An exception is when xterm is started with the "-bc" argument, or another way
+that causes the cursor to blink.  This actually means that the blinking flag
+is inverted.  Since Vim cannot detect this, the terminal window cursor
+blinking will also be inverted.
+
+
 Unix ~
 
 On Unix a pty is used to make it possible to run all kinds of commands.  You
@@ -269,23 +287,31 @@
 3. Debugging					*terminal-debug*
 
 The Terminal debugging plugin can be used to debug a program with gdb and view
-the source code in a Vim window. For example: >
+the source code in a Vim window.
 
+Load the plugin with this command: >
+	packadd termdebug
+
+To start debugging use `:TermDebug` folowed by the command name, for example: >
 	:TermDebug vim
 
-This opens three windows:
+This opens two windows:
 - A terminal window in which "gdb vim" is executed.  Here you can directly
   interact with gdb.
 - A terminal window for the executed program.  When "run" is used in gdb the
   program I/O will happen in this window, so that it does not interfere with
   controlling gdb.
-- A normal Vim window used to show the source code.  When gdb jumps to a
-  source file location this window will display the code, if possible.  Values
-  of variables can be inspected, breakpoints set and cleared, etc.
+The current window is used to show the source code.  When gdb jumps to a
+source file location this window will display the code, if possible.  Values
+of variables can be inspected, breakpoints set and cleared, etc.
 
-This uses two terminal windows.  To open the gdb window: >
-	:term gdb [arguments]
-To open the terminal to run the tested program |term_start()| is used.
+When the debugger ends the two opened windows are closed.
+
+
+Customizing ~
+
+g:debugger	The debugger command.  Default "gdb".
+
 
 TODO
 
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index f065b7c..1cedf63 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 8.0.  Last change: 2017 Aug 11
+*todo.txt*      For Vim version 8.0.  Last change: 2017 Aug 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -41,7 +41,6 @@
 
 Terminal emulator window:
 - Lots of stuff to implement, see src/terminal.c
-- Add winpty.dll and winpty-agent.exe in the NSIS build.
 - Add debugger interface.  Implementation for gdb by Xavier de Gaye.  Should
   work like an IDE.  Try to keep it generic.  Now found here:
     http://clewn.sf.net.
@@ -60,6 +59,8 @@
 - Try out background make plugin: 
   https://github.com/AndrewVos/vim-make-background
 - Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
+- Writing raw mode to a buffer should still handle NL characters as line
+  breaks. (Dmitry Zotikov, 2017 Aug 16)
 - When out_cb executes :sleep, the close_cb may be invoked. (Daniel Hahler,
   2016 Dec 11, #1320)
 - Implement |job-term| ?
@@ -74,7 +75,7 @@
   Feb 9)  How to do this on MS-Windows?
 - For connection to server, a "keep open" flag would be useful.  Retry
   connecting in the main loop with zero timeout.
-- job_start(): run job in a newly opened terminal.
+- job_start(): run job in a newly opened terminal (not a terminal window).
     With xterm could use -S{pty}.
     Although user could use "xterm -e 'cmd arg'".
 
@@ -122,6 +123,8 @@
   Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
   (2017 May 15, #1252)
 
+Patch to turn test80 into a new style test. (Yegappan Lakshmanan, 2017 Aug 20)
+
 Include a few color schemes, based on popularity:
 http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
 http://vimawesome.com/?q=tag:color-scheme
@@ -130,27 +133,34 @@
 - seoul256 - Christian Brabandt (2017 Aug 3)
 - gruvbox -  Christian Brabandt (2017 Aug 3)
 - janah - Marco Hinz (2017 Aug 4)
-- apprentice - Romain Lafourcade (2017 Aug 6)  remarks about help file
+- apprentice - Romain Lafourcade (2017 Aug 6)  remarks about help file #1964
 Suggested by Hiroki Kokubun:
 - [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
 - [hybrid](https://github.com/w0ng/vim-hybrid)
 
-test_gui fails with gnome2: cannot create .gnome2 dir
-    use  testdir/Xfakehome  instead of does/not/exist?
+When starting with --clean packages under "start" are not loaded.  Make this
+work:  :packadd START {name}  similar to :runtime START name
 
-Patch for quickfix: parse lines for any quickfix list. (Yegappan Lakshmanan,
-2017 Jul 20)
+When using :packadd files under "later" are not used, which is inconsistent
+with packages under "start". (xtal8, #1994)
 
-Patch for restoring wide characters in the console buffer.
-(Ken Takata, 2016 Jun 7)
+After 8.0.0962 pasting leaves the cursor in another position. (Ken Takata,
+2017 Aug 23, #2015) Also (zdm, 2017 Aug 23)
 
-Patch to add Couchbase syntax file. (Eugene Ciurana, 2017 Aug 8, #1951)
+Patch to add quickfix list identifier. (Yegappan, 2017 Aug 15)
 
-Patch to fix font name problem with cp932. (Ken Takata, 2017 Aug 9)
+Mac Terminal.app: ctermbg=15 gives light grey instead of white.
+ctermbg=256 breaks clearing till end of the line.  Both work fine in xterm.
+
+Patch to avoid editing a file in the session file twice. (Christian Brabandt,
+2017 Aug 21)  #1958
 
 With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
 (Marcin Szewczyk, 2017 Apr 26)
 
+Using 'wildignore' also applies to literally entered file name.  Also with
+:drop (remote commands).
+
 ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
 Lemonboy can reproduce (2017 Jun 5)
 
@@ -158,14 +168,19 @@
 
 Error in emsg with buggy script. (Dominique, 2017 Apr 30)
 
-Start a test directory under runtime, to test runtime file changes.
-Start with filetype detection.  Only include in the source distribution.
-"make test" in src/ can be renamed to "make testsrc" and "make test" would do
-both "testsrc" and "testruntime" targets.
+Test runtime files.
+Start with filetype detection: testdir/test_filetype.vim
 
-Patch for Murphi syntax. (Matthew Fernandez, 2017 Jul 24)
+Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
+Feb 14).  Also see #1215.
 
-Better detection of strace file. (Steven Fernandez, 2017 Jul 12, #1837)
+Patch to ignore case when 'diffopt' has "icase" for finding the difference
+inside a line. (Rick Howe, 2017 Aug 21, 22 with test)
+
+Patch to support strikethrough next to bold and italic. (Christian Brabandt,
+2013 Jul 30)  Update from Ken Takata, 2013 Oct 12.
+Update mentioned by Christian, 2016 Apr 25.
+Update from Ken Takata, 2017 Aug 23.
 
 Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
 Kiichi, 2016 Feb 28)
@@ -173,13 +188,25 @@
 Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98
 Update Aug 2017: #1953
 
+Patch to fix indenting for raw C++ string. (Christian Brabandt, 2017 Aug 24,
+#2019)
+
 Add options_default() / options_restore() to set several options to Vim
 defaults for a plugin. Comments from Zyx, 2017 May 10.
 Perhaps use a vimcontext / endvimcontext command block.
 
+Patch to fix bogus characters inserted in visual-block append. (Christian
+Brabandt, 2017 Aug 23)
+
 Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
 Still happens (2017 Jul 9)
 
+When bracketed paste is used, pasting at the ":append" prompt does not get the
+line breaks. (Ken Takata, 2017 Aug 22)
+
+This example in the help does not work (Andy Wokula, 2017 Aug 20):
+    augroup mine | au! BufRead | augroup END
+
 Memory leak in test_arabic.
 
 Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
@@ -382,9 +409,6 @@
     call Foo(12, all = 0)
     call Foo(12, 15, 0)
 
-Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
-Feb 14).
-
 Change the Farsi code to work with UTF-8.  Possibly combined with the Arabic
 support, or similar.
 Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
@@ -624,11 +648,6 @@
 Patch to fix increment/decrement not working properly when 'virtualedit' is
 set. (Hirohito Higashi, 2016 Aug 1, #923)
 
-Patch to support strikethrough next to bold and italic. (Christian Brabandt,
-2013 Jul 30)  Update from Ken Takata, 2013 Oct 12.
-Update mentioned by Christian, 2016 Apr 25.
-Update from Ken Takata, 2016 Jul 17.
-
 When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
 Because of using the initial buffer? (Dun Peal, 2016 May 12)
 
@@ -1396,9 +1415,6 @@
 When using a Vim server, a # in the path causes an error message.
 (Jeff Lanzarotta, 2011 Feb 17)
 
-Setting $HOME on MS-Windows is not very well documented.  Suggestion by Ben
-Fritz (2011 Oct 27).
-
 When there is a ">" in a line that "gq" wraps to the start of the next line,
 then the following line will pick it up as a leader.  Should get the leader
 from the first line, not a wrapped line. (Matt Ackeret, 2012 Feb 27)
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index a0428a0..8b2ce53 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt*	For Vim version 8.0.  Last change: 2017 Jul 19
+*usr_41.txt*	For Vim version 8.0.  Last change: 2017 Aug 22
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -966,6 +966,23 @@
 	job_info()		get information about a job
 	job_setoptions()	set options for a job
 
+Terminal window:				*terminal-functions*
+	term_start()		open a terminal window and run a job
+	term_list()		get the list of terminal buffers
+	term_sendkeys()		send keystrokes to a terminal
+	term_wait()		wait for screen to be updated
+	term_getjob()		get the job associated with a terminal
+	term_scrape()		get row of a terminal screen
+	term_getline()		get a line of text from a terminal
+	term_getattr()		get the value of attribute {what}
+	term_getcursor()	get the cursor position of a terminal
+	term_getscrolled()	get the scroll count of a terminal
+	term_getaltscreen()	get the alternate screen flag
+	term_getsize()		get the size of a terminal
+	term_getstatus()	get the status of a terminal
+	term_gettitle()		get the title of a terminal
+	term_gettty()		get the tty name of a terminal
+
 Timers:						*timer-functions*
 	timer_start()		create a timer
 	timer_pause()		pause or unpause a timer
diff --git a/runtime/doc/vim.man b/runtime/doc/vim.man
index cb0057a..64fa795 100644
--- a/runtime/doc/vim.man
+++ b/runtime/doc/vim.man
@@ -3,7 +3,7 @@
 
 
 NAME
-       vim - Vi IMproved, a programmers text editor
+       vim - Vi IMproved, a programmer's text editor
 
 SYNOPSIS
        vim [options] [file ..]
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index d3cf69e..8e8b0bb 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt*   For Vim version 8.0.  Last change: 2017 Jul 23
+*windows.txt*   For Vim version 8.0.  Last change: 2017 Aug 21
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -344,8 +344,9 @@
 							*:hide*
 :hid[e]
 :{count}hid[e]
-		Quit the current window, unless it is the last window on the
-		screen.  For {count} see |:quit| command.
+		Without {count}: Quit the current window, unless it is the
+		last window on the screen.
+		If {count} is given quit the {count} window.
 		
 		The buffer becomes hidden (unless there is another window
 		editing it or 'bufhidden' is "unload", "delete" or "wipe").
@@ -1031,6 +1032,8 @@
 			   displayed in a window |hidden-buffer|
 		   -	a buffer with 'modifiable' off
 		   =	a readonly buffer
+		   R	a terminal buffer with a running job
+		   F	a terminal buffer with a finished job
 		    +	a modified buffer
 		    x   a buffer with read errors