diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 43f72195a1a4d17720e9b3a09fe18122ca2fe1c8..d1764affb5dcfaf7c1e353886c2f61089bffd906 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,4 +1,4 @@
-*cmdline.txt*   For Vim version 7.0aa.  Last change: 2005 Feb 14
+*cmdline.txt*   For Vim version 7.0aa.  Last change: 2005 Jul 05
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -726,7 +726,7 @@ Note: these are typed literally, they are not special keys!
 		   effective buffer number (for ":r file" it is the current
 		   buffer, the file being read is not in a buffer).
 	<amatch>   when executing autocommands, is replaced with the match for
-		   which this autocommand was executed.  It differs form
+		   which this autocommand was executed.  It differs from
 		   <afile> only when the file name isn't used to match with
 		   (for FileType and Syntax events).
 	<sfile>    when executing a ":source" command, is replaced with the
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 5fc1dd82d5656ce416d813d7b59fea7f971c70a9..79782c868aa837c3dff8545e3a0b4a2a45f76492 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt*	For Vim version 7.0aa.  Last change: 2005 Jul 04
+*spell.txt*	For Vim version 7.0aa.  Last change: 2005 Jul 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -79,20 +79,20 @@ zW			Like "zw" but add the word to the internal word list
 
 							*:spe* *:spellgood*
 :[count]spe[llgood] {word}
-			Add [word} as a good word to 'spellfile', like with
+			Add {word} as a good word to 'spellfile', like with
 			"zg".  Without count the first name is used, with a
 			count of two the second entry, etc.
 
-:spe[llgood]! {word}	Add [word} as a good word to the internal word list,
+:spe[llgood]! {word}	Add {word} as a good word to the internal word list,
 			like with "zG".
 
 							*:spellw* *:spellwrong*
 :[count]spellw[rong] {word}
-			Add [word} as a wrong (bad) word to 'spellfile', as
+			Add {word} as a wrong (bad) word to 'spellfile', as
 			with "zw".  Without count the first name is used, with
 			a count of two the second entry, etc.
 
-:spellw[rong]! {word}	Add [word} as a wrong (bad) word to the internal word
+:spellw[rong]! {word}	Add {word} as a wrong (bad) word to the internal word
 			list.
 
 After adding a word to 'spellfile' with the above commands its associated
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 2660432d935df204c538cfe9b5fe8e15d0725aa0..8272543350f603d6705de73a00ac05114ae2de92 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.0aa.  Last change: 2005 Jun 03
+*syntax.txt*	For Vim version 7.0aa.  Last change: 2005 Jul 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3906,6 +3906,9 @@ SpecialKey	Meta and special keys listed with ":map", also for text used
 		really is.
 							*hl-SpellBad*
 SpellBad	Word that is not recognized by the spellchecker. |spell|
+		This will be combined with the highlighting used otherwise.
+							*hl-SpellCap*
+SpellCap	Word that should start with a capital. |spell|
 		This will be combined with the highlighting used otherwise.
 							*hl-SpellLocal*
 SpellLocal	Word that is recognized by the spellchecker as one that is
