diff -Nur -x .svn vim7-current.orig/runtime/doc/change.txt vim7-current/runtime/doc/change.txt
--- vim7-current.orig/runtime/doc/change.txt	2011-03-24 17:51:54.000000000 +0900
+++ vim7-current/runtime/doc/change.txt	2011-03-24 17:27:48.000000000 +0900
@@ -697,12 +697,12 @@
 Otherwise it works on whole lines anyway.
 
 					*sub-replace-special* *:s\=*
-When the {string} starts with "\=" it is evaluated as an expression, see
-|sub-replace-expression|.  You can use that for any special characters.
-Otherwise these characters in {string} have a special meaning:
+When the {string} contains these characters, they have special meanings except
+that the {string} starts with "\=", see |sub-replace-expression|. You can use
+the "\=" notation for these characters not to have special meanings.
 								*:s%*
 When {string} is equal to "%" and '/' is included with the 'cpoptions' option,
-then the {string} of the previous substitute command is used. |cpo-/|
+then the {string} of the previous substitute command is used, see |cpo-/|.
 
 magic	nomagic	  action    ~
   &	  \&	  replaced with the whole matched pattern	     *s/\&*
@@ -737,6 +737,14 @@
       \x	  where x is any character not mentioned above:
 		  Reserved for future expansion
 
+The special meanings of these characters are also valid inside the third
+argument {sub} of |substitute()| function with the following exceptions; 
+  *A % inserts a percent literally without regard to 'cpoptions'.
+  *magic is set without regard to 'magic'.
+  *A ~ inserts a tilde literally.
+  *<CR> and \r inserts a carriage-return (CTRL-M).
+  *\<CR> does not have a special meaning. it's just one of \x.
+
 Examples: >
   :s/a\|b/xxx\0xxx/g		 modifies "a b"	     to "xxxaxxx xxxbxxx"
   :s/\([abc]\)\([efg]\)/\2\1/g	 modifies "af fa bg" to "fa fa gb"
@@ -768,17 +776,18 @@
 Substitute with an expression			*sub-replace-expression*
 						*sub-replace-\=*
 When the substitute string starts with "\=" the remainder is interpreted as an
-expression.  This does not work recursively: a substitute() function inside
+expression.  This does not work recursively: a |substitute()| function inside
 the expression cannot use "\=" for the substitute string.
 
 The special meaning for characters as mentioned at |sub-replace-special| does
-not apply except for "<CR>", "\<CR>" and "\\".  Thus in the result of the
-expression you need to use two backslashes to get one, put a backslash before a
-<CR> you want to insert, and use a <CR> without a backslash where you want to
-break the line.
+not apply except for <CR>. For convenience a <NL> character is also used as
+a line break.
 
-For convenience a <NL> character is also used as a line break.  Prepend a
-backslash to get a real <NL> character (which will be a NUL in the file).
+The "\=" notation is also valid inside the third argument {sub} of
+|substitute()| function. In this case, the special meanings for characters as
+mentioned at |sub-replace-special| does not apply at all. Especially, <CR> and
+<NL> are interpreted not as a line break but as a carriage-return and a
+new-line respectively.
 
 When the result is a |List| then the items are joined with separating line
 breaks.  Thus each item becomes a line, except that they can contain line
diff -Nur -x .svn vim7-current.orig/runtime/doc/eval.txt vim7-current/runtime/doc/eval.txt
--- vim7-current.orig/runtime/doc/eval.txt	2011-03-24 17:51:54.000000000 +0900
+++ vim7-current/runtime/doc/eval.txt	2011-03-24 18:18:33.000000000 +0900
@@ -1899,7 +1899,7 @@
 strridx( {haystack}, {needle} [, {start}])
 				Number	last index of {needle} in {haystack}
 strtrans( {expr})		String	translate string to make it printable
-submatch( {nr})			String	specific match in ":substitute"
+submatch( {nr})			String	specific match in ":s" or substitute()
 substitute( {expr}, {pat}, {sub}, {flags})
 				String	all {pat} in {expr} replaced with {sub}
 synID( {lnum}, {col}, {trans})	Number	syntax ID at {lnum} and {col}
@@ -5305,13 +5305,15 @@
 		starting a new line.
 
 submatch({nr})						*submatch()*
