Blame SOURCES/7.4.191

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.191
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.191
22c937
Problem:    Escaping a file name for shell commands can't be done without a
22c937
            function.
22c937
Solution:   Add the :S file name modifier.
22c937
Files:      src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
22c937
            src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
22c937
            src/testdir/Make_vms.mms, src/testdir/Makefile,
22c937
            src/testdir/test105.in, src/testdir/test105.ok,
22c937
            runtime/doc/cmdline.txt, runtime/doc/eval.txt,
22c937
            runtime/doc/map.txt, runtime/doc/options.txt,
22c937
            runtime/doc/quickfix.txt, runtime/doc/usr_30.txt,
22c937
            runtime/doc/usr_40.txt, runtime/doc/usr_42.txt,
22c937
            runtime/doc/vi_diff.txt, src/eval.c, src/misc2.c, src/normal.c,
22c937
            src/proto/misc2.pro
22c937
22c937
22c937
*** ../vim-7.4.190/src/testdir/Make_amiga.mak	2014-02-05 22:25:29.974568243 +0100
22c937
--- src/testdir/Make_amiga.mak	2014-02-23 23:16:51.056762395 +0100
22c937
***************
22c937
*** 35,41 ****
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test97.out test98.out \
22c937
  		test99.out test100.out test101.out test102.out test103.out \
22c937
! 		test104.out
22c937
  
22c937
  .SUFFIXES: .in .out
22c937
  
22c937
--- 35,41 ----
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test97.out test98.out \
22c937
  		test99.out test100.out test101.out test102.out test103.out \
22c937
! 		test104.out test105.out
22c937
  
22c937
  .SUFFIXES: .in .out
22c937
  
22c937
***************
22c937
*** 156,158 ****
22c937
--- 156,159 ----
22c937
  test102.out: test102.in
22c937
  test103.out: test103.in
22c937
  test104.out: test104.in
22c937
+ test105.out: test105.in
22c937
*** ../vim-7.4.190/src/testdir/Make_dos.mak	2014-02-05 22:25:29.978568243 +0100
22c937
--- src/testdir/Make_dos.mak	2014-02-23 23:17:41.840762314 +0100
22c937
***************
22c937
*** 33,39 ****
22c937
  		test84.out test85.out test86.out test87.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out
22c937
  
22c937
  SCRIPTS32 =	test50.out test70.out
22c937
  
22c937
--- 33,40 ----
22c937
  		test84.out test85.out test86.out test87.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out \
22c937
! 		test105.out
22c937
  
22c937
  SCRIPTS32 =	test50.out test70.out
22c937
  
22c937
*** ../vim-7.4.190/src/testdir/Make_ming.mak	2014-02-05 22:25:29.978568243 +0100
22c937
--- src/testdir/Make_ming.mak	2014-02-23 23:17:29.400762333 +0100
22c937
***************
22c937
*** 53,59 ****
22c937
  		test84.out test85.out test86.out test87.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out
22c937
  
22c937
  SCRIPTS32 =	test50.out test70.out
22c937
  
22c937
--- 53,60 ----
22c937
  		test84.out test85.out test86.out test87.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out \
22c937
! 		test105.out
22c937
  
22c937
  SCRIPTS32 =	test50.out test70.out
22c937
  
22c937
*** ../vim-7.4.190/src/testdir/Make_os2.mak	2014-02-05 22:25:29.978568243 +0100
22c937
--- src/testdir/Make_os2.mak	2014-02-23 23:17:49.476762302 +0100
22c937
***************
22c937
*** 35,41 ****
22c937
  		test81.out test82.out test83.out test84.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out
22c937
  
22c937
  .SUFFIXES: .in .out
22c937
  
22c937
--- 35,42 ----
22c937
  		test81.out test82.out test83.out test84.out test88.out \
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test98.out test99.out \
22c937
! 		test100.out test101.out test102.out test103.out test104.out \
22c937
! 		test105.out
22c937
  
22c937
  .SUFFIXES: .in .out
22c937
  
22c937
*** ../vim-7.4.190/src/testdir/Make_vms.mms	2014-02-05 22:25:29.978568243 +0100
22c937
--- src/testdir/Make_vms.mms	2014-02-23 23:17:56.596762290 +0100
22c937
***************
22c937
*** 4,10 ****
22c937
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
22c937
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
22c937
  #
