changeset 523:a7ae7e043e43

updated for version 7.0146
author vimboss
date Tue, 13 Sep 2005 21:20:47 +0000
parents 530b30703db6
children d9cc61139d12
files runtime/autoload/ccomplete.vim runtime/autoload/htmlcomplete.vim runtime/autoload/netrw.vim runtime/doc/digraph.txt runtime/doc/eval.txt runtime/doc/insert.txt runtime/doc/options.txt runtime/doc/pattern.txt runtime/doc/pi_netrw.txt runtime/doc/quickref.txt runtime/doc/spell.txt runtime/doc/syntax.txt runtime/doc/tags runtime/doc/todo.txt runtime/doc/version7.txt runtime/ftplugin/html.vim runtime/optwin.vim runtime/spell/ru/ru_RU.diff runtime/spell/ru/ru_YO.diff runtime/syntax/vim.vim src/digraph.c src/edit.c src/globals.h src/normal.c src/option.c src/proto/normal.pro src/search.c src/spell.c src/structs.h src/syntax.c src/version.h
diffstat 31 files changed, 628 insertions(+), 167 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/autoload/ccomplete.vim
+++ b/runtime/autoload/ccomplete.vim
@@ -1,10 +1,10 @@
 " Vim completion script
 " Language:	C
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2005 Sep 10
+" Last Change:	2005 Sep 13
 
 
-" This function is used for the 'occultfunc' option.
+" This function is used for the 'omnifunc' option.
 function! ccomplete#Complete(findstart, base)
   if a:findstart
     " Locate the start of the item, including "." and "->".
@@ -38,12 +38,12 @@ function! ccomplete#Complete(findstart, 
   " 2. in tags file(s) (like with ":tag")
   " 3. in current file (like with "gD")
   let res = []
-  if searchdecl(items[0]) == 0
+  if searchdecl(items[0], 0, 1) == 0
     " Found, now figure out the type.
     " TODO: join previous line if it makes sense
     let line = getline('.')
     let col = col('.')
-    let res = ccomplete#Nextitem(strpart(line, 0, col), items[1:])
+    let res = s:Nextitem(strpart(line, 0, col), items[1:])
   endif
 
   if len(res) == 0
@@ -54,7 +54,7 @@ function! ccomplete#Complete(findstart, 
     for i in range(len(diclist))
       " New ctags has the "typename" field.
       if has_key(diclist[i], 'typename')
-	call extend(res, ccomplete#StructMembers(diclist[i]['typename'], items[1:]))
+	call extend(res, s:StructMembers(diclist[i]['typename'], items[1:]))
       endif
 
       " For a variable use the command, which must be a search pattern that
@@ -63,7 +63,7 @@ function! ccomplete#Complete(findstart, 
 	let line = diclist[i]['cmd']
 	if line[0] == '/' && line[1] == '^'
 	  let col = match(line, items[0])
-	  call extend(res, ccomplete#Nextitem(strpart(line, 2, col - 2), items[1:])
+	  call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:]))
 	endif
       endif
     endfor
@@ -74,19 +74,30 @@ function! ccomplete#Complete(findstart, 
     " TODO: join previous line if it makes sense
     let line = getline('.')
     let col = col('.')
-    let res = ccomplete#Nextitem(strpart(line, 0, col), items[1:])
+    let res = s:Nextitem(strpart(line, 0, col), items[1:])
+  endif
+
+  " If the one and only match was what's already there and it is a composite
+  " type, add a "." or "->".
+  if len(res) == 1 && res[0]['match'] == items[-1] && len(s:SearchMembers(res, [''])) > 0
+    " If there is a '*' before the name use "->".
+    if match(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0
+      let res[0]['match'] .= '->'
+    else
+      let res[0]['match'] .= '.'
+    endif
   endif
 
   " The basetext is up to the last "." or "->" and won't be changed.  The
   " matching members are concatenated to this.
   let basetext = matchstr(a:base, '.*\(\.\|->\)')
-  return map(res, 'basetext . v:val')
+  return map(res, 'basetext . v:val["match"]')
 endfunc
 
 " Find composing type in "lead" and match items[0] with it.
 " Repeat this recursively for items[1], if it's there.
 " Return the list of matches.
-function! ccomplete#Nextitem(lead, items)
+function! s:Nextitem(lead, items)
 
   " Use the text up to the variable name and split it in tokens.
   let tokens = split(a:lead, '\s\+\|\<')
@@ -97,7 +108,7 @@ function! ccomplete#Nextitem(lead, items
 
     " Recognize "struct foobar" and "union foobar".
     if (tokens[tidx] == 'struct' || tokens[tidx] == 'union') && tidx + 1 < len(tokens)
-      let res = ccomplete#StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items)
+      let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items)
       break
     endif
 
@@ -108,20 +119,42 @@ function! ccomplete#Nextitem(lead, items
 
     " Use the tags file to find out if this is a typedef.
     let diclist = taglist('^' . tokens[tidx] . '$')
-    for i in range(len(diclist))
+    for tagidx in range(len(diclist))
       " New ctags has the "typename" field.
-      if has_key(diclist[i], 'typename')
-	call extend(res, ccomplete#StructMembers(diclist[i]['typename'], a:items))
+      if has_key(diclist[tagidx], 'typename')
+	call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items))
+	continue
+      endif
+
+      " Only handle typedefs here.
+      if diclist[tagidx]['kind'] != 't'
 	continue
       endif
 
-      " For old ctags we only recognize "typedef struct foobar" in the tags
-      " file command.
-      let cmd = diclist[i]['cmd']
-      let ci = matchend(cmd, 'typedef\s\+struct\s\+')
-      if ci > 1
-	let name = matchstr(cmd, '\w*', ci)
-	call extend(res, ccomplete#StructMembers('struct:' . name, a:items))
+      " For old ctags we recognize "typedef struct aaa" and
+      " "typedef union bbb" in the tags file command.
+      let cmd = diclist[tagidx]['cmd']
+      let ei = matchend(cmd, 'typedef\s\+')
+      if ei > 1
+	let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
+	if len(cmdtokens) > 1
+	  if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union'
+	    let name = ''
+	    " Use the first identifier after the "struct" or "union"
+	    for ti in range(len(cmdtokens) - 1)
+	      if cmdtokens[ti] =~ '^\w'
+		let name = cmdtokens[ti]
+		break
+	      endif
+	    endfor
+	    if name != ''
+	      call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items))
+	    endif
+	  else
+	    " Could be "typedef other_T some_T".
+	    call extend(res, s:Nextitem(cmdtokens[0], a:items))
+	  endif
+	endif
       endif
     endfor
     if len(res) > 0
@@ -133,12 +166,13 @@ function! ccomplete#Nextitem(lead, items
 endfunction
 
 
-" Return a list with resulting matches
-function! ccomplete#StructMembers(typename, items)
+" Return a list with resulting matches.
+" Each match is a dictionary with "match" and "tagline" entries.
+function! s:StructMembers(typename, items)
   " Todo: What about local structures?
   let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
   if fnames == ''
-    return [[], []]
+    return []
   endif
 
   let typename = a:typename
@@ -153,45 +187,49 @@ function! ccomplete#StructMembers(typena
     let typename = substitute(typename, ':[^:]*::', ':', '')
   endwhile
 
-  let members = []
-  let taglines = []
+  let matches = []
   for l in qflist
     let memb = matchstr(l['text'], '[^\t]*')
     if memb =~ '^' . a:items[0]
-      call add(members, memb)
-      call add(taglines, l['text'])
+      call add(matches, {'match': memb, 'tagline': l['text']})
     endif
   endfor
 
-  if len(members) > 0
+  if len(matches) > 0
     " No further items, return the result.
     if len(a:items) == 1
-      return members
+      return matches
     endif
 
     " More items following.  For each of the possible members find the
     " matching following members.
