r357 - in trunk/vim/debian/patches: . merged-upstream

Norbert Tretkowski nobse at costa.debian.org
Sat Oct 15 16:54:18 UTC 2005


Author: nobse
Date: 2005-10-15 16:54:18 +0000 (Sat, 15 Oct 2005)
New Revision: 357

Added:
   trunk/vim/debian/patches/merged-upstream/118_ocaml.vim.diff
Removed:
   trunk/vim/debian/patches/118_ocaml.vim.diff
Log:
Merged upstream.


Deleted: trunk/vim/debian/patches/118_ocaml.vim.diff
===================================================================
--- trunk/vim/debian/patches/118_ocaml.vim.diff	2005-10-15 16:42:59 UTC (rev 356)
+++ trunk/vim/debian/patches/118_ocaml.vim.diff	2005-10-15 16:54:18 UTC (rev 357)
@@ -1,1024 +0,0 @@
-diff -urN vim64b/runtime/ftplugin/ocaml.vim vim64b.new/runtime/ftplugin/ocaml.vim
---- vim64b/runtime/ftplugin/ocaml.vim	2004-04-12 19:11:36.000000000 +0200
-+++ vim64b.new/runtime/ftplugin/ocaml.vim	2005-10-11 19:33:15.000000000 +0200
-@@ -1,38 +1,64 @@
--" Vim settings file
--" Language:     OCaml
--" Maintainers:  Mike Leary          <leary at nwlink.com>
--"               Markus Mottl        <markus at oefai.at>
--"               Stefano Zacchiroli  <zack at bononia.it>
--" URL:          http://www.oefai.at/~markus/vim/ftplugin/ocaml.vim
--" Last Change:  2004 Apr 12 - better .ml/.mli-switching without Python (SZ)
--"               2003 Nov 21 - match_words-patterns and .ml/.mli-switching (MM)
--"               2003 Oct 16 - re-entered variable 'did_ocaml_dtypes' (MM)
--"               2003 Oct 15 - added Stefano Zacchirolis (SZ) Python-code for
--"                             displaying type annotations (MM)
--
--" Only do these settings when not done yet for this buffer
--if exists("b:did_ftplugin")
--  finish
--endif
-+" Language:    OCaml
-+" Maintainer:  David Baelde        <firstname.name at ens-lyon.org>
-+"              Mike Leary          <leary at nwlink.com>
-+"              Markus Mottl        <markus.mottl at gmail.com>
-+"              Stefano Zacchiroli  <zack at bononia.it>
-+" URL:         http://www.ocaml.info/vim/ftplugin/ocaml.vim
-+" Last Change: 2005 May 10 - improved errorformat (SZ)
-+" Changelog:
-+"         0.12 - Modeline support
-+"              - Folding now works also when indent_struct != 2
-+"              - Changed folding customization variable, default is off
-+"              - Made folding settings local to the buffer
-+"              - Included the official ftplugin ocaml.vim, except
-+"                annotations stuff, and parenthesis around assert false
-+"                abbreviation
-+"              - Corrected toplevel let folding
-+"              - Made the file reloading correctly
-+"
-+" omlet.vim plugins -- utilities for working on OCaml files with VIm
-+" Copyright (C) 2005 D. Baelde, M. Leary, M. Mottl, S. Zacchiroli
-+"
-+" This program is free software; you can redistribute it and/or modify
-+" it under the terms of the GNU General Public License as published by
-+" the Free Software Foundation; either version 2 of the License, or
-+" (at your option) any later version.
-+"
-+" This program is distributed in the hope that it will be useful,
-+" but WITHOUT ANY WARRANTY; without even the implied warranty of
-+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+" GNU General Public License for more details.
-+"
-+" You should have received a copy of the GNU General Public License
-+" along with this program; if not, write to the Free Software
-+" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+" Folding is activated if ocaml_folding is set
-+" Do these settings once per buffer
- 
--" Don't do other file type settings for this buffer
--let b:did_ftplugin = 1
-+" if exists("b:did_ftplugin")
-+"   finish
-+" endif
-+let b:did_ftplugin=1
- 
-+" Error handling -- helps moving where the compiler wants you to go
- set cpo-=C
--
--" Error formats
- setlocal efm=
--  \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
--  \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
--  \%+EReference\ to\ unbound\ regexp\ name\ %m,
--  \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
--  \%Wocamlyacc:\ w\ -\ %m,
--  \%-Zmake%.%#,
--  \%C%m
-+      \%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
-+      \%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
-+      \%+EReference\ to\ unbound\ regexp\ name\ %m,
-+      \%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
-+      \%Wocamlyacc:\ w\ -\ %m,
-+      \%-Zmake%.%#,
-+      \%C%m,
-+      \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
-+      \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
-+      \%D%*\\a:\ Entering\ directory\ `%f',
-+      \%X%*\\a:\ Leaving\ directory\ `%f',
-+      \%DMaking\ %*\\a\ in\ %f
- 
- " Add mappings, unless the user didn't want this.
- if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
--  " Uncommenting
-+  " (un)commenting
-   if !hasmapto('<Plug>Comment')
-     nmap <buffer> <LocalLeader>c <Plug>LUncomOn
-     vmap <buffer> <LocalLeader>c <Plug>BUncomOn
-@@ -41,12 +67,12 @@
-   endif
- 
-   nnoremap <buffer> <Plug>LUncomOn mz0i(* <ESC>$A *)<ESC>`z
--  nnoremap <buffer> <Plug>LUncomOff <ESC>:s/^(\* \(.*\) \*)/\1/<CR>
-+  nnoremap <buffer> <Plug>LUncomOff :s/^(\* \(.*\) \*)/\1/<CR>:noh<CR>
-   vnoremap <buffer> <Plug>BUncomOn <ESC>:'<,'><CR>`<O<ESC>0i(*<ESC>`>o<ESC>0i*)<ESC>`<
-   vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
- 
-   if !hasmapto('<Plug>Abbrev')
--    iabbrev <buffer> ASS (assert false)
-+    iabbrev <buffer> ASS (assert false (* XXX *))
-   endif
- endif
- 
-@@ -56,31 +82,123 @@
- let b:mw=b:mw . '\<\(object\|sig\|struct\|begin\)\>:\<end\>'
- let b:match_words=b:mw
- 
-+let b:match_ignorecase=0
-+
- " switching between interfaces (.mli) and implementations (.ml)
- if !exists("g:did_ocaml_switch")
-   let g:did_ocaml_switch = 1
--  map ,s :call OCaml_switch(0)<CR>
--  map ,S :call OCaml_switch(1)<CR>
-+  map <LocalLeader>s :call OCaml_switch(0)<CR>
-+  map <LocalLeader>S :call OCaml_switch(1)<CR>
-   fun OCaml_switch(newwin)
-     if (match(bufname(""), "\\.mli$") >= 0)
-       let fname = substitute(bufname(""), "\\.mli$", ".ml", "")
-       if (a:newwin == 1)
--	exec "new " . fname
-+        exec "new " . fname
-       else
--	exec "arge " . fname
-+        exec "arge " . fname
-       endif
-     elseif (match(bufname(""), "\\.ml$") >= 0)
-       let fname = bufname("") . "i"
-       if (a:newwin == 1)
--	exec "new " . fname
-+        exec "new " . fname
-       else
--	exec "arge " . fname
-+        exec "arge " . fname
-       endif
-     endif
-   endfun
- endif
- 
--" Vim support for OCaml 3.07 .annot files (requires Vim with python support)
-+" Folding support
-+
-+" Get the modeline because folding depends on indentation
-+let s:s = line2byte(line('.'))+col('.')-1
-+if search('^\s*(\*:o\?caml:')
-+  let s:modeline = getline(".")
-+else
-+  let s:modeline = ""
-+endif
-+if s:s > 0
-+  exe 'goto' s:s
-+endif
-+
-+" Get the indentation params
-+let s:m = matchstr(s:modeline,'default\s*=\s*\d\+')
-+if s:m != ""
-+  let s:idef = matchstr(s:m,'\d\+')
-+elseif exists("g:omlet_indent")
-+  let s:idef = g:omlet_indent
-+else
-+  let s:idef = 2
-+endif
-+let s:m = matchstr(s:modeline,'struct\s*=\s*\d\+')
-+if s:m != ""
-+  let s:i = matchstr(s:m,'\d\+')
-+elseif exists("g:omlet_indent_struct")
-+  let s:i = g:omlet_indent_struct
-+else
-+  let s:i = s:idef
-+endif
-+
-+" Set the folding method
-+if exists("g:ocaml_folding")
-+  setlocal foldmethod=expr
-+  setlocal foldexpr=OMLetFoldLevel(v:lnum)
-+endif
-+
-+" - Only definitions below, executed once -------------------------------------
-+
-+if exists("*OMLetFoldLevel")
-+  finish
-+endif
-+
-+function s:topindent(lnum)
-+  let l = a:lnum
-+  while l > 0
-+    if getline(l) =~ '\s*\%(\<struct\>\|\<sig\>\|\<object\>\)'
-+      return indent(l)
-+    endif
-+    let l = l-1
-+  endwhile
-+  return -s:i
-+endfunction
-+
-+function OMLetFoldLevel(l)
-+
-+  " This is for not merging blank lines around folds to them
-+  if getline(a:l) !~ '\S'
-+    return -1
-+  endif
-+
-+  " We start folds for modules, classes, and every toplevel definition
-+  if getline(a:l) =~ '^\s*\%(\<val\>\|\<module\>\|\<class\>\|\<type\>\|\<method\>\|\<initializer\>\|\<inherit\>\|\<exception\>\|\<external\>\)'
-+    exe 'return ">' (indent(a:l)/s:i)+1 '"'
-+  endif
-+
-+  " Toplevel let are detected thanks to the indentation
-+  if getline(a:l) =~ '^\s*let\>' && indent(a:l) == s:i+s:topindent(a:l)
-+    exe 'return ">' (indent(a:l)/s:i)+1 '"'
-+  endif
-+
-+  " We close fold on end which are associated to struct, sig or object.
-+  " We use syntax information to do that.
-+  if getline(a:l) =~ '^\s*end\>' && synIDattr(synID(a:l, indent(a:l)+1, 0), "name") != "ocamlKeyword"
-+    return (indent(a:l)/s:i)+1
-+  endif
-+
-+  " Folds end on ;;
-+  if getline(a:l) =~ '^\s*;;'
-+    exe 'return "<' (indent(a:l)/s:i)+1 '"'
-+  endif
-+
-+  " Comments around folds aren't merged to them.
-+  if synIDattr(synID(a:l, indent(a:l)+1, 0), "name") == "ocamlComment"
-+    return -1
-+  endif
-+
-+  return '='
-+endfunction
-+
-+" Vim support for OCaml .annot files (requires Vim with python support)
- "
- " Executing OCamlPrintType(<mode>) function will display in the Vim bottom
- " line(s) the type of an ocaml value getting it from the corresponding .annot
-@@ -92,13 +210,14 @@
- " .annot files are parsed lazily the first time OCamlPrintType is invoked; is
- " also possible to force the parsing using the OCamlParseAnnot() function.
- "
--" Hitting the <F3> key will cause OCamlPrintType function to be invoked with
-+" Typing ',3' will cause OCamlPrintType function to be invoked with
- " the right argument depending on the current mode (visual or not).
- "
--" Copyright (C) <2003> Stefano Zacchiroli <zack at bononia.it>
-+" Copyright (C) <2003-2004> Stefano Zacchiroli <zack at bononia.it>
- "
- " Created:        Wed, 01 Oct 2003 18:16:22 +0200 zack
--" LastModified:   Mon, 06 Oct 2003 11:05:39 +0200 zack
-+" LastModified:   Wed, 25 Aug 2004 18:28:39 +0200 zack
-+"
- "
- " This program is free software; you can redistribute it and/or modify
- " it under the terms of the GNU General Public License as published by
-@@ -113,16 +232,8 @@
- " You should have received a copy of the GNU General Public License
- " along with this program; if not, write to the Free Software
- " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
--"
- 
- if !has("python")
--  echo "Python support not found: OCaml .annot support disabled"
--  finish
--endif
--
--if !exists("g:did_ocaml_dtypes")
--  let g:did_ocaml_dtypes = 1
--else
-   finish
- endif
- 
-@@ -166,7 +277,7 @@
-            at least two space characters.
- 
-       - in each block, the two positions are respectively the start and the
--      - end of the range described by the block.
-+        end of the range described by the block.
-       - in a position, the filename is the name of the file, the first num
-         is the line number, the second num is the offset of the beginning
-         of the line, the third num is the offset of the position itself.
-@@ -182,7 +293,7 @@
-         self.__timestamp = None # last parse action timestamp
-         self.__annot = {}
-         self.__re = re.compile(
--          '^"[^"]+"\s+(\d+)\s+(\d+)\s+(\d+)\s+"[^"]+"\s+(\d+)\s+(\d+)\s+(\d+)$')
-+          '^"[^"]*"\s+(\d+)\s+(\d+)\s+(\d+)\s+"[^"]*"\s+(\d+)\s+(\d+)\s+(\d+)$')
- 
-     def __parse(self, fname):
-         try:
-@@ -210,7 +321,9 @@
-                     lineno += 1
-                     if (line == ""): raise malformed_annotations(lineno)
-                 type = string.join(type, "\n")
--                self.__annot[(line1, col1), (line2, col2)] = type
-+                key = ((line1, col1), (line2, col2))
-+                if not self.__annot.has_key(key):
-+                    self.__annot[key] = type
-                 line = f.readline() # position line
-             f.close()
-             self.__filename = fname
-@@ -285,7 +398,7 @@
- 
- EOF
- 
--fun OCamlPrintType(current_mode)
-+fun! OCamlPrintType(current_mode)
-   if (a:current_mode == "visual")
-     python printOCamlType("visual")
-   else
-@@ -293,9 +406,9 @@
-   endif
- endfun
- 
--fun OCamlParseAnnot()
-+fun! OCamlParseAnnot()
-   python parseOCamlAnnot()
- endfun
- 
--map <F3> :call OCamlPrintType("normal")<RETURN>
--vmap <F3> :call OCamlPrintType("visual")<RETURN>
-+map <LocalLeader>t :call OCamlPrintType("normal")<RETURN>
-+vmap <LocalLeader>t :call OCamlPrintType("visual")<RETURN>
-diff -urN vim64b/runtime/indent/ocaml.vim vim64b.new/runtime/indent/ocaml.vim
---- vim64b/runtime/indent/ocaml.vim	2004-05-08 11:04:21.000000000 +0200
-+++ vim64b.new/runtime/indent/ocaml.vim	2005-09-21 23:39:12.000000000 +0200
-@@ -1,16 +1,16 @@
- " Vim indent file
- " Language:     OCaml
--" Maintainers:  Jean-Francois Yuen  <jfyuen at happycoders.org>
--"               Mike Leary          <leary at nwlink.com>
--"               Markus Mottl        <markus at oefai.at>
--" URL:          http://www.oefai.at/~markus/vim/indent/ocaml.vim
--" Last Change:  2004 Apr 11 - Added indent for 'class' (JY)
--"               2003 Sep 16 - Added 'private' as keyword (JY)
--"               2003 Mar 29 - Fixed bug with 'if' and 'else' (JY)
-+" Maintainers:  Jean-Francois Yuen   <jfyuen at happycoders.org>
-+"               Mike Leary           <leary at nwlink.com>
-+"               Markus Mottl         <markus.mottl at gmail.com>
-+" URL:          http://www.ocaml.info/vim/indent/ocaml.vim
-+" Last Change:  2005 Jun 25 - Fixed multiple bugs due to 'else\nreturn ind' working
-+"               2005 May 09 - Added an option to not indent OCaml-indents specially (MM)
-+"               2005 Apr 11 - Fixed an indentation bug concerning "let" (MM)
- 
- " Only load this indent file when no other was loaded.
- if exists("b:did_indent")
--  finish
-+ finish
- endif
- let b:did_indent = 1
- 
-@@ -22,14 +22,16 @@
- setlocal textwidth=80
- 
- " Comment formatting
--if (has("comments"))
--  setlocal comments=sr:(*,mb:*,ex:*)
--  setlocal fo=cqort
-+if !exists("no_ocaml_comments")
-+ if (has("comments"))
-+   setlocal comments=sr:(*,mb:*,ex:*)
-+   setlocal fo=cqort
-+ endif
- endif
- 
- " Only define the function once.
- if exists("*GetOCamlIndent")
--  finish
-+ finish
- endif
- 
- " Define some patterns:
-@@ -42,254 +44,209 @@
- let s:type = '^\s*\%(class\|let\|type\)\>.*='
- 
- " Skipping pattern, for comments
--function s:SkipPattern(lnum, pat)
--  let def = prevnonblank(a:lnum - 1)
--  while def > 0 && getline(def) =~ a:pat
--    let def = prevnonblank(def - 1)
--  endwhile
--  return def
-+function s:GetLineWithoutFullComment(lnum)
-+ let lnum = prevnonblank(a:lnum - 1)
-+ let lline = substitute(getline(lnum), '(\*.*\*)\s*$', '', '')
-+ while lline =~ '^\s*$' && lnum > 0
-+   let lnum = prevnonblank(lnum - 1)
-+   let lline = substitute(getline(lnum), '(\*.*\*)\s*$', '', '')
-+ endwhile
-+ return lnum
- endfunction
- 
- " Indent for ';;' to match multiple 'let'
- function s:GetInd(lnum, pat, lim)
--  let llet = search(a:pat, 'bW')
--  let old = indent(a:lnum)
--  while llet > 0
--    let old = indent(llet)
--    let nb = s:SkipPattern(llet, '^\s*(\*.*\*)\s*$')
--    if getline(nb) =~ a:lim
--      return old
--    endif
--    let llet = search(a:pat, 'bW')
--  endwhile
--  return old
-+ let llet = search(a:pat, 'bW')
-+ let old = indent(a:lnum)
-+ while llet > 0
-+   let old = indent(llet)
-+   let nb = s:GetLineWithoutFullComment(llet)
-+   if getline(nb) =~ a:lim
-+     return old
-+   endif
-+   let llet = search(a:pat, 'bW')
-+ endwhile
-+ return old
- endfunction
- 
- " Indent pairs
- function s:FindPair(pstart, pmid, pend)
--  call search(a:pend, 'bW')
--  return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
-+ call search(a:pend, 'bW')
-+ return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
- endfunction
- 
- " Indent 'let'
- function s:FindLet(pstart, pmid, pend)
--  call search(a:pend, 'bW')
--  return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "^\\s*let\\>.*=.*\\<in\\s*$" || getline(prevnonblank(".") - 1) =~ s:beflet'))
-+ call search(a:pend, 'bW')
-+ return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "^\\s*let\\>.*=.*\\<in\\s*$" || getline(prevnonblank(".") - 1) =~ s:beflet'))
- endfunction
- 
- function GetOCamlIndent()
--  " Find a non-blank line above the current line.
--  let lnum = prevnonblank(v:lnum - 1)
-+ " Find a non-commented line above the current line.
-+ let lnum = s:GetLineWithoutFullComment(v:lnum)
- 
--  " At the start of the file use zero indent.
--  if lnum == 0
--    return 0
--  endif
--
--  let ind = indent(lnum)
--  let lline = getline(lnum)
--
--  " Return double 'shiftwidth' after lines matching:
--  if lline =~ '^\s*|.*->\s*$'
--    return ind + &sw + &sw
--  endif
--
--  let line = getline(v:lnum)
--
--  " Indent if current line begins with 'end':
--  if line =~ '^\s*end\>'
--    return s:FindPair(s:module, '','\<end\>')
--
--  " Indent if current line begins with 'done' for 'do':
--  elseif line =~ '^\s*done\>'
--    return s:FindPair('\<do\>', '','\<done\>')
--
--  " Indent if current line begins with '}' or '>}':
--  elseif line =~ '^\s*\(\|>\)}'
--    return s:FindPair('{', '','}')
--
--  " Indent if current line begins with ']', '|]' or '>]':
--  elseif line =~ '^\s*\(\||\|>\)\]'
--    return s:FindPair('\[', '','\]')
--
--  " Indent if current line begins with ')':
--  elseif line =~ '^\s*)'
--    return s:FindPair('(', '',')')
--
--  " Indent if current line begins with 'let':
--  elseif line =~ '^\s*let\>'
--    if lline !~ s:lim . '\|' . s:letlim . '\|' . s:beflet
--      return s:FindLet(s:type, '','\<let\s*$')
--    else return ind
--    endif
--
--  " Indent if current line begins with 'class' or 'type':
--  elseif line =~ '^\s*\(class\|type\)\>'
--    if lline !~ s:lim . '\|\<and\s*$\|' . s:letlim
--      return s:FindLet(s:type, '','\<\(class\|type\)\s*$')
--    else return ind
--    endif
--
--  " Indent for pattern matching:
--  elseif line =~ '^\s*|'
--    if lline !~ '^\s*\(|[^\]]\|\(match\|type\|with\)\>\)\|\<\(function\|parser\|private\|with\)\s*$'
--      call search('|', 'bW')
--      return indent(searchpair('^\s*\(match\|type\)\>\|\<\(function\|parser\|private\|with\)\s*$', '', '^\s*|', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") !~ "^\\s*|.*->"'))
--    else return ind
--    endif
--
--  " Indent if current line begins with ';;':
--  elseif line =~ '^\s*;;'
--    if lline !~ ';;\s*$'
--      return s:GetInd(v:lnum, s:letpat, s:letlim)
--    else return ind
--    endif
--
--  " Indent if current line begins with 'in':
--  elseif line =~ '^\s*in\>'
--    if lline !~ '^\s*\(let\|and\)\>'
--      return s:FindPair('\<let\>', '', '\<in\>')
--    else return ind
--    endif
--
--  " Indent if current line begins with 'else':
--  elseif line =~ '^\s*else\>'
--    if lline !~ '^\s*\(if\|then\)\>'
--      return s:FindPair('\<if\>', '', '\<else\>')
--    else return ind
--    endif
--
--  " Indent if current line begins with 'then':
--  elseif line =~ '^\s*then\>'
--    if lline !~ '^\s*\(if\|else\)\>'
--      return s:FindPair('\<if\>', '', '\<then\>')
--    else return ind
--    endif
--
--  " Indent if current line begins with 'and':
--  elseif line =~ '^\s*and\>'
--    if lline !~ '^\s*\(and\|let\|type\)\>\|\<end\s*$'
--      return ind - &sw
--    else return ind
--    endif
--
--  " Indent if current line begins with 'with':
--  elseif line =~ '^\s*with\>'
--    if lline !~ '^\s*\(match\|try\)\>'
--      return s:FindPair('\<\%(match\|try\)\>', '','\<with\>')
--    else return ind
--    endif
--
--  " Indent if current line begins with 'exception':
--  elseif line =~ '^\s*exception\>'
--    if lline !~ s:lim . '\|' . s:letlim
--      return indent(search('^\s*\(\(external\|include\|open\|type\)\>\|val\>.*:\)', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'external':
--  elseif line =~ '^\s*external\>'
--    if lline !~ s:lim . '\|' . s:letlim
--      return indent(search('^\s*\(\(exception\|external\|include\|open\|type\)\>\|val\>.*:\)', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'include':
--  elseif line =~ '^\s*include\>'
--    if lline !~ s:lim . '\|' . s:letlim
--      return indent(search('^\s*\(\(exception\|external\|open\|type\)\>\|val\>.*:\)', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'open':
--  elseif line =~ '^\s*open\>'
--    if lline !~ s:lim . '\|' . s:letlim
--      return indent(search('^\s*\(\(exception\|external\|include\|type\)\>\|val\>.*:\)', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'val':
--  elseif line =~ '^\s*val\>'
--    if lline !~ '^\s*\(exception\|external\|include\|open\)\>\|' . s:obj . '\|' . s:letlim
--      return indent(search('^\s*\(\(exception\|include\|initializer\|method\|open\|type\|val\)\>\|external\>.*:\)', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'constraint':
--  elseif line =~ '^\s*constraint\>'
--    if lline !~ s:obj
--      return indent(search('^\s*\(inherit\|initializer\|method\|val\)\>', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'inherit':
--  elseif line =~ '^\s*inherit\>'
--    if lline !~ s:obj
--      return indent(search('^\s*\(constraint\|initializer\|method\|val\)\>', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'inherit':
--  elseif line =~ '^\s*initializer\>'
--    if lline !~ s:obj
--      return indent(search('^\s*\(constraint\|inherit\|method\|val\)\>', 'bW'))
--    else return ind
--    endif
--
--  " Indent if current line begins with 'method':
--  elseif line =~ '^\s*method\>'
--    if lline !~ s:obj
--      return indent(search('^\s*\(\(constraint\|inherit\|initializer\|val\)\>\|method\>.*\(:\|=\)\)', 'bW'))
--    else return ind
--    endif
--
--  endif
--
--  " Add a 'shiftwidth' after lines ending with:
--  if lline =~ '\(:\|=\|->\|<-\|(\|\[\|{\|{<\|\[|\|\[<\|\<\(begin\|do\|else\|fun\|function\|functor\|if\|initializer\|object\|parser\|private\|sig\|struct\|then\|try\)\|\<object\s*(.*)\)\s*$'
--    let ind = ind + &sw
--
--  " Back to normal indent after lines ending with ';;':
--  elseif lline =~ ';;\s*$' && lline !~ '^\s*;;'
--    let ind = s:GetInd(v:lnum, s:letpat, s:letlim)
--
--  " Back to normal indent after lines ending with 'end':
--  elseif lline =~ '\<end\s*$'
--    let ind = s:FindPair(s:module, '','\<end\>')
--
--  " Back to normal indent after lines ending with 'in':
--  elseif lline =~ '\<in\s*$' && lline !~ '^\s*in\>'
--    let ind = s:FindPair('\<let\>', '', '\<in\>')
--
--  " Back to normal indent after lines ending with 'done':
--  elseif lline =~ '\<done\s*$'
--    let ind = s:FindPair('\<do\>', '','\<done\>')
--
--  " Back to normal indent after lines ending with '}' or '>}':
--  elseif lline =~ '\(\|>\)}\s*$'
--    let ind = s:FindPair('{', '','}')
--
--  " Back to normal indent after lines ending with ']', '|]' or '>]':
--  elseif lline =~ '\(\||\|>\)\]\s*$'
--    let ind = s:FindPair('\[', '','\]')
--
--  " Back to normal indent after comments:
--  elseif lline =~ '\*)\s*$'
--    call search('\*)', 'bW')
--    let ind = indent(searchpair('(\*', '', '\*)', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
--
--  " Back to normal indent after lines ending with ')':
--  elseif lline =~ ')\s*$'
--    let ind = s:FindPair('(', '',')')
--
--  endif
--
--  " Subtract a 'shiftwidth' after lines matching 'match ... with parser':
--  if lline =~ '^\s*match\>.*\<with\>\s*\<parser\s*$'
--    let ind = ind - &sw
--  endif
-+ " At the start of the file use zero indent.
-+ if lnum == 0
-+   return 0
-+ endif
-+
-+ let ind = indent(lnum)
-+ let lline = substitute(getline(lnum), '(\*.*\*)\s*$', '', '')
-+
-+ " Return double 'shiftwidth' after lines matching:
-+ if lline =~ '^\s*|.*->\s*$'
-+   return ind + &sw + &sw
-+ endif
-+
-+ let line = getline(v:lnum)
-+
-+ " Indent if current line begins with 'end':
-+ if line =~ '^\s*end\>'
-+   return s:FindPair(s:module, '','\<end\>')
-+
-+ " Indent if current line begins with 'done' for 'do':
-+ elseif line =~ '^\s*done\>'
-+   return s:FindPair('\<do\>', '','\<done\>')
-+
-+ " Indent if current line begins with '}' or '>}':
-+ elseif line =~ '^\s*\(\|>\)}'
-+   return s:FindPair('{', '','}')
-+
-+ " Indent if current line begins with ']', '|]' or '>]':
-+ elseif line =~ '^\s*\(\||\|>\)\]'
-+   return s:FindPair('\[', '','\]')
-+
-+ " Indent if current line begins with ')':
-+ elseif line =~ '^\s*)'
-+   return s:FindPair('(', '',')')
-+
-+ " Indent if current line begins with 'let':
-+ elseif line =~ '^\s*let\>'
-+   if lline !~ s:lim . '\|' . s:letlim . '\|' . s:beflet
-+     return s:FindLet(s:type, '','\<let\s*$')
-+   endif
-+
-+ " Indent if current line begins with 'class' or 'type':
-+ elseif line =~ '^\s*\(class\|type\)\>'
-+   if lline !~ s:lim . '\|\<and\s*$\|' . s:letlim
-+     return s:FindLet(s:type, '','\<\(class\|type\)\s*$')
-+   endif
-+
-+ " Indent for pattern matching:
-+ elseif line =~ '^\s*|'
-+   if lline !~ '^\s*\(|[^\]]\|\(match\|type\|with\)\>\)\|\<\(function\|parser\|private\|with\)\s*$'
-+     call search('|', 'bW')
-+     return indent(searchpair('^\s*\(match\|type\)\>\|\<\(function\|parser\|private\|with\)\s*$', '', '^\s*|', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") !~ "^\\s*|.*->"'))
-+   endif
-+
-+ " Indent if current line begins with ';;':
-+ elseif line =~ '^\s*;;'
-+   if lline !~ ';;\s*$'
-+     return s:GetInd(v:lnum, s:letpat, s:letlim)
-+   endif
-+
-+ " Indent if current line begins with 'in':
-+ elseif line =~ '^\s*in\>'
-+   if lline !~ '^\s*\(let\|and\)\>'
-+     return s:FindPair('\<let\>', '', '\<in\>')
-+   endif
-+
-+ " Indent if current line begins with 'else':
-+ elseif line =~ '^\s*else\>'
-+   if lline !~ '^\s*\(if\|then\)\>'
-+     return s:FindPair('\<if\>', '', '\<else\>')
-+   endif
-+
-+ " Indent if current line begins with 'then':
-+ elseif line =~ '^\s*then\>'
-+   if lline !~ '^\s*\(if\|else\)\>'
-+     return s:FindPair('\<if\>', '', '\<then\>')
-+   endif
-+
-+ " Indent if current line begins with 'and':
-+ elseif line =~ '^\s*and\>'
-+   if lline !~ '^\s*\(and\|let\|type\)\>\|\<end\s*$'
-+     return ind - &sw
-+   endif
-+
-+ " Indent if current line begins with 'with':
-+ elseif line =~ '^\s*with\>'
-+   if lline !~ '^\s*\(match\|try\)\>'
-+     return s:FindPair('\<\%(match\|try\)\>', '','\<with\>')
-+   endif
-+
-+ " Indent if current line begins with 'exception', 'external', 'include' or
-+ " 'open':
-+ elseif line =~ '^\s*\(exception\|external\|include\|open\)\>'
-+   if lline !~ s:lim . '\|' . s:letlim
-+     call search(line)
-+     return indent(search('^\s*\(\(exception\|external\|include\|open\|type\)\>\|val\>.*:\)', 'bW'))
-+   endif
-+
-+ " Indent if current line begins with 'val':
-+ elseif line =~ '^\s*val\>'
-+   if lline !~ '^\s*\(exception\|external\|include\|open\)\>\|' . s:obj . '\|' . s:letlim
-+     return indent(search('^\s*\(\(exception\|include\|initializer\|method\|open\|type\|val\)\>\|external\>.*:\)', 'bW'))
-+   endif
-+
-+ " Indent if current line begins with 'constraint', 'inherit', 'initializer'
-+ " or 'method':
-+ elseif line =~ '^\s*\(constraint\|inherit\|initializer\|method\)\>'
-+   if lline !~ s:obj
-+     return indent(search('\<\(object\|object\s*(.*)\)\s*$', 'bW')) + &sw
-+   endif
-+
-+ endif
-+
-+ " Add a 'shiftwidth' after lines ending with:
-+ if lline =~ '\(:\|=\|->\|<-\|(\|\[\|{\|{<\|\[|\|\[<\|\<\(begin\|do\|else\|fun\|function\|functor\|if\|initializer\|object\|parser\|private\|sig\|struct\|then\|try\)\|\<object\s*(.*)\)\s*$'
-+   let ind = ind + &sw
-+
-+ " Back to normal indent after lines ending with ';;':
-+ elseif lline =~ ';;\s*$' && lline !~ '^\s*;;'
-+   let ind = s:GetInd(v:lnum, s:letpat, s:letlim)
-+
-+ " Back to normal indent after lines ending with 'end':
-+ elseif lline =~ '\<end\s*$'
-+   let ind = s:FindPair(s:module, '','\<end\>')
-+
-+ " Back to normal indent after lines ending with 'in':
-+ elseif lline =~ '\<in\s*$' && lline !~ '^\s*in\>'
-+   let ind = s:FindPair('\<let\>', '', '\<in\>')
-+
-+ " Back to normal indent after lines ending with 'done':
-+ elseif lline =~ '\<done\s*$'
-+   let ind = s:FindPair('\<do\>', '','\<done\>')
-+
-+ " Back to normal indent after lines ending with '}' or '>}':
-+ elseif lline =~ '\(\|>\)}\s*$'
-+   let ind = s:FindPair('{', '','}')
-+
-+ " Back to normal indent after lines ending with ']', '|]' or '>]':
-+ elseif lline =~ '\(\||\|>\)\]\s*$'
-+   let ind = s:FindPair('\[', '','\]')
-+
-+ " Back to normal indent after comments:
-+ elseif lline =~ '\*)\s*$'
-+   call search('\*)', 'bW')
-+   let ind = indent(searchpair('(\*', '', '\*)', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string"'))
-+
-+ " Back to normal indent after lines ending with ')':
-+ elseif lline =~ ')\s*$'
-+   let ind = s:FindPair('(', '',')')
-+
-+ " If this is a multiline comment then align '*':
-+ elseif lline =~ '^\s*(\*' && line =~ '^\s*\*'
-+   let ind = ind + 1
-+
-+ endif
-+
-+ " Subtract a 'shiftwidth' after lines matching 'match ... with parser':
-+ if lline =~ '\<match\>.*\<with\>\s*\<parser\s*$'
-+   let ind = ind - &sw
-+ endif
- 
--  return ind
-+ return ind
- 
- endfunction
- 
-diff -urN vim64b/runtime/syntax/ocaml.vim vim64b.new/runtime/syntax/ocaml.vim
---- vim64b/runtime/syntax/ocaml.vim	2004-07-26 10:10:21.000000000 +0200
-+++ vim64b.new/runtime/syntax/ocaml.vim	2005-09-21 23:39:11.000000000 +0200
-@@ -1,19 +1,23 @@
- " Vim syntax file
- " Language:     OCaml
- " Filenames:    *.ml *.mli *.mll *.mly
--" Maintainers:  Markus Mottl      <markus at oefai.at>
-+" Maintainers:  Markus Mottl      <markus.mottl at gmail.com>
- "               Karl-Heinz Sylla  <Karl-Heinz.Sylla at gmd.de>
- "               Issac Trotts      <ijtrotts at ucdavis.edu>
--" URL:          http://www.oefai.at/~markus/vim/syntax/ocaml.vim
--" Last Change:  2004 Jul 26
--"               2003 Jan 19 - Added keyword "require" for scripting (MM)
--"               2002 Oct 30 - New variable "ocaml_revised" (MM)
-+" URL:          http://www.ocaml.info/vim/syntax/ocaml.vim
-+" Last Change:  2005 May 18 - Added 'NOTE' to highlighted comment words (MM)
-+"               2005 Apr 14 - Fixed a small bug concerning 'include' (MM)
-+"               2005 Mar 15 - Added a patch from David Baelde (MM)
-+
-+" A minor patch was applied to the official version so that object/end
-+" can be distinguished from begin/end, which is used for indentation,
-+" and folding. (David Baelde)
- 
- " 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")
-+elseif exists("b:current_syntax") && b:current_syntax != "ocaml"
-   finish
- endif
- 
-@@ -24,7 +28,7 @@
- syn match    ocamlComment   "^#!.*"
- 
- " Scripting directives
--syn match    ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|trace\|untrace\|untrace_all\|print_depth\|print_length\)\>"
-+syn match    ocamlScript "^#\<\(quit\|labels\|warnings\|directory\|cd\|load\|use\|install_printer\|remove_printer\|require\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\)\>"
- 
- " lowercase identifier - the standard way to match
- syn match    ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
-@@ -74,11 +78,11 @@
- 
- " Comments
- syn region   ocamlComment start="(\*" end="\*)" contains=ocamlComment,ocamlTodo
--syn keyword  ocamlTodo contained TODO FIXME XXX
-+syn keyword  ocamlTodo contained TODO FIXME XXX NOTE
- 
- 
- " Objects
--syn region   ocamlEnd matchgroup=ocamlKeyword start="\<object\>" matchgroup=ocamlKeyword end="\<end\>" contains=ALLBUT, at ocamlContained,ocamlEndErr
-+syn region   ocamlEnd matchgroup=ocamlObject start="\<object\>" matchgroup=ocamlObject end="\<end\>" contains=ALLBUT, at ocamlContained,ocamlEndErr
- 
- 
- " Blocks
-@@ -113,7 +117,7 @@
- syn region   ocamlNone matchgroup=ocamlKeyword start="\<open\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\(\.\u\(\w\|'\)*\)*\>" contains=@ocamlAllErrs,ocamlComment
- 
- " "include"
--syn match    ocamlKeyword "\<include\>" contained skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
-+syn match    ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
- 
- " "module" - somewhat complicated stuff ;-)
- syn region   ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
-@@ -163,8 +167,9 @@
-   syn match    ocamlKeyChar  "!"
- endif
- 
--syn keyword  ocamlType     array bool char exn float format format4 int
--syn keyword  ocamlType     list option string unit
-+syn keyword  ocamlType     array bool char exn float format format4
-+syn keyword  ocamlType     int int32 int64 lazy_t list nativeint option
-+syn keyword  ocamlType     string unit
- 
- syn keyword  ocamlOperator asr lor lsl lsr lxor mod not
- 
-@@ -203,20 +208,20 @@
- syn match    ocamlKeyChar      "="
- 
- if exists("ocaml_revised")
--  syn match    ocamlErr		"<-"
-+  syn match    ocamlErr        "<-"
- else
--  syn match    ocamlOperator	"<-"
-+  syn match    ocamlOperator   "<-"
- endif
- 
--syn match    ocamlNumber	"\<-\=\d\+\>"
--syn match    ocamlNumber	"\<-\=0[x|X]\x\+\>"
--syn match    ocamlNumber	"\<-\=0[o|O]\o\+\>"
--syn match    ocamlNumber	"\<-\=0[b|B][01]\+\>"
--syn match    ocamlFloat		"\<-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=[fl]\=\>"
-+syn match    ocamlNumber        "\<-\=\d\+[l|L]\?\>"
-+syn match    ocamlNumber        "\<-\=0[x|X]\x\+[l|L]\?\>"
-+syn match    ocamlNumber        "\<-\=0[o|O]\o\+[l|L]\?\>"
-+syn match    ocamlNumber        "\<-\=0[b|B][01]\+[l|L]\?\>"
-+syn match    ocamlFloat         "\<-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=[fl]\=\>"
- 
- " Labels
--syn match    ocamlLabel		"\~\(\l\|_\)\(\w\|'\)*"lc=1
--syn match    ocamlLabel		"?\(\l\|_\)\(\w\|'\)*"lc=1
-+syn match    ocamlLabel        "\~\(\l\|_\)\(\w\|'\)*"lc=1
-+syn match    ocamlLabel        "?\(\l\|_\)\(\w\|'\)*"lc=1
- syn region   ocamlLabel transparent matchgroup=ocamlLabel start="?(\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT, at ocamlContained,ocamlParenErr
- 
- 
-@@ -252,62 +257,63 @@
-     command -nargs=+ HiLink hi def link <args>
-   endif
- 
--  HiLink ocamlBraceErr	   Error
--  HiLink ocamlBrackErr	   Error
--  HiLink ocamlParenErr	   Error
--  HiLink ocamlArrErr	   Error
-+  HiLink ocamlBraceErr     Error
-+  HiLink ocamlBrackErr     Error
-+  HiLink ocamlParenErr     Error
-+  HiLink ocamlArrErr       Error
- 
-   HiLink ocamlCommentErr   Error
- 
--  HiLink ocamlCountErr	   Error
--  HiLink ocamlDoErr	   Error
--  HiLink ocamlDoneErr	   Error
--  HiLink ocamlEndErr	   Error
--  HiLink ocamlThenErr	   Error
-+  HiLink ocamlCountErr     Error
-+  HiLink ocamlDoErr        Error
-+  HiLink ocamlDoneErr      Error
-+  HiLink ocamlEndErr       Error
-+  HiLink ocamlThenErr      Error
- 
--  HiLink ocamlCharErr	   Error
-+  HiLink ocamlCharErr      Error
- 
--  HiLink ocamlErr	   Error
-+  HiLink ocamlErr          Error
- 
--  HiLink ocamlComment	   Comment
-+  HiLink ocamlComment      Comment
- 
--  HiLink ocamlModPath	   Include
--  HiLink ocamlModule	   Include
-+  HiLink ocamlModPath      Include
-+  HiLink ocamlObject	   Include
-+  HiLink ocamlModule       Include
-   HiLink ocamlModParam1    Include
--  HiLink ocamlModType	   Include
--  HiLink ocamlMPRestr3	   Include
--  HiLink ocamlFullMod	   Include
-+  HiLink ocamlModType      Include
-+  HiLink ocamlMPRestr3     Include
-+  HiLink ocamlFullMod      Include
-   HiLink ocamlModTypeRestr Include
--  HiLink ocamlWith	   Include
--  HiLink ocamlMTDef	   Include
-+  HiLink ocamlWith         Include
-+  HiLink ocamlMTDef        Include
- 
--  HiLink ocamlScript	   Include
-+  HiLink ocamlScript       Include
- 
-   HiLink ocamlConstructor  Constant
- 
-   HiLink ocamlModPreRHS    Keyword
--  HiLink ocamlMPRestr2	   Keyword
--  HiLink ocamlKeyword	   Keyword
--  HiLink ocamlFunDef	   Keyword
-+  HiLink ocamlMPRestr2     Keyword
-+  HiLink ocamlKeyword      Keyword
-+  HiLink ocamlFunDef       Keyword
-   HiLink ocamlRefAssign    Keyword
--  HiLink ocamlKeyChar	   Keyword
--  HiLink ocamlAnyVar	   Keyword
--  HiLink ocamlTopStop	   Keyword
--  HiLink ocamlOperator	   Keyword
-+  HiLink ocamlKeyChar      Keyword
-+  HiLink ocamlAnyVar       Keyword
-+  HiLink ocamlTopStop      Keyword
-+  HiLink ocamlOperator     Keyword
- 
--  HiLink ocamlBoolean	   Boolean
-+  HiLink ocamlBoolean      Boolean
-   HiLink ocamlCharacter    Character
--  HiLink ocamlNumber	   Number
--  HiLink ocamlFloat	   Float
--  HiLink ocamlString	   String
-+  HiLink ocamlNumber       Number
-+  HiLink ocamlFloat        Float
-+  HiLink ocamlString       String
- 
--  HiLink ocamlLabel	   Identifier
-+  HiLink ocamlLabel        Identifier
- 
--  HiLink ocamlType	   Type
-+  HiLink ocamlType         Type
- 
--  HiLink ocamlTodo	   Todo
-+  HiLink ocamlTodo         Todo
- 
--  HiLink ocamlEncl	   Keyword
-+  HiLink ocamlEncl         Keyword
- 
-   delcommand HiLink
- endif

Copied: trunk/vim/debian/patches/merged-upstream/118_ocaml.vim.diff (from rev 353, trunk/vim/debian/patches/118_ocaml.vim.diff)




More information about the pkg-vim-maintainers mailing list