22c937
! # Last change:  2013 Nov 21
22c937
  #
22c937
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
22c937
  # Edit the lines in the Configuration section below to select.
22c937
--- 4,10 ----
22c937
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
22c937
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
22c937
  #
22c937
! # Last change:  2014 Feb 23
22c937
  #
22c937
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
22c937
  # Edit the lines in the Configuration section below to select.
22c937
***************
22c937
*** 79,85 ****
22c937
  	 test82.out test83.out test84.out test88.out test89.out \
22c937
  	 test90.out test91.out test92.out test93.out test94.out \
22c937
  	 test95.out test96.out test97.out test98.out test99.out \
22c937
! 	 test100.out test101.out test102.out test103.out test104.out
22c937
  
22c937
  # Known problems:
22c937
  # Test 30: a problem around mac format - unknown reason
22c937
--- 79,86 ----
22c937
  	 test82.out test83.out test84.out test88.out test89.out \
22c937
  	 test90.out test91.out test92.out test93.out test94.out \
22c937
  	 test95.out test96.out test97.out test98.out test99.out \
22c937
! 	 test100.out test101.out test102.out test103.out test104.out \
22c937
! 	 test105.out
22c937
  
22c937
  # Known problems:
22c937
  # Test 30: a problem around mac format - unknown reason
22c937
*** ../vim-7.4.190/src/testdir/Makefile	2014-02-05 22:25:29.982568243 +0100
22c937
--- src/testdir/Makefile	2014-02-23 23:18:14.040762262 +0100
22c937
***************
22c937
*** 31,37 ****
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test97.out test98.out \
22c937
  		test99.out test100.out test101.out test102.out test103.out \
22c937
! 		test104.out
22c937
  
22c937
  SCRIPTS_GUI = test16.out
22c937
  
22c937
--- 31,37 ----
22c937
  		test89.out test90.out test91.out test92.out test93.out \
22c937
  		test94.out test95.out test96.out test97.out test98.out \
22c937
  		test99.out test100.out test101.out test102.out test103.out \
22c937
! 		test104.out test105.out
22c937
  
22c937
  SCRIPTS_GUI = test16.out
22c937
  