-    let res = []
-    for i in range(len(members))
-      let line = taglines[i]
-      let e = matchend(line, '\ttypename:')
-      if e > 0
-	" Use typename field
-	let name = matchstr(line, '[^\t]*', e)
-	call extend(res, ccomplete#StructMembers(name, a:items[1:]))
-      else
-	let s = match(line, '\t\zs/^')
-	if s > 0
-	  let e = match(line, members[i], s)
-	  if e > 0
-	    call extend(res, ccomplete#Nextitem(strpart(line, s, e - s), a:items[1:]))
-	  endif
-	endif
-      endif
-    endfor
-    return res
+    return s:SearchMembers(matches, a:items[1:])
   endif
 
   " Failed to find anything.
   return []
 endfunction
+
+" For matching members, find matches for following items.
+function! s:SearchMembers(matches, items)
+  let res = []
+  for i in range(len(a:matches))
+    let line = a:matches[i]['tagline']
+    let e = matchend(line, '\ttypename:')
+    if e > 0
+      " Use typename field
+      let name = matchstr(line, '[^\t]*', e)
+      call extend(res, s:StructMembers(name, a:items))
+    else
+      " Use the search command (the declaration itself).
+      let s = match(line, '\t\zs/^')
+      if s > 0
+	let e = match(line, a:matches[i]['match'], s)
+	if e > 0
+	  call extend(res, s:Nextitem(strpart(line, s, e - s), a:items))
+	endif
+      endif
+    endif
+  endfor
+  return res
+endfunc
new file mode 100644
--- /dev/null
+++ b/runtime/autoload/htmlcomplete.vim
@@ -0,0 +1,243 @@
+" Vim completion script
+" Language:	XHTML 1.0 Strict
+" Maintainer:	Mikolaj Machowski ( mikmach AT wp DOT pl )
+" Last Change:	2005 Sep 13
+
+function! htmlcomplete#CompleteTags(findstart, base)
+  if a:findstart
+    " locate the start of the word
+    let line = getline('.')
+    let start = col('.') - 1
+    while start >= 0 && line[start - 1] !~ '<'
+      let start -= 1
+    endwhile
+	let g:st = start
+    return start
+  else
+	" Set attribute groups
+    let g:coreattrs = ["id", "class", "style", "title"] 
+    let g:i18n = ["lang", "xml:lang", "dir"]
+    let g:events = ["onclick", "ondblclick", "onmousedown", "onmouseup", "onmousemove",
+    			\ "onmouseout", "onkeypress", "onkeydown", "onkeyup"]
+    let g:focus = ["accesskey", "tabindex", "onfocus", "onblur"]
+    let g:coregroup = g:coreattrs
+    let g:coregroup = extend(g:coregroup, g:i18n)
+    let g:coregroup = extend(g:coregroup, g:events)
+    " find tags matching with "a:base"
+    let res = []
+	" If a:base contains > it means we are already outside of tag and we
+	" should abandon action
+	if a:base =~ '>'
+		return []
+	endif
+	" If a:base contains white space it is attribute. 
+	" It could be also value of attribute...
+	" Possible situations where any prediction would be difficult:
+	" 1. Events attributes
+	if a:base =~ '\s'
+		" Sort out style, class, and on* cases
+		" Perfect solution for style would be switching for CSS completion. Is
+		" it possible?
+		" Also retrieving class names from current file and linked
+		" stylesheets.
+		if a:base =~ "\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']"
+			let stripbase = matchstr(a:base, ".*\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
+			" Now we have a:base stripped from all chars up to style/class.
+			" It may fail with some strange style value combinations.
+			if stripbase !~ "[\"']"
+				return []
+			endif
+		endif
+		" We have to get first word to offer
+		" proper attributes.
+		let tag = split(a:base)[0]
+		" Get last word, it should be attr name
+		let attr = matchstr(a:base, '.*\s\zs.*')
+		" If attr contains =\s*[\"'] we catched value of attribute
+		if attr =~ "=\s*[\"']"
+			" Let do attribute specific completion
+			let attrname = matchstr(attr, '.*\ze\s*=')
+			let entered_value = matchstr(attr, ".*=\\s*[\"']\\zs.*")
+			let values = []
+			if attrname == 'media'
+				let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
+			elseif attrname == 'xml:space'
+				let values = ["preserve"]
+			elseif attrname == 'shape'
+				if a:base =~ '^a\>'
+					let values = ["rect"]
+				else
+					let values = ["rect", "circle", "poly", "default"]
+				endif
+			elseif attrname == 'valuetype'
+				let values = ["data", "ref", "object"]
+			elseif attrname == 'method'
+				let values = ["get", "post"]
+			elseif attrname == 'frame'
+				let values = ["void", "above", "below", "hsides", "lhs", "rhs", "vsides", "box", "border"]
+			elseif attrname == 'rules'
+				let values = ["none", "groups", "rows", "all"]
+			elseif attrname == 'align'
+				let values = ["left", "center", "right", "justify", "char"]
+			elseif attrname == 'valign'
+				let values = ["top", "middle", "bottom", "baseline"]
+			elseif attrname == 'scope'
+				let values = ["row", "col", "rowgroup", "colgroup"]
+			elseif attrname == 'href'
+				" Now we are looking for local anchors defined by name or id
+				if entered_value =~ '^#'
+					let file = join(getline(1, line('$')), ' ')
+					" Split it be sure there will be one id/name element in
+					" item, it will be also first word [a-zA-Z0-9_-] in element
+					let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']")
+					for i in oneelement
+						let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
+					endfor
+				endif
+			elseif attrname == 'type'
+				if a:base =~ '^input'
+					let values = ["input-text", "password", "checkbox", "radio", "submit", "reset", "input-file", "hidden", "input-image", "input-button"]
+				elseif a:base =~ '^button'
+					let values = ["button", "submit", "reset"]
+				endif
+			else
+				return []
+			endif
+
+			if len(values) == 0
+				return []
+			endif
+
+			" We need special version of sbase
+			let attrbase = matchstr(a:base, ".*[\"']")
+
+			for m in values
+				if m =~ '^' . entered_value
+					call add(res, attrbase . m . '" ')
+				endif
+			endfor
+		endif
+		" Shorten a:base to not include last word
+		let sbase = matchstr(a:base, '.*\ze\s.*')
+		if tag =~ '^\(abbr\|acronym\|b\|bdo\|big\|caption\|cite\|code\|dd\|dfn\|div\|dl\|dt\|em\|fieldset\|h\d\|kbd\|li\|noscript\|ol\|p\|samp\|small\|span\|strong\|sub\|sup\|tt\|ul\|var\)$'
+			let attrs = g:coregroup
+		elseif tag == 'a'
+			let tagspec = ["charset", "type", "name", "href", "hreflang", "rel", "rev", "shape", "coords"]
+			let attrs = extend(tagspec, g:coregroup)
+			let attrs = extend(attrs, g:focus)
+		elseif tag == 'area'
+			let attrs = g:coregroup
+		elseif tag == 'base'
+			let attrs = ["href", "id"]
+		elseif tag == 'blockquote'
+			let attrs = g:coregroup
+			let attrs = extend(attrs, ["cite"])
+		elseif tag == 'body'
+			let attrs = g:coregroup
+			let attrs = extend(attrs, ["onload", "onunload"])
+		elseif tag == 'br'
+			let attrs = g:coreattrs
+		elseif tag == 'button'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, g:focus)
+			let attrs = extend(attrs, ["name", "value", "type"])
+		elseif tag == '^\(col\|colgroup\)$'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["span", "width", "align", "char", "charoff", "valign"])
+		elseif tag =~ '^\(del\|ins\)$'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["cite", "datetime"])
+		elseif tag == 'form'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["action", "method", "enctype", "onsubmit", "onreset", "accept", "accept-charset"])
+		elseif tag == 'head'
+			let attrs = g:i18n
+			let attrs = extend(attrs, ["id", "profile"])
+		elseif tag == 'html'
+			let attrs = g:i18n
+			let attrs = extend(attrs, ["id", "xmlns"])
+		elseif tag == 'img'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["src", "alt", "longdesc", "height", "width", "usemap", "ismap"])
+		elseif tag == 'input'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, g:focus)
+			let attrs = extend(attrs, ["type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "onselect", "onchange", "accept"])
+		elseif tag == 'label'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["for", "accesskey", "onfocus", "onblur"])
+		elseif tag == 'legend'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["accesskey"])
+		elseif tag == 'link'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["charset", "href", "hreflang", "type", "rel", "rev", "media"])
+		elseif tag == 'map'
+			let attrs = g:i18n
+			let attrs = extend(attrs, g:events)
+			let attrs = extend(attrs, ["id", "class", "style", "title", "name"])
+		elseif tag == 'meta'
+			let attrs = g:i18n
+			let attrs = extend(attrs, ["id", "http-equiv", "content", "scheme", "name"])
+		elseif tag == 'title'
+			let attrs = g:i18n
+			let attrs = extend(attrs, ["id"])
+		elseif tag == 'object'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex"])
+		elseif tag == 'optgroup'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["disbled", "label"])
+		elseif tag == 'option'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["disbled", "selected", "value", "label"])
+		elseif tag == 'param'
+			let attrs = ["id", "name", "value", "valuetype", "type"]
+		elseif tag == 'pre'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["xml:space"])
+		elseif tag == 'q'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["cite"])
+		elseif tag == 'script'
+			let attrs = ["id", "charset", "type", "src", "defer", "xml:space"]
+		elseif tag == 'select'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"])
+		elseif tag == 'style'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["id", "type", "media", "title", "xml:space"])
+		elseif tag == 'table'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["summary", "width", "border", "frame", "rules" "cellspacing", "cellpadding"])
+		elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["align", "char", "charoff", "valign"])
+		elseif tag == 'textarea'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, g:focus)
+			let attrs = extend(attrs, ["name", "rows", "cols", "disabled", "readonly", "onselect", "onchange"])
+		elseif tag =~ '^\(th\|td\)$'
+			let attrs = g:coreattrs
+			let attrs = extend(attrs, ["abbr", "headers", "scope", "rowspan", "colspan", "align", "char", "charoff", "valign"])
+		endif
+
+		for m in sort(attrs)
+			if m =~ '^' . attr
+				if m =~ '^\(ismap\|defer\|declare\|nohref\|checked\|disabled\|selected\|readonly\)$'
+					call add(res, sbase.' '.m)
+				else
+					call add(res, sbase.' '.m.'="')
+				endif
+			endif
+		endfor
+		return res
+	endif
+    for m in split("a abbr acronym address area b base bdo big blockquote body br button caption cite code col colgroup dd del dfn div dl dt em fieldset form head h1 h2 h3 h4 h5 h6 hr html i img input ins kbd label legend li link map meta noscript object ol optgroup option p param pre q samp script select small span strong style sub sup table tbody td textarea tfoot th thead title tr tt ul var")
+		if m =~ '^' . a:base
+			call add(res, m)
+		endif
+    endfor
+    return res
+  endif
+endfunction
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,7 +1,7 @@
 " netrw.vim: Handles file transfer and remote directory listing across a network
 "            AUTOLOAD PORTION