diff --git a/runtime/doc/tags b/runtime/doc/tags
index f231debf853a312209ecc4db843ef844378e8898..b7f8aa7d1936aa60c296f3985519c78f687e2896 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5148,6 +5148,7 @@ hebrew	hebrew.txt	/*hebrew*
 hebrew.txt	hebrew.txt	/*hebrew.txt*
 help	various.txt	/*help*
 help-context	help.txt	/*help-context*
+help-tags	tags	1
 help-translated	various.txt	/*help-translated*
 help-xterm-window	various.txt	/*help-xterm-window*
 help.txt	help.txt	/*help.txt*
@@ -5207,6 +5208,7 @@ hl-Search	syntax.txt	/*hl-Search*
 hl-SignColumn	syntax.txt	/*hl-SignColumn*
 hl-SpecialKey	syntax.txt	/*hl-SpecialKey*
 hl-SpellBad	syntax.txt	/*hl-SpellBad*
+hl-SpellCap	syntax.txt	/*hl-SpellCap*
 hl-SpellLocal	syntax.txt	/*hl-SpellLocal*
 hl-SpellRare	syntax.txt	/*hl-SpellRare*
 hl-StatusLine	syntax.txt	/*hl-StatusLine*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 0dc952e34bd9316cd6941422d0a66143576185ad..d290eea378a8cf583178089ed2eba945dbb402a4 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 Jul 04
+*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Jul 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
diff --git a/runtime/ftplugin/AppendMatchGroup.vim b/runtime/ftplugin/AppendMatchGroup.vim
index da7994eda1e66f250a11c6fbcd7cd2d2ae3247dc..34e80b5f8398e1f17e4fe73c918f68158f6cec28 100644
--- a/runtime/ftplugin/AppendMatchGroup.vim
+++ b/runtime/ftplugin/AppendMatchGroup.vim
@@ -1,125 +1,125 @@
-" Vim filetype plugin file utility
-" Language:    * (various)
-" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
-" Date:        6/30/2004
-
-" The start of match (b:SOM) default is:
-"       '\<'
-" The end of match (b:EOM) default is:
-"       '\>'
-"
-" If you want to use some other start/end of match, just assign the
-" value to the b:SOM|EOM variable in your filetype script.
-"
-" SEE: :h pattern.txt
-"      :h pattern-searches
-"      :h regular-expression
-"      :h matchit
-
-let s:myName=expand("<sfile>:t")
-
-" matchit.vim not loaded -- don't do anyting
-if !exists("loaded_matchit")
-	echomsg s:myName.": matchit.vim not loaded -- finishing without loading"
-	finish
-endif
-
-" already been here -- don't redefine
-if exists("*AppendMatchGroup")
-	finish
-endif
-
-" Function To Build b:match_words
-" The following function, 'AppendMatchGroup', helps to increase
-" readability of your filetype script if you choose to use matchit.
-" It also precludes many construction errors, reducing the
-" construction to simply invoking the function with the match words.
-" As an example, let's take the ubiquitous if/then/else/endif type
-" of construct.  This is how the entry in your filetype script would look.
-"
-"     " source the AppendMatchGroup function file
-"     runtime ftplugin/AppendMatchGroup.vim
-"
-"     " fill b:match_words
-"     call AppendMatchGroup('if,then,else,endif')
-"
-" And the b:match_words constructed would look like:
-"
-"     \<if\>:\<then\>:\<else\>:\<endif\>
-" 
-" Use of AppendMatchGroup makes your filetype script is a little
-" less busy and a lot more readable.  Additionally, it
-" checks three critical things:
-"
-"      1)  Do you have at least 2 entries in your match group.
-"
-"      2)  Does the buffer variable 'b:match_words' exist?  if not, create it.
-"
-"      3)  If the buffer variable 'b:match_words' does exist, is the last
-"          character a ','?  If not, add it before appending.
-" 
-" You should now be able to match 'if/then/else/endif' in succession
-" in your source file, in just about any construction you may have
-" chosen for them.
-"
-" To add another group, simply call 'AppendMatchGroup again.  E.G.:
-"
-"      call AppendMatchGroup('while,do,endwhile')
-
-function AppendMatchGroup(mwordList)
-	let List=a:mwordList
-	let Comma=match(List,',')
-	if Comma == -1 || Comma == strlen(List)-1
-		echoerr "Must supply a comma separated list of at least 2 entries."
-		echoerr "Supplied list: <".List.">"
-		return
-	endif
-	let listEntryBegin=0
-	let listEntryEnd=Comma
-	let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
-	let List=strpart(List,Comma+1)
-	let Comma=match(List,',')
-	" if listEntry is all spaces || List is empty || List is all spaces
-	if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1)
-			\ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1)
-		echoerr "Can't use all spaces for an entry <".listEntry.">"
-		echoerr "Remaining supplied list: <".List.">"
-		return
-	endif
-
-	if !exists("b:SOM")
-		let b:SOM='\<'
-	endif
-	if !exists("b:EOM")
-		let b:EOM='\>'
-	endif
-	if !exists("b:match_words")
-		let b:match_words=''
-	endif
-	if b:match_words != '' && match(b:match_words,',$') == -1
-		let b:match_words=b:match_words.','
-	endif
-	" okay, all set add first entry in this list
-	let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
-	while Comma != -1
-		let listEntryEnd=Comma
-		let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
-		let List=strpart(List,Comma+1)
-		let Comma=match(List,',')
-		" if listEntry is all spaces
-		if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1
-			echoerr "Can't use all spaces for an entry <".listEntry."> - skipping"
-			echoerr "Remaining supplied list: <".List.">"
-			continue
-		endif
-		let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
-	endwhile
-	let listEntry=List
-	let b:match_words=b:match_words.b:SOM.listEntry.b:EOM
-endfunction
-
-" TODO:  Write a wrapper to handle multiple groups in one function call.
-"        Don't see a lot of utility in this as it would undoubtedly warrant
-"        continuation lines in the filetype script and it would be a toss
-"        up as to which is more readable: individual calls one to a line or
-"        a single call with continuation lines.  I vote for the former.
+" Vim filetype plugin file utility
+" Language:    * (various)
+" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
+" Date:        6/30/2004
+
+" The start of match (b:SOM) default is:
+"       '\<'
+" The end of match (b:EOM) default is:
+"       '\>'
+"
+" If you want to use some other start/end of match, just assign the
+" value to the b:SOM|EOM variable in your filetype script.
+"
+" SEE: :h pattern.txt
+"      :h pattern-searches
+"      :h regular-expression
+"      :h matchit
+
+let s:myName=expand("<sfile>:t")
+
+" matchit.vim not loaded -- don't do anyting
+if !exists("loaded_matchit")
+	echomsg s:myName.": matchit.vim not loaded -- finishing without loading"
+	finish
+endif
+
+" already been here -- don't redefine
+if exists("*AppendMatchGroup")
+	finish
+endif
+
+" Function To Build b:match_words
+" The following function, 'AppendMatchGroup', helps to increase
+" readability of your filetype script if you choose to use matchit.
+" It also precludes many construction errors, reducing the
+" construction to simply invoking the function with the match words.
+" As an example, let's take the ubiquitous if/then/else/endif type
+" of construct.  This is how the entry in your filetype script would look.
+"
+"     " source the AppendMatchGroup function file
+"     runtime ftplugin/AppendMatchGroup.vim
+"
+"     " fill b:match_words
+"     call AppendMatchGroup('if,then,else,endif')
+"
+" And the b:match_words constructed would look like:
+"
+"     \<if\>:\<then\>:\<else\>:\<endif\>
+" 
+" Use of AppendMatchGroup makes your filetype script is a little
+" less busy and a lot more readable.  Additionally, it
+" checks three critical things:
+"
+"      1)  Do you have at least 2 entries in your match group.
+"
+"      2)  Does the buffer variable 'b:match_words' exist?  if not, create it.
+"
+"      3)  If the buffer variable 'b:match_words' does exist, is the last
+"          character a ','?  If not, add it before appending.
+" 
+" You should now be able to match 'if/then/else/endif' in succession
+" in your source file, in just about any construction you may have
+" chosen for them.
+"
+" To add another group, simply call 'AppendMatchGroup again.  E.G.:
+"
+"      call AppendMatchGroup('while,do,endwhile')
+
+function AppendMatchGroup(mwordList)
+	let List=a:mwordList
+	let Comma=match(List,',')
+	if Comma == -1 || Comma == strlen(List)-1
+		echoerr "Must supply a comma separated list of at least 2 entries."
+		echoerr "Supplied list: <".List.">"
+		return
+	endif
+	let listEntryBegin=0
+	let listEntryEnd=Comma
+	let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
+	let List=strpart(List,Comma+1)
+	let Comma=match(List,',')
+	" if listEntry is all spaces || List is empty || List is all spaces
+	if (match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1)
+			\ || List == '' || (match(List,'\s\+') == 0 && match(List,'\S\+') == -1)
+		echoerr "Can't use all spaces for an entry <".listEntry.">"
+		echoerr "Remaining supplied list: <".List.">"
+		return
+	endif
+
+	if !exists("b:SOM")
+		let b:SOM='\<'
+	endif
+	if !exists("b:EOM")
+		let b:EOM='\>'
+	endif
+	if !exists("b:match_words")
+		let b:match_words=''
+	endif
+	if b:match_words != '' && match(b:match_words,',$') == -1
+		let b:match_words=b:match_words.','
+	endif
+	" okay, all set add first entry in this list
+	let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
+	while Comma != -1
+		let listEntryEnd=Comma
+		let listEntry=strpart(List,listEntryBegin,listEntryEnd-listEntryBegin)
+		let List=strpart(List,Comma+1)
+		let Comma=match(List,',')
+		" if listEntry is all spaces
+		if match(listEntry,'\s\+') == 0 && match(listEntry,'\S\+') == -1
+			echoerr "Can't use all spaces for an entry <".listEntry."> - skipping"
+			echoerr "Remaining supplied list: <".List.">"
+			continue
+		endif
+		let b:match_words=b:match_words.b:SOM.listEntry.b:EOM.':'
+	endwhile
+	let listEntry=List
+	let b:match_words=b:match_words.b:SOM.listEntry.b:EOM
+endfunction
+
+" TODO:  Write a wrapper to handle multiple groups in one function call.
+"        Don't see a lot of utility in this as it would undoubtedly warrant
+"        continuation lines in the filetype script and it would be a toss
+"        up as to which is more readable: individual calls one to a line or
+"        a single call with continuation lines.  I vote for the former.
diff --git a/runtime/ftplugin/mupad.vim b/runtime/ftplugin/mupad.vim
index 791b99aa1025a052ac284d582b446597ac0adc17..ef3a4fe28f4e9b7e9fd39fb21f684eae6f8d70ec 100644
--- a/runtime/ftplugin/mupad.vim
+++ b/runtime/ftplugin/mupad.vim
@@ -1,30 +1,30 @@
-" Vim filetype plugin file
-" Language:    MuPAD source files
-" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
-" Filenames:   *.mu
-" Date:        6/30/2004
-
-if exists("b:did_ftplugin") | finish | endif
-let b:did_ftplugin = 1
-
-" Change the :browse e filter to primarily show MuPAD source files.
-if has("gui_win32")
-  let  b:browsefilter=
-		\ "MuPAD source (*.mu)\t*.mu\n" .
-		\	"All Files (*.*)\t*.*\n"
-endif
-
-" matchit.vim not loaded -- don't do anyting below
-if !exists("loaded_matchit")
-	" echomsg "matchit.vim not loaded -- finishing"
-	finish
-endif
-
-" source the AppendMatchGroup function file
-runtime ftplugin/AppendMatchGroup.vim
-
-" fill b:match_words for MuPAD
-call AppendMatchGroup('domain,end_domain')
-call AppendMatchGroup('proc,begin,end_proc')
-call AppendMatchGroup('if,then,elif,else,end_if')
-call AppendMatchGroup('\%(for\|while\|repeat\|case\),of,do,break,next,until,\%(end_for\|end_while\|end_repeat\|end_case\)')
+" Vim filetype plugin file
+" Language:    MuPAD source files
+" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
+" Filenames:   *.mu
+" Date:        6/30/2004
+
+if exists("b:did_ftplugin") | finish | endif
+let b:did_ftplugin = 1
+
+" Change the :browse e filter to primarily show MuPAD source files.
+if has("gui_win32")
+  let  b:browsefilter=
+		\ "MuPAD source (*.mu)\t*.mu\n" .
+		\	"All Files (*.*)\t*.*\n"
+endif
+
+" matchit.vim not loaded -- don't do anyting below
+if !exists("loaded_matchit")
+	" echomsg "matchit.vim not loaded -- finishing"
+	finish
+endif
+
+" source the AppendMatchGroup function file
+runtime ftplugin/AppendMatchGroup.vim
+
+" fill b:match_words for MuPAD
+call AppendMatchGroup('domain,end_domain')
+call AppendMatchGroup('proc,begin,end_proc')
+call AppendMatchGroup('if,then,elif,else,end_if')
+call AppendMatchGroup('\%(for\|while\|repeat\|case\),of,do,break,next,until,\%(end_for\|end_while\|end_repeat\|end_case\)')
diff --git a/runtime/indent/pascal.vim b/runtime/indent/pascal.vim
index 7085287a0f2927b86a53eac1d1b656c90f431ecc..b1a652d0a9baf04b1866a53a9d999c4a8504abb1 100644
--- a/runtime/indent/pascal.vim
+++ b/runtime/indent/pascal.vim
@@ -1,173 +1,173 @@
-" Vim indent file
-" Language:    Pascal
-" Maintainer:  Neil Carter <n.carter@swansea.ac.uk>
-" Created:     2004 Jul 13
-" Last Change: 2005 Jun 15
-
-
-if exists("b:did_indent")
-	finish
-endif
-let b:did_indent = 1
-
-setlocal indentexpr=GetPascalIndent(v:lnum)
-setlocal indentkeys&
-setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
-setlocal indentkeys+==program,==function,==procedure,==object,==private
-setlocal indentkeys+==record,==if,==else,==case
-
-if exists("*GetPascalIndent")
-	finish
-endif
-
-
-function! s:GetPrevNonCommentLineNum( line_num )
-
-	" Skip lines starting with a comment
-	let SKIP_LINES = '^\s*\(\((\*\)\|\(\*\ \)\|\(\*)\)\|{\|}\)'
-
-	let nline = a:line_num
-	while nline > 0
-		let nline = prevnonblank(nline-1)
-		if getline(nline) !~? SKIP_LINES
-			break
-		endif
-	endwhile
-
-	return nline
-endfunction
-
-
-function! GetPascalIndent( line_num )
-	" Line 0 always goes at column 0
-	if a:line_num == 0
-		return 0
-	endif
-
-	let this_codeline = getline( a:line_num )
-
-	" If in the middle of a three-part comment
-	if this_codeline =~ '^\s*\*'
-		return indent( a:line_num )
-	endif
-
-	let prev_codeline_num = s:GetPrevNonCommentLineNum( a:line_num )
-	let prev_codeline = getline( prev_codeline_num )
-	let indnt = indent( prev_codeline_num )
-
-	" Compiler directives should always go in column zero.
-	if this_codeline =~ '^\s*{\(\$IFDEF\|\$ELSE\|\$ENDIF\)'
-		return 0
-	endif
-
-	" These items have nothing before or after (not even a comment), and
-	" go on column 0. Make sure that the ^\s* is followed by \( to make
-	" ORs work properly, and not include the start of line (this must
-	" always appear).
-	" The bracketed expression with the underline is a routine
-	" separator. This is one case where we do indent comment lines.
-	if this_codeline =~ '^\s*\((\*\ _\+\ \*)\|\<\(const\|var\)\>\)$'
-		return 0
-	endif
-
-	" These items may have text after them, and go on column 0 (in most
-	" cases). The problem is that "function" and "procedure" keywords
-	" should be indented if within a class declaration.
-	if this_codeline =~ '^\s*\<\(program\|type\|uses\|procedure\|function\)\>'
-		return 0
-	endif
-
-	" BEGIN
-	" If the begin does not come after "if", "for", or "else", then it
-	" goes in column 0
-	if this_codeline =~ '^\s*begin\>' && prev_codeline !~ '^\s*\<\(if\|for\|else\)\>'
-		return 0
-	endif
-
-	" These keywords are indented once only.
-	if this_codeline =~ '^\s*\<\(private\)\>'
-		return &shiftwidth
-	endif
-
-	" If the PREVIOUS LINE contained these items, the current line is
-	" always indented once.
-	if prev_codeline =~ '^\s*\<\(type\|uses\)\>'
-		return &shiftwidth
-	endif
-
-	" These keywords are indented once only. Possibly surrounded by
-	" other chars.
-	if this_codeline =~ '^.\+\<\(object\|record\)\>'
-		return &shiftwidth
-	endif
-
-	" If the previous line was indenting...
-	if prev_codeline =~ '^\s*\<\(for\|if\|case\|else\|end\ else\)\>'
-		" then indent.
-		let indnt = indnt + &shiftwidth
-		" BUT... if this is the start of a multistatement block then we
-		" need to align the begin with the previous line.
-		if this_codeline =~ '^\s*begin\>'
-			return indnt - &shiftwidth
-		endif
-
-		" We also need to keep the indentation level constant if the
-		" whole if-then statement was on one line.
-		if prev_codeline =~ '\<then\>.\+'
-			let indnt = indnt - &shiftwidth
-		endif
-	endif
-
-	" PREVIOUS-LINE BEGIN
-	" If the previous line was an indenting keyword then indent once...
-	if prev_codeline =~ '^\s*\<\(const\|var\|begin\|repeat\|private\)\>'
-		" But only if this is another var in a list.
-		if this_codeline !~ '^\s*var\>'
-			return indnt + &shiftwidth
-		endif
-	endif
-
-	" PREVIOUS-LINE BEGIN
-	" Indent code after a case statement begin
-	if prev_codeline =~ '\:\ begin\>'
-		return indnt + &shiftwidth
-	endif
-
-	" These words may have text before them on the line (hence the .*)
-	" but are followed by nothing. Always indent once only.
-	if prev_codeline =~ '^\(.*\|\s*\)\<\(object\|record\)\>$'
-		return indnt + &shiftwidth
-	endif
-
-	" If we just closed a bracket that started on a previous line, then
-	" unindent. But don't return yet -- we need to check for further
-	" unindentation (for end/until/else)
-	if prev_codeline =~ '^[^(]*[^*])'
-		let indnt = indnt - &shiftwidth
-	endif
-
-	" At the end of a block, we have to unindent both the current line
-	" (the "end" for instance) and the newly-created line.
-	if this_codeline =~ '^\s*\<\(end\|until\|else\)\>'
-		return indnt - &shiftwidth
-	endif
-
-	" If we have opened a bracket and it continues over one line,
-	" then indent once.
-	"
-	" RE = an opening bracket followed by any amount of anything other
-	" than a closing bracket and then the end-of-line.
-	"
-	" If we didn't include the end of line, this RE would match even
-	" closed brackets, since it would match everything up to the closing
-	" bracket.
-	"
-	" This test isn't clever enough to handle brackets inside strings or
-	" comments.
-	if prev_codeline =~ '([^*]\=[^)]*$'
-		return indnt + &shiftwidth
-	endif
-
-	return indnt
-endfunction
-
+" Vim indent file
+" Language:    Pascal
+" Maintainer:  Neil Carter <n.carter@swansea.ac.uk>
+" Created:     2004 Jul 13
+" Last Change: 2005 Jul 05
+
+
+if exists("b:did_indent")
+	finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetPascalIndent(v:lnum)
+setlocal indentkeys&
+setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for
+setlocal indentkeys+==program,==function,==procedure,==object,==private
+setlocal indentkeys+==record,==if,==else,==case
+
+if exists("*GetPascalIndent")
+	finish
+endif
+
+
+function! s:GetPrevNonCommentLineNum( line_num )
+
+	" Skip lines starting with a comment
+	let SKIP_LINES = '^\s*\(\((\*\)\|\(\*\ \)\|\(\*)\)\|{\|}\)'
+
+	let nline = a:line_num
+	while nline > 0
+		let nline = prevnonblank(nline-1)
+		if getline(nline) !~? SKIP_LINES
+			break
+		endif
+	endwhile
+
+	return nline
+endfunction
+
+
+function! GetPascalIndent( line_num )
+	" Line 0 always goes at column 0
+	if a:line_num == 0
+		return 0
+	endif
+
+	let this_codeline = getline( a:line_num )
+
+	" If in the middle of a three-part comment
+	if this_codeline =~ '^\s*\*'
+		return indent( a:line_num )
+	endif
+
+	let prev_codeline_num = s:GetPrevNonCommentLineNum( a:line_num )
+	let prev_codeline = getline( prev_codeline_num )
+	let indnt = indent( prev_codeline_num )
+
+	" Compiler directives should always go in column zero.
+	if this_codeline =~ '^\s*{\(\$IFDEF\|\$ELSE\|\$ENDIF\)'
+		return 0
+	endif
+
+	" These items have nothing before or after (not even a comment), and
+	" go on column 0. Make sure that the ^\s* is followed by \( to make
+	" ORs work properly, and not include the start of line (this must
+	" always appear).
+	" The bracketed expression with the underline is a routine
+	" separator. This is one case where we do indent comment lines.
+	if this_codeline =~ '^\s*\((\*\ _\+\ \*)\|\<\(const\|var\)\>\)$'
+		return 0
+	endif
+
+	" These items may have text after them, and go on column 0 (in most
+	" cases). The problem is that "function" and "procedure" keywords
+	" should be indented if within a class declaration.
+	if this_codeline =~ '^\s*\<\(program\|type\|uses\|procedure\|function\)\>'
+		return 0
+	endif
+
+	" BEGIN
+	" If the begin does not come after "if", "for", or "else", then it
+	" goes in column 0
+	if this_codeline =~ '^\s*begin\>' && prev_codeline !~ '^\s*\<\(if\|for\|else\)\>'
+		return 0
+	endif
+
+	" These keywords are indented once only.
+	if this_codeline =~ '^\s*\<\(private\)\>'
+		return &shiftwidth
+	endif
+
+	" If the PREVIOUS LINE contained these items, the current line is
+	" always indented once.
+	if prev_codeline =~ '^\s*\<\(type\|uses\)\>'
+		return &shiftwidth
+	endif
+
+	" These keywords are indented once only. Possibly surrounded by
+	" other chars.
+	if this_codeline =~ '^.\+\<\(object\|record\)\>'
+		return &shiftwidth
+	endif
+
+	" If the previous line was indenting...
+	if prev_codeline =~ '^\s*\<\(for\|if\|case\|else\|end\ else\)\>'
+		" then indent.
+		let indnt = indnt + &shiftwidth
+		" BUT... if this is the start of a multistatement block then we
+		" need to align the begin with the previous line.
+		if this_codeline =~ '^\s*begin\>'
+			return indnt - &shiftwidth
+		endif
+
+		" We also need to keep the indentation level constant if the
+		" whole if-then statement was on one line.
+		if prev_codeline =~ '\<then\>.\+'
+			let indnt = indnt - &shiftwidth
+		endif
+	endif
+
+	" PREVIOUS-LINE BEGIN
+	" If the previous line was an indenting keyword then indent once...
+	if prev_codeline =~ '^\s*\<\(const\|var\|begin\|repeat\|private\)\>'
+		" But only if this is another var in a list.
+		if this_codeline !~ '^\s*var\>'
+			return indnt + &shiftwidth
+		endif
+	endif
+
+	" PREVIOUS-LINE BEGIN
+	" Indent code after a case statement begin
+	if prev_codeline =~ '\:\ begin\>'
+		return indnt + &shiftwidth
+	endif
+
+	" These words may have text before them on the line (hence the .*)
+	" but are followed by nothing. Always indent once only.
+	if prev_codeline =~ '^\(.*\|\s*\)\<\(object\|record\)\>$'
+		return indnt + &shiftwidth
+	endif
+
+	" If we just closed a bracket that started on a previous line, then
+	" unindent. But don't return yet -- we need to check for further
+	" unindentation (for end/until/else)
+	if prev_codeline =~ '^[^(]*[^*])'
+		let indnt = indnt - &shiftwidth
+	endif
+
+	" At the end of a block, we have to unindent both the current line
+	" (the "end" for instance) and the newly-created line.
+	if this_codeline =~ '^\s*\<\(end\|until\|else\)\>'
+		return indnt - &shiftwidth
+	endif
+
+	" If we have opened a bracket and it continues over one line,
+	" then indent once.
+	"
+	" RE = an opening bracket followed by any amount of anything other
+	" than a closing bracket and then the end-of-line.
+	"
+	" If we didn't include the end of line, this RE would match even
+	" closed brackets, since it would match everything up to the closing
+	" bracket.
+	"
+	" This test isn't clever enough to handle brackets inside strings or
+	" comments.
+	if prev_codeline =~ '([^*]\=[^)]*$'
+		return indnt + &shiftwidth
+	endif
+
+	return indnt
+endfunction
+
diff --git a/runtime/keymap/canfr-win.vim b/runtime/keymap/canfr-win.vim
index 7a405bf0be10c0de7c0274512760b167aee498e2..1907fc5b46b128210591b60591b3d0a9c3d0799f 100644
--- a/runtime/keymap/canfr-win.vim
+++ b/runtime/keymap/canfr-win.vim
@@ -1,91 +1,91 @@
-" Vim Keymap file for the normalized Canadian multilingual keyboard
-" CAN/CSA Z243.200-92 using the latin1 encoding.
-" This mapping is limited in scope, as it assumes that the AltGr
-" key works as it typically does in a Windows system with a multilingual
-" English keyboard.  It probably won't work with the US keyboard on US
-" English versions of Windows, because those don't provide the AltGr keys.
-" The mapping was tested with Win2k and WinXP.
-
-" Maintainer: Eric Joanis <joanis@cs.toronto.edu>
-" Last Change: 2004 Jan 13
-
-" 2003 Dec 04
-" Initial Revision
-
-" 2004 Jan 13
-" Added the upper case accented characters, forgotten in the initial version.
-
-" All characters are given literally, conversion to another encoding (e.g.,
-" UTF-8) should work.
-scriptencoding latin1
-
-" Use this short name in the status line.
-let b:keymap_name = "canfr"
-
-loadkeymap
-<	'
->	"
-/	é
-?	É
-'	è
-\"	È
-\\	à
-|	À
-[a	â
-[e	ê
-[i	î
-[o	ô
-[u	û
-[A	Â
-[E	Ê
-[I	Î
-[O	Ô
-[U	Û
-[[	^
-{a	ä
-{e	ë
-{i	ï
-{o	ö
-{u	ü
-{y	ÿ
-{A	Ä
-{E	Ë
-{I	Ï
-{O	Ö
-{U	Ü
-]	ç
-}	Ç
-`	/
-~	\\
-^	?
-ú	«
-ø	»
-¬	<
-®	>
-»	°
-Ûa	à
-Ûe	è
-Ûi	ì
-Ûo	ò
-Ûu	ù
-ÛA	À
-ÛE	È
-ÛI	Ì
-ÛO	Ò
-ÛU	Ù
-ÛÛ	`
-Ýa	ã
-Ýo	õ
-Ýn	ñ
-Ýs	ß
-ÝA	Ã
-ÝO	Õ
-ÝN	Ñ
-ÝS	ß
-ÝÝ	~
-à	|
-·	{
-¸	}
-¹	[
-°	]
-½	¬
+" Vim Keymap file for the normalized Canadian multilingual keyboard
+" CAN/CSA Z243.200-92 using the latin1 encoding.
+" This mapping is limited in scope, as it assumes that the AltGr
+" key works as it typically does in a Windows system with a multilingual
+" English keyboard.  It probably won't work with the US keyboard on US
+" English versions of Windows, because those don't provide the AltGr keys.
+" The mapping was tested with Win2k and WinXP.
+
+" Maintainer: Eric Joanis <joanis@cs.toronto.edu>
+" Last Change: 2004 Jan 13
+
+" 2003 Dec 04
+" Initial Revision
+
+" 2004 Jan 13
+" Added the upper case accented characters, forgotten in the initial version.
+
+" All characters are given literally, conversion to another encoding (e.g.,
+" UTF-8) should work.
+scriptencoding latin1
+
+" Use this short name in the status line.
+let b:keymap_name = "canfr"
+
+loadkeymap
+<	'
+>	"
+/	é
+?	É
+'	è
+\"	È
+\\	à
+|	À
+[a	â
+[e	ê
+[i	î
+[o	ô
+[u	û
+[A	Â
+[E	Ê
+[I	Î
+[O	Ô
+[U	Û
+[[	^
+{a	ä
+{e	ë
+{i	ï
+{o	ö
+{u	ü
+{y	ÿ
+{A	Ä
+{E	Ë
+{I	Ï
+{O	Ö
+{U	Ü
+]	ç
+}	Ç
+`	/
+~	\\
+^	?
+ú	«
+ø	»
+¬	<
+®	>
+»	°
+Ûa	à
+Ûe	è
+Ûi	ì
+Ûo	ò
+Ûu	ù
+ÛA	À
+ÛE	È
+ÛI	Ì
+ÛO	Ò
+ÛU	Ù
+ÛÛ	`
+Ýa	ã
+Ýo	õ
+Ýn	ñ
+Ýs	ß
+ÝA	Ã
+ÝO	Õ
+ÝN	Ñ
+ÝS	ß
+ÝÝ	~
+à	|
+·	{
+¸	}
+¹	[
+°	]
+½	¬
diff --git a/runtime/spell/README.txt b/runtime/spell/README.txt
index 8ea5272f05bf752af23f101f4c728dc72785964e..44dedb7afad0c0b6753fce0e832b9a9cb8cf882b 100644
--- a/runtime/spell/README.txt
+++ b/runtime/spell/README.txt
@@ -2,7 +2,7 @@ The spell files included here are in Vim's special format.  You can't edit
 them.  See ":help spell" for more information.
 
 
-Copyright
+COPYRIGHT
 
 The files used as input for the spell files come from the OpenOffice.org spell
 files.  Most of them go under the LGPL or a similar license.
@@ -10,3 +10,78 @@ files.  Most of them go under the LGPL or a similar license.
 Copyright notices for specific languages are in README_??.txt.  Note that the
 files for different regions are merged, both to save space and to make it
 possible to highlight words for another region different from bad words.
+
+
+GENERATING .SPL FILES
+
+This involves downloading the files from the OpenOffice.org server, applying a
+patch and running Vim to generate the .spl file.  To do this all in one go use
+the Aap program (www.a-a-p.org).  It's simple to install, it only requires
+Python.
+
+You can also do it manually:
+1. Fetch the right spell file from:
+   http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
+
+2. Unzip the archive:
+	unzip LL_RR.zip
+
+3. Apply the patch:
+	patch < LL_RR.diff
+
+4. If the language has multiple regions do the above for each region.  E.g.,
+   for English there are five regions: US, CA, AU, NZ and GB.
+
+5. Run Vim and execute ":mkspell".  Make sure you do this with the correct
+   locale, that influences the upper/lower case letters and word characters.
+   On Unix it's something like:
+   	env LANG=en_US.UTF-8 vim
+	mkspell! en en_US en_AU en_CA en_GB en_NZ
+
+6. Repeat step 5 for other locales.  For English you could generate a spell
+   file for latin1, utf-8 and ASCII.  ASCII only makes sense for languages
+   that have very few words with non-ASCII letters.
+
+Now you understand why I prefer using the Aap recipe :-).
+
+
+MAINTAINING A LANGUAGE
+
+Every language should have a maintainer.  His tasks are to track the changes
+in the OpenOffice.org spell files and make updated patches.  Words that
+haven't been added/removed from the OpenOffice lists can also be handled by
+the patches.
+
+It is important to keep the version of the .dic and .aff files that you
+started with.  When OpenOffice brings out new versions of these files you can
+find out what changed and take over these changes in your patch.  When there
+are very many changes you can do it the other way around: re-apply the changes
+for Vim to the new versions of the .dic and .aff files.
+
+This procedure should work well:
+
+1. Obtain the zip archive with the .aff and .dic files.  Unpack it as
+   explained above and copy (don't rename!) the .aff and .dic files to
+   .orig.aff and .orig.dic.  Using the Aap recipe should work, it will make
+   the copies for you.
+
+2. Tweak the .aff and .dic files to generate the perfect .spl file.  Don't
+   change too much, the OpenOffice people are not stupid.  However, you may
+   want to remove obvious mistakes.  And remove single-letter words that
+   aren't really words, they mess up the suggestions (English has this
+   problem).
+
+3. Make the diff file.  "aap diff" will do this for you.  If a diff would be
+   too big you might consider writing a Vim script to do systematic changes.
+   Do check that someone else can reproduce building the spell file.  Send the
+   result to Bram for inclusion in the distribution.  Bram will generate the
+   .spl file and upload it to the ftp server (if he can't generate it you will
+   have to send him the .spl file too).
+
+4. When OpenOffice makes a new zip file available you need to update the
+   patch.  "aap check" should do most of the work for you: if there are
+   changes the .new.dic and .new.aff files will appear.  You can now figure
+   out the differences with .orig.dic and .orig.aff, adjust the .dic and .aff
+   files and finally move the .new.dic to .orig.dic and .new.aff to .orig.aff.
+
+5. Repeat step 4. regularly.
diff --git a/runtime/spell/en.ascii.spl b/runtime/spell/en.ascii.spl
index 1b51921ed9e666fe946a1a786fa6d5750c24c5fc..045e07ba7376eb8eb306c6e60d717307cca038b6 100644
Binary files a/runtime/spell/en.ascii.spl and b/runtime/spell/en.ascii.spl differ
diff --git a/runtime/spell/en.latin1.spl b/runtime/spell/en.latin1.spl
index b759d2f16c0341b7559ac652f4f805d837c507f3..f92ba01c78da11915c58832f23a135265e04d31f 100644
Binary files a/runtime/spell/en.latin1.spl and b/runtime/spell/en.latin1.spl differ
diff --git a/runtime/spell/en.utf-8.spl b/runtime/spell/en.utf-8.spl
index 420d3af0620c1d5eb618cd9cd52ae378c5a15227..83aea8d052bec4f6bf0834909965c1bf86909b54 100644
Binary files a/runtime/spell/en.utf-8.spl and b/runtime/spell/en.utf-8.spl differ
diff --git a/runtime/spell/he/main.aap b/runtime/spell/he/main.aap
index 413c5e2c3c6fcaa17b40f839b03827f3b120f421..9adb109e83b9c1e9f9c0c8aa3352cf9504410113 100644
--- a/runtime/spell/he/main.aap
+++ b/runtime/spell/he/main.aap
@@ -9,12 +9,16 @@
 SPELLDIR = ..
 FILES    = he_IL.aff he_IL.dic
 
-all: $(SPELLDIR)/he.utf-8.spl ../README_he.txt
+all: $(SPELLDIR)/he.utf-8.spl $(SPELLDIR)/he.iso-8859-8.spl ../README_he.txt
 
 $(SPELLDIR)/he.utf-8.spl : $(VIM) $(FILES)
         :sys env LANG=he_IL.UTF-8
 		$(VIM) -e -c "mkspell! $(SPELLDIR)/he he_IL" -c q
 
+$(SPELLDIR)/he.iso-8859-8.spl : $(VIM) $(FILES)
+        :sys $(VIM) -e -c "set enc=iso-8859-8"
+                        -c "mkspell! $(SPELLDIR)/he he_IL" -c q
+
 ../README_he.txt : README_he_IL.txt
         :copy $source $target
 
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
index 772babe780be5cf0fc744bbd7175166d98c31e3c..61bc6c820aa8d2f6428cf753a6e750a1ee2a7403 100644
--- a/runtime/syntax/html.vim
+++ b/runtime/syntax/html.vim
@@ -2,7 +2,7 @@
 " Language:	HTML
 " Maintainer:	Claudio Fleiner <claudio@fleiner.com>
 " URL:		http://www.fleiner.com/vim/syntax/html.vim
-" Last Change:  2004 May 16
+" Last Change:  2005 Jul 05
 
 " Please check :help html.vim for some comments and a description of the options
 
@@ -35,8 +35,8 @@ syn match htmlError "[<>&]"
 syn region  htmlString   contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
 syn region  htmlString   contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
 syn match   htmlValue    contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1   contains=javaScriptExpression,@htmlPreproc
-syn region  htmlEndTag		   start=+</+	   end=+>+ contains=htmlTagN,htmlTagError
-syn region  htmlTag		   start=+<[^/]+   end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+syn region  htmlEndTag		   start=+</+	   end=+>+ contains=htmlTagN,htmlTagError,@NoSpell
+syn region  htmlTag		   start=+<[^/]+   end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,@NoSpell
 syn match   htmlTagN     contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
 syn match   htmlTagN     contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
 syn match   htmlTagError contained "[^>]<"ms=s+1
@@ -116,7 +116,7 @@ syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|
 
 if !exists("html_no_rendering")
   " rendering
-  syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+  syn cluster htmlTop contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
 
   syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
   syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
@@ -146,7 +146,7 @@ if !exists("html_no_rendering")
   syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
   syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
 
-  syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+  syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
   syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
   syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
   syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
diff --git a/runtime/syntax/mupad.vim b/runtime/syntax/mupad.vim
index 86e032047ad7bf2e82ff495480fbc55cec0ab67b..109f880ee13e36cdc28d70c933c8f3d0357bc9f5 100644
--- a/runtime/syntax/mupad.vim
+++ b/runtime/syntax/mupad.vim
@@ -1,295 +1,295 @@
-" Vim syntax file
-" Language:    MuPAD source
-" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
-" Filenames:   *.mu
-" Date:        6/30/2004
-
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
-  syntax clear
-elseif exists("b:current_syntax")
-  finish
-endif
-
-" Set default highlighting to Win2k
-if !exists("mupad_cmdextversion")
-  let mupad_cmdextversion = 2
-endif
-
-syn case match
-
-syn match mupadComment	"//\p*$"
-syn region mupadComment	start="/\*"	end="\*/"
-
-syn region mupadString	start="\""	skip=/\\"/	end="\""
-
-syn match mupadOperator		"(\|)\|:=\|::\|:\|;"
-" boolean
-syn keyword mupadOperator	and	or	not	xor
-syn match mupadOperator		"==>\|\<=\>"
-
-" Informational
-syn keyword mupadSpecial		FILEPATH	NOTEBOOKFILE	NOTEBOOKPATH
-" Set-able, e.g., DIGITS:=10
-syn keyword mupadSpecial		DIGITS		HISTORY		LEVEL
-syn keyword mupadSpecial		MAXLEVEL	MAXDEPTH	ORDER
-syn keyword mupadSpecial		TEXTWIDTH
-" Set-able, e.g., PRETTYPRINT:=TRUE
-syn keyword mupadSpecial		PRETTYPRINT
-" Set-able, e.g., LIBPATH:="C:\\MuPAD Pro\\mylibdir" or LIBPATH:="/usr/MuPAD Pro/mylibdir"
-syn keyword mupadSpecial		LIBPATH		PACKAGEPATH
-syn keyword mupadSpecial		READPATH	TESTPATH	WRITEPATH
-" Symbols and Constants
-syn keyword mupadDefine		FAIL		NIL
-syn keyword mupadDefine		TRUE		FALSE		UNKNOWN
-syn keyword mupadDefine		complexInfinity		infinity
-syn keyword mupadDefine		C_	CATALAN	E	EULER	I	PI	Q_	R_
-syn keyword mupadDefine		RD_INF	RD_NINF	undefined	unit	universe	Z_
-" print() directives
-syn keyword mupadDefine		Unquoted	NoNL	KeepOrder	Typeset
-" domain specifics
-syn keyword mupadStatement	domain	begin	end_domain	end
-syn keyword mupadIdentifier	inherits	category	axiom	info	doc interface
-" basic programming statements
-syn keyword mupadStatement	proc	begin	end_proc	
-syn keyword mupadUnderlined	name	local	option	save
-syn keyword mupadConditional	if	then	elif	else	end_if
-syn keyword mupadConditional	case	of	do	break	end_case
-syn keyword mupadRepeat		for	do	next	break	end_for
-syn keyword mupadRepeat		while	do	next break end_while
-syn keyword mupadRepeat		repeat	next break until	end_repeat
-" domain packages/libraries
-syn keyword mupadType			detools	import	linalg	numeric	numlib	plot	polylib
-syn match mupadType				'\<DOM_\w*\>'
-
-"syn keyword mupadFunction	contains
-" Functions dealing with prime numbers
-syn keyword mupadFunction	phi	invphi	mersenne	nextprime	numprimedivisors
-syn keyword mupadFunction	pollard	prevprime	primedivisors
-" Functions operating on Lists, Matrices, Sets, ...
-syn keyword mupadFunction	array	_index
-" Evaluation
-syn keyword mupadFunction	float contains
-" stdlib
-syn keyword mupadFunction	_exprseq	_invert	_lazy_and	_lazy_or	_negate
-syn keyword mupadFunction	_stmtseq	_invert	intersect	minus		union
-syn keyword mupadFunction	Ci	D	Ei	O	Re	Im	RootOf	Si
-syn keyword mupadFunction	Simplify
-syn keyword mupadFunction	abs	airyAi	airyBi	alias	unalias	anames	append
-syn keyword mupadFunction	arcsin	arccos	arctan	arccsc	arcsec	arccot
-syn keyword mupadFunction	arcsinh	arccosh	arctanh	arccsch	arcsech	arccoth
-syn keyword mupadFunction	arg	args	array	assert	assign	assignElements
-syn keyword mupadFunction	assume	assuming	asympt	bernoulli
-syn keyword mupadFunction	besselI	besselJ	besselK	besselY	beta	binomial	bool
-syn keyword mupadFunction	bytes	card
-syn keyword mupadFunction	ceil	floor	round	trunc
-syn keyword mupadFunction	coeff	coerce	collect	combine	copyClosure
-syn keyword mupadFunction	conjugate	content	context	contfrac
-syn keyword mupadFunction	debug	degree	degreevec	delete	_delete	denom
-syn keyword mupadFunction	densematrix	diff	dilog	dirac	discont	div	_div
-syn keyword mupadFunction	divide	domtype	doprint	erf	erfc	error	eval	evalassign
-syn keyword mupadFunction	evalp	exp	expand	export	unexport	expose	expr
-syn keyword mupadFunction	expr2text	external	extnops	extop	extsubsop
-syn keyword mupadFunction	fact	fact2	factor	fclose	finput	fname	fopen	fprint
-syn keyword mupadFunction	fread	ftextinput	readbitmap	readdata	pathname
-syn keyword mupadFunction	protocol	read	readbytes	write	writebytes
-syn keyword mupadFunction	float	frac	frame	_frame	frandom	freeze	unfreeze
-syn keyword mupadFunction	funcenv	gamma	gcd	gcdex	genident	genpoly
-syn keyword mupadFunction	getpid	getprop	ground	has	hastype	heaviside	help
-syn keyword mupadFunction	history	hold	hull	hypergeom	icontent	id
-syn keyword mupadFunction	ifactor	igamma	igcd	igcdex	ilcm	in	_in
-syn keyword mupadFunction	indets	indexval	info	input	int	int2text
-syn keyword mupadFunction	interpolate	interval	irreducible	is
-syn keyword mupadFunction	isprime	isqrt	iszero	ithprime	kummerU	lambertW
-syn keyword mupadFunction	last	lasterror	lcm	lcoeff	ldegree	length
-syn keyword mupadFunction	level	lhs	rhs	limit	linsolve	lllint
-syn keyword mupadFunction	lmonomial	ln	loadmod	loadproc	log	lterm
-syn keyword mupadFunction	match	map	mapcoeffs	maprat	matrix	max	min
-syn keyword mupadFunction	mod	modp	mods	monomials	multcoeffs	new
-syn keyword mupadFunction	newDomain	_next	nextprime	nops
-syn keyword mupadFunction	norm	normal	nterms	nthcoeff	nthmonomial	nthterm
-syn keyword mupadFunction	null	numer	ode	op	operator	package
-syn keyword mupadFunction	pade	partfrac	patchlevel	pdivide
-syn keyword mupadFunction	piecewise	plot	plotfunc2d	plotfunc3d
-syn keyword mupadFunction	poly	poly2list	polylog	powermod	print
-syn keyword mupadFunction	product	protect	psi	quit	_quit	radsimp	random	rationalize
-syn keyword mupadFunction	rec	rectform	register	reset	return	revert
-syn keyword mupadFunction	rewrite	select	series	setuserinfo	share	sign	signIm
-syn keyword mupadFunction	simplify	
-syn keyword mupadFunction	sin	cos	tan	csc	sec	cot
-syn keyword mupadFunction	sinh	cosh	tanh	csch	sech	coth
-syn keyword mupadFunction	slot	solve	
-syn keyword mupadFunction	pdesolve	matlinsolve	matlinsolveLU	toeplitzSolve
-syn keyword mupadFunction	vandermondeSolve	fsolve	odesolve	odesolve2
-syn keyword mupadFunction	polyroots	polysysroots	odesolveGeometric
-syn keyword mupadFunction	realroot	realroots	mroots	lincongruence
-syn keyword mupadFunction	msqrts
-syn keyword mupadFunction	sort	split	sqrt	strmatch	strprint
-syn keyword mupadFunction	subs	subset	subsex	subsop	substring	sum
-syn keyword mupadFunction	surd	sysname	sysorder	system	table	taylor	tbl2text
-syn keyword mupadFunction	tcoeff	testargs	testeq	testtype	text2expr
-syn keyword mupadFunction	text2int	text2list	text2tbl	rtime	time
-syn keyword mupadFunction	traperror	type	unassume	unit	universe
-syn keyword mupadFunction	unloadmod	unprotect	userinfo	val	version
-syn keyword mupadFunction	warning	whittakerM	whittakerW	zeta	zip
-
-" graphics  plot::
-syn keyword mupadFunction	getDefault	setDefault	copy	modify	Arc2d	Arrow2d
-syn keyword mupadFunction	Arrow3d	Bars2d	Bars3d	Box	Boxplot	Circle2d	Circle3d
-syn keyword mupadFunction	Cone	Conformal	Curve2d	Curve3d	Cylinder	Cylindrical
-syn keyword mupadFunction	Density	Ellipse2d	Function2d	Function3d	Hatch
-syn keyword mupadFunction	Histogram2d	HOrbital	Implicit2d	Implicit3d
-syn keyword mupadFunction	Inequality	Iteration	Line2d	Line3d	Lsys	Matrixplot
-syn keyword mupadFunction	MuPADCube	Ode2d	Ode3d	Parallelogram2d	Parallelogram3d
-syn keyword mupadFunction	Piechart2d	Piechart3d	Point2d	Point3d	Polar
-syn keyword mupadFunction	Polygon2d	Polygon3d	Raster	Rectangle	Sphere
-syn keyword mupadFunction	Ellipsoid	Spherical	Sum	Surface	SurfaceSet
-syn keyword mupadFunction	SurfaceSTL	Tetrahedron	Hexahedron	Octahedron
-syn keyword mupadFunction	Dodecahedron	Icosahedron	Text2d	Text3d	Tube	Turtle
-syn keyword mupadFunction	VectorField2d	XRotate	ZRotate	Canvas	CoordinateSystem2d
-syn keyword mupadFunction	CoordinateSystem3d	Group2d	Group3d	Scene2d	Scene3d	ClippingBox
-syn keyword mupadFunction	Rotate2d	Rotate3d	Scale2d	Scale3d	Transform2d
-syn keyword mupadFunction	Transform3d	Translate2d	Translate3d	AmbientLight
-syn keyword mupadFunction	Camera	DistantLight	PointLight	SpotLight
-
-" graphics Attributes
-" graphics  Output Attributes
-syn keyword mupadIdentifier	OutputFile	OutputOptions
-" graphics  Defining Attributes
-syn keyword mupadIdentifier	Angle	AngleRange	AngleBegin	AngleEnd
-syn keyword mupadIdentifier	Area	Axis	AxisX	AxisY	AxisZ	Base	Top
-syn keyword mupadIdentifier	BaseX	TopX	BaseY	TopY	BaseZ	TopZ
-syn keyword mupadIdentifier	BaseRadius	TopRadius	Cells
-syn keyword mupadIdentifier	Center	CenterX	CenterY	CenterZ
-syn keyword mupadIdentifier	Closed	ColorData	CommandList	Contours	CoordinateType
-syn keyword mupadIdentifier	Data	DensityData	DensityFunction	From	To
-syn keyword mupadIdentifier	FromX	ToX	FromY	ToY	FromZ	ToZ
-syn keyword mupadIdentifier	Function	FunctionX	FunctionY	FunctionZ
-syn keyword mupadIdentifier	Function1	Function2	Baseline
-syn keyword mupadIdentifier	Generations	RotationAngle	IterationRules	StartRule StepLength
-syn keyword mupadIdentifier	TurtleRules	Ground	Heights	Moves	Inequalities
-syn keyword mupadIdentifier	InputFile	Iterations	StartingPoint
-syn keyword mupadIdentifier	LineColorFunction	FillColorFunction
-syn keyword mupadIdentifier	Matrix2d	Matrix3d
-syn keyword mupadIdentifier	MeshList	MeshListType	MeshListNormals
-syn keyword mupadIdentifier	MagneticQuantumNumber	MomentumQuantumNumber	PrincipalQuantumNumber
-syn keyword mupadIdentifier	Name	Normal	NormalX	NormalY	NormalZ
-syn keyword mupadIdentifier	ParameterName	ParameterBegin	ParameterEnd	ParameterRange
-syn keyword mupadIdentifier	Points2d	Points3d	Radius	RadiusFunction
-syn keyword mupadIdentifier	Position	PositionX	PositionY	PositionZ
-syn keyword mupadIdentifier	Scale	ScaleX	ScaleY	ScaleZ Shift	ShiftX	ShiftY	ShiftZ
-syn keyword mupadIdentifier	SemiAxes	SemiAxisX	SemiAxisY	SemiAxisZ
-syn keyword mupadIdentifier	Tangent1	Tangent1X	Tangent1Y	Tangent1Z
-syn keyword mupadIdentifier	Tangent2	Tangent2X	Tangent2Y	Tangent2Z
-syn keyword mupadIdentifier	Text	TextOrientation	TextRotation
-syn keyword mupadIdentifier	UName	URange	UMin	UMax	VName	VRange	VMin	VMax
-syn keyword mupadIdentifier	XName	XRange	XMin	XMax	YName	YRange	YMin	YMax
-syn keyword mupadIdentifier	ZName	ZRange	ZMin	ZMax	ViewingBox
-syn keyword mupadIdentifier	ViewingBoxXMin	ViewingBoxXMax	ViewingBoxXRange
-syn keyword mupadIdentifier	ViewingBoxYMin	ViewingBoxYMax	ViewingBoxYRange
-syn keyword mupadIdentifier	ViewingBoxZMin	ViewingBoxZMax	ViewingBoxZRange
-syn keyword mupadIdentifier	Visible
-" graphics  Axis Attributes
-syn keyword mupadIdentifier	Axes	AxesInFront	AxesLineColor	AxesLineWidth
-syn keyword mupadIdentifier	AxesOrigin	AxesOriginX	AxesOriginY	AxesOriginZ
-syn keyword mupadIdentifier	AxesTips	AxesTitleAlignment
-syn keyword mupadIdentifier	AxesTitleAlignmentX	AxesTitleAlignmentY	AxesTitleAlignmentZ
-syn keyword mupadIdentifier	AxesTitles	XAxisTitle	YAxisTitle	ZAxisTitle
-syn keyword mupadIdentifier	AxesVisible	XAxisVisible	YAxisVisible	ZAxisVisible
-syn keyword mupadIdentifier	YAxisTitleOrientation
-" graphics  Tick Marks Attributes
-syn keyword mupadIdentifier	TicksAnchor	XTicksAnchor	YTicksAnchor	ZTicksAnchor
-syn keyword mupadIdentifier	TicksAt	XTicksAt	YTicksAt	ZTicksAt
-syn keyword mupadIdentifier	TicksBetween	XTicksBetween	YTicksBetween	ZTicksBetween
-syn keyword mupadIdentifier	TicksDistance	XTicksDistance	YTicksDistance	ZTicksDistance
-syn keyword mupadIdentifier	TicksNumber	XTicksNumber	YTicksNumber	ZTicksNumber
-syn keyword mupadIdentifier	TicksVisible	XTicksVisible	YTicksVisible	ZTicksVisible
-syn keyword mupadIdentifier	TicksLength	TicksLabelStyle
-syn keyword mupadIdentifier	XTicksLabelStyle	YTicksLabelStyle	ZTicksLabelStyle
-syn keyword mupadIdentifier	TicksLabelsVisible
-syn keyword mupadIdentifier	XTicksLabelsVisible	YTicksLabelsVisible	ZTicksLabelsVisible
-" graphics  Grid Lines Attributes
-syn keyword mupadIdentifier	GridInFront	GridLineColor	SubgridLineColor
-syn keyword mupadIdentifier	GridLineStyle	SubgridLineStyle GridLineWidth	SubgridLineWidth
-syn keyword mupadIdentifier	GridVisible	XGridVisible	YGridVisible	ZGridVisible
-syn keyword mupadIdentifier	SubgridVisible	XSubgridVisible	YSubgridVisible	ZSubgridVisible
-" graphics  Animation Attributes
-syn keyword mupadIdentifier	Frames	TimeRange	TimeBegin	TimeEnd
-syn keyword mupadIdentifier	VisibleAfter	VisibleBefore	VisibleFromTo
-syn keyword mupadIdentifier	VisibleAfterEnd	VisibleBeforeBegin
-" graphics  Annotation Attributes
-syn keyword mupadIdentifier	Footer	Header	FooterAlignment	HeaderAlignment
-syn keyword mupadIdentifier	HorizontalAlignment	TitleAlignment	VerticalAlignment
-syn keyword mupadIdentifier	Legend	LegendEntry	LegendText
-syn keyword mupadIdentifier	LegendAlignment	LegendPlacement	LegendVisible
-syn keyword mupadIdentifier	Title	Titles
-syn keyword mupadIdentifier	TitlePosition	TitlePositionX	TitlePositionY	TitlePositionZ
-" graphics  Layout Attributes
-syn keyword mupadIdentifier	Bottom	Left	Height	Width	Layout	Rows	Columns
-syn keyword mupadIdentifier	Margin	BottomMargin	TopMargin	LeftMargin	RightMargin
-syn keyword mupadIdentifier	OutputUnits	Spacing
-" graphics  Calculation Attributes
-syn keyword mupadIdentifier	AdaptiveMesh	DiscontinuitySearch	Mesh	SubMesh
-syn keyword mupadIdentifier	UMesh	USubMesh	VMesh	VSubMesh
-syn keyword mupadIdentifier	XMesh	XSubMesh	YMesh	YSubMesh	Zmesh
-" graphics  Camera and Lights Attributes
-syn keyword mupadIdentifier	CameraCoordinates	CameraDirection
-syn keyword mupadIdentifier	CameraDirectionX	CameraDirectionY	CameraDirectionZ
-syn keyword mupadIdentifier	FocalPoint	FocalPointX	FocalPointY	FocalPointZ
-syn keyword mupadIdentifier	LightColor	Lighting	LightIntensity	OrthogonalProjection
-syn keyword mupadIdentifier	SpotAngle	ViewingAngle
-syn keyword mupadIdentifier	Target	TargetX	TargetY	TargetZ
-" graphics  Presentation Style and Fonts Attributes
-syn keyword mupadIdentifier	ArrowLength
-syn keyword mupadIdentifier	AxesTitleFont	FooterFont	HeaderFont	LegendFont
-syn keyword mupadIdentifier	TextFont	TicksLabelFont	TitleFont
-syn keyword mupadIdentifier	BackgroundColor	BackgroundColor2	BackgroundStyle
-syn keyword mupadIdentifier	BackgroundTransparent	Billboarding	BorderColor	BorderWidth
-syn keyword mupadIdentifier	BoxCenters	BoxWidths	DrawMode Gap	XGap	YGap
-syn keyword mupadIdentifier	Notched	NotchWidth	Scaling	YXRatio	ZXRatio
-syn keyword mupadIdentifier	VerticalAsymptotesVisible	VerticalAsymptotesStyle
-syn keyword mupadIdentifier	VerticalAsymptotesColor	VerticalAsymptotesWidth
-" graphics  Line Style Attributes
-syn keyword mupadIdentifier	LineColor	LineColor2	LineColorType	LineStyle
-syn keyword mupadIdentifier	LinesVisible	ULinesVisible	VLinesVisible	XLinesVisible
-syn keyword mupadIdentifier	YLinesVisible	LineWidth	MeshVisible
-" graphics  Point Style Attributes
-syn keyword mupadIdentifier	PointColor	PointSize	PointStyle	PointsVisible
-" graphics  Surface Style Attributes
-syn keyword mupadIdentifier	BarStyle	Shadows	Color	Colors	FillColor	FillColor2
-syn keyword mupadIdentifier	FillColorTrue	FillColorFalse	FillColorUnknown	FillColorType
-syn keyword mupadIdentifier	Filled	FillPattern	FillPatterns	FillStyle
-syn keyword mupadIdentifier	InterpolationStyle	Shading	UseNormals
-" graphics  Arrow Style Attributes
-syn keyword mupadIdentifier	TipAngle	TipLength	TipStyle	TubeDiameter
-syn keyword mupadIdentifier	Tubular
-" graphics  meta-documentation Attributes
-syn keyword mupadIdentifier	objectGroupsListed	
-
-if version >= 508 || !exists("did_mupad_syntax_inits")
-  if version < 508
-    let did_mupad_syntax_inits = 1
-    command -nargs=+ HiLink hi link <args>
-  else
-    command -nargs=+ HiLink hi def link <args>
-  endif
-
-  HiLink mupadComment		Comment
-  HiLink mupadString		String
-  HiLink mupadOperator		Operator
-  HiLink mupadSpecial		Special
-  HiLink mupadStatement		Statement
-  HiLink mupadUnderlined	Underlined
-  HiLink mupadConditional	Conditional
-  HiLink mupadRepeat		Repeat
-  HiLink mupadFunction		Function
-  HiLink mupadType		Type
-  HiLink mupadDefine		Define
-  HiLink mupadIdentifier	Identifier
-
-  delcommand HiLink
-endif
-
-" TODO  More comprehensive listing.
+" Vim syntax file
+" Language:    MuPAD source
+" Maintainer:  Dave Silvia <dsilvia@mchsi.com>
+" Filenames:   *.mu
+" Date:        6/30/2004
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" Set default highlighting to Win2k
+if !exists("mupad_cmdextversion")
+  let mupad_cmdextversion = 2
+endif
+
+syn case match
+
+syn match mupadComment	"//\p*$"
+syn region mupadComment	start="/\*"	end="\*/"
+
+syn region mupadString	start="\""	skip=/\\"/	end="\""
+
+syn match mupadOperator		"(\|)\|:=\|::\|:\|;"
+" boolean
+syn keyword mupadOperator	and	or	not	xor
+syn match mupadOperator		"==>\|\<=\>"
+
+" Informational
+syn keyword mupadSpecial		FILEPATH	NOTEBOOKFILE	NOTEBOOKPATH
+" Set-able, e.g., DIGITS:=10
+syn keyword mupadSpecial		DIGITS		HISTORY		LEVEL
+syn keyword mupadSpecial		MAXLEVEL	MAXDEPTH	ORDER
+syn keyword mupadSpecial		TEXTWIDTH
+" Set-able, e.g., PRETTYPRINT:=TRUE
+syn keyword mupadSpecial		PRETTYPRINT
+" Set-able, e.g., LIBPATH:="C:\\MuPAD Pro\\mylibdir" or LIBPATH:="/usr/MuPAD Pro/mylibdir"
+syn keyword mupadSpecial		LIBPATH		PACKAGEPATH
+syn keyword mupadSpecial		READPATH	TESTPATH	WRITEPATH
+" Symbols and Constants
+syn keyword mupadDefine		FAIL		NIL
+syn keyword mupadDefine		TRUE		FALSE		UNKNOWN
+syn keyword mupadDefine		complexInfinity		infinity
+syn keyword mupadDefine		C_	CATALAN	E	EULER	I	PI	Q_	R_
+syn keyword mupadDefine		RD_INF	RD_NINF	undefined	unit	universe	Z_
+" print() directives
+syn keyword mupadDefine		Unquoted	NoNL	KeepOrder	Typeset
+" domain specifics
+syn keyword mupadStatement	domain	begin	end_domain	end
+syn keyword mupadIdentifier	inherits	category	axiom	info	doc interface
+" basic programming statements
+syn keyword mupadStatement	proc	begin	end_proc
+syn keyword mupadUnderlined	name	local	option	save
+syn keyword mupadConditional	if	then	elif	else	end_if
+syn keyword mupadConditional	case	of	do	break	end_case
+syn keyword mupadRepeat		for	do	next	break	end_for
+syn keyword mupadRepeat		while	do	next break end_while
+syn keyword mupadRepeat		repeat	next break until	end_repeat
+" domain packages/libraries
+syn keyword mupadType			detools	import	linalg	numeric	numlib	plot	polylib
+syn match mupadType				'\<DOM_\w*\>'
+
+"syn keyword mupadFunction	contains
+" Functions dealing with prime numbers
+syn keyword mupadFunction	phi	invphi	mersenne	nextprime	numprimedivisors
+syn keyword mupadFunction	pollard	prevprime	primedivisors
+" Functions operating on Lists, Matrices, Sets, ...
+syn keyword mupadFunction	array	_index
+" Evaluation
+syn keyword mupadFunction	float contains
+" stdlib
+syn keyword mupadFunction	_exprseq	_invert	_lazy_and	_lazy_or	_negate
+syn keyword mupadFunction	_stmtseq	_invert	intersect	minus		union
+syn keyword mupadFunction	Ci	D	Ei	O	Re	Im	RootOf	Si
+syn keyword mupadFunction	Simplify
+syn keyword mupadFunction	abs	airyAi	airyBi	alias	unalias	anames	append
+syn keyword mupadFunction	arcsin	arccos	arctan	arccsc	arcsec	arccot
+syn keyword mupadFunction	arcsinh	arccosh	arctanh	arccsch	arcsech	arccoth
+syn keyword mupadFunction	arg	args	array	assert	assign	assignElements
+syn keyword mupadFunction	assume	assuming	asympt	bernoulli
+syn keyword mupadFunction	besselI	besselJ	besselK	besselY	beta	binomial	bool
+syn keyword mupadFunction	bytes	card
+syn keyword mupadFunction	ceil	floor	round	trunc
+syn keyword mupadFunction	coeff	coerce	collect	combine	copyClosure
+syn keyword mupadFunction	conjugate	content	context	contfrac
+syn keyword mupadFunction	debug	degree	degreevec	delete	_delete	denom
+syn keyword mupadFunction	densematrix	diff	dilog	dirac	discont	div	_div
+syn keyword mupadFunction	divide	domtype	doprint	erf	erfc	error	eval	evalassign
+syn keyword mupadFunction	evalp	exp	expand	export	unexport	expose	expr
+syn keyword mupadFunction	expr2text	external	extnops	extop	extsubsop
+syn keyword mupadFunction	fact	fact2	factor	fclose	finput	fname	fopen	fprint
+syn keyword mupadFunction	fread	ftextinput	readbitmap	readdata	pathname
+syn keyword mupadFunction	protocol	read	readbytes	write	writebytes
+syn keyword mupadFunction	float	frac	frame	_frame	frandom	freeze	unfreeze
+syn keyword mupadFunction	funcenv	gamma	gcd	gcdex	genident	genpoly
+syn keyword mupadFunction	getpid	getprop	ground	has	hastype	heaviside	help
+syn keyword mupadFunction	history	hold	hull	hypergeom	icontent	id
+syn keyword mupadFunction	ifactor	igamma	igcd	igcdex	ilcm	in	_in
+syn keyword mupadFunction	indets	indexval	info	input	int	int2text
+syn keyword mupadFunction	interpolate	interval	irreducible	is
+syn keyword mupadFunction	isprime	isqrt	iszero	ithprime	kummerU	lambertW
+syn keyword mupadFunction	last	lasterror	lcm	lcoeff	ldegree	length
+syn keyword mupadFunction	level	lhs	rhs	limit	linsolve	lllint
+syn keyword mupadFunction	lmonomial	ln	loadmod	loadproc	log	lterm
+syn keyword mupadFunction	match	map	mapcoeffs	maprat	matrix	max	min
+syn keyword mupadFunction	mod	modp	mods	monomials	multcoeffs	new
+syn keyword mupadFunction	newDomain	_next	nextprime	nops
+syn keyword mupadFunction	norm	normal	nterms	nthcoeff	nthmonomial	nthterm
+syn keyword mupadFunction	null	numer	ode	op	operator	package
+syn keyword mupadFunction	pade	partfrac	patchlevel	pdivide
+syn keyword mupadFunction	piecewise	plot	plotfunc2d	plotfunc3d
+syn keyword mupadFunction	poly	poly2list	polylog	powermod	print
+syn keyword mupadFunction	product	protect	psi	quit	_quit	radsimp	random	rationalize
+syn keyword mupadFunction	rec	rectform	register	reset	return	revert
+syn keyword mupadFunction	rewrite	select	series	setuserinfo	share	sign	signIm
+syn keyword mupadFunction	simplify
+syn keyword mupadFunction	sin	cos	tan	csc	sec	cot
+syn keyword mupadFunction	sinh	cosh	tanh	csch	sech	coth
+syn keyword mupadFunction	slot	solve
+syn keyword mupadFunction	pdesolve	matlinsolve	matlinsolveLU	toeplitzSolve
+syn keyword mupadFunction	vandermondeSolve	fsolve	odesolve	odesolve2
+syn keyword mupadFunction	polyroots	polysysroots	odesolveGeometric
+syn keyword mupadFunction	realroot	realroots	mroots	lincongruence
+syn keyword mupadFunction	msqrts
+syn keyword mupadFunction	sort	split	sqrt	strmatch	strprint
+syn keyword mupadFunction	subs	subset	subsex	subsop	substring	sum
+syn keyword mupadFunction	surd	sysname	sysorder	system	table	taylor	tbl2text
+syn keyword mupadFunction	tcoeff	testargs	testeq	testtype	text2expr
+syn keyword mupadFunction	text2int	text2list	text2tbl	rtime	time
+syn keyword mupadFunction	traperror	type	unassume	unit	universe
+syn keyword mupadFunction	unloadmod	unprotect	userinfo	val	version
+syn keyword mupadFunction	warning	whittakerM	whittakerW	zeta	zip
+
+" graphics  plot::
+syn keyword mupadFunction	getDefault	setDefault	copy	modify	Arc2d	Arrow2d
+syn keyword mupadFunction	Arrow3d	Bars2d	Bars3d	Box	Boxplot	Circle2d	Circle3d
+syn keyword mupadFunction	Cone	Conformal	Curve2d	Curve3d	Cylinder	Cylindrical
+syn keyword mupadFunction	Density	Ellipse2d	Function2d	Function3d	Hatch
+syn keyword mupadFunction	Histogram2d	HOrbital	Implicit2d	Implicit3d
+syn keyword mupadFunction	Inequality	Iteration	Line2d	Line3d	Lsys	Matrixplot
+syn keyword mupadFunction	MuPADCube	Ode2d	Ode3d	Parallelogram2d	Parallelogram3d
+syn keyword mupadFunction	Piechart2d	Piechart3d	Point2d	Point3d	Polar
+syn keyword mupadFunction	Polygon2d	Polygon3d	Raster	Rectangle	Sphere
+syn keyword mupadFunction	Ellipsoid	Spherical	Sum	Surface	SurfaceSet
+syn keyword mupadFunction	SurfaceSTL	Tetrahedron	Hexahedron	Octahedron
+syn keyword mupadFunction	Dodecahedron	Icosahedron	Text2d	Text3d	Tube	Turtle
+syn keyword mupadFunction	VectorField2d	XRotate	ZRotate	Canvas	CoordinateSystem2d
+syn keyword mupadFunction	CoordinateSystem3d	Group2d	Group3d	Scene2d	Scene3d	ClippingBox
+syn keyword mupadFunction	Rotate2d	Rotate3d	Scale2d	Scale3d	Transform2d
+syn keyword mupadFunction	Transform3d	Translate2d	Translate3d	AmbientLight
+syn keyword mupadFunction	Camera	DistantLight	PointLight	SpotLight
+
+" graphics Attributes
+" graphics  Output Attributes
+syn keyword mupadIdentifier	OutputFile	OutputOptions
+" graphics  Defining Attributes
+syn keyword mupadIdentifier	Angle	AngleRange	AngleBegin	AngleEnd
+syn keyword mupadIdentifier	Area	Axis	AxisX	AxisY	AxisZ	Base	Top
+syn keyword mupadIdentifier	BaseX	TopX	BaseY	TopY	BaseZ	TopZ
+syn keyword mupadIdentifier	BaseRadius	TopRadius	Cells
+syn keyword mupadIdentifier	Center	CenterX	CenterY	CenterZ
+syn keyword mupadIdentifier	Closed	ColorData	CommandList	Contours	CoordinateType
+syn keyword mupadIdentifier	Data	DensityData	DensityFunction	From	To
+syn keyword mupadIdentifier	FromX	ToX	FromY	ToY	FromZ	ToZ
+syn keyword mupadIdentifier	Function	FunctionX	FunctionY	FunctionZ
+syn keyword mupadIdentifier	Function1	Function2	Baseline
+syn keyword mupadIdentifier	Generations	RotationAngle	IterationRules	StartRule StepLength
+syn keyword mupadIdentifier	TurtleRules	Ground	Heights	Moves	Inequalities
+syn keyword mupadIdentifier	InputFile	Iterations	StartingPoint
+syn keyword mupadIdentifier	LineColorFunction	FillColorFunction
+syn keyword mupadIdentifier	Matrix2d	Matrix3d
+syn keyword mupadIdentifier	MeshList	MeshListType	MeshListNormals
+syn keyword mupadIdentifier	MagneticQuantumNumber	MomentumQuantumNumber	PrincipalQuantumNumber
+syn keyword mupadIdentifier	Name	Normal	NormalX	NormalY	NormalZ
+syn keyword mupadIdentifier	ParameterName	ParameterBegin	ParameterEnd	ParameterRange
+syn keyword mupadIdentifier	Points2d	Points3d	Radius	RadiusFunction
+syn keyword mupadIdentifier	Position	PositionX	PositionY	PositionZ
+syn keyword mupadIdentifier	Scale	ScaleX	ScaleY	ScaleZ Shift	ShiftX	ShiftY	ShiftZ
+syn keyword mupadIdentifier	SemiAxes	SemiAxisX	SemiAxisY	SemiAxisZ
+syn keyword mupadIdentifier	Tangent1	Tangent1X	Tangent1Y	Tangent1Z
+syn keyword mupadIdentifier	Tangent2	Tangent2X	Tangent2Y	Tangent2Z
+syn keyword mupadIdentifier	Text	TextOrientation	TextRotation
+syn keyword mupadIdentifier	UName	URange	UMin	UMax	VName	VRange	VMin	VMax
+syn keyword mupadIdentifier	XName	XRange	XMin	XMax	YName	YRange	YMin	YMax
+syn keyword mupadIdentifier	ZName	ZRange	ZMin	ZMax	ViewingBox
+syn keyword mupadIdentifier	ViewingBoxXMin	ViewingBoxXMax	ViewingBoxXRange
+syn keyword mupadIdentifier	ViewingBoxYMin	ViewingBoxYMax	ViewingBoxYRange
+syn keyword mupadIdentifier	ViewingBoxZMin	ViewingBoxZMax	ViewingBoxZRange
+syn keyword mupadIdentifier	Visible
+" graphics  Axis Attributes
+syn keyword mupadIdentifier	Axes	AxesInFront	AxesLineColor	AxesLineWidth
+syn keyword mupadIdentifier	AxesOrigin	AxesOriginX	AxesOriginY	AxesOriginZ
+syn keyword mupadIdentifier	AxesTips	AxesTitleAlignment
+syn keyword mupadIdentifier	AxesTitleAlignmentX	AxesTitleAlignmentY	AxesTitleAlignmentZ
+syn keyword mupadIdentifier	AxesTitles	XAxisTitle	YAxisTitle	ZAxisTitle
+syn keyword mupadIdentifier	AxesVisible	XAxisVisible	YAxisVisible	ZAxisVisible
+syn keyword mupadIdentifier	YAxisTitleOrientation
+" graphics  Tick Marks Attributes
+syn keyword mupadIdentifier	TicksAnchor	XTicksAnchor	YTicksAnchor	ZTicksAnchor
+syn keyword mupadIdentifier	TicksAt	XTicksAt	YTicksAt	ZTicksAt
+syn keyword mupadIdentifier	TicksBetween	XTicksBetween	YTicksBetween	ZTicksBetween
+syn keyword mupadIdentifier	TicksDistance	XTicksDistance	YTicksDistance	ZTicksDistance
+syn keyword mupadIdentifier	TicksNumber	XTicksNumber	YTicksNumber	ZTicksNumber
+syn keyword mupadIdentifier	TicksVisible	XTicksVisible	YTicksVisible	ZTicksVisible
+syn keyword mupadIdentifier	TicksLength	TicksLabelStyle
+syn keyword mupadIdentifier	XTicksLabelStyle	YTicksLabelStyle	ZTicksLabelStyle
+syn keyword mupadIdentifier	TicksLabelsVisible
+syn keyword mupadIdentifier	XTicksLabelsVisible	YTicksLabelsVisible	ZTicksLabelsVisible
+" graphics  Grid Lines Attributes
+syn keyword mupadIdentifier	GridInFront	GridLineColor	SubgridLineColor
+syn keyword mupadIdentifier	GridLineStyle	SubgridLineStyle GridLineWidth	SubgridLineWidth
+syn keyword mupadIdentifier	GridVisible	XGridVisible	YGridVisible	ZGridVisible
+syn keyword mupadIdentifier	SubgridVisible	XSubgridVisible	YSubgridVisible	ZSubgridVisible
+" graphics  Animation Attributes
+syn keyword mupadIdentifier	Frames	TimeRange	TimeBegin	TimeEnd
+syn keyword mupadIdentifier	VisibleAfter	VisibleBefore	VisibleFromTo
+syn keyword mupadIdentifier	VisibleAfterEnd	VisibleBeforeBegin
+" graphics  Annotation Attributes
+syn keyword mupadIdentifier	Footer	Header	FooterAlignment	HeaderAlignment
+syn keyword mupadIdentifier	HorizontalAlignment	TitleAlignment	VerticalAlignment
+syn keyword mupadIdentifier	Legend	LegendEntry	LegendText
+syn keyword mupadIdentifier	LegendAlignment	LegendPlacement	LegendVisible
+syn keyword mupadIdentifier	Title	Titles
+syn keyword mupadIdentifier	TitlePosition	TitlePositionX	TitlePositionY	TitlePositionZ
+" graphics  Layout Attributes
+syn keyword mupadIdentifier	Bottom	Left	Height	Width	Layout	Rows	Columns
+syn keyword mupadIdentifier	Margin	BottomMargin	TopMargin	LeftMargin	RightMargin
+syn keyword mupadIdentifier	OutputUnits	Spacing
+" graphics  Calculation Attributes
+syn keyword mupadIdentifier	AdaptiveMesh	DiscontinuitySearch	Mesh	SubMesh
+syn keyword mupadIdentifier	UMesh	USubMesh	VMesh	VSubMesh
+syn keyword mupadIdentifier	XMesh	XSubMesh	YMesh	YSubMesh	Zmesh
+" graphics  Camera and Lights Attributes
+syn keyword mupadIdentifier	CameraCoordinates	CameraDirection
+syn keyword mupadIdentifier	CameraDirectionX	CameraDirectionY	CameraDirectionZ
+syn keyword mupadIdentifier	FocalPoint	FocalPointX	FocalPointY	FocalPointZ
+syn keyword mupadIdentifier	LightColor	Lighting	LightIntensity	OrthogonalProjection
+syn keyword mupadIdentifier	SpotAngle	ViewingAngle
+syn keyword mupadIdentifier	Target	TargetX	TargetY	TargetZ
+" graphics  Presentation Style and Fonts Attributes
+syn keyword mupadIdentifier	ArrowLength
+syn keyword mupadIdentifier	AxesTitleFont	FooterFont	HeaderFont	LegendFont
+syn keyword mupadIdentifier	TextFont	TicksLabelFont	TitleFont
+syn keyword mupadIdentifier	BackgroundColor	BackgroundColor2	BackgroundStyle
+syn keyword mupadIdentifier	BackgroundTransparent	Billboarding	BorderColor	BorderWidth
+syn keyword mupadIdentifier	BoxCenters	BoxWidths	DrawMode Gap	XGap	YGap
+syn keyword mupadIdentifier	Notched	NotchWidth	Scaling	YXRatio	ZXRatio
+syn keyword mupadIdentifier	VerticalAsymptotesVisible	VerticalAsymptotesStyle
+syn keyword mupadIdentifier	VerticalAsymptotesColor	VerticalAsymptotesWidth
+" graphics  Line Style Attributes
+syn keyword mupadIdentifier	LineColor	LineColor2	LineColorType	LineStyle
+syn keyword mupadIdentifier	LinesVisible	ULinesVisible	VLinesVisible	XLinesVisible
+syn keyword mupadIdentifier	YLinesVisible	LineWidth	MeshVisible
+" graphics  Point Style Attributes
+syn keyword mupadIdentifier	PointColor	PointSize	PointStyle	PointsVisible
+" graphics  Surface Style Attributes
+syn keyword mupadIdentifier	BarStyle	Shadows	Color	Colors	FillColor	FillColor2
+syn keyword mupadIdentifier	FillColorTrue	FillColorFalse	FillColorUnknown	FillColorType
+syn keyword mupadIdentifier	Filled	FillPattern	FillPatterns	FillStyle
+syn keyword mupadIdentifier	InterpolationStyle	Shading	UseNormals
+" graphics  Arrow Style Attributes
+syn keyword mupadIdentifier	TipAngle	TipLength	TipStyle	TubeDiameter
+syn keyword mupadIdentifier	Tubular
+" graphics  meta-documentation Attributes
+syn keyword mupadIdentifier	objectGroupsListed
+
+if version >= 508 || !exists("did_mupad_syntax_inits")
+  if version < 508
+    let did_mupad_syntax_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink mupadComment		Comment
+  HiLink mupadString		String
+  HiLink mupadOperator		Operator
+  HiLink mupadSpecial		Special
+  HiLink mupadStatement		Statement
+  HiLink mupadUnderlined	Underlined
+  HiLink mupadConditional	Conditional
+  HiLink mupadRepeat		Repeat
+  HiLink mupadFunction		Function
+  HiLink mupadType		Type
+  HiLink mupadDefine		Define
+  HiLink mupadIdentifier	Identifier
+
+  delcommand HiLink
+endif
+
+" TODO  More comprehensive listing.
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index d29d5ceab74bd032c8a43b28a8e310d1c0baaa32..b8933aff3abe69ee5ec5a68a00cbc0397fb4c15f 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -55,7 +55,7 @@ syn match vimHLGroup contained	"Conceal"
 syn case match
 
 " Function Names {{{2