22c937
*** ../vim-7.4.190/src/testdir/test105.in	2014-02-23 23:35:40.680760596 +0100
22c937
--- src/testdir/test105.in	2014-02-23 23:30:24.748761099 +0100
22c937
***************
22c937
*** 0 ****
22c937
--- 1,45 ----
22c937
+ Test filename modifiers     vim: set ft=vim :
22c937
+ 
22c937
+ STARTTEST
22c937
+ :source small.vim
22c937
+ :%delete _
22c937
+ :set shell=sh
22c937
+ :set shellslash
22c937
+ :let tab="\t"
22c937
+ :command -nargs=1 Put :let expr=<q-args> | $put =expr.tab.strtrans(string(eval(expr)))
22c937
+ :let $HOME=fnamemodify('.', ':p:h:h:h')
22c937
+ :Put fnamemodify('.',              ':p'      )[-1:]
22c937
+ :Put fnamemodify('.',              ':p:h'    )[-1:]
22c937
+ :Put fnamemodify('test.out',       ':p'      )[-1:]
22c937
+ :Put fnamemodify('test.out',       ':.'      )
22c937
+ :Put fnamemodify('../testdir/a',   ':.'      )
22c937
+ :Put fnamemodify('test.out',       ':~'      )
22c937
+ :Put fnamemodify('../testdir/a',   ':~'      )
22c937
+ :Put fnamemodify('../testdir/a',   ':t'      )
22c937
+ :Put fnamemodify('.',              ':p:t'    )
22c937
+ :Put fnamemodify('test.out',       ':p:t'    )
22c937
+ :Put fnamemodify('test.out',       ':p:e'    )
22c937
+ :Put fnamemodify('test.out',       ':p:t:e'  )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':r'      )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':r:r'    )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':r:r:r'  )
22c937
+ :Put substitute(fnamemodify('abc.fb2.tar.gz', ':p:r:r'), '.*\(src/testdir/.*\)', '\1', '')
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':e'      )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':e:e'    )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':e:e:e'  )
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':e:e:e:e')
22c937
+ :Put fnamemodify('abc.fb2.tar.gz', ':e:e:r'  )
22c937
+ :Put fnamemodify('abc def',        ':S'      )
22c937
+ :Put fnamemodify('abc" "def',      ':S'      )
22c937
+ :Put fnamemodify('abc"%"def',      ':S'      )
22c937
+ :Put fnamemodify('abc'' ''def',    ':S'      )
22c937
+ :Put fnamemodify('abc''%''def',    ':S'      )
22c937
+ :Put fnamemodify("abc\ndef",       ':S'      )
22c937
+ :set shell=tcsh
22c937
+ :Put fnamemodify("abc\ndef",       ':S'      )
22c937
+ :$put ='vim: ts=8'
22c937
+ :1 delete _
22c937
+ :w! test.out
22c937
+ :qa!
22c937
+ ENDTEST
22c937
+ 
22c937
*** ../vim-7.4.190/src/testdir/test105.ok	2014-02-23 23:35:40.688760596 +0100
22c937
--- src/testdir/test105.ok	2014-02-23 23:32:11.204760929 +0100
22c937
***************
22c937
*** 0 ****
22c937
--- 1,29 ----
22c937
+ fnamemodify('.',              ':p'      )[-1:]	'/'
22c937
+ fnamemodify('.',              ':p:h'    )[-1:]	'r'
22c937
+ fnamemodify('test.out',       ':p'      )[-1:]	't'
22c937
+ fnamemodify('test.out',       ':.'      )	'test.out'
22c937
+ fnamemodify('../testdir/a',   ':.'      )	'a'
22c937
+ fnamemodify('test.out',       ':~'      )	'~/src/testdir/test.out'
22c937
+ fnamemodify('../testdir/a',   ':~'      )	'~/src/testdir/a'
22c937
+ fnamemodify('../testdir/a',   ':t'      )	'a'
22c937
+ fnamemodify('.',              ':p:t'    )	''
22c937
+ fnamemodify('test.out',       ':p:t'    )	'test.out'
22c937
+ fnamemodify('test.out',       ':p:e'    )	'out'
22c937
+ fnamemodify('test.out',       ':p:t:e'  )	'out'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':r'      )	'abc.fb2.tar'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':r:r'    )	'abc.fb2'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':r:r:r'  )	'abc'
22c937
+ substitute(fnamemodify('abc.fb2.tar.gz', ':p:r:r'), '.*\(src/testdir/.*\)', '\1', '')	'src/testdir/abc.fb2'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':e'      )	'gz'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':e:e'    )	'tar.gz'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':e:e:e'  )	'fb2.tar.gz'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':e:e:e:e')	'fb2.tar.gz'
22c937
+ fnamemodify('abc.fb2.tar.gz', ':e:e:r'  )	'tar'
22c937
+ fnamemodify('abc def',        ':S'      )	'''abc def'''
22c937
+ fnamemodify('abc" "def',      ':S'      )	'''abc" "def'''
22c937
+ fnamemodify('abc"%"def',      ':S'      )	'''abc"%"def'''
22c937
+ fnamemodify('abc'' ''def',    ':S'      )	'''abc''\'''' ''\''''def'''
22c937
+ fnamemodify('abc''%''def',    ':S'      )	'''abc''\''''%''\''''def'''
22c937
+ fnamemodify("abc\ndef",       ':S'      )	'''abc^@def'''
22c937
+ fnamemodify("abc\ndef",       ':S'      )	'''abc\^@def'''
22c937
+ vim: ts=8
22c937
*** ../vim-7.4.190/runtime/doc/cmdline.txt	2013-11-09 05:30:18.000000000 +0100
22c937
--- runtime/doc/cmdline.txt	2014-02-23 23:20:57.020762003 +0100
22c937
***************
22c937
*** 758,763 ****
22c937
--- 758,764 ----
22c937
  function expand() |expand()|.
22c937
  	%	Is replaced with the current file name.		  *:_%* *c_%*
22c937
  	#	Is replaced with the alternate file name.	  *:_#* *c_#*
22c937
+ 		This is remembered for every window.
22c937
  	#n	(where n is a number) is replaced with		  *:_#0* *:_#n*
22c937
  		the file name of buffer n.  "#0" is the same as "#".     *c_#n*
22c937
  	##	Is replaced with all names in the argument list	  *:_##* *c_##*