-" Date:		Sep 09, 2005
-" Version:	69
+" Date:		Sep 12, 2005
+" Version:	70
 " Maintainer:	Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
 " Copyright:    Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@@ -26,7 +26,7 @@ if v:version < 700
  echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
  finish
 endif
-let g:loaded_netrw = "v69"
+let g:loaded_netrw = "v70"
 let s:keepcpo      = &cpo
 set cpo&vim
 " call Decho("doing autoload/netrw.vim")
@@ -1143,7 +1143,7 @@ fun! s:NetBrowse(dirname)
    keepjumps 1d
 
    " save certain window-oriented variables into buffer-oriented variables
-   call s:BufWinVars()
+   call s:SetBufWinVars()
    call s:NetOptionRestore()
    setlocal nomod
 
@@ -2237,12 +2237,10 @@ endfun
 " ---------------------------------------------------------------------
 " NetObtain: obtain file under cursor (for remote browsing support) {{{2
 fun! s:NetObtain()
-  if !exists("s:netrw_users_stl")
-   let s:netrw_users_stl= &stl
-  endif
   let fname= expand("<cWORD>")
-  exe 'set stl=%f\ %h%m%r%=Obtaining\ '.escape(fname,' ')
-  redraw!
+
+  " NetrwStatusLine support - for obtaining support
+  call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.fname)
 
 "  call Dfunc("NetObtain() method=".w:netrw_method)
   if exists("w:netrw_method") && w:netrw_method =~ '[235]'
@@ -2320,6 +2318,8 @@ fun! s:NetObtain()
      echohl Error | echo "***netrw*** this system doesn't support ftp" | echohl None
      call inputsave()|call input("Press <cr> to continue")|call inputrestore()
     endif
+    let &stl        = s:netrw_users_stl
+    let &laststatus = s:netrw_users_ls
 "    call Dret("NetObtain")
     return
    endif
@@ -2343,7 +2343,8 @@ fun! s:NetObtain()
   endif
 
   " restore status line
-  let &stl= s:netrw_users_stl
+  let &stl        = s:netrw_users_stl
+  let &laststatus = s:netrw_users_ls
   redraw!
 
 "  call Dret("NetObtain")
@@ -2611,7 +2612,7 @@ fun! netrw#DirBrowse(dirname)
   let w:netrw_prvdir= b:netrw_curdir
 
   " save certain window-oriented variables into buffer-oriented variables
-  call s:BufWinVars()
+  call s:SetBufWinVars()
   call s:NetOptionRestore()
   setlocal noma nomod nonu bh=hide nobl
 
@@ -3042,12 +3043,8 @@ fun! netrw#Explore(indx,dosplit,style,..
      endif
     endif
 
-    " NetrwStatusLine support
+    " NetrwStatusLine support - for exploring support
     let w:netrw_explore_indx= indx
-    if !exists("s:netrw_users_stl")
-     let s:netrw_users_stl= &stl
-    endif
-    set stl=%f\ %h%m%r%=%{NetrwStatusLine()}
 "    call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
 
     " sanity check
@@ -3060,15 +3057,21 @@ fun! netrw#Explore(indx,dosplit,style,..
     endif
 
     exe "let dirfile= w:netrw_explore_list[".indx."]"
-"    call Decho("dirfile<".dirfile."> indx=".indx)
+"    call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">")
     let newdir= substitute(dirfile,'/[^/]*$','','e')
 "    call Decho("newdir<".newdir.">")
+
 "    call Decho("calling LocalBrowse(newdir<".newdir.">)")
     call s:LocalBrowse(newdir)
-    call search(substitute(dirfile,"^.*/","",""),"W")
+    if w:netrw_longlist == 0 || w:netrw_longlist == 1
+     call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
+    else
+     call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
+    endif
     let w:netrw_explore_mtchcnt = indx + 1
     let w:netrw_explore_bufnr   = bufnr(".")
     let w:netrw_explore_line    = line(".")
+    call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
 "    call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
 
    else
@@ -3088,12 +3091,73 @@ fun! netrw#Explore(indx,dosplit,style,..
 endfun
 
 " ---------------------------------------------------------------------
+" SetupNetrwStatusLine: {{{2
+fun! s:SetupNetrwStatusLine(statline)
+"  call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)")
+
+  if !exists("s:netrw_setup_statline")
+   let s:netrw_setup_statline= 1
+"   call Decho("do first-time status line setup")
+
+   if !exists("s:netrw_users_stl")
+    let s:netrw_users_stl= &stl
+   endif
+   if !exists("s:netrw_users_ls")
+    let s:netrw_users_ls= &laststatus
+   endif
+
+   " set up User9 highlighting as needed
+   let keepa= @a
+   redir @a
+   try
+    hi User9
+   catch /^Vim\%((\a\+)\)\=:E411/
+    if &bg == "dark"
+     hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue
+    else
+     hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue
+    endif
+   endtry
+   redir END
+   let @a= keepa
+  endif
+
+  " set up status line (may use User9 highlighting)
+  " insure that windows have a statusline
+  " make sure statusline is displayed
+  let &stl=a:statline
+  set laststatus=2
+"  call Decho("stl=".&stl)
+  redraw!
+
+"  call Dret("SetupNetrwStatusLine : stl=".&stl)
+endfun
+
+" ---------------------------------------------------------------------
 " NetrwStatusLine: {{{2
 fun! NetrwStatusLine()