-syn keyword vimFuncName contained	add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty errorlist escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function get getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify sort split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile 
+syn keyword vimFuncName contained	add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty errorlist escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function get getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify sort split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile soundfold spellsuggest spellbadword
 
 "--- syntax above generated by mkvimvim ---
 " Special Vim Highlighting (not automatic) {{{1
diff --git a/src/Makefile b/src/Makefile
index 03ee7c28b7486529d5f17b4679e239b572ebad0e..cea05871a8ea51ed05afaca0ef6456cc145f32c7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -516,6 +516,8 @@ CClink = $(CC)
 # EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond
 # allocated memory (and makes every malloc()/free() very slow).
 # Electric Fence is free (search ftp sites).
+# You may want to set the EF_PROTECT_BELOW environment variable to check the
+# other side of allocated memory.
 # On FreeBSD you might need to enlarge the number of mmaps allowed.  Do this
 # as root: sysctl -w vm.max_proc_mmap=30000
 #EXTRA_LIBS = /usr/local/lib/libefence.a
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 0eac58bda038bc8c96fd8166841ac211f1487171..b3faec86cedec14f550ad81ce356bcd6a4abf10f 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1186,9 +1186,9 @@ script_dump_profile(fd)
     int
 prof_def_func()
 {
-    scriptitem_T    *si = &SCRIPT_ITEM(current_SID);
-
-    return si->sn_pr_force;
+    if (current_SID > 0)
+	return SCRIPT_ITEM(current_SID).sn_pr_force;
+    return FALSE;
 }
 
 # endif