22c937
***************
22c937
*** 823,830 ****
22c937
  		   the start of the function.
22c937
  
22c937
  							 *filename-modifiers*
22c937
! 	 *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs*
22c937
! 	        *%:8* *%:p* *%:.* *%:~* *%:h* *%:t* *%:r* *%:e* *%:s* *%:gs*
22c937
  The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
22c937
  "<afile>" or "<abuf>".  They are also used with the |fnamemodify()| function.
22c937
  These are not available when Vim has been compiled without the |+modify_fname|
22c937
--- 824,831 ----
22c937
  		   the start of the function.
22c937
  
22c937
  							 *filename-modifiers*
22c937
! *:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S*
22c937
!      *%:8* *%:p* *%:.* *%:~* *%:h* *%:t* *%:r* *%:e* *%:s* *%:gs* *%:S*
22c937
  The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
22c937
  "<afile>" or "<abuf>".  They are also used with the |fnamemodify()| function.
22c937
  These are not available when Vim has been compiled without the |+modify_fname|
22c937
***************
22c937
*** 879,884 ****
22c937
--- 880,889 ----
22c937
  	:gs?pat?sub?
22c937
  		Substitute all occurrences of "pat" with "sub".  Otherwise
22c937
  		this works like ":s".
22c937
+ 	:S	Escape special characters for use with a shell command (see 
22c937
+ 		|shellescape()|). Must be the last one. Examples: >
22c937
+ 		    :!dir <cfile>:S
22c937
+ 		    :call system('chmod +w -- ' . expand('%:S'))
22c937
  
22c937
  Examples, when the file name is "src/version.c", current dir
22c937
  "/home/mool/vim": >
22c937
*** ../vim-7.4.190/runtime/doc/eval.txt	2014-01-14 12:33:32.000000000 +0100
22c937
--- runtime/doc/eval.txt	2014-02-23 23:19:32.420762138 +0100
22c937
***************
22c937
*** 5414,5419 ****
22c937
--- 5428,5434 ----
22c937
  <		This results in a directory listing for the file under the
22c937
  		cursor.  Example of use with |system()|: >
22c937
  		    :call system("chmod +w -- " . shellescape(expand("%")))
22c937
+ <		See also |::S|.
22c937
  
22c937
  
22c937
  shiftwidth()						*shiftwidth()*
22c937
***************
22c937
*** 5896,5909 ****
22c937
  		passed as stdin to the command.  The string is written as-is,
22c937
  		you need to take care of using the correct line separators
22c937
  		yourself.  Pipes are not used.
22c937
! 		Note: Use |shellescape()| to escape special characters in a
22c937
! 		command argument.  Newlines in {expr} may cause the command to
22c937
! 		fail.  The characters in 'shellquote' and 'shellxquote' may
22c937
! 		also cause trouble.
22c937
  		This is not to be used for interactive commands.
22c937
  
22c937
  		The result is a String.  Example: >
22c937
  		    :let files = system("ls " .  shellescape(expand('%:h')))
22c937
  
22c937
  <		To make the result more system-independent, the shell output
22c937
  		is filtered to replace <CR> with <NL> for Macintosh, and
22c937
--- 5911,5926 ----
22c937
  		passed as stdin to the command.  The string is written as-is,
22c937
  		you need to take care of using the correct line separators
22c937
  		yourself.  Pipes are not used.
22c937
! 		Note: Use |shellescape()| or |::S| with |expand()| or 
22c937
! 		|fnamemodify()| to escape special characters in a command 
22c937
! 		argument.  Newlines in {expr} may cause the command to fail.  
22c937
! 		The characters in 'shellquote' and 'shellxquote' may also 
22c937
! 		cause trouble.
22c937
  		This is not to be used for interactive commands.
22c937
  
22c937
  		The result is a String.  Example: >
22c937
  		    :let files = system("ls " .  shellescape(expand('%:h')))
22c937
+ 		    :let files = system('ls ' . expand('%:h:S'))
22c937
  
22c937
  <		To make the result more system-independent, the shell output
22c937
  		is filtered to replace <CR> with <NL> for Macintosh, and
22c937
*** ../vim-7.4.190/runtime/doc/map.txt	2013-08-10 13:24:56.000000000 +0200
22c937
--- runtime/doc/map.txt	2014-02-23 23:19:32.424762138 +0100
22c937
***************
22c937
*** 380,386 ****
22c937
     The simplest way to load a set of related language mappings is by using the