-		Only for an expression in a |:substitute| command.  Returns
-		the {nr}'th submatch of the matched text.  When {nr} is 0
-		the whole matched text is returned.
+		This is used in the expression for |:substitute| command or 
+                |substitute()| function. See also |sub-replace-expression|. 
+                This returns the {nr}'th submatch of the matched text.  When 
+                {nr} is 0 the whole matched text is returned.
 		Example: >
 			:s/\d\+/\=submatch(0) + 1/
 <		This finds the first number in the line and adds one to it.
-		A line break is included as a newline character.
+		A newline character in the matched text is interpreted as a
+		line break in the expression for |:substitute| command.
 
 substitute({expr}, {pat}, {sub}, {flags})		*substitute()*
 		The result is a String, which is a copy of {expr}, in which
@@ -5325,6 +5327,8 @@
 		Note that some codes in {sub} have a special meaning
 		|sub-replace-special|.	For example, to replace something with
 		"\n" (two characters), use "\\\\n" or '\\n'.
+		When {sub} starts with "\=", the remainder is interpreted as
+		an expression. See |sub-replace-expression|.
 		When {pat} does not match in {expr}, {expr} is returned
 		unmodified.
 		When {flags} is "g", all matches of {pat} in {expr} are
diff -Nur -x .svn vim7-current.orig/runtime/doc/usr_41.txt vim7-current/runtime/doc/usr_41.txt
--- vim7-current.orig/runtime/doc/usr_41.txt	2011-03-24 17:51:54.000000000 +0900
+++ vim7-current/runtime/doc/usr_41.txt	2011-03-24 17:37:13.000000000 +0900
@@ -597,7 +597,7 @@
 	strridx()		last index of a short string in a long string
 	strlen()		length of a string
 	substitute()		substitute a pattern match with a string
-	submatch()		get a specific match in a ":substitute"
+	submatch()		get a specific match in a ":s" or substitute()
 	strpart()		get part of a string
 	expand()		expand special keywords
 	iconv()			convert text from one encoding to another
diff -Nur -x .svn vim7-current.orig/src/regexp.c vim7-current/src/regexp.c
--- vim7-current.orig/src/regexp.c	2011-03-24 17:52:33.000000000 +0900
+++ vim7-current/src/regexp.c	2011-03-24 16:53:48.000000000 +0900
@@ -6830,6 +6830,7 @@
 static regmmatch_T	*submatch_mmatch;
 static linenr_T		submatch_firstlnum;
 static linenr_T		submatch_maxline;
+static int		submatch_line_lbr;
 #endif
 
 #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) || defined(PROTO)
@@ -6956,6 +6957,7 @@
 	    submatch_mmatch = reg_mmatch;
 	    submatch_firstlnum = reg_firstlnum;
 	    submatch_maxline = reg_maxline;
+	    submatch_line_lbr = reg_line_lbr;
 	    save_reg_win = reg_win;
 	    save_ireg_ic = ireg_ic;
 	    can_f_submatch = TRUE;
@@ -6969,7 +6971,7 @@
 		{
 		    /* Change NL to CR, so that it becomes a line break.
 		     * Skip over a backslashed character. */
-		    if (*s == NL)
+		    if (*s == NL && !submatch_line_lbr)
 			*s = CAR;
 		    else if (*s == '\\' && s[1] != NUL)
 		    {
@@ -6979,7 +6981,7 @@
 			 *   abc\
 			 *   def
 			 */
-			if (*s == NL)
+			if (*s == NL && !submatch_line_lbr)
 			    *s = CAR;
 			had_backslash = TRUE;
 		    }
@@ -7002,6 +7004,7 @@
 	    reg_mmatch = submatch_mmatch;
 	    reg_firstlnum = submatch_firstlnum;
 	    reg_maxline = submatch_maxline;
+	    reg_line_lbr = submatch_line_lbr;
 	    reg_win = save_reg_win;
 	    ireg_ic = save_ireg_ic;
 	    can_f_submatch = FALSE;
diff -Nur -x .svn vim7-current.orig/src/testdir/Makefile vim7-current/src/testdir/Makefile
--- vim7-current.orig/src/testdir/Makefile	2011-03-24 17:52:19.000000000 +0900
+++ vim7-current/src/testdir/Makefile	2011-03-24 17:43:37.000000000 +0900
@@ -23,7 +23,7 @@
 		test54.out test55.out test56.out test57.out test58.out \
 		test59.out test60.out test61.out test62.out test63.out \
 		test64.out test65.out test66.out test67.out test68.out \
-		test69.out test70.out
+		test69.out test70.out test71.out test72.out
 
 SCRIPTS_GUI = test16.out
 