diff --git a/src/fileio.c b/src/fileio.c
index a8192eab0710820ca78d1825c8a38214b19eb23b..dc2606b93dff14818d295adf6560a74c6f5091b3 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5435,25 +5435,27 @@ buf_modname(shortname, fname, ext, prepend_dot)
      * Then truncate what is after the '/', '\' or ':' to 8 characters for
      * MSDOS and 26 characters for AMIGA, a lot more for UNIX.
      */
-    for (ptr = retval + fnamelen; ptr >= retval; mb_ptr_back(retval, ptr))
+    for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr))
     {
 #ifndef RISCOS
 	if (*ext == '.'
-#ifdef USE_LONG_FNAME
+# ifdef USE_LONG_FNAME
 		    && (!USE_LONG_FNAME || shortname)
-#else
-# ifndef SHORT_FNAME
+# else
+#  ifndef SHORT_FNAME
 		    && shortname
+#  endif
 # endif
-#endif
 								)
 	    if (*ptr == '.')	/* replace '.' by '_' */
 		*ptr = '_';
-#endif /* RISCOS */
+#endif
 	if (vim_ispathsep(*ptr))
+	{
+	    ++ptr;
 	    break;
+	}
     }
-    ptr++;
 
     /* the file name has at most BASENAMELEN characters. */
 #ifndef SHORT_FNAME
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 1c9d422e8ee7ae2f7ba35f6f166351b40b43e1c5..e9e75e517f564825cf9216029880dcf76f4f064d 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
-		test56.out test57.out test58.out
+		test56.out test57.out test58.out test59.out
 
 .SUFFIXES: .in .out
 