22c937
  'keymap' option.  See |45.5|.
22c937
     In Insert mode and in Command-line mode the mappings can be disabled with
22c937
! the CTRL-^ command |i_CTRL-^| |c_CTRL-^| These commands change the value of
22c937
  the 'iminsert' option.  When starting to enter a normal command line (not a
22c937
  search pattern) the mappings are disabled until a CTRL-^ is typed.  The state
22c937
  last used is remembered for Insert mode and Search patterns separately.  The
22c937
--- 380,386 ----
22c937
     The simplest way to load a set of related language mappings is by using the
22c937
  'keymap' option.  See |45.5|.
22c937
     In Insert mode and in Command-line mode the mappings can be disabled with
22c937
! the CTRL-^ command |i_CTRL-^| |c_CTRL-^|. These commands change the value of
22c937
  the 'iminsert' option.  When starting to enter a normal command line (not a
22c937
  search pattern) the mappings are disabled until a CTRL-^ is typed.  The state
22c937
  last used is remembered for Insert mode and Search patterns separately.  The
22c937
***************
22c937
*** 593,599 ****
22c937
  When you have a mapping that contains an Ex command, you need to put a line
22c937
  terminator after it to have it executed.  The use of <CR> is recommended for
22c937
  this (see |<>|).  Example: >
22c937
!    :map  _ls  :!ls -l %<CR>:echo "the end"<CR>
22c937
  
22c937
  To avoid mapping of the characters you type in insert or Command-line mode,
22c937
  type a CTRL-V first.  The mapping in Insert mode is disabled if the 'paste'
22c937
--- 593,599 ----
22c937
  When you have a mapping that contains an Ex command, you need to put a line
22c937
  terminator after it to have it executed.  The use of <CR> is recommended for
22c937
  this (see |<>|).  Example: >
22c937
!    :map  _ls  :!ls -l %:S<CR>:echo "the end"<CR>
22c937
  
22c937
  To avoid mapping of the characters you type in insert or Command-line mode,
22c937
  type a CTRL-V first.  The mapping in Insert mode is disabled if the 'paste'
22c937
*** ../vim-7.4.190/runtime/doc/options.txt	2013-11-12 04:43:57.000000000 +0100
22c937
--- runtime/doc/options.txt	2014-02-23 23:19:32.428762138 +0100
22c937
***************
22c937
*** 4757,4764 ****
22c937
  			global or local to buffer |global-local|
22c937
  			{not in Vi}
22c937
  	Program to use for the ":make" command.  See |:make_makeprg|.
22c937
! 	This option may contain '%' and '#' characters, which are expanded to
22c937
! 	the current and alternate file name. |:_%| |:_#|
22c937
  	Environment variables are expanded |:set_env|.  See |option-backslash|
22c937
  	about including spaces and backslashes.
22c937
  	Note that a '|' must be escaped twice: once for ":set" and once for
22c937
--- 4757,4765 ----
22c937
  			global or local to buffer |global-local|
22c937
  			{not in Vi}
22c937
  	Program to use for the ":make" command.  See |:make_makeprg|.