-"  let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr(".")." Xline#".w:netrw_explore_line." line#".line(".")
+
+  " vvv NetrwStatusLine() debugging vvv
+"  let g:stlmsg=""
+"  if !exists("w:netrw_explore_bufnr")
+"   let g:stlmsg="!X<explore_bufnr>"
+"  elseif w:netrw_explore_bufnr != bufnr(".")
+"   let g:stlmsg="explore_bufnr!=".bufnr(".")
+"  endif
+"  if !exists("w:netrw_explore_line")
+"   let g:stlmsg=" !X<explore_line>"
+"  elseif w:netrw_explore_line != line(".")
+"   let g:stlmsg=" explore_line!={line(.)<".line(".").">"
+"  endif
+"  if !exists("w:netrw_explore_list")
+"   let g:stlmsg=" !X<explore_list>"
+"  endif
+  " ^^^ NetrwStatusLine() debugging ^^^
+
   if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr(".") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
    " restore user's status line
-   let &stl= s:netrw_users_stl
+   let &stl        = s:netrw_users_stl
+   let &laststatus = s:netrw_users_ls
    if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
    if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
    return ""
@@ -3591,14 +3655,14 @@ fun! s:CopyWinVars()
 endfun
 
 " ---------------------------------------------------------------------
-" BufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1
+" SetBufWinVars: (used by NetBrowse() and LocalBrowse()) {{{1
 "   To allow separate windows to have their own activities, such as
 "   Explore **/pattern, several variables have been made window-oriented.
 "   However, when the user splits a browser window (ex: ctrl-w s), these
-"   variables are not inherited by the new window.  BufWinVars() and
+"   variables are not inherited by the new window.  SetBufWinVars() and
 "   UseBufWinVars() get around that.
-fun! s:BufWinVars()
-"  call Dfunc("BufWinVars()")
+fun! s:SetBufWinVars()
+"  call Dfunc("SetBufWinVars()")
   if exists("w:netrw_longlist")       |let b:netrw_longlist        = w:netrw_longlist       |endif
   if exists("w:netrw_bannercnt")      |let b:netrw_bannercnt       = w:netrw_bannercnt      |endif
   if exists("w:netrw_method")         |let b:netrw_method          = w:netrw_method         |endif
@@ -3609,7 +3673,7 @@ fun! s:BufWinVars()
   if exists("w:netrw_explore_bufnr")  |let b:netrw_explore_bufnr   = w:netrw_explore_bufnr  |endif
   if exists("w:netrw_explore_line")   |let b:netrw_explore_line    = w:netrw_explore_line   |endif
   if exists("w:netrw_explore_list")   |let b:netrw_explore_list    = w:netrw_explore_list   |endif
-"  call Dret("BufWinVars")
+"  call Dret("SetBufWinVars")
 endfun
 
 " ---------------------------------------------------------------------
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -1,4 +1,4 @@
-*digraph.txt*   For Vim version 7.0aa.  Last change: 2005 Mar 06
+*digraph.txt*   For Vim version 7.0aa.  Last change: 2005 Sep 11
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -166,7 +166,8 @@ EURO
 Exception: RFC1345 doesn't specify the euro sign.  In Vim the digraph =e was
 added for this.  Note the difference between latin1, where the digraph Cu is
 used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
-used for the euro sign, while both of them are the character 164, 0xa4.
+used for the euro sign, while both of them are the character 164, 0xa4.  For
+compatibility with zsh Eu can also be used for the euro sign.
 
 							*digraph-table*
 char  digraph	hex	dec	official name ~
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Sep 10
+*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Sep 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1607,7 +1607,8 @@ repeat( {expr}, {count})	String	repeat {
 resolve( {filename})		String	get filename a shortcut points to
 reverse( {list})		List	reverse {list} in-place
 search( {pattern} [, {flags}])	Number	search for {pattern}
-searchdecl({name} [, {global}]) Number  search for variable declaration
+searchdecl({name} [, {global} [, {thisblock}]])
+				Number  search for variable declaration
 searchpair( {start}, {middle}, {end} [, {flags} [, {skip}]])
 				Number	search for other end of start/end pair
 server2client( {clientid}, {string})
@@ -3730,10 +3731,17 @@ search({pattern} [, {flags}])				*search
 		    :endwhile
 <
 
-searchdecl({name} [, {global}])				*searchdecl()*
-		Search for the declaration of {name}.  Without {global} or
-		with a zero {global} argument this works like |gd|.  With a
-		non-zero {global} argument it works like |gD|.
+searchdecl({name} [, {global} [, {thisblock}]])			*searchdecl()*
+		Search for the declaration of {name}.
+		
+		With a non-zero {global} argument it works like |gD|, find
+		first match in the file.  Otherwise it works like |gd|, find
+		first match in the function.
+
+		With a non-zero {thisblock} argument matches in a {} block
+		that ends before the cursor position are ignored.  Avoids
+		finding variable declarations only valid in another scope.
+
 		Moves the cursor to the found match.
 		Returns zero for success, non-zero for failure.
 		Example: >
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Sep 10
+*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -569,7 +569,7 @@ 7. file names						|i_CTRL-X_CTRL-F|
 8. definitions or macros				|i_CTRL-X_CTRL-D|
 9. Vim command-line					|i_CTRL-X_CTRL-V|
 10. User defined completion				|i_CTRL-X_CTRL-U|
-11. Occult completion					|i_CTRL-X_CTRL-O|
+11. omni completion					|i_CTRL-X_CTRL-O|
 12. Spelling suggestions				|i_CTRL-X_s|
 13. keywords in 'complete'				|i_CTRL-N|
 
@@ -674,6 +674,9 @@ at least two characters is matched.
 	just type:
 	    printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
 
+The search wraps around the end of the file, the value of 'wrapscan' is not
+used here.
+
 Multiple repeats of the same completion are skipped; thus a different match
 will be inserted at each CTRL-N and CTRL-P (unless there is only one
 matching keyword).
@@ -882,13 +885,13 @@ CTRL-X CTRL-U		Guess what kind of item i
 			previous one.
 
 
-Occult completion					*compl-occult*
+Omni completion						*compl-omni*
 
 Completion is done by a function that can be defined by the user with the
-'occultfunc' option.  This is to be used for filetype-specific completion.
+'omnifunc' option.  This is to be used for filetype-specific completion.
 
 See the 'completefunc' help for how the function is called and an example.
-For remarks about specific filetypes see |compl-occult-filetypes|.
+For remarks about specific filetypes see |compl-omni-filetypes|.
 
 							*i_CTRL-X_CTRL-O*
 CTRL-X CTRL-O		Guess what kind of item is in front of the cursor and
@@ -949,14 +952,14 @@ CTRL-P			Find previous match for words t
 			other contexts unless a double CTRL-X is used.
 
 
-Filetype-specific remarks for occult completion	    *compl-occult-filetypes*
+Filetype-specific remarks for omni completion	    *compl-omni-filetypes*
 
-C							*ft-c-occult*
+C							*ft-c-omni*
 
-Completion requires a tags file.  You should use Exuberant ctags, because it
-adds extra information that is needed for completion.  You can find it here:
-http://ctags.sourceforge.net/
-For version 5.5.4 you need to add a patch that adds the "typename:" field:
+Completion of C code requires a tags file.  You should use Exuberant ctags,
+because it adds extra information that is needed for completion.  You can find
+it here: http://ctags.sourceforge.net/
+For version 5.5.4 you should add a patch that adds the "typename:" field:
 ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
 
 If you want to complete system functions you can do something like this.  Use
@@ -974,6 +977,9 @@ When using CTRL-X CTRL-O after something
 to recognize the type of the variable and figure out what members it has.
 This means only members valid for the variable will be listed.
 
+When a member name already was complete, CTRL-X CTRL-O will add a "." or
+"->" for composite types.
+
 Vim doesn't include a C compiler, only the most obviously formatted
 declarations are recognized.  Preprocessor stuff may cause confusion.
 When the same structure name appears in multiple places all possible members
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.0aa.  Last change: 2005 Sep 10
+*options.txt*	For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -19,7 +19,7 @@ achieve special effects.  These options 
 	string		has a string value
 
 ==============================================================================
-1. Setting options					*set-option*
+1. Setting options					*set-option* *E764*
 
 							*:se* *:set*
 :se[t]			Show all options that differ from their default value.
@@ -4602,8 +4602,8 @@ A jump table for the options with a shor
 	The minimum value is 1, the maximum value is 10.
 	NOTE: 'numberwidth' is reset to 8 when 'compatible' is set.
 
-						*'occultfunc'* *'ofu'*
-'occultfunc' 'ofu'	string	(default: empty)
+						*'omnifunc'* *'ofu'*
+'omnifunc' 'ofu'	string	(default: empty)
 			local to buffer
 			{not in Vi}
 			{not available when compiled without the +eval
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.0aa.  Last change: 2005 Aug 18
+*pattern.txt*   For Vim version 7.0aa.  Last change: 2005 Sep 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -117,6 +117,14 @@ gD			Goto global Declaration.  When the 
 			like "gd", except that the search for the keyword
 			always starts in line 1.  {not in Vi}
 
+							*1gd*
+1gd			Like "gd", but ignore matches inside a {} block that
+			ends before the cursor position. {not in Vi}
+
+							*1gD*
+1gD			Like "gD", but ignore matches inside a {} block that
+			ends before the cursor position. {not in Vi}
+
 							*CTRL-C*
 CTRL-C			Interrupt current (search) command.  Use CTRL-Break on
 			MS-DOS |dos-CTRL-Break|.
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt*  For Vim version 7.0.  Last change: Sep 07, 2005
+*pi_netrw.txt*  For Vim version 7.0.  Last change: Sep 12, 2005
 
 
 		VIM REFERENCE MANUAL    by Charles E. Campbell, Jr.
@@ -333,6 +333,7 @@ after one has set it.
 
 Unfortunately there doesn't appear to be a way for netrw to feed a password to
 scp.  Thus every transfer via scp will require re-entry of the password.
+However, |netrw-listhack| can help with this problem.
 
 
 ==============================================================================
@@ -341,20 +342,27 @@ 3. Activation						*netrw-activate*
 Network-oriented file transfers are available by default whenever
 |'nocompatible'| mode is enabled.  The <netrw.vim> file resides in your
 system's vim-plugin directory and is sourced automatically whenever you bring
-up vim.
-
+up vim.  I suggest that, at a minimum, you have at least the following in your
+<.vimrc> customization file: >
+	set nocp
+	if version >= 600
+	  filetype plugin indent on
+	endif
+<
 
 ==============================================================================
 4. Transparent File Transfer				*netrw-transparent*
 
 Transparent file transfers occur whenever a regular file read or write
 (invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
-Thus one may use files across networks as if they were local. >
+Thus one may use files across networks just as simply as if they were local. >
 
 	vim ftp://[user@]machine/path
 	...
 	:wq
 
+See |netrw-activate| for more on how to encourage your vim to use plugins
+such as netrw.
 
 ==============================================================================
 5. Ex Commands						*netrw-ex*
@@ -368,8 +376,7 @@ additional commands available.
 :[range]Nw {netfile} [{netfile}]...
 		Write the specified lines to the {netfile}.
 
-:Nread
-		Read the specified lines into the current
+:Nread		Read the specified lines into the current
 		buffer from the file specified in
 		b:netrw_lastfile.
 
@@ -400,10 +407,11 @@ 6. Variables and Options       			*netrw
 
 The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
 behavior.  These variables typically may be set in the user's <.vimrc> file:
->
-                                -------------
-                           	Netrw Options
-                                -------------
+(also see |netrw-settings|) >
+
+                        -------------
+                        Netrw Options
+                        -------------
 	Option			Meaning
 	--------------		-----------------------------------------------
 <
@@ -859,7 +867,21 @@ OBTAINING A FILE						*netrw-O*
 When browsing a remote directory, one may obtain a file under the cursor (ie.
 get a copy on your local machine, but not edit it) by pressing the O key.
 Only ftp and scp are supported for this operation (but since these two are
-available for browsing, that shouldn't be a problem).
+available for browsing, that shouldn't be a problem).  The status bar
+will then show, on its right hand side, a message like "Obtaining filename".
+The statusline will be restored after the transfer is complete.
+
+Netrw can also "obtain" a file using the local browser.  Netrw's display
+of a directory is not necessarily the same as Vim's "current directory",
+unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>.  One may select
+a file using the local browser (by putting the cursor on it) and pressing
+"O" will then "obtain" the file; ie. copy it to Vim's current directory.
+
+Related topics:
+ * To see what the current directory is, use |:pwd|
+ * To make the currently browsed directory the current directory, see |netrw-c|
+ * To automatically make the currently browsed directory the current
+   directory, see |g:netrw_keepdir|.
 
 
 THIN, LONG, AND WIDE LISTINGS					*netrw-i*
@@ -1257,6 +1279,9 @@ which is loaded automatically at startup
 ==============================================================================
 10. History						*netrw-history*
 
+	v70: * when using |netrw-O|, the "Obtaining filename" message is now
+	       shown using |hl-User9|.  If User9 has not been defined, netrw
+	       will define it.
 	v69: * Bugfix: win95/98 machines were experiencing a
 	       "E121: Undefined variable: g:netrw_win95ftp" message
 	v68: * double-click-leftmouse selects word under mouse
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt*  For Vim version 7.0aa.  Last change: 2005 Sep 01
+*quickref.txt*  For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -772,7 +772,7 @@ Short explanation of each option:		*opti
 |'nrformats'|	  |'nf'|     number formats recognized for CTRL-A command
 |'number'|	  |'nu'|     print the line number in front of each line
 |'numberwidth'|	  |'nuw'|    number of columns used for the line number
-|'occultfunc'|    |'ofu'|    function for filetype-specific completion
+|'omnifunc'|      |'ofu'|    function for filetype-specific completion
 |'osfiletype'|	  |'oft'|    operating system-specific filetype information
 |'paragraphs'|	  |'para'|   nroff macros that separate paragraphs
 |'paste'|		     allow pasting text
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt*	For Vim version 7.0aa.  Last change: 2005 Aug 30
+*spell.txt*	For Vim version 7.0aa.  Last change: 2005 Sep 12
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -60,7 +60,7 @@ To search for the next misspelled word:
 [S			Like "]S" but search backwards.
 
 
-To add words to your own word list:				*E764*
+To add words to your own word list:
 
 							*zg*
 zg			Add word under the cursor as a good word to the first
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.0aa.  Last change: 2005 Aug 30
+*syntax.txt*	For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3969,7 +3969,7 @@ WarningMsg	warning messages
 							*hl-WildMenu*
 WildMenu	current match in 'wildmenu' completion
 
-						*hl-User1* *hl-User1..9*
+					*hl-User1* *hl-User1..9* *hl-User9*
 The 'statusline' syntax allows the use of 9 different highlights in the
 statusline and ruler (via 'rulerformat').  The names are User1 to User9.
 
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -607,9 +607,9 @@
 'number'	options.txt	/*'number'*
 'numberwidth'	options.txt	/*'numberwidth'*
 'nuw'	options.txt	/*'nuw'*
-'occultfunc'	options.txt	/*'occultfunc'*
 'oft'	options.txt	/*'oft'*
 'ofu'	options.txt	/*'ofu'*
+'omnifunc'	options.txt	/*'omnifunc'*
 'op'	vi_diff.txt	/*'op'*
 'open'	vi_diff.txt	/*'open'*
 'optimize'	vi_diff.txt	/*'optimize'*
@@ -1484,6 +1484,8 @@ 12.5	usr_12.txt	/*12.5*
 12.6	usr_12.txt	/*12.6*
 12.7	usr_12.txt	/*12.7*
 12.8	usr_12.txt	/*12.8*
+1gD	pattern.txt	/*1gD*
+1gd	pattern.txt	/*1gd*
 20.1	usr_20.txt	/*20.1*
 20.2	usr_20.txt	/*20.2*
 20.3	usr_20.txt	/*20.3*
@@ -3752,7 +3754,7 @@ E760	spell.txt	/*E760*
 E761	spell.txt	/*E761*
 E762	spell.txt	/*E762*
 E763	spell.txt	/*E763*
-E764	spell.txt	/*E764*
+E764	options.txt	/*E764*
 E765	options.txt	/*E765*
 E766	eval.txt	/*E766*
 E767	eval.txt	/*E767*
@@ -4460,8 +4462,8 @@ compl-filename	insert.txt	/*compl-filena
 compl-function	insert.txt	/*compl-function*
 compl-generic	insert.txt	/*compl-generic*
 compl-keyword	insert.txt	/*compl-keyword*
-compl-occult	insert.txt	/*compl-occult*
-compl-occult-filetypes	insert.txt	/*compl-occult-filetypes*
+compl-omni	insert.txt	/*compl-omni*
+compl-omni-filetypes	insert.txt	/*compl-omni-filetypes*
 compl-spelling	insert.txt	/*compl-spelling*
 compl-tag	insert.txt	/*compl-tag*
 compl-vim	insert.txt	/*compl-vim*
@@ -4962,7 +4964,7 @@ ft-aspperl-syntax	syntax.txt	/*ft-aspper
 ft-aspvbs-syntax	syntax.txt	/*ft-aspvbs-syntax*
 ft-bash-syntax	syntax.txt	/*ft-bash-syntax*
 ft-basic-syntax	syntax.txt	/*ft-basic-syntax*
-ft-c-occult	insert.txt	/*ft-c-occult*
+ft-c-omni	insert.txt	/*ft-c-omni*
 ft-c-syntax	syntax.txt	/*ft-c-syntax*
 ft-ch-syntax	syntax.txt	/*ft-ch-syntax*
 ft-changelog-plugin	filetype.txt	/*ft-changelog-plugin*
@@ -5363,6 +5365,7 @@ hl-Title	syntax.txt	/*hl-Title*
 hl-Tooltip	syntax.txt	/*hl-Tooltip*
 hl-User1	syntax.txt	/*hl-User1*
 hl-User1..9	syntax.txt	/*hl-User1..9*
+hl-User9	syntax.txt	/*hl-User9*
 hl-VertSplit	syntax.txt	/*hl-VertSplit*
 hl-Visual	syntax.txt	/*hl-Visual*
 hl-VisualNOS	syntax.txt	/*hl-VisualNOS*
@@ -5977,6 +5980,7 @@ new-multi-byte	version5.txt	/*new-multi-
 new-multi-lang	version6.txt	/*new-multi-lang*
 new-netrw-explore	version7.txt	/*new-netrw-explore*
 new-network-files	version6.txt	/*new-network-files*
+new-omni-completion	version7.txt	/*new-omni-completion*
 new-operator-mod	version6.txt	/*new-operator-mod*
 new-options-5.2	version5.txt	/*new-options-5.2*
 new-options-5.4	version5.txt	/*new-options-5.4*
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Sep 10
+*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -31,10 +31,12 @@ be worked on, but only if you sponsor Vi
 -------------------- Known bugs and current work -----------------------
 
 ccomplete:
+- How to use a popup menu?
 - When a typedef or struct is local to a file only use it in that file?
-- How to use a popup menu?
-- when a struct reference is already complete and CTRL-X CTRL-O is used, add a
-  "." or "->"?
+
+When 'foldcolumn' is 1 show more + to be able to open all folds? (Donohue)
+
+After vi" another i" should include the quotes.
 
 Mac unicode patch (Da Woon Jung):
 - selecting proportional font breaks display
@@ -63,21 +65,27 @@ Awaiting response:
 
 PLANNED FOR VERSION 7.0:
 
--   Occult completion: Understands the programming language and finds matches
+-   Omni completion: Understands the programming language and finds matches
     that make sense.  Esp. members of classes/structs.
 
     It's not much different from other Insert-mode completion, use the same
-    mechanism.  Use CTRL-X CTRL-O and 'occultfunc'.  Set 'occultfunc' in the
+    mechanism.  Use CTRL-X CTRL-O and 'omnifunc'.  Set 'omnifunc' in the
     filetype plugin, define the function in the autoload directory.
     
     Separately develop the completion logic and the UI.  When adding UI stuff
     make it work for all completion methods.
 
     UI:
-    - At first: use 'wildmenu' kind of thing.
-    - Nicer: Display the list of choices right under the place where they
+    - Display the list of choices right under the place where they
       would be inserted in a kind of meny (use scrollbar when there are many
       alternatives).
+      At first in a terminal, then add GUI implementations.
+    - When using tags, show match in preview window (function prototype,
+      struct member, etc.).
+      Or use one window for matches, another for context/info (Doug Kearns,
+      2005 Sep 13)
+    - Ideas on: http://www.wholetomato.com/
+
 
     Completion logic:
 	Use runtime/autoload/{filetype}complete.vim files.
@@ -92,6 +100,12 @@ PLANNED FOR VERSION 7.0:
 	    complist[0]['helpfunc'] = function that shows help text
 	    etc.
 
+	Can CTRL-] (jump to tag) include the "." and "->" to restrict the
+	number of possible matches? (Flemming Madsen)
+
+	In general: Besides completion, figure out the type of a variable
+	and use it for information.
+
 	Ideas from others:
 	http://www.vim.org/scripts/script.php?script_id=747
 	    http://sourceforge.net/projects/insenvim
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Sep 10
+*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Sep 13
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -20,6 +20,7 @@ NEW FEATURES				|new-7|
 
 Vim script enhancements			|new-vim-script|
 Spell checking				|new-spell|
+Omni completion				|new-omni-completion|
 KDE support				|new-KDE|
 MzScheme interface			|new-MzScheme|
 Printing multi-byte text		|new-print-multi-byte|
@@ -180,6 +181,22 @@ highlighting.
 Much more info here: |spell|.
 
 
+Omni completion					*new-omni-completion*
+-----------------
+
+This could also be called "intellisense", but that is a trademark.  It is a
+smart kind of completion.  The text in front of the cursor is inspected to
+figure out what could be following.  This considers struct and class members,
+unions, etc.
+
+Use CTRL-X CTRL-O in Insert mode to start the completion.  |i_CTRL-X_CTRL-O|
+
+The 'omnifunc' option is set by filetype plugins to define the function that
+figures out the completion.
+
+Currently only C is supported. |ft-c-omni|
+
+
 KDE support						*new-KDE*
 -----------
 
@@ -349,6 +366,7 @@ Options: ~
 'completefunc'		The name of a function used for user-specified Insert
 			mode completion.  CTRL-X CTRL-U can be used in Insert
 			mode to do any kind of completion.  (Taro Muraoka)
+'omnifunc'		The name of a function used for omni completion.
 'quoteescape'		Characters used to escape quotes inside a string.
 			Used for the a", a' and a` text objects. |a'|
 'numberwidth'		Minimal width of the space used for the 'number'
@@ -450,6 +468,7 @@ New functions: ~
 |remove()|		remove one or more items from a List or Dictionary
 |repeat()| 		repeat "expr" "count" times (Christophe Poucet)
 |reverse()|		reverse the order of a List
+|searchdecl()|		search for declaration of variable
 |setqflist()|		create a quickfix list (Yegappan Lakshmanan)
 |sort()|		sort a List
 |soundfold()|		get the sound-a-like equivalent of a word
@@ -576,6 +595,9 @@ When 'verbose' is set the output of the 
 
 ":function /pattern" lists functions matching the pattern.
 
+"1gd" can be used like "gd" but ignores matches in a {} block that ends before
+the cursor position.  Likewise for "1gD" and "gD".
+
 ==============================================================================
 IMPROVEMENTS						*improvements-7*
 
--- a/runtime/ftplugin/html.vim
+++ b/runtime/ftplugin/html.vim
@@ -14,6 +14,8 @@ set cpo-=C
 
 setlocal commentstring=<!--%s-->
 
+setlocal omnifunc=htmlcomplete#CompleteTags
+
 " HTML:  thanks to Johannes Zellner and Benji Fisher.
 if exists("loaded_matchit")
     let b:match_ignorecase = 1
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2005 Sep 01
+" Last Change:	2005 Sep 13
 
 " If there already is an option window, jump to that one.
 if bufwinnr("option-window") > 0
@@ -704,7 +704,7 @@ if has("insert_expand")
   call append("$", "completefunc\tuser defined function for Insert mode completion")
   call append("$", "\t(local to buffer)")
   call <SID>OptionL("cfu")
-  call append("$", "occultfunc\tfunction for filetype-specific Insert mode completion")
+  call append("$", "omnifunc\tfunction for filetype-specific Insert mode completion")
   call append("$", "\t(local to buffer)")
   call <SID>OptionL("ofu")
   call append("$", "dictionary\tlist of dictionary files for keyword completion")
--- a/runtime/spell/ru/ru_RU.diff
+++ b/runtime/spell/ru/ru_RU.diff
@@ -1,8 +1,8 @@
 *** ru_RU.orig.aff	Sun Aug 28 21:12:27 2005
---- ru_RU.aff	Sun Sep  4 17:21:40 2005
+--- ru_RU.aff	Mon Sep 12 22:10:22 2005
 ***************
 *** 3,4 ****
---- 3,13 ----
+--- 3,11 ----
   
 + FOL ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ
 + LOW ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ
@@ -11,8 +11,6 @@
 + SOFOFROM ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑáâ÷çäå³öúéêëìíîïðòóôõæèãþûýøùÿüàñ
 + SOFOTO   ÅÂ×ÇÄÅÅÖÚÅÊËÌÎÎÅÐÒÓÔÅÆÈÃÞÛÛØÅ'ÅÅÅåâ÷çäååöúåêëìîîåðòóôåæèãþûûøå'ååå
 + 
-+ MIDWORD '-
-+ 
   SFX L Y 52
 *** ru_RU.orig.dic	Sun Aug 28 21:12:27 2005
 --- ru_RU.dic	Sun Sep  4 17:23:27 2005
--- a/runtime/spell/ru/ru_YO.diff
+++ b/runtime/spell/ru/ru_YO.diff
@@ -1,8 +1,8 @@
 *** ru_YO.orig.aff	Sun Aug 28 21:12:35 2005
---- ru_YO.aff	Sun Sep  4 17:23:51 2005
+--- ru_YO.aff	Mon Sep 12 22:10:32 2005
 ***************
 *** 3,4 ****
---- 3,13 ----
+--- 3,11 ----
   
 + FOL ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ
 + LOW ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑ
@@ -11,8 +11,6 @@
 + SOFOFROM ÁÂ×ÇÄÅ£ÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝØÙßÜÀÑáâ÷çäå³öúéêëìíîïðòóôõæèãþûýøùÿüàñ
 + SOFOTO   ÅÂ×ÇÄÅÅÖÚÅÊËÌÎÎÅÐÒÓÔÅÆÈÃÞÛÛØÅ'ÅÅÅåâ÷çäååöúåêëìîîåðòóôåæèãþûûøå'ååå
 + 
-+ MIDWORD '-
-+ 
   SFX L Y 56
 *** ru_YO.orig.dic	Sun Aug 28 21:12:35 2005
 --- ru_YO.dic	Sun Sep  4 17:24:26 2005
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -20,7 +20,7 @@ syn keyword vimCommand contained	ab[brev
 syn match   vimCommand contained	"\<z[-+^.=]"
 
 " vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained	: acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw occultfunc oft ofu osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose verbosefile vfile vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww 
+syn keyword vimOption contained	: acd ai akm al aleph allowrevins altkeymap ambiwidth ambw anti antialias ar arab arabic arabicshape ari arshape autochdir autoindent autoread autowrite autowriteall aw awa background backspace backup backupcopy backupdir backupext backupskip balloondelay ballooneval balloonexpr bdir bdlay beval bex bexpr bg bh bin binary biosk bioskey bk bkc bl bomb breakat brk browsedir bs bsdir bsk bt bufhidden buflisted buftype casemap cb ccv cd cdpath cedit cf cfu ch charconvert ci cin cindent cink cinkeys cino cinoptions cinw cinwords clipboard cmdheight cmdwinheight cmp cms co columns com comments commentstring compatible complete completefunc confirm consk conskey copyindent cp cpo cpoptions cpt cscopepathcomp cscopeprg cscopequickfix cscopetag cscopetagorder cscopeverbose cspc csprg csqf cst csto csverb cwh debug deco def define delcombine dex dg dict dictionary diff diffexpr diffopt digraph dip dir directory display dy ea ead eadirection eb ed edcompatible ef efm ei ek enc encoding endofline eol ep equalalways equalprg errorbells errorfile errorformat esckeys et eventignore ex expandtab exrc fcl fcs fdc fde fdi fdl fdls fdm fdn fdo fdt fen fenc fencs ff ffs fileencoding fileencodings fileformat fileformats filetype fillchars fk fkmap flp fml fmr fo foldclose foldcolumn foldenable foldexpr foldignore foldlevel foldlevelstart foldmarker foldmethod foldminlines foldnestmax foldopen foldtext formatlistpat formatoptions formatprg fp fs fsync ft gcr gd gdefault gfm gfn gfs gfw ghr go gp grepformat grepprg guicursor guifont guifontset guifontwide guiheadroom guioptions guipty helpfile helpheight helplang hf hh hi hid hidden highlight history hk hkmap hkmapp hkp hl hlg hls hlsearch ic icon iconstring ignorecase im imactivatekey imak imc imcmdline imd imdisable imi iminsert ims imsearch inc include includeexpr incsearch inde indentexpr indentkeys indk inex inf infercase insertmode is isf isfname isi isident isk iskeyword isp isprint joinspaces js key keymap keymodel keywordprg km kmp kp langmap langmenu laststatus lazyredraw lbr lcs linebreak lines linespace lisp lispwords list listchars lm lmap loadplugins lpl ls lsp lw lz ma magic makeef makeprg mat matchpairs matchtime maxfuncdepth maxmapdepth maxmem maxmempattern maxmemtot mef menuitems mfd mh mis mkspellmem ml mls mm mmd mmp mmt mod modeline modelines modifiable modified more mouse mousef mousefocus mousehide mousem mousemodel mouses mouseshape mouset mousetime mp mps msm mzq mzquantum nf nrformats nu number numberwidth nuw omnifunc oft ofu osfiletype pa para paragraphs paste pastetoggle patchexpr patchmode path pdev penc pex pexpr pfn pheader pi pm pmbcs pmbfn popt preserveindent previewheight previewwindow printdevice printencoding printexpr printfont printheader printmbcharset printmbfont printoptions prompt pt pvh pvw qe quoteescape readonly remap report restorescreen revins ri rightleft rightleftcmd rl rlc ro rs rtp ru ruf ruler rulerformat runtimepath sb sbo sbr sc scb scr scroll scrollbind scrolljump scrolloff scrollopt scs sect sections secure sel selection selectmode sessionoptions sft sh shcf shell shellcmdflag shellpipe shellquote shellredir shellslash shelltemp shelltype shellxquote shiftround shiftwidth shm shortmess shortname showbreak showcmd showfulltag showmatch showmode shq si sidescroll sidescrolloff siso sj slm sm smartcase smartindent smarttab smc smd sn so softtabstop sol sp spc spell spellcapcheck spellfile spelllang spellsuggest spf spl splitbelow splitright spr sps sr srr ss ssl ssop st sta startofline statusline stl stmp sts su sua suffixes suffixesadd sw swapfile swapsync swb swf switchbuf sws sxq syn synmaxcol syntax ta tabstop tag tagbsearch taglength tagrelative tags tagstack tb tbi tbidi tbis tbs tenc term termbidi termencoding terse textauto textmode textwidth tf tgst thesaurus tildeop timeout timeoutlen title titlelen titleold titlestring tl tm to toolbar toolbariconsize top tr ts tsl tsr ttimeout ttimeoutlen ttm tty ttybuiltin ttyfast ttym ttymouse ttyscroll ttytype tw tx uc ul undolevels updatecount updatetime ut vb vbs vdir ve verbose verbosefile vfile vi viewdir viewoptions viminfo virtualedit visualbell vop wa wak warn wb wc wcm wd weirdinvert wfh wh whichwrap wi wig wildchar wildcharm wildignore wildmenu wildmode wildoptions wim winaltkeys window winfixheight winheight winminheight winminwidth winwidth wiv wiw wm wmh wmnu wmw wop wrap wrapmargin wrapscan write writeany writebackup writedelay ws ww 
 
 " vimOptions: These are the turn-off setting variants {{{2
 syn keyword vimOption contained	noacd noai noakm noallowrevins noaltkeymap noanti noantialias noar noarab noarabic noarabicshape noari noarshape noautochdir noautoindent noautoread noautowrite noautowriteall noaw noawa nobackup noballooneval nobeval nobin nobinary nobiosk nobioskey nobk nobl nobomb nobuflisted nocf noci nocin nocindent nocompatible noconfirm noconsk noconskey nocopyindent nocp nocscopetag nocscopeverbose nocst nocsverb nodeco nodelcombine nodg nodiff nodigraph nodisable noea noeb noed noedcompatible noek noendofline noeol noequalalways noerrorbells noesckeys noet noex noexpandtab noexrc nofen nofk nofkmap nofoldenable nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkmapp nohkp nohls nohlsearch noic noicon noignorecase noim noimc noimcmdline noimd noincsearch noinf noinfercase noinsertmode nois nojoinspaces nojs nolazyredraw nolbr nolinebreak nolisp nolist noloadplugins nolpl nolz noma nomagic nomh noml nomod nomodeline nomodifiable nomodified nomore nomousef nomousefocus nomousehide nonu nonumber nopaste nopi nopreserveindent nopreviewwindow noprompt nopvw noreadonly noremap norestorescreen norevins nori norightleft norightleftcmd norl norlc noro nors noru noruler nosb nosc noscb noscrollbind noscs nosecure nosft noshellslash noshelltemp noshiftround noshortname noshowcmd noshowfulltag noshowmatch noshowmode nosi nosm nosmartcase nosmartindent nosmarttab nosmd nosn nosol nospell nosplitbelow nosplitright nospr nosr nossl nosta nostartofline nostmp noswapfile noswf nota notagbsearch notagrelative notagstack notbi notbidi notbs notermbidi noterse notextauto notextmode notf notgst notildeop notimeout notitle noto notop notr nottimeout nottybuiltin nottyfast notx novb novisualbell nowa nowarn nowb noweirdinvert nowfh nowildmenu nowinfixheight nowiv nowmnu nowrap nowrapscan nowrite nowriteany nowritebackup nows 
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -336,6 +336,7 @@ static digr_T digraphdefault[] =
 	{'A', 'E',   158},	/* Æ */
 	{'o', 'x',   159},	/* ¤ - currency symbol in ISO 8859-1 */
 	{'e', '=',   159},	/* ¤ - euro symbol in ISO 8859-15 */
+	{'E', 'u',   159},	/* ¤ - euro symbol in ISO 8859-15 */
 	{'j', 'u',   160},	/* µ */
 	{'y', '"',   167},	/* x XX */
 	{'~', '!',   170},	/* ¡ */
@@ -1423,6 +1424,7 @@ static digr_T digraphdefault[] =
 	{'P', 't', 0x20a7},
 	{'W', '=', 0x20a9},
 	{'=', 'e', 0x20ac}, /* euro */
+	{'E', 'u', 0x20ac}, /* euro */
 	{'o', 'C', 0x2103},
 	{'c', 'o', 0x2105},
 	{'o', 'F', 0x2109},
--- a/src/edit.c
+++ b/src/edit.c
@@ -31,7 +31,7 @@
 #define CTRL_X_THESAURUS	(10 + CTRL_X_WANT_IDENT)
 #define CTRL_X_CMDLINE		11
 #define CTRL_X_FUNCTION		12
-#define CTRL_X_OCCULT		13
+#define CTRL_X_OMNI		13
 #define CTRL_X_SPELL		14
 #define CTRL_X_LOCAL_MSG	15	/* only used in "ctrl_x_msgs" */
 
@@ -52,7 +52,7 @@ static char *ctrl_x_msgs[] =
     N_(" Thesaurus completion (^T^N^P)"),
     N_(" Command-line completion (^V^N^P)"),
     N_(" User defined completion (^U^N^P)"),
-    N_(" Occult completion (^O^N^P)"),
+    N_(" Omni completion (^O^N^P)"),
     N_(" Spelling suggestion (^S^N^P)"),
     N_(" Keyword Local completion (^N^P)"),
 };
@@ -820,7 +820,7 @@ doESCkey:
 
 	case Ctrl_O:	/* execute one command */
 #ifdef FEAT_COMPL_FUNC
-	    if (ctrl_x_mode == CTRL_X_OCCULT)
+	    if (ctrl_x_mode == CTRL_X_OMNI)
 		goto docomplete;
 #endif
 	    if (echeck_abbr(Ctrl_O + ABBR_OFF))
@@ -1844,7 +1844,7 @@ vim_is_ctrl_x_key(c)
 #ifdef FEAT_COMPL_FUNC
 	case CTRL_X_FUNCTION:
 	    return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N);
-	case CTRL_X_OCCULT:
+	case CTRL_X_OMNI:
 	    return (c == Ctrl_O || c == Ctrl_P || c == Ctrl_N);
 #endif
 	case CTRL_X_SPELL:
@@ -2361,7 +2361,7 @@ ins_compl_prep(c)
 		ctrl_x_mode = CTRL_X_FUNCTION;
 		break;
 	    case Ctrl_O:
-		ctrl_x_mode = CTRL_X_OCCULT;
+		ctrl_x_mode = CTRL_X_OMNI;
 		break;
 #endif
 	    case 's':
@@ -2584,13 +2584,13 @@ ins_compl_next_buf(buf, flag)
 static int expand_by_function __ARGS((int type, char_u *base, char_u ***matches));
 
 /*
- * Execute user defined complete function 'completefunc' or 'occultfunc', and
+ * Execute user defined complete function 'completefunc' or 'omnifunc', and
  * get matches in "matches".
  * Return value is number of matches.
  */
     static int
 expand_by_function(type, base, matches)
-    int		type;	    /* CTRL_X_OCCULT or CTRL_X_FUNCTION */
+    int		type;	    /* CTRL_X_OMNI or CTRL_X_FUNCTION */
     char_u	*base;
     char_u	***matches;
 {
@@ -2848,8 +2848,11 @@ ins_compl_get_exp(ini, dir)
 
 #ifdef FEAT_COMPL_FUNC
 	case CTRL_X_FUNCTION:
-	case CTRL_X_OCCULT:
-	    num_matches = expand_by_function(type, compl_pattern, &matches);
+	case CTRL_X_OMNI:
+	    if (*compl_pattern == NUL)
+		num_matches = 0;
+	    else
+		num_matches = expand_by_function(type, compl_pattern, &matches);
 	    if (num_matches > 0)
 		ins_compl_add_matches(num_matches, matches, dir);
 	    break;
@@ -3457,7 +3460,7 @@ ins_complete(c)
 	    compl_col = startcol;
 	    compl_length = curs_col - startcol;
 	}
-	else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OCCULT)
+	else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
 	{
 #ifdef FEAT_COMPL_FUNC
 	    /*
@@ -3469,12 +3472,16 @@ ins_complete(c)
 	    char_u	*funcname;
 	    pos_T	pos;
 
-	    /* Call 'completefunc' or 'occultfunc' and get pattern length as a
+	    /* Call 'completefunc' or 'omnifunc' and get pattern length as a
 	     * string */
 	    funcname = ctrl_x_mode == CTRL_X_FUNCTION
 					  ? curbuf->b_p_cfu : curbuf->b_p_ofu;
 	    if (*funcname == NUL)
+	    {
+		EMSG2(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
+					     ? "completefunc" : "omnifunc");
 		return FAIL;
+	    }
 
 	    args[0] = (char_u *)"1";
 	    args[1] = NULL;
@@ -3483,7 +3490,7 @@ ins_complete(c)
 	    curwin->w_cursor = pos;	/* restore the cursor position */
 
 	    if (col < 0)
-		return FAIL;
+		col = curs_col;
 	    compl_col = col;
 	    if ((colnr_T)compl_col > curs_col)
 		compl_col = curs_col;
--- a/src/globals.h
+++ b/src/globals.h
@@ -1418,6 +1418,7 @@ EXTERN char_u e_emptybuf[]	INIT(= N_("E7
 EXTERN char_u e_invalpat[]	INIT(= N_("E682: Invalid search pattern or delimiter"));
 #endif
 EXTERN char_u e_bufloaded[]	INIT(= N_("E139: File is loaded in another buffer"));
+EXTERN char_u e_notset[]	INIT(= N_("E764: Option '%s' is not set"));
 
 #ifdef MACOS_X_UNIX
 EXTERN short disallow_gui	INIT(= FALSE);
--- a/src/normal.c
+++ b/src/normal.c
@@ -60,7 +60,7 @@ static void	nv_error __ARGS((cmdarg_T *c
 static void	nv_help __ARGS((cmdarg_T *cap));
 static void	nv_addsub __ARGS((cmdarg_T *cap));
 static void	nv_page __ARGS((cmdarg_T *cap));
-static void	nv_gd __ARGS((oparg_T *oap, int nchar));
+static void	nv_gd __ARGS((oparg_T *oap, int nchar, int thisblock));
 static int	nv_screengo __ARGS((oparg_T *oap, int dir, long dist));
 #ifdef FEAT_MOUSE
 static void	nv_mousescroll __ARGS((cmdarg_T *cap));
@@ -3920,15 +3920,16 @@ nv_page(cap)
  * Implementation of "gd" and "gD" command.
  */
     static void
-nv_gd(oap, nchar)
+nv_gd(oap, nchar, thisblock)
     oparg_T	*oap;
     int		nchar;
+    int		thisblock;	/* 1 for "1gd" and "1gD" */
 {
     int		len;
     char_u	*ptr;
 
     if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0
-	    || find_decl(ptr, len, nchar == 'd', 0) == FAIL)
+	    || find_decl(ptr, len, nchar == 'd', thisblock, 0) == FAIL)
 	clearopbeep(oap);
 #ifdef FEAT_FOLDING
     else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP)
@@ -3937,15 +3938,18 @@ nv_gd(oap, nchar)
 }
 
 /*
- * Search for variable declaration of "ptr[len]".  When "locally" is TRUE in
- * the current function ("gd"), otherwise in the current file ("gD").
+ * Search for variable declaration of "ptr[len]".
+ * When "locally" is TRUE in the current function ("gd"), otherwise in the
+ * current file ("gD").
+ * When "thisblock" is TRUE check the {} block scope.
  * Return FAIL when not found.
  */
     int
-find_decl(ptr, len, locally, searchflags)
+find_decl(ptr, len, locally, thisblock, searchflags)
     char_u	*ptr;
     int		len;
     int		locally;
+    int		thisblock;
     int		searchflags;	/* flags passed to searchit() */
 {
     char_u	*pat;
@@ -3983,11 +3987,11 @@ find_decl(ptr, len, locally, searchflags
     }
     else
     {
-	par_pos = curwin->w_cursor;
 	while (curwin->w_cursor.lnum > 1 && *skipwhite(ml_get_curline()) != NUL)
 	    --curwin->w_cursor.lnum;
     }
     curwin->w_cursor.col = 0;
+    par_pos = curwin->w_cursor;
 
     /* Search forward for the identifier, ignore comment lines. */
     found_pos.lnum = 0;
@@ -3997,6 +4001,19 @@ find_decl(ptr, len, locally, searchflags
 					       pat, 1L, searchflags, RE_LAST);
 	if (curwin->w_cursor.lnum >= old_pos.lnum)
 	    t = FAIL;	/* match after start is failure too */
+
+	if (thisblock)
+	{
+	    pos_T	*pos;
+
+	    /* Check that the block the match is in doesn't end before the
+	     * position where we started the search from. */
+	    if ((pos = findmatchlimit(NULL, '}', FM_FORWARD,
+		     (int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL
+		    && pos->lnum < old_pos.lnum)
+		continue;
+	}
+
 	if (t == FAIL)
 	{
 	    /* If we previously found a valid position, use it. */
@@ -7668,7 +7685,7 @@ nv_g_cmd(cap)
      */
     case 'd':
     case 'D':
-	nv_gd(oap, cap->nchar);
+	nv_gd(oap, cap->nchar, (int)cap->count0);
 	break;
 
 #ifdef FEAT_MOUSE
--- a/src/option.c
+++ b/src/option.c
@@ -1603,7 +1603,7 @@ static struct vimoption
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)8L, (char_u *)4L}},
-    {"occultfunc", "ofu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE,
+    {"omnifunc",    "ofu",  P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE,
 #ifdef FEAT_COMPL_FUNC
 			    (char_u *)&p_ofu, PV_OFU,
 			    {(char_u *)"", (char_u *)0L}
--- a/src/proto/normal.pro
+++ b/src/proto/normal.pro
@@ -16,7 +16,7 @@ void push_showcmd __ARGS((void));
 void pop_showcmd __ARGS((void));
 void do_check_scrollbind __ARGS((int check));
 void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff));
-int find_decl __ARGS((char_u *ptr, int len, int locally, int searchflags));
+int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags));
 void scroll_redraw __ARGS((int up, long count));
 void do_nv_ident __ARGS((int c1, int c2));
 int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp));
--- a/src/search.c
+++ b/src/search.c
@@ -1562,6 +1562,9 @@ check_prevcol(linep, col, ch, prevcol)
  *	  FM_FORWARD	search forwards (when initc is '/', '*' or '#')
  *	  FM_BLOCKSTOP	stop at start/end of block ({ or } in column 0)
  *	  FM_SKIPCOMM	skip comments (not implemented yet!)
+ *
+ * "oap" is only used to set oap->motion_type for a linewise motion, it be
+ * NULL
  */
 
     pos_T *
--- a/src/spell.c
+++ b/src/spell.c
@@ -7699,7 +7699,7 @@ spell_add_word(word, len, bad, index)
 
 	if (*curbuf->b_p_spf == NUL)
 	{
-	    EMSG(_("E764: 'spellfile' is not set"));
+	    EMSG2(_(e_notset), "spellfile");
 	    return;
 	}
 
--- a/src/structs.h
+++ b/src/structs.h
@@ -1288,7 +1288,7 @@ struct file_buffer
 #endif
 #ifdef FEAT_COMPL_FUNC
     char_u	*b_p_cfu;	/* 'completefunc' */
-    char_u	*b_p_ofu;	/* 'occultfunc' */
+    char_u	*b_p_ofu;	/* 'omnifunc' */
 #endif
     int		b_p_eol;	/* 'endofline' */
     int		b_p_et;		/* 'expandtab' */
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6087,7 +6087,7 @@ static char *(highlight_init_light[]) =
 	"Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue",
 	"FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
 	"SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
-	"Visual term=reverse ctermbg=LightGrey guibg=LightGrey",
+	"Visual term=reverse ctermbg=Magenta guibg=LightGrey",
 	"DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
 	"DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
 	"DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
@@ -6113,7 +6113,7 @@ static char *(highlight_init_dark[]) =
 	"Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan",
 	"FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
 	"SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
-	"Visual term=reverse ctermbg=DarkGrey guibg=DarkGrey",
+	"Visual term=reverse ctermbg=Magenta guibg=DarkGrey",
 	"DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
 	"DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
 	"DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
--- 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 Sep 10)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 10, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 13)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 13, compiled "