@@ -102,3 +102,4 @@ test55.out: test55.in
 test56.out: test56.in
 test57.out: test57.in
 test58.out: test58.in
+test59.out: test59.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 1b3c772b4676bdfccc0a88c6d6e1fd7d41e4e6ee..092b24aaca634e885227a3244b62d841a08f946b 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -18,7 +18,7 @@ SCRIPTS16 =	test1.out test19.out test20.out test22.out \
 		test35.out test36.out test43.out \
 		test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out \
-		test55.out test56.out test57.out test58.out
+		test55.out test56.out test57.out test58.out test59.out
 
 SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test8.out test9.out test11.out test13.out test14.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index a771e6a5fc88e6b894410d19ba75d27515d8535f..5236922c5ff1f86efa5d31579d0df682eb34d2b5 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test51.out test53.out test54.out test55.out \
-		test56.out test57.out test58.out
+		test56.out test57.out test58.out test59.out
 
 .SUFFIXES: .in .out
 
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 1ca1e8b1b99f4bcb6927d6b53079ae82c0b96dfe..6d08e5041a41ac6e4f952763aaad4a83b1f5162c 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2005 Jul 04
+# Last change:  2005 Jul 05
 #
 # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX.
 # Edit the lines in the Configuration section below to select.
@@ -58,7 +58,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test38.out test39.out test40.out test41.out test42.out \
 	 test43.out test44.out test45.out test46.out \
 	 test48.out test51.out test53.out test54.out test55.out \