22c937
! 	This option may contain '%' and '#' characters (see  |:_%| and |:_#|), 
22c937
! 	which are expanded to the current and alternate file name.  Use |::S| 
22c937
! 	to escape file names in case they contain special characters.
22c937
  	Environment variables are expanded |:set_env|.  See |option-backslash|
22c937
  	about including spaces and backslashes.
22c937
  	Note that a '|' must be escaped twice: once for ":set" and once for
22c937
*** ../vim-7.4.190/runtime/doc/quickfix.txt	2013-08-10 13:25:00.000000000 +0200
22c937
--- runtime/doc/quickfix.txt	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 838,844 ****
22c937
  The alltests.py script seems to be used quite often, that's all.
22c937
  Useful values for the 'makeprg' options therefore are:
22c937
   setlocal makeprg=./alltests.py " Run a testsuite
22c937
!  setlocal makeprg=python %      " Run a single testcase
22c937
  
22c937
  Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
22c937
  
22c937
--- 838,844 ----
22c937
  The alltests.py script seems to be used quite often, that's all.
22c937
  Useful values for the 'makeprg' options therefore are:
22c937
   setlocal makeprg=./alltests.py " Run a testsuite
22c937
!  setlocal makeprg=python\ %:S   " Run a single testcase
22c937
  
22c937
  Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
22c937
  
22c937
***************
22c937
*** 1332,1338 ****
22c937
  Here is an alternative from Michael F. Lamb for Unix that filters the errors
22c937
  first: >
22c937
    :setl errorformat=%Z%f:%l:\ %m,%A%p^,%-G%*[^sl]%.%#
22c937
!   :setl makeprg=javac\ %\ 2>&1\ \\\|\ vim-javac-filter
22c937
  
22c937
  You need to put the following in "vim-javac-filter" somewhere in your path
22c937
  (e.g., in ~/bin) and make it executable: >
22c937
--- 1332,1338 ----
22c937
  Here is an alternative from Michael F. Lamb for Unix that filters the errors
22c937
  first: >
22c937
    :setl errorformat=%Z%f:%l:\ %m,%A%p^,%-G%*[^sl]%.%#
22c937
!   :setl makeprg=javac\ %:S\ 2>&1\ \\\|\ vim-javac-filter
22c937
  
22c937
  You need to put the following in "vim-javac-filter" somewhere in your path
22c937
  (e.g., in ~/bin) and make it executable: >
22c937
*** ../vim-7.4.190/runtime/doc/usr_30.txt	2013-08-10 13:25:05.000000000 +0200
22c937
--- runtime/doc/usr_30.txt	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 128,134 ****
22c937
  You can include special Vim keywords in the command specification.  The %
22c937
  character expands to the name of the current file.  So if you execute the
22c937
  command: >
22c937
! 	:set makeprg=make\ %
22c937
  
22c937
  When you are editing main.c, then ":make" executes the following command: >
22c937
  
22c937
--- 128,134 ----
22c937
  You can include special Vim keywords in the command specification.  The %
22c937
  character expands to the name of the current file.  So if you execute the
22c937
  command: >
22c937
! 	:set makeprg=make\ %:S
22c937
  
22c937
  When you are editing main.c, then ":make" executes the following command: >
22c937
  
22c937
***************
22c937
*** 137,143 ****
22c937
  This is not too useful, so you will refine the command a little and use the :r
22c937
  (root) modifier: >
22c937
  
22c937
! 	:set makeprg=make\ %:r.o
22c937
  
22c937
  Now the command executed is as follows: >
22c937
  
22c937
--- 137,143 ----
22c937
  This is not too useful, so you will refine the command a little and use the :r
22c937
  (root) modifier: >
22c937
  
22c937
! 	:set makeprg=make\ %:r:S.o
22c937
  
22c937
  Now the command executed is as follows: >
22c937
  
22c937
*** ../vim-7.4.190/runtime/doc/usr_40.txt	2013-08-10 13:25:05.000000000 +0200
22c937
--- runtime/doc/usr_40.txt	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 209,215 ****
22c937
  separates the two commands.  This also means that a | character can't be used
22c937
  inside a map command.  To include one, use <Bar> (five characters).  Example:
22c937
  >
22c937
! 	:map <F8> :write <Bar> !checkin %<CR>
22c937
  
22c937
  The same problem applies to the ":unmap" command, with the addition that you
22c937
  have to watch out for trailing white space.  These two commands are different:
22c937
--- 209,215 ----
22c937
  separates the two commands.  This also means that a | character can't be used
22c937
  inside a map command.  To include one, use <Bar> (five characters).  Example:
22c937
  >
22c937
! 	:map <F8> :write <Bar> !checkin %:S<CR>
22c937
  
22c937
  The same problem applies to the ":unmap" command, with the addition that you
22c937
  have to watch out for trailing white space.  These two commands are different:
22c937
*** ../vim-7.4.190/runtime/doc/usr_42.txt	2013-08-10 13:25:05.000000000 +0200
22c937
--- runtime/doc/usr_42.txt	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 311,317 ****
22c937
  item with a bitmap.  For example, define a new toolbar item with: >
22c937
  
22c937
  	:tmenu ToolBar.Compile  Compile the current file
22c937
! 	:amenu ToolBar.Compile  :!cc % -o %:r<CR>
22c937
  
22c937
  Now you need to create the icon.  For MS-Windows it must be in bitmap format,
22c937
  with the name "Compile.bmp".  For Unix XPM format is used, the file name is
22c937
--- 311,317 ----
22c937
  item with a bitmap.  For example, define a new toolbar item with: >
22c937
  
22c937
  	:tmenu ToolBar.Compile  Compile the current file
22c937
! 	:amenu ToolBar.Compile  :!cc %:S -o %:r:S<CR>
22c937
  
22c937
  Now you need to create the icon.  For MS-Windows it must be in bitmap format,
22c937
  with the name "Compile.bmp".  For Unix XPM format is used, the file name is
22c937
*** ../vim-7.4.190/runtime/doc/vi_diff.txt	2013-08-10 13:25:07.000000000 +0200
22c937
--- runtime/doc/vi_diff.txt	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 540,546 ****
22c937
  Added :wnext command.  Same as ":write" followed by ":next".
22c937
  
22c937
  The ":w!" command always writes, also when the file is write protected.  In Vi
22c937
! you would have to do ":!chmod +w %" and ":set noro".
22c937
  
22c937
  When 'tildeop' has been set, "~" is an operator (must be followed by a
22c937
  movement command).
22c937
--- 540,546 ----
22c937
  Added :wnext command.  Same as ":write" followed by ":next".
22c937
  
22c937
  The ":w!" command always writes, also when the file is write protected.  In Vi
22c937
! you would have to do ":!chmod +w %:S" and ":set noro".
22c937
  
22c937
  When 'tildeop' has been set, "~" is an operator (must be followed by a
22c937
  movement command).
22c937
*** ../vim-7.4.190/src/eval.c	2014-02-23 22:54:54.724764490 +0100
22c937
--- src/eval.c	2014-02-23 23:19:32.432762138 +0100
22c937
***************
22c937
*** 16950,16956 ****
22c937
      typval_T	*rettv;
22c937
  {
22c937
      rettv->vval.v_string = vim_strsave_shellescape(
22c937
! 		       get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]));
22c937
      rettv->v_type = VAR_STRING;
