summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-08-19 20:40:30 +0000
committerBram Moolenaar <Bram@vim.org>2005-08-19 20:40:30 +0000
commit8aff23a13e69dd6290e9a6f2c3aeb4b486f28279 (patch)
tree361a4567d1f0459e4efbe2b5d05db96991679251
parent5195e45609b26b3d262a90822a2283a4adcf65c9 (diff)
updated for version 7.0132v7.0132
-rw-r--r--runtime/autoload/netrw.vim158
-rw-r--r--runtime/doc/eval.txt5
-rw-r--r--runtime/doc/options.txt49
-rw-r--r--runtime/doc/pattern.txt7
-rw-r--r--runtime/doc/pi_netrw.txt5
-rw-r--r--runtime/doc/spell.txt275
-rw-r--r--runtime/doc/syntax.txt5
-rw-r--r--runtime/doc/tags14
-rw-r--r--runtime/doc/todo.txt19
-rw-r--r--runtime/doc/various.txt8
-rw-r--r--runtime/filetype.vim17
-rw-r--r--runtime/plugin/NetrwPlugin.vim6
-rw-r--r--runtime/spell/en.latin1.splbin568698 -> 568720 bytes
-rw-r--r--runtime/syntax/bib.vim7
-rw-r--r--src/edit.c22
-rw-r--r--src/ex_cmds.c10
-rw-r--r--src/globals.h8
-rw-r--r--src/option.c16
-rw-r--r--src/option.h3
-rw-r--r--src/proto/ex_cmds.pro1
-rw-r--r--src/proto/spell.pro1
-rw-r--r--src/version.h4
22 files changed, 438 insertions, 202 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index e077e25e74..c797beca30 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,8 +1,8 @@
" netrw.vim: Handles file transfer and remote directory listing across a network
" AUTOLOAD PORTION
-" Last Change: Aug 16, 2005
+" Last Change: Aug 19, 2005
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
-" Version: 63
+" Version: 65
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
@@ -690,8 +690,6 @@ fun! s:NetGetFile(readcmd, fname, method)
exe a:readcmd." ".v:cmdarg." ".fname
let line1 = curline + 1
let line2 = line("$") - lastline + 1
- let s:netrw_line = s:netrw_line + 1
- let s:netrw_col = 1
else
" not readable
" call Dret("NetGetFile : fname<".fname."> not readable")
@@ -1025,6 +1023,8 @@ fun! s:NetBrowse(dirname)
return
endif
+ call s:NetOptionSave()
+
" sanity check
if exists("b:netrw_method") && b:netrw_method =~ '[235]'
" call Decho("b:netrw_method=".b:netrw_method)
@@ -1033,6 +1033,7 @@ fun! s:NetBrowse(dirname)
echohl Error | echo "***netrw*** this system doesn't support remote directory listing via ftp" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
+ call s:NetOptionRestore()
" call Dret("NetBrowse")
return
endif
@@ -1042,6 +1043,7 @@ fun! s:NetBrowse(dirname)
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
+ call s:NetOptionRestore()
" call Dret("NetBrowse")
return
endif
@@ -1061,6 +1063,7 @@ fun! s:NetBrowse(dirname)
echohl Error | echo "***netrw*** netrw doesn't understand your dirname<".dirname.">" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
+ call s:NetOptionRestore()
" call Dret("NetBrowse : badly formatted dirname<".dirname.">")
return
endif
@@ -1109,6 +1112,7 @@ fun! s:NetBrowse(dirname)
" call Decho("attempt transfer of symlink as file")
call s:NetBrowse(substitute(dirname,'@$','','e'))
redraw!
+ call s:NetOptionRestore()
" call Dret("NetBrowse : symlink")
return
@@ -1119,7 +1123,7 @@ fun! s:NetBrowse(dirname)
" remove any filetype indicator from end of dirname, except for the
" "this is a directory" indicator (/). There shouldn't be one of those,
" anyway.
- let path= substitute(path,'[*=@|]$','','e')
+ let path= substitute(path,'[*=@|]\r\=$','','e')
" call Decho("new path<".path.">")
" remote-read the requested file into current buffer
@@ -1133,7 +1137,7 @@ fun! s:NetBrowse(dirname)
" save certain window-oriented variables into buffer-oriented variables
call s:BufWinVars()
-
+ call s:NetOptionRestore()
setlocal nonu nomod noma
" call Dret("NetBrowse : file<".fname.">")
@@ -1152,6 +1156,7 @@ fun! s:NetBrowse(dirname)
" call Decho("buffer already exists, switching to it")
exe "b ".bufnamenr
if line("$") >= 5
+ call s:NetOptionRestore()
" call Dret("NetBrowse")
return
endif
@@ -1166,7 +1171,7 @@ fun! s:NetBrowse(dirname)
" call Decho("exe file ".escape(bufname,s:netrw_cd_escape))
exe 'file '.escape(bufname,s:netrw_cd_escape)
" call Decho("renaming file to bufname<".bufname.">")
- setlocal bh=hide nobl nonu
+ setlocal bh=hide bt=nofile nobl nonu
" save current directory on directory history list
call <SID>NetBookmarkDir(3,expand("%"))
@@ -1281,7 +1286,6 @@ fun! s:NetBrowse(dirname)
exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
endif
endif
-
" set up syntax highlighting
if has("syntax")
@@ -1347,8 +1351,12 @@ fun! s:NetBrowse(dirname)
endif
endif
endif
+
+ " cleanup any windows mess at end-of-line
+ keepjumps silent! %s/\r$//e
exe "keepjumps ".w:netrw_bannercnt
+ call s:NetOptionRestore()
setlocal nomod noma nonu
" call Dret("NetBrowse")
@@ -1772,6 +1780,16 @@ fun! s:NetBrowseFtpCmd(path,cmd)
endif
endif
+ " ftp's ls doesn't seem to include ./ or ../
+ if !search('^\.\/$','wn')
+ exe 'keepjumps '.curline
+ if a:path !~ '^$'
+ put ='../'
+ endif
+ put ='./'
+ exe 'keepjumps '.curline
+ endif
+
" restore settings
let &ff= ffkeep
" call Dret("NetBrowseFtpCmd")
@@ -2128,22 +2146,18 @@ fun! netrw#DirBrowse(dirname)
" call Dret("DirBrowse")
return
endif
+ call s:NetOptionSave()
if v:version < 603
if !exists("g:netrw_quiet")
echohl Error | echo "***netrw*** vim version<".v:version."> too old for browsing with netrw" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif
+ call s:NetOptionRestore()
" call Dret("DirBrowse : vim version<".v:version."> too old")
return
endif
- " record autochdir setting and then insure its unset (tnx to David Fishburn)
- if has("netbeans_intg") || has("sun_workshop")
- let keep_autochdir= &autochdir
- set noautochdir
- endif
-
" use buffer-oriented WinVars if buffer ones exist but window ones don't
call s:UseBufWinVars()
@@ -2166,7 +2180,7 @@ fun! netrw#DirBrowse(dirname)
endif
" get cleared buffer
- if bufnum < 0
+ if bufnum < 0 || !bufexists(bufnum)
if v:version < 700
enew!
else
@@ -2185,6 +2199,7 @@ fun! netrw#DirBrowse(dirname)
" call Decho("change directory: cd ".b:netrw_curdir)
exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape)
endif
+ call s:NetOptionRestore()
" call Dret("DirBrowse : reusing buffer#".bufnum."<".a:dirname.">")
return
endif
@@ -2201,6 +2216,11 @@ fun! netrw#DirBrowse(dirname)
if b:netrw_curdir =~ '[/\\]$'
let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e')
endif
+ if b:netrw_curdir == ''
+ " under unix, when the root directory is encountered, the result
+ " from the preceding substitute is an empty string.
+ let b:netrw_curdir= '/'
+ endif
" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
" make netrw's idea of the current directory vim's if the user wishes
@@ -2214,6 +2234,7 @@ fun! netrw#DirBrowse(dirname)
if exists("w:netrw_prvdir")
let b:netrw_curdir= w:netrw_prvdir
else
+ call s:NetOptionRestore()
" call Dret("DirBrowse : reusing buffer#".bufnum."<".a:dirname.">")
return
endif
@@ -2223,8 +2244,8 @@ fun! netrw#DirBrowse(dirname)
" change the name of the buffer to reflect the b:netrw_curdir
exe 'silent! file '.escape(b:netrw_curdir,s:netrw_cd_escape)
- " make this buffer modifiable and hidden
- setlocal ma hidden nonu bt=nofile
+ " make this buffer not-a-file, modifiable, not line-numbered, etc
+ setlocal bh=hide bt=nofile nobl ma nonu
if v:version < 700
silent! %d
else
@@ -2367,11 +2388,8 @@ fun! netrw#DirBrowse(dirname)
" save certain window-oriented variables into buffer-oriented variables
call s:BufWinVars()
-
+ call s:NetOptionRestore()
setlocal noma nomod nonu bh=hide nobl
- if has("netbeans_intg") || has("sun_workshop")
- let &autochdir= keep_autochdir
- endif
" call Dret("DirBrowse : file<".expand("%:p")."> bufname<".bufname("%").">")
endfun
@@ -2470,6 +2488,9 @@ fun! s:LocalBrowseList()
keepjumps put=pfile
endif
endwhile
+
+ " cleanup any windows mess at end-of-line
+ keepjumps silent! %s/\r$//e
setlocal ts=32
" call Dret("LocalBrowseList")
@@ -3091,27 +3112,42 @@ endfun
" ------------------------------------------------------------------------
" NetOptionSave: save options and set to "standard" form {{{1
-fun!s:NetOptionSave()
+fun! s:NetOptionSave()
" call Dfunc("NetOptionSave()")
+ if !exists("w:netoptionsave")
+ let w:netoptionsave= 1
+ else
+" call Dret("NetOptionSave : netoptionsave=".w:netoptionsave)
+ return
+ endif
" Get Temporary Filename
- let s:aikeep = &ai
- let s:cinkeep = &cin
- let s:cinokeep = &cino
- let s:comkeep = &com
- let s:cpokeep = &cpo
- let s:dirkeep = getcwd()
- let s:gdkeep = &gd
- let s:twkeep = &tw
+ let w:aikeep = &ai
+ " record autochdir setting and then insure its unset (tnx to David Fishburn)
+ if has("netbeans_intg") || has("sun_workshop")
+ let w:acdkeep = &autochdir
+ set noautochdir
+ endif
+ let w:cinkeep = &cin
+ let w:cinokeep = &cino
+ let w:comkeep = &com
+ let w:cpokeep = &cpo
+ if !g:netrw_keepdir
+ let w:dirkeep = getcwd()
+ endif
+ let w:gdkeep = &gd
+ let w:repkeep = &report
+ let w:twkeep = &tw
setlocal cino =
setlocal com =
setlocal cpo -=aA
setlocal nocin noai
setlocal tw =0
+ setlocal report=10000
if has("win32") && !has("win95")
- let s:swfkeep= &swf
+ let w:swfkeep= &swf
setlocal noswf
-" call Decho("setting s:swfkeep to <".&swf.">")
+" call Decho("setting w:swfkeep to <".&swf.">")
endif
" call Dret("NetOptionSave")
@@ -3121,36 +3157,50 @@ endfun
" NetOptionRestore: restore options {{{1
fun! s:NetOptionRestore()
" call Dfunc("NetOptionRestore()")
+ if !exists("w:netoptionsave")
+" call Dret("NetOptionRestore : netoptionsave=".w:netoptionsave)
+ return
+ endif
+ unlet w:netoptionsave
- let &ai = s:aikeep
- let &cin = s:cinkeep
- let &cino = s:cinokeep
- let &com = s:comkeep
- let &cpo = s:cpokeep
- exe "lcd ".s:dirkeep
- let &gd = s:gdkeep
- let &tw = s:twkeep
- if exists("s:swfkeep")
+ let &ai = w:aikeep
+ if has("netbeans_intg") || has("sun_workshop")
+ let &acd = w:acdkeep
+ endif
+ let &cin = w:cinkeep
+ let &cino = w:cinokeep
+ let &com = w:comkeep
+ let &cpo = w:cpokeep
+ if exists("w:dirkeep")
+ exe "lcd ".w:dirkeep
+ endif
+ let &gd = w:gdkeep
+ let &report = w:repkeep
+ let &tw = w:twkeep
+ if exists("w:swfkeep")
if &directory == ""
" user hasn't specified a swapfile directory;
" netrw will temporarily make the swapfile
" directory the current local one.
let &directory = getcwd()
- silent! let &swf = s:swfkeep
+ silent! let &swf = w:swfkeep
set directory=
else
- let &swf= s:swfkeep
- endif
- unlet s:swfkeep
- endif
- unlet s:aikeep
- unlet s:cinkeep
- unlet s:cinokeep
- unlet s:comkeep
- unlet s:cpokeep
- unlet s:gdkeep
- unlet s:twkeep
- unlet s:dirkeep
+ let &swf= w:swfkeep
+ endif
+ unlet w:swfkeep
+ endif
+ unlet w:aikeep
+ unlet w:cinkeep
+ unlet w:cinokeep
+ unlet w:comkeep
+ unlet w:cpokeep
+ unlet w:gdkeep
+ unlet w:repkeep
+ unlet w:twkeep
+ if exists("w:dirkeep")
+ unlet w:dirkeep
+ endif
" call Dret("NetOptionRestore")
endfun
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 61a22df731..c18959678d 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4692,10 +4692,7 @@ last defined. Example: >
function SetFileTypeSH(name)
Last set from /usr/share/vim/vim-7.0/filetype.vim
<
-When the function was defined by hand there is no "Last set" message. When
-the function was defined while executing a function, user command or
-autocommand, the script in which it was defined is reported.
-{not available when compiled without the +eval feature}
+See |:verbose-cmd| for more information.
*E124* *E125*
:fu[nction][!] {name}([arguments]) [range] [abort] [dict]
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d15d454a67..56a91b6af7 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 12
+*options.txt* For Vim version 7.0aa. Last change: 2005 Aug 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4284,6 +4284,45 @@ A jump table for the options with a short description can be found at |Q_op|.
generated from a list of items, e.g., the Buffers menu. Changing this
option has no direct effect, the menu must be refreshed first.
+ *'mkspellmem'* *'msm'*
+'mkspellmem' 'msm' string (default "460000,2000,500")
+ global
+ {not in Vi}
+ {not available when compiled without the |+syntax|
+ feature}
+ Parameters for |:mkspell|. This tunes when to start compressing the
+ word tree. Compression can be slow when there are many words, but
+ it's needed to avoid running out of memory. The amount of memory used
+ per word depends very much on how similar the words are, that's why
+ this tuning is complicated.
+
+ There are three numbers, separated by commas:
+ {start},{inc},{added}
+
+ For most languages the uncompressed word tree fits in memory. {start}
+ gives the amount of memory in Kbyte that can be used before any
+ compression is done. It should be a bit smaller than the amount of
+ memory that is available to Vim.
+
+ When going over the {start} limit the {inc} number specifies the
+ amount of memory in Kbyte that can be allocated before another
+ compression is done. A low number means compression is done after
+ less words are added, which is slow. A high number means more memory
+ will be allocated.
+
+ After doing compression, {added} times 1024 words can be added before
+ the {inc} limit is ignored and compression is done when any extra
+ amount of memory is needed. A low number means there is a smaller
+ chance of hitting the {inc} limit, less memory is used but it's
+ slower.
+
+ The languages for which these numbers are important are Italian and
+ Hungarian. The default works for when you have about 512 Mbyte. If
+ you have 1 Gbyte you could use: >
+ :set mkspellmem=900000,3000,800
+< If you have less than 512 Mbyte |:mkspell| may fail for some
+ languages, no matter what you set 'mkspellmem' to.
+
*'modeline'* *'ml'* *'nomodeline'* *'noml'*
'modeline' 'ml' boolean (Vim default: on, Vi default: off)
local to buffer
@@ -5696,7 +5735,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Pattern to locate the end of a sentence. The following word will be
checked to start with a capital letter. If not then it is highlighted
- with SpellCap |hl-SpellCap|.
+ with SpellCap |hl-SpellCap| (unless the word is also badly spelled).
When this check is not wanted make this option empty.
Only used when 'spell' is set.
Be careful with special characters, see |option-backslash| about
@@ -5749,6 +5788,7 @@ A jump table for the options with a short description can be found at |Q_op|.
region by listing them: "en_us,en_ca" supports both US and Canadian
English, but not words specific for Australia, New Zealand or Great
Britain.
+ *E757*
As a special case the name of a .spl file can be given as-is. The
first "_xx" in the name is removed and used as the region name
(_xx is an underscore, two letters and followed by a non-letter).
@@ -5789,6 +5829,11 @@ A jump table for the options with a short description can be found at |Q_op|.
character inserts/deletes/swaps. Works well for
simple typing mistakes.
+ {number} The maximum number of suggestions listed for |z?|.
+ Not used for |spellsuggest()|. The number of
+ suggestions is never more than the value of 'lines'
+ minus two.
+
file:{filename} Read file {filename}, which must have two columns,
separated by a slash. The first column contains the
bad word, the second column the suggested good word.
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 078d754206..84e9bf5172 100644
--- 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 14
+*pattern.txt* For Vim version 7.0aa. Last change: 2005 Aug 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -943,9 +943,10 @@ x A single character, with no special meaning, matches itself
"\_[^ab]" matches the end-of-line and any character but "a" and "b".
This makes it Vi compatible: Without the "\_" or "\n" the collection
does not match an end-of-line.
-
+ *E769*
When the ']' is not there Vim will not give an error message but
- assume no collection is used. Useful to search for '['.
+ assume no collection is used. Useful to search for '['. However, you
+ do get E769 for internal searching.
If the sequence begins with "^", it matches any single character NOT
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 00718833fe..48ee8806d3 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1217,6 +1217,11 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
10. History *netrw-history*
+ v64: * Browser functions now use NetOptionSave/Restore; in particular,
+ netrw now works around the report setting
+ * Bugfix - browsing a "/" directory (Unix) yielded buffers
+ named "[Scratch]" instead of "/"
+ * Bugfix - remote browsing with ftp was omitting the ./ and ../
v63: * netrw now takes advantage of autoload (and requires 7.0)
* Bugfix - using r (to reverse sort) working again
v62: * Bugfix - spaces allowed again in directory names with
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 929c1060a0..2ec2eba36f 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt* For Vim version 7.0aa. Last change: 2005 Aug 16
+*spell.txt* For Vim version 7.0aa. Last change: 2005 Aug 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -433,8 +433,12 @@ then Vim will try to guess.
|spell-affix-SAL|
This command uses a lot of memory, required to find
- the optimal word tree (Polish requires a few hundred
- Mbyte). The final result will be much smaller.
+ the optimal word tree (Polish, Italian and Hungarian
+ require several hundred Mbyte). The final result will
+ be much smaller, because compression is used. To
+ avoid running out of memory compression will be done
+ now and then. This can be tuned with the 'mkspellmem'
+ option.
After the spell file was written and it was being used
in a buffer it will be reloaded automatically.
@@ -452,7 +456,8 @@ then Vim will try to guess.
Vim will report the number of duplicate words. This might be a mistake in the
list of words. But sometimes it is used to have different prefixes and
suffixes for the same basic word to avoid them combining (e.g. Czech uses
-this).
+this). If you want Vim to report all duplicate words set the 'verbose'
+option.
Since you might want to change a Myspell word list for use with Vim the
following procedure is recommended:
@@ -477,6 +482,25 @@ When the Myspell files are updated you can merge the differences:
4. Rename xx_YY.new.dic to xx_YY.orig.dic and xx_YY.new.aff to xx_YY.new.aff.
+SPELL FILE VERSIONS *E770* *E771* *E772*
+
+Spell checking is a relatively new feature in Vim, thus it's possible that the
+.spl file format will be changed to support more languages. Vim will check
+the validity of the spell file and report anything wrong.
+
+ E771: Old spell file, needs to be updated ~
+This spell file is older than your Vim. You need to update the .spl file.
+
+ E772: Spell file is for newer version of Vim ~
+This means the spell file was made for a later version of Vim. You need to
+update Vim.
+
+ E770: Unsupported section in spell file ~
+This means the spell file was made for a later version of Vim and contains a
+section that is required for the spell file to work. In this case it's
+probably a good idea to upgrade your Vim.
+
+
SPELL FILE DUMP
If for some reason you want to check what words are supported by the currently
@@ -736,6 +760,7 @@ Example:
SFX F 0 in [^i]n # Spion > Spionin ~
SFX F 0 nen in # Bauerin > Bauerinnen ~
+ *spell-affix-rare*
An extra item for Vim is the "rare" flag. It must come after the other
fields, before a comment. When used then all words that use the affix will be
marked as rare words. Example:
@@ -746,6 +771,22 @@ marked as rare words. Example:
However, if the word also appears as a good word in another way it won't be
marked as rare.
+ *spell-affix-nocomp*
+Another extra item for Vim is the "nocomp" flag. It must come after the other
+fields, before a comment. It can be either before or after "rare". When used
+then all words that use the affix will not be used for compound words.
+Example:
+ affix file:
+ COMPOUNDFLAG c ~
+ SFX a Y 2 ~
+ SFX a 0 s . ~
+ SFX a 0 ize . nocomp ~
+ dictionary:
+ word/c ~
+ util/ac ~
+
+This allows for "wordutil" and "wordutils" but not "wordutilize".
+
*spell-affix-PFXPOSTPONE*
When an affix file has very many prefixes that apply to many words it's not
possible to build the whole word list in memory. This applies to Hebrew (a
@@ -761,9 +802,6 @@ string is one character and equal to the last character of the added string,
but in lower case. Thus when the chop string is used to allow the following
word to start with an upper case letter.
-It is not possible to use PFXPOSTPONE together with COMPOUNDFLAG or
-COMPOUNDFLAGS.
-
WORDS WITH A SLASH *spell-affix-SLASH*
@@ -818,86 +856,73 @@ This can be used to exclude words that would otherwise be good. For example
Once a word has been marked as bad it won't be undone by encountering the same
word as good.
+ *spell-affix-NEEDAFFIX*
+The NEEDAFFIX flag is used to require that a word is used with an affix. The
+word itself is not a good word. Example:
+
+ NEEDAFFIX + ~
+
COMPOUND WORDS *spell-affix-compound*
-A compound word is a longer word made by concatenating words. To specify
-which words may be concatenated a character is used. This character is put in
-the list of affixes after the word. We will call this character a flag here.
-Obviously these flags must be different from any affix IDs used.
+A compound word is a longer word made by concatenating words that appear in
+the .dic file. To specify which words may be concatenated a character is
+used. This character is put in the list of affixes after the word. We will
+call this character a flag here. Obviously these flags must be different from
+any affix IDs used.
*spell-COMPOUNDFLAG*
The Myspell compatible method uses one flag, specified with COMPOUNDFLAG.
-All words with this flag combine in any order and without limit in length.
-This means there is no control over which word comes first. Example:
+All words with this flag combine in any order. This means there is no control
+over which word comes first. Example:
COMPOUNDFLAG c ~
*spell-COMPOUNDFLAGS*
-The method added by Vim allows specifying which words can be prepended to
-other words, and which words can be appended to other words. This is a list
-of comma separated items. Each item may contain zero or more dashes and plus
-signs.
-
-NOTE: At this moment COMPOUNDFLAGS has not been implemented yet!
-
-An item without dashes specifies words that combine in any order and as often
-as possible. Example:
- COMPOUNDFLAGS c,m ~
-
-This allows all words with the "c" flag to be combined and all words with the
-"m" flag to be combined, but a word with the "c" flag doesn't combine with a
-word with the "m" flag.
-
-Flags that are put together, without a separating comma, are considered
-interchangable. Example:
- COMPOUNDFLAGS cm ~
-
-This allows all words with the "c" and/or "m" flag to be combined.
-
-An item with one dash specifies flags for a leading word and flags for a
-trailing word. Thus only two-word combinations are made. Example:
- COMPOUNDFLAGS f-d ~
-
-Here the 'f' flag can be used for food and 'd' for dishes, such that you can
-use these words in the dictionary:
- tomato/f ~
- onion/f~
- soup/d~
- salat/d~
-
-Which makes the words:
- tomato
+A more advanced method to specify how compound words can be formed uses
+multiple items with multiple flags. This is not compatible with Myspell 3.0.
+Let's start with an example:
+ COMPOUNDFLAGS c+ ~
+ COMPOUNDFLAGS se ~
+
+The first line defines that words with the "c" flag can be concatenated in any
+order. The second line defines compound words that are made of one word with
+the "s" flag and one word with the "e" flag. With this dictionary:
+ bork/c ~
+ onion/s ~
+ soup/e ~
+
+You can make these words:
+ bork
+ borkbork
+ borkborkbork
+ (etc.)
onion
soup
- salat
- tomatosoup
- tomatosalat
onionsoup
- onionsalat
-
-Note that something like "souptomato" is not possible. And that it's actually
-easier to list all the words if you have only this few.
-
-More dashes can be used to allow more words to combine. For example:
- COMPOUNDFLAGS f-d,f-f-d ~
-
-Would allow "tomatoonionsoup" (OK, so this is a bad example, but you get the
-idea).
-
-When a word can be used an undetermined number of times use a plus instead of
-a dash. Example:
- COMPOUNDFLAGS f+d ~
-
-Then you can make tasty "oniononiontomatotomatosoup".
-
-The "+" may also appear at the end, which means that the last flags can be
-repeated many times. Example:
- COMPOUNDFLAGS f-d+ ~
-Which allows the use of "onionsoupsoupsoupsoupsoupsoup".
+The COMPOUNDFLAGS item may appear multiple times. The argument is made out of
+one or more groups, where each group can be:
+ one flag e.g., c
+ alternate flags inside [] e.g., [abc]
+Optionally this may be followed by:
+ * the group appears zero or more times, e.g., sm*e
+ + the group appears one or more times, e.g., c+
+
+This is similar to the regexp pattern syntax (but not the same!). A few
+examples with the sequence of word flags they require:
+ COMPOUNDFLAGS x+ x xx xxx etc.
+ COMPOUNDFLAGS yz yz
+ COMPOUNDFLAGS x+z xz xxz xxxz etc.
+ COMPOUNDFLAGS yx+ yx yxx yxxx etc.
+
+ COMPOUNDFLAGS [abc]z az bz cz
+ COMPOUNDFLAGS [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc.
+ COMPOUNDFLAGS a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc.
+ COMPOUNDFLAGS sm*e se sme smme smmme etc.
+ COMPOUNDFLAGS s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc.
*spell-COMPOUNDMIN*
-The minimal length of a word used for concatenation is specified with
+The minimal byte length of a word used for concatenation is specified with
COMPOUNDMIN. Example:
COMPOUNDMIN 5 ~
@@ -905,39 +930,79 @@ When omitted a minimal length of 3 bytes is used. Obviously you could just
leave out the compound flag from short words instead, this feature is present
for compatibility with Myspell.
- *spell-CMP*
-NOTE: At this moment CMP has not been implemented yet!
-
-Sometimes it is necessary to change a word when concatenating it to another,
-by removing a few letters, inserting something or both. It can also be useful
-to restrict concatenation to words that match a pattern. For this purpose CMP
-items can be used. They look like this:
- CMP {flag} {flags} {strip} {add} {cond} {cond2}
-
- {flag} the flag, as used in COMPOUNDFLAGS for the lead word
- {flags} accepted flags for the following word ('.' to accept
- all)
- {strip} text to remove from the end of the lead word (zero
- for no stripping)
- {add} text to insert between the words (zero for no
- addition)
- {cond} condition to match at the end of the lead word
- {cond2} condition to match at the start of the following word
-
-This is the same as what is used for SFX and PFX items, with the extra {flags}
-and {cond2} fields. Example:
- CMP f mrt 0 - . . ~
-
-When used with the food and dish word list above, this means that a dash is
-inserted after each food item. Thus you get "onion-soup" and
-"onion-tomato-salat".
-
-When there are CMP items for a compound flag the concatenation is only done
-when a CMP item matches.
-
-When there are no CMP items for a compound flag, then all words will be
-concatenated, as if there was an item:
- CMP {flag} . 0 0 . .
+ *spell-COMPOUNDMAX*
+The maximum number of words that can be concatenated into a compound word is
+specified with COMPOUNDMAX. Example:
+ COMPOUNDMAX 3 ~
+
+When omitted there is no maximum. It applies to all compound words.
+
+To set a limit for words with specific flags make sure the items in
+COMPOUNDFLAGS where they appear don't allow too many words.
+
+ *spell-COMPOUNDSYLMAX*
+The maximum number of syllables that a compound word may contain is specified
+with COMPOUNDSYLMAX. Example:
+ COMPOUNDSYLMAX 6 ~
+
+This has no effect if there is no SYLLABLE item. Without COMPOUNDSYLMAX there
+is no limit on the number of syllables.
+
+ *spell-SYLLABLE*
+The SYLLABLE item defines characters or character sequences that are used to
+count the number of syllables in a word. Example:
+ SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui ~
+
+Before the first slash is the set of characters that are counted for one
+syllable, also when repeated and mixed, until the next character that is not
+in this set. After the slash come sequences of characters that are counted
+for one syllable. These are preferred over using characters from the set.
+With the example "ideeen" has three syllables, counted by "i", "ee" and "e".
+
+Only case-folded letters need to be included.
+
+Above another way to restrict compounding was mentioned above: adding "nocomp"
+after an affix causes all words that are made with that affix not be be used
+for compounding. |spell-affix-nocomp|
+
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+NOTE: The following has not been implemented yet, because there are no word
+lists that support this.
+> *spell-CMP*
+> Sometimes it is necessary to change a word when concatenating it to another,
+> by removing a few letters, inserting something or both. It can also be useful
+> to restrict concatenation to words that match a pattern. For this purpose CMP
+> items can be used. They look like this:
+> CMP {flag} {flags} {strip} {strip2} {add} {cond} {cond2}
+>
+> {flag} the flag, as used in COMPOUNDFLAGS for the lead word
+> {flags} accepted flags for the following word ('.' to accept
+> all)
+> {strip} text to remove from the end of the lead word (zero
+> for no stripping)
+> {strip2} text to remove from the start of the following word
+> (zero for no stripping)
+> {add} text to insert between the words (zero for no
+> addition)
+> {cond} condition to match at the end of the lead word
+> {cond2} condition to match at the start of the following word
+>
+> This is the same as what is used for SFX and PFX items, with the extra {flags}
+> and {cond2} fields. Example:
+> CMP f mrt 0 - . . ~
+>
+> When used with the food and dish word list above, this means that a dash is
+> inserted after each food item. Thus