-	 test56.out test57.out test58.out
+	 test56.out test57.out test58.out test59.out
 
 .IFDEF WANT_GUI
 SCRIPT_GUI = test16.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 7fa325f847007220668d1204e9ec82540b802814..433f48711868292b7c380d80af0ba8f1feb4933c 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -14,7 +14,8 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test38.out test39.out test40.out test41.out test42.out \
 		test43.out test44.out test45.out test46.out test47.out \
 		test48.out test49.out test51.out test52.out test53.out \
-		test54.out test55.out test56.out test57.out test58.out
+		test54.out test55.out test56.out test57.out test58.out \
+		test59.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test58.in b/src/testdir/test58.in
index 58275a3f11c73b1bba2ea2079bddfa14b68b8355..0575a44401a2d39438c0a203ffb36a06109f00a4 100644
--- a/src/testdir/test58.in
+++ b/src/testdir/test58.in
@@ -12,31 +12,46 @@ STARTTEST
 :" use that spell file
 :set spl=Xtest.latin1.spl
 :set spell
+:func SpellTest()
 /^test1:
-]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 4)
-:$put =string(lst)
-`m]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 2)
-:$put =string(lst)
-`m]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 2)
-:$put =string(lst)
-`m]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 2)
-:$put =string(lst)
-`m]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 2)
-:$put =string(lst)
-`m]smm:let str = spellbadword()
-:$put =str
-`m:let lst = spellsuggest(str, 2)
-:$put =string(lst)
+normal ]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 4)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+endfunc
+:call SpellTest()
 :spelldump
 1GyG:q
 :$put