22c937
  }
22c937
  
22c937
--- 16950,16956 ----
22c937
      typval_T	*rettv;
22c937
  {
22c937
      rettv->vval.v_string = vim_strsave_shellescape(
22c937
! 		get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), TRUE);
22c937
      rettv->v_type = VAR_STRING;
22c937
  }
22c937
  
22c937
***************
22c937
*** 24355,24360 ****
22c937
--- 24355,24371 ----
22c937
  	}
22c937
      }
22c937
  
22c937
+     if (src[*usedlen] == ':' && src[*usedlen + 1] == 'S')
22c937
+     {
22c937
+ 	p = vim_strsave_shellescape(*fnamep, FALSE, FALSE);
22c937
+ 	if (p == NULL)
22c937
+ 	    return -1;
22c937
+ 	vim_free(*bufp);
22c937
+ 	*bufp = *fnamep = p;
22c937
+ 	*fnamelen = (int)STRLEN(p);
22c937
+ 	*usedlen += 2;
22c937
+     }
22c937
+ 
22c937
      return valid;
22c937
  }
22c937
  
22c937
*** ../vim-7.4.190/src/misc2.c	2014-01-06 06:18:44.000000000 +0100
22c937
--- src/misc2.c	2014-02-23 23:25:44.168761546 +0100
22c937
***************
22c937
*** 1369,1380 ****
22c937
   * Escape a newline, depending on the 'shell' option.
22c937
   * When "do_special" is TRUE also replace "!", "%", "#" and things starting
22c937
   * with "<" like "<cfile>".
22c937
   * Returns the result in allocated memory, NULL if we have run out.
22c937
   */
22c937
      char_u *
22c937
! vim_strsave_shellescape(string, do_special)
22c937
      char_u	*string;
22c937
      int		do_special;