@@ -84,6 +99,17 @@ gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add
 `m]s:let str = spellbadword()
 :$put =str
 :"
+:" Postponed prefixes
+gg:/^affstart3/+1,/^affend3/-1w! Xtest.aff
+:mkspell! Xtest Xtest
+:set spellfile=
+:set spl=Xtest.latin1.spl
+:mess
+:spelldump
+1GyG:q
+:$put
+:call SpellTest()
+:"
 gg:/^test output:/,$wq! test.out
 ENDTEST
 
@@ -116,6 +142,11 @@ SFX S Y 2
 SFX S 0 s [^s]
 SFX S 0 es s
 
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
 REP 3
 REP g ch
 REP ch g
@@ -159,6 +190,11 @@ SFX S Y 2
 SFX S 0 s [^s]
 SFX S 0 es s
 
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
 REP 3
 REP g ch
 REP ch g
@@ -284,9 +320,58 @@ SAL ZZ-                  _
 SAL Z                    S
 affend2
 
+affstart3
+SET ISO8859-1
+
+FOL  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+LOW  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+UPP  ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
+
+PFXPOSTPONE
+
+MIDWORD	'-
+
+KEP =
+RAR ?
+BAD !
+
+NOSPLITSUGS
+
+PFX I N 1
+PFX I 0 in .
+
+PFX O Y 1
+PFX O 0 out .
+
+SFX S Y 2
+SFX S 0 s [^s]
+SFX S 0 es s
+
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
+REP 3
+REP g ch
+REP ch g
+REP svp s.v.p.
+
+MAP 9
+MAP aàáâãäå
+MAP eèéêë
+MAP iìíîï
+MAP oòóôõö
+MAP uùúûü
+MAP nñ
+MAP cç
+MAP yÿý
+MAP sß
+affend3
+
 dicstart
 123456
-test
+test/NO
 # comment
 wrong
 Comment
diff --git a/src/testdir/test58.ok b/src/testdir/test58.ok
index 6de84842c9bd23519eb1b473a5180378f3cd6b44..186b2566686f5015d7ed37dedaa7254fe4c535e9 100644
--- a/src/testdir/test58.ok
+++ b/src/testdir/test58.ok
@@ -19,9 +19,12 @@ input
 OK
 output
 outputs
+outtest
 put
 puts
 test
+testen
+testn
 the end
 uk
 wrong
@@ -40,3 +43,32 @@ elequint
 elekwent
 elequint
 elekwint
+# file: Xtest.latin1.spl
+Comment
+deol
+déôr
+OK
+put
+input
+output
+puts
+outputs
+test
+outtest
+testen
+testn
+the end
+uk
+wrong
+inputs
+['input', 'puts', 'put', 'outputs']
+comment
+['Comment']
+ok
+['OK', 'uk']
+Ok
+['OK', 'Uk']
+test
+['test', 'Test']
+déôl
+['deol', 'déôr']
diff --git a/src/testdir/test59.in b/src/testdir/test59.in
new file mode 100644
index 0000000000000000000000000000000000000000..5a3753068c98616a6bd23c596a1cd3bff36351a4
--- /dev/null
+++ b/src/testdir/test59.in
@@ -0,0 +1,406 @@
+Tests for spell checking with 'encoding' set to "utf-8".  vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:so mbyte.vim
+:"
+:" First generate a .spl file from a .dic and a .aff file.
+:set enc=utf-8
+:/^affstart1/+1,/affend1/-1w Xtest.aff
+:/^dicstart/+1,/dicend/-1w Xtest.dic
+:mkspell Xtest Xtest
+:"
+:" use that spell file
+:set spl=Xtest.utf-8.spl
+:set spell
+:func SpellTest()
+/^test1:
+normal ]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 4)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+normal `m]smm
+let str = spellbadword()
+$put =str
+normal `m
+let lst = spellsuggest(str, 2)
+$put =string(lst)
+endfunc
+:call SpellTest()
+:spelldump
+1GyG:q
+:$put
+:$put =soundfold('goobledygoook')
+:$put =soundfold('kóopërÿnôven')
+:$put =soundfold('oeverloos gezwets edale')
+:"
+:" and now with SAL instead of SOFO items; test automatic reloading
+gg:/^affstart2/+1,/^affend2/-1w! Xtest.aff
+:mkspell! Xtest Xtest
+:$put =soundfold('goobledygoook')
+:$put =soundfold('kóopërÿnôven')
+:$put =soundfold('oeverloos gezwets edale')
+:"
+:" also use an addition file
+gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add
+:mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add
+:set spl=en
+:set spellfile=Xtest.utf-8.add
+/^test2:
+]s:let str = spellbadword()
+:$put =str
+:set spl=en_us
+/^test2:
+]smm:let str = spellbadword()
+:$put =str
+`m]s:let str = spellbadword()
+:$put =str
+:set spl=en_gb
+/^test2:
+]smm:let str = spellbadword()
+:$put =str
+`m]s:let str = spellbadword()
+:$put =str
+:set spl=en_nz
+/^test2:
+]smm:let str = spellbadword()
+:$put =str
+`m]s:let str = spellbadword()
+:$put =str
+:set spl=en_ca
+/^test2:
+]smm:let str = spellbadword()
+:$put =str
+`m]s:let str = spellbadword()
+:$put =str
+:"
+:" Postponed prefixes
+gg:/^affstart3/+1,/^affend3/-1w! Xtest.aff
+:mkspell! Xtest Xtest
+:set spellfile=
+:set spl=Xtest.utf-8.spl
+:mess
+:spelldump
+1GyG:q
+:$put
+:call SpellTest()
+:"
+gg:/^test output:/,$wq! test.out
+ENDTEST
+
+affstart1
+SET ISO8859-1
+TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ
+
+FOL  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+LOW  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+UPP  ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
+
+SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿
+SOFOTO   ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?
+
+MIDWORD	'-
+
+KEP =
+RAR ?
+BAD !
+
+NOSPLITSUGS
+
+PFX I N 1
+PFX I 0 in .
+
+PFX O Y 1
+PFX O 0 out .
+
+SFX S Y 2
+SFX S 0 s [^s]
+SFX S 0 es s
+
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
+REP 3
+REP g ch
+REP ch g
+REP svp s.v.p.
+
+MAP 9
+MAP aàáâãäå
+MAP eèéêë
+MAP iìíîï
+MAP oòóôõö
+MAP uùúûü
+MAP nñ
+MAP cç
+MAP yÿý
+MAP sß
+affend1
+
+affstart2
+SET ISO8859-1
+TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ
+
+FOL  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+LOW  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+UPP  ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
+
+MIDWORD	'-
+
+KEP =
+RAR ?
+BAD !
+
+NOSPLITSUGS
+
+PFX I N 1
+PFX I 0 in .
+
+PFX O Y 1
+PFX O 0 out .
+
+SFX S Y 2
+SFX S 0 s [^s]
+SFX S 0 es s
+
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
+REP 3
+REP g ch
+REP ch g
+REP svp s.v.p.
+
+MAP 9
+MAP aàáâãäå
+MAP eèéêë
+MAP iìíîï
+MAP oòóôõö
+MAP uùúûü
+MAP nñ
+MAP cç
+MAP yÿý
+MAP sß
+
+SAL AH(AEIOUY)-^         *H
+SAL AR(AEIOUY)-^         *R
+SAL A(HR)^               *
+SAL A^                   *
+SAL AH(AEIOUY)-          H
+SAL AR(AEIOUY)-          R
+SAL A(HR)                _
+SAL À^                   *
+SAL Å^                   *
+SAL BB-                  _
+SAL B                    B
+SAL CQ-                  _
+SAL CIA                  X
+SAL CH                   X
+SAL C(EIY)-              S
+SAL CK                   K
+SAL COUGH^               KF
+SAL CC<                  C
+SAL C                    K
+SAL DG(EIY)              K
+SAL DD-                  _
+SAL D                    T
+SAL É<                   E
+SAL EH(AEIOUY)-^         *H
+SAL ER(AEIOUY)-^         *R
+SAL E(HR)^               *
+SAL ENOUGH^$             *NF
+SAL E^                   *
+SAL EH(AEIOUY)-          H
+SAL ER(AEIOUY)-          R
+SAL E(HR)                _
+SAL FF-                  _
+SAL F                    F
+SAL GN^                  N
+SAL GN$                  N
+SAL GNS$                 NS
+SAL GNED$                N
+SAL GH(AEIOUY)-          K
+SAL GH                   _
+SAL GG9                  K
+SAL G                    K
+SAL H                    H
+SAL IH(AEIOUY)-^         *H
+SAL IR(AEIOUY)-^         *R
+SAL I(HR)^               *
+SAL I^                   *
+SAL ING6                 N
+SAL IH(AEIOUY)-          H
+SAL IR(AEIOUY)-          R
+SAL I(HR)                _
+SAL J                    K
+SAL KN^                  N
+SAL KK-                  _
+SAL K                    K
+SAL LAUGH^               LF
+SAL LL-                  _
+SAL L                    L
+SAL MB$                  M
+SAL MM                   M
+SAL M                    M
+SAL NN-                  _
+SAL N                    N
+SAL OH(AEIOUY)-^         *H
+SAL OR(AEIOUY)-^         *R
+SAL O(HR)^               *
+SAL O^                   *
+SAL OH(AEIOUY)-          H
+SAL OR(AEIOUY)-          R
+SAL O(HR)                _
+SAL PH                   F
+SAL PN^                  N
+SAL PP-                  _
+SAL P                    P
+SAL Q                    K
+SAL RH^                  R
+SAL ROUGH^               RF
+SAL RR-                  _
+SAL R                    R
+SAL SCH(EOU)-            SK
+SAL SC(IEY)-             S
+SAL SH                   X
+SAL SI(AO)-              X
+SAL SS-                  _
+SAL S                    S
+SAL TI(AO)-              X
+SAL TH                   @
+SAL TCH--                _
+SAL TOUGH^               TF
+SAL TT-                  _
+SAL T                    T
+SAL UH(AEIOUY)-^         *H
+SAL UR(AEIOUY)-^         *R
+SAL U(HR)^               *
+SAL U^                   *
+SAL UH(AEIOUY)-          H
+SAL UR(AEIOUY)-          R
+SAL U(HR)                _
+SAL V^                   W
+SAL V                    F
+SAL WR^                  R
+SAL WH^                  W
+SAL W(AEIOU)-            W
+SAL X^                   S
+SAL X                    KS
+SAL Y(AEIOU)-            Y
+SAL ZZ-                  _
+SAL Z                    S
+affend2
+
+affstart3
+SET ISO8859-1
+
+FOL  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+LOW  àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
+UPP  ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
+
+PFXPOSTPONE
+
+MIDWORD	'-
+
+KEP =
+RAR ?
+BAD !
+
+NOSPLITSUGS
+
+PFX I N 1
+PFX I 0 in .
+
+PFX O Y 1
+PFX O 0 out .
+
+SFX S Y 2
+SFX S 0 s [^s]
+SFX S 0 es s
+
+SFX N N 3
+SFX N 0 en [^n]
+SFX N 0 nen n
+SFX N 0 n .
+
+REP 3
+REP g ch
+REP ch g
+REP svp s.v.p.
+
+MAP 9
+MAP aàáâãäå
+MAP eèéêë
+MAP iìíîï
+MAP oòóôõö
+MAP uùúûü
+MAP nñ
+MAP cç
+MAP yÿý
+MAP sß
+affend3
+
+dicstart
+123456
+test/NO
+# comment
+wrong
+Comment
+OK
+uk
+put/ISO
+the end
+deol
+déôr
+dicend
+
+addstart
+/regions=usgbnz
+elequint/2
+elekwint/3
+addend
+
+test1:
+inputs	wrong
+comment	wrong
+puts	OK
+ok	wrong
+Ok	wrong
+the end.  test wrong
+déôl
+
+test2:
+elequint test elekwint test elekwent asdf
+
+
+test output:
diff --git a/src/testdir/test59.ok b/src/testdir/test59.ok
new file mode 100644
index 0000000000000000000000000000000000000000..6bbed6e225b076b9070eccdc479110f181ef634f
--- /dev/null
+++ b/src/testdir/test59.ok
@@ -0,0 +1,74 @@
+test output:
+inputs
+['input', 'puts', 'outputs', 'put']
+comment
+['Comment']
+ok
+['OK', 'uk']
+Ok
+['OK', 'Uk']
+test
+['test', 'Test']
+déôl
+['deol', 'déôr']
+# file: Xtest.utf-8.spl
+Comment
+deol
+déôr
+input
+OK
+output
+outputs
+outtest
+put
+puts
+test
+testen
+testn
+the end
+uk
+wrong
+gebletegek
+kepereneven
+everles gesvets etele
+kbltykk
+kprnfn
+*fls kswts tl
+elekwent
+elequint
+elekwint
+elekwint
+elekwent
+elequint
+elekwent
+elequint
+elekwint
+# file: Xtest.utf-8.spl
+Comment
+deol
+déôr
+OK
+put
+input
+output
+puts
+outputs
+test
+outtest
+testen
+testn
+the end
+uk
+wrong
+inputs
+['input', 'puts', 'put', 'outputs']
+comment
+['Comment']
+ok
+['OK', 'uk']
+Ok
+['OK', 'Uk']
+test
+['test', 'Test']
+déôl
+['deol', 'déôr']
diff --git a/src/version.h b/src/version.h
index 9656b5a8f34a4ceeed136841fe8d20cc274ca575..5936c4e5a81eb1a667cc5ac4399e393ed512d8ad 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 (2005 Jul 4)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 4, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 5)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 5, compiled "