22c937
  {
22c937
      unsigned	length;
22c937
      char_u	*p;
22c937
--- 1369,1382 ----
22c937
   * Escape a newline, depending on the 'shell' option.
22c937
   * When "do_special" is TRUE also replace "!", "%", "#" and things starting
22c937
   * with "<" like "<cfile>".
22c937
+  * When "do_newline" is FALSE do not escape newline unless it is csh shell.
22c937
   * Returns the result in allocated memory, NULL if we have run out.
22c937
   */
22c937
      char_u *
22c937
! vim_strsave_shellescape(string, do_special, do_newline)
22c937
      char_u	*string;
22c937
      int		do_special;
22c937
+     int		do_newline;
22c937
  {
22c937
      unsigned	length;
22c937
      char_u	*p;
22c937
***************
22c937
*** 1403,1409 ****
22c937
  # endif
22c937
  	if (*p == '\'')
22c937
  	    length += 3;		/* ' => '\'' */
22c937
! 	if (*p == '\n' || (*p == '!' && (csh_like || do_special)))
22c937
  	{
22c937
  	    ++length;			/* insert backslash */
22c937
  	    if (csh_like && do_special)
22c937
--- 1405,1412 ----
22c937
  # endif
22c937
  	if (*p == '\'')
22c937
  	    length += 3;		/* ' => '\'' */
22c937
! 	if ((*p == '\n' && (csh_like || do_newline))
22c937
! 		|| (*p == '!' && (csh_like || do_special)))
22c937
  	{
22c937
  	    ++length;			/* insert backslash */
22c937
  	    if (csh_like && do_special)
22c937
***************
22c937
*** 1454,1460 ****
22c937
  		++p;
22c937
  		continue;
22c937
  	    }
22c937
! 	    if (*p == '\n' || (*p == '!' && (csh_like || do_special)))
22c937
  	    {
22c937
  		*d++ = '\\';
22c937
  		if (csh_like && do_special)
22c937
--- 1457,1464 ----
22c937
  		++p;
22c937
  		continue;
22c937
  	    }
22c937
! 	    if ((*p == '\n' && (csh_like || do_newline))
22c937
! 		    || (*p == '!' && (csh_like || do_special)))
22c937
  	    {
22c937
  		*d++ = '\\';
22c937
  		if (csh_like && do_special)
22c937
*** ../vim-7.4.190/src/normal.c	2014-02-22 23:49:30.268896843 +0100
22c937
--- src/normal.c	2014-02-23 23:19:32.436762138 +0100
22c937
***************
22c937
*** 5790,5796 ****
22c937
      {
22c937
  	/* Escape the argument properly for a shell command */
22c937
  	ptr = vim_strnsave(ptr, n);
22c937
! 	p = vim_strsave_shellescape(ptr, TRUE);
22c937
  	vim_free(ptr);
22c937
  	if (p == NULL)
22c937
  	{
22c937
--- 5790,5796 ----
22c937
      {
22c937
  	/* Escape the argument properly for a shell command */
22c937
  	ptr = vim_strnsave(ptr, n);
22c937
! 	p = vim_strsave_shellescape(ptr, TRUE, TRUE);
22c937
  	vim_free(ptr);
22c937
  	if (p == NULL)
22c937
  	{
22c937
*** ../vim-7.4.190/src/proto/misc2.pro	2013-08-10 13:37:20.000000000 +0200
22c937
--- src/proto/misc2.pro	2014-02-23 23:19:32.436762138 +0100
22c937
***************
22c937
*** 32,38 ****
22c937
  char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
22c937
  char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
22c937
  int csh_like_shell __ARGS((void));
22c937
! char_u *vim_strsave_shellescape __ARGS((char_u *string, int do_special));
22c937
  char_u *vim_strsave_up __ARGS((char_u *string));
22c937
  char_u *vim_strnsave_up __ARGS((char_u *string, int len));
22c937
  void vim_strup __ARGS((char_u *p));
22c937
--- 32,38 ----
22c937
  char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
22c937
  char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
22c937
  int csh_like_shell __ARGS((void));
22c937
! char_u *vim_strsave_shellescape __ARGS((char_u *string, int do_special, int do_newline));
22c937
  char_u *vim_strsave_up __ARGS((char_u *string));
22c937
  char_u *vim_strnsave_up __ARGS((char_u *string, int len));
22c937
  void vim_strup __ARGS((char_u *p));
22c937
*** ../vim-7.4.190/src/version.c	2014-02-23 22:58:12.072764176 +0100
22c937
--- src/version.c	2014-02-23 23:35:51.044760579 +0100
22c937
***************
22c937
*** 740,741 ****
22c937
--- 740,743 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     191,
22c937
  /**/
22c937
22c937
-- 
22c937
Windows
22c937
M!uqoms
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///