Author: adamg Date: Sat Jul 9 07:06:50 2011 GMT Module: packages Tag: HEAD ---- Log message: - new
---- Files affected: packages/vim: 7.3.223 (NONE -> 1.1) (NEW) packages/vim: 7.3.224 (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/vim/7.3.223 diff -u /dev/null packages/vim/7.3.223:1.1 --- /dev/null Sat Jul 9 09:06:50 2011 +++ packages/vim/7.3.223 Sat Jul 9 09:06:45 2011 @@ -0,0 +1,387 @@ +To: [email protected] +Subject: Patch 7.3.223 +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.223 +Problem: MingW cross compilation doesn't work with tiny features. +Solution: Move acp_to_enc(), enc_to_utf16() and utf16_to_enc() outside of + "#ifdef CLIPBOARD". Fix typo in makefile. +Files: src/Make_ming.mak, src/os_mswin.c + + +*** ../mercurial/vim73/src/Make_ming.mak 2010-12-30 14:50:46.000000000 +0100 +--- src/Make_ming.mak 2011-06-19 01:20:16.000000000 +0200 +*************** +*** 87,93 **** + + # If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext + # or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/ +! # uncomment the following, but I can't build a static versi�n with them, ?-(| + #GETTEXT=c:/gettext-0.10.37-20010430 + #STATIC_GETTEXT=USE_STATIC_GETTEXT + #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT +--- 87,93 ---- + + # If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext + # or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/ +! # uncomment the following, but I can't build a static version with them, ?-(| + #GETTEXT=c:/gettext-0.10.37-20010430 + #STATIC_GETTEXT=USE_STATIC_GETTEXT + #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT +*** ../mercurial/vim73/src/os_mswin.c 2011-06-19 01:14:23.000000000 +0200 +--- src/os_mswin.c 2011-06-19 01:25:23.000000000 +0200 +*************** +*** 1105,1236 **** + return ret; + } + +- #if defined(FEAT_MBYTE) || defined(PROTO) +- /* +- * Note: the following two functions are only guaranteed to work when using +- * valid MS-Windows codepages or when iconv() is available. +- */ +- +- /* +- * Convert "str" from 'encoding' to UTF-16. +- * Input in "str" with length "*lenp". When "lenp" is NULL, use strlen(). +- * Output is returned as an allocated string. "*lenp" is set to the length of +- * the result. A trailing NUL is always added. +- * Returns NULL when out of memory. +- */ +- short_u * +- enc_to_utf16(char_u *str, int *lenp) +- { +- vimconv_T conv; +- WCHAR *ret; +- char_u *allocbuf = NULL; +- int len_loc; +- int length; +- +- if (lenp == NULL) +- { +- len_loc = (int)STRLEN(str) + 1; +- lenp = &len_loc; +- } +- +- if (enc_codepage > 0) +- { +- /* We can do any CP### -> UTF-16 in one pass, and we can do it +- * without iconv() (convert_* may need iconv). */ +- MultiByteToWideChar_alloc(enc_codepage, 0, str, *lenp, &ret, &length); +- } +- else +- { +- /* Use "latin1" by default, we might be called before we have p_enc +- * set up. Convert to utf-8 first, works better with iconv(). Does +- * nothing if 'encoding' is "utf-8". */ +- conv.vc_type = CONV_NONE; +- if (convert_setup(&conv, p_enc ? p_enc : (char_u *)"latin1", +- (char_u *)"utf-8") == FAIL) +- return NULL; +- if (conv.vc_type != CONV_NONE) +- { +- str = allocbuf = string_convert(&conv, str, lenp); +- if (str == NULL) +- return NULL; +- } +- convert_setup(&conv, NULL, NULL); +- +- length = utf8_to_utf16(str, *lenp, NULL, NULL); +- ret = (WCHAR *)alloc((unsigned)((length + 1) * sizeof(WCHAR))); +- if (ret != NULL) +- { +- utf8_to_utf16(str, *lenp, (short_u *)ret, NULL); +- ret[length] = 0; +- } +- +- vim_free(allocbuf); +- } +- +- *lenp = length; +- return (short_u *)ret; +- } +- +- /* +- * Convert an UTF-16 string to 'encoding'. +- * Input in "str" with length (counted in wide characters) "*lenp". When +- * "lenp" is NULL, use wcslen(). +- * Output is returned as an allocated string. If "*lenp" is not NULL it is +- * set to the length of the result. +- * Returns NULL when out of memory. +- */ +- char_u * +- utf16_to_enc(short_u *str, int *lenp) +- { +- vimconv_T conv; +- char_u *utf8_str = NULL, *enc_str = NULL; +- int len_loc; +- +- if (lenp == NULL) +- { +- len_loc = (int)wcslen(str) + 1; +- lenp = &len_loc; +- } +- +- if (enc_codepage > 0) +- { +- /* We can do any UTF-16 -> CP### in one pass. */ +- int length; +- +- WideCharToMultiByte_alloc(enc_codepage, 0, str, *lenp, +- (LPSTR *)&enc_str, &length, 0, 0); +- *lenp = length; +- return enc_str; +- } +- +- /* Avoid allocating zero bytes, it generates an error message. */ +- utf8_str = alloc(utf16_to_utf8(str, *lenp == 0 ? 1 : *lenp, NULL)); +- if (utf8_str != NULL) +- { +- *lenp = utf16_to_utf8(str, *lenp, utf8_str); +- +- /* We might be called before we have p_enc set up. */ +- conv.vc_type = CONV_NONE; +- convert_setup(&conv, (char_u *)"utf-8", +- p_enc? p_enc: (char_u *)"latin1"); +- if (conv.vc_type == CONV_NONE) +- { +- /* p_enc is utf-8, so we're done. */ +- enc_str = utf8_str; +- } +- else +- { +- enc_str = string_convert(&conv, utf8_str, lenp); +- vim_free(utf8_str); +- } +- +- convert_setup(&conv, NULL, NULL); +- } +- +- return enc_str; +- } +- #endif /* FEAT_MBYTE */ +- + /* + * Wait for another process to Close the Clipboard. + * Returns TRUE for success. +--- 1105,1110 ---- +*************** +*** 1436,1467 **** + #endif + } + +- #if (defined(FEAT_MBYTE) && defined(WIN3264)) || defined(PROTO) +- /* +- * Convert from the active codepage to 'encoding'. +- * Input is "str[str_size]". +- * The result is in allocated memory: "out[outlen]". With terminating NUL. +- */ +- void +- acp_to_enc(str, str_size, out, outlen) +- char_u *str; +- int str_size; +- char_u **out; +- int *outlen; +- +- { +- LPWSTR widestr; +- +- MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, &widestr, outlen); +- if (widestr != NULL) +- { +- ++*outlen; /* Include the 0 after the string */ +- *out = utf16_to_enc((short_u *)widestr, outlen); +- vim_free(widestr); +- } +- } +- #endif +- + /* + * Send the current selection to the clipboard. + */ +--- 1310,1315 ---- +*************** +*** 1626,1631 **** +--- 1474,1631 ---- + + #endif /* FEAT_CLIPBOARD */ + ++ #if defined(FEAT_MBYTE) || defined(PROTO) ++ /* ++ * Note: the following two functions are only guaranteed to work when using ++ * valid MS-Windows codepages or when iconv() is available. ++ */ ++ ++ /* ++ * Convert "str" from 'encoding' to UTF-16. ++ * Input in "str" with length "*lenp". When "lenp" is NULL, use strlen(). ++ * Output is returned as an allocated string. "*lenp" is set to the length of ++ * the result. A trailing NUL is always added. ++ * Returns NULL when out of memory. ++ */ ++ short_u * ++ enc_to_utf16(char_u *str, int *lenp) ++ { ++ vimconv_T conv; ++ WCHAR *ret; ++ char_u *allocbuf = NULL; ++ int len_loc; ++ int length; ++ ++ if (lenp == NULL) ++ { ++ len_loc = (int)STRLEN(str) + 1; ++ lenp = &len_loc; ++ } ++ ++ if (enc_codepage > 0) ++ { ++ /* We can do any CP### -> UTF-16 in one pass, and we can do it ++ * without iconv() (convert_* may need iconv). */ ++ MultiByteToWideChar_alloc(enc_codepage, 0, str, *lenp, &ret, &length); ++ } ++ else ++ { ++ /* Use "latin1" by default, we might be called before we have p_enc ++ * set up. Convert to utf-8 first, works better with iconv(). Does ++ * nothing if 'encoding' is "utf-8". */ ++ conv.vc_type = CONV_NONE; ++ if (convert_setup(&conv, p_enc ? p_enc : (char_u *)"latin1", ++ (char_u *)"utf-8") == FAIL) ++ return NULL; ++ if (conv.vc_type != CONV_NONE) ++ { ++ str = allocbuf = string_convert(&conv, str, lenp); ++ if (str == NULL) ++ return NULL; ++ } ++ convert_setup(&conv, NULL, NULL); ++ ++ length = utf8_to_utf16(str, *lenp, NULL, NULL); ++ ret = (WCHAR *)alloc((unsigned)((length + 1) * sizeof(WCHAR))); ++ if (ret != NULL) ++ { ++ utf8_to_utf16(str, *lenp, (short_u *)ret, NULL); ++ ret[length] = 0; ++ } ++ ++ vim_free(allocbuf); ++ } ++ ++ *lenp = length; ++ return (short_u *)ret; ++ } ++ ++ /* ++ * Convert an UTF-16 string to 'encoding'. ++ * Input in "str" with length (counted in wide characters) "*lenp". When ++ * "lenp" is NULL, use wcslen(). ++ * Output is returned as an allocated string. If "*lenp" is not NULL it is ++ * set to the length of the result. ++ * Returns NULL when out of memory. ++ */ ++ char_u * ++ utf16_to_enc(short_u *str, int *lenp) ++ { ++ vimconv_T conv; ++ char_u *utf8_str = NULL, *enc_str = NULL; ++ int len_loc; ++ ++ if (lenp == NULL) ++ { ++ len_loc = (int)wcslen(str) + 1; ++ lenp = &len_loc; ++ } ++ ++ if (enc_codepage > 0) ++ { ++ /* We can do any UTF-16 -> CP### in one pass. */ ++ int length; ++ ++ WideCharToMultiByte_alloc(enc_codepage, 0, str, *lenp, ++ (LPSTR *)&enc_str, &length, 0, 0); ++ *lenp = length; ++ return enc_str; ++ } ++ ++ /* Avoid allocating zero bytes, it generates an error message. */ ++ utf8_str = alloc(utf16_to_utf8(str, *lenp == 0 ? 1 : *lenp, NULL)); ++ if (utf8_str != NULL) ++ { ++ *lenp = utf16_to_utf8(str, *lenp, utf8_str); ++ ++ /* We might be called before we have p_enc set up. */ ++ conv.vc_type = CONV_NONE; ++ convert_setup(&conv, (char_u *)"utf-8", ++ p_enc? p_enc: (char_u *)"latin1"); ++ if (conv.vc_type == CONV_NONE) ++ { ++ /* p_enc is utf-8, so we're done. */ ++ enc_str = utf8_str; ++ } ++ else ++ { ++ enc_str = string_convert(&conv, utf8_str, lenp); ++ vim_free(utf8_str); ++ } ++ ++ convert_setup(&conv, NULL, NULL); ++ } ++ ++ return enc_str; ++ } ++ #endif /* FEAT_MBYTE */ ++ ++ #if (defined(FEAT_MBYTE) && defined(WIN3264)) || defined(PROTO) ++ /* ++ * Convert from the active codepage to 'encoding'. ++ * Input is "str[str_size]". ++ * The result is in allocated memory: "out[outlen]". With terminating NUL. ++ */ ++ void ++ acp_to_enc(str, str_size, out, outlen) ++ char_u *str; ++ int str_size; ++ char_u **out; ++ int *outlen; ++ ++ { ++ LPWSTR widestr; ++ ++ MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, &widestr, outlen); ++ if (widestr != NULL) ++ { ++ ++*outlen; /* Include the 0 after the string */ ++ *out = utf16_to_enc((short_u *)widestr, outlen); ++ vim_free(widestr); ++ } ++ } ++ #endif ++ + + /* + * Debugging helper: expose the MCH_WRITE_DUMP stuff to other modules +*** ../vim-7.3.222/src/version.c 2011-06-19 01:27:29.000000000 +0200 +--- src/version.c 2011-06-19 01:28:41.000000000 +0200 +*************** +*** 711,712 **** +--- 711,714 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 223, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +191. You rate eating establishments not by the quality of the food, + but by the availability of electrical outlets for your PowerBook. + + /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// ================================================================ Index: packages/vim/7.3.224 diff -u /dev/null packages/vim/7.3.224:1.1 --- /dev/null Sat Jul 9 09:06:50 2011 +++ packages/vim/7.3.224 Sat Jul 9 09:06:48 2011 @@ -0,0 +1,162 @@ +To: [email protected] +Subject: Patch 7.3.224 +Fcc: outbox +From: Bram Moolenaar <[email protected]> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.224 +Problem: Can't pass dict to sort function. +Solution: Add the optional {dict} argument to sort(). (ZyX) +Files: runtime/doc/eval.txt, src/eval.c + + +*** ../mercurial/vim73/runtime/doc/eval.txt 2011-05-19 17:25:36.000000000 +0200 +--- runtime/doc/eval.txt 2011-06-19 02:42:52.000000000 +0200 +*************** +*** 1919,1925 **** + simplify( {filename}) String simplify filename as much as possible + sin( {expr}) Float sine of {expr} + sinh( {expr}) Float hyperbolic sine of {expr} +! sort( {list} [, {func}]) List sort {list}, using {func} to compare + soundfold( {word}) String sound-fold {word} + spellbadword() String badly spelled word at cursor + spellsuggest( {word} [, {max} [, {capital}]]) +--- 1922,1929 ---- + simplify( {filename}) String simplify filename as much as possible + sin( {expr}) Float sine of {expr} + sinh( {expr}) Float hyperbolic sine of {expr} +! sort( {list} [, {func} [, {dict}]]) +! List sort {list}, using {func} to compare + soundfold( {word}) String sound-fold {word} + spellbadword() String badly spelled word at cursor + spellsuggest( {word} [, {max} [, {capital}]]) +*************** +*** 5275,5281 **** + {only available when compiled with the |+float| feature} + + +! sort({list} [, {func}]) *sort()* *E702* + Sort the items in {list} in-place. Returns {list}. If you + want a list to remain unmodified make a copy first: > + :let sortedlist = sort(copy(mylist)) +--- 5279,5285 ---- + {only available when compiled with the |+float| feature} + + +! sort({list} [, {func} [, {dict}]]) *sort()* *E702* + Sort the items in {list} in-place. Returns {list}. If you + want a list to remain unmodified make a copy first: > + :let sortedlist = sort(copy(mylist)) +*************** +*** 5283,5288 **** +--- 5287,5294 ---- + Numbers sort after Strings, |Lists| after Numbers. + For sorting text in the current buffer use |:sort|. + When {func} is given and it is one then case is ignored. ++ {dict} is for functions with the "dict" attribute. It will be ++ used to set the local variable "self". |Dictionary-function| + When {func} is a |Funcref| or a function name, this function + is called to compare items. The function is invoked with two + items as argument and must return zero if they are equal, 1 or +*** ../mercurial/vim73/src/eval.c 2011-05-19 18:26:34.000000000 +0200 +--- src/eval.c 2011-06-19 02:51:13.000000000 +0200 +*************** +*** 7930,7936 **** + {"sin", 1, 1, f_sin}, + {"sinh", 1, 1, f_sinh}, + #endif +! {"sort", 1, 2, f_sort}, + {"soundfold", 1, 1, f_soundfold}, + {"spellbadword", 0, 1, f_spellbadword}, + {"spellsuggest", 1, 3, f_spellsuggest}, +--- 7930,7936 ---- + {"sin", 1, 1, f_sin}, + {"sinh", 1, 1, f_sinh}, + #endif +! {"sort", 1, 3, f_sort}, + {"soundfold", 1, 1, f_soundfold}, + {"spellbadword", 0, 1, f_spellbadword}, + {"spellsuggest", 1, 3, f_spellsuggest}, +*************** +*** 16366,16371 **** +--- 16366,16372 ---- + + static int item_compare_ic; + static char_u *item_compare_func; ++ static dict_T *item_compare_selfdict; + static int item_compare_func_err; + #define ITEM_COMPARE_FAIL 999 + +*************** +*** 16425,16431 **** + + rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ + res = call_func(item_compare_func, (int)STRLEN(item_compare_func), +! &rettv, 2, argv, 0L, 0L, &dummy, TRUE, NULL); + clear_tv(&argv[0]); + clear_tv(&argv[1]); + +--- 16426,16433 ---- + + rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ + res = call_func(item_compare_func, (int)STRLEN(item_compare_func), +! &rettv, 2, argv, 0L, 0L, &dummy, TRUE, +! item_compare_selfdict); + clear_tv(&argv[0]); + clear_tv(&argv[1]); + +*************** +*** 16471,16478 **** +--- 16473,16482 ---- + + item_compare_ic = FALSE; + item_compare_func = NULL; ++ item_compare_selfdict = NULL; + if (argvars[1].v_type != VAR_UNKNOWN) + { ++ /* optional second argument: {func} */ + if (argvars[1].v_type == VAR_FUNC) + item_compare_func = argvars[1].vval.v_string; + else +*************** +*** 16487,16492 **** +--- 16491,16507 ---- + else + item_compare_func = get_tv_string(&argvars[1]); + } ++ ++ if (argvars[2].v_type != VAR_UNKNOWN) ++ { ++ /* optional third argument: {dict} */ ++ if (argvars[2].v_type != VAR_DICT) ++ { ++ EMSG(_(e_dictreq)); ++ return; ++ } ++ item_compare_selfdict = argvars[2].vval.v_dict; ++ } + } + + /* Make an array with each entry pointing to an item in the List. */ +*** ../vim-7.3.223/src/version.c 2011-06-19 01:30:01.000000000 +0200 +--- src/version.c 2011-06-19 02:52:46.000000000 +0200 +*************** +*** 711,712 **** +--- 711,714 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 224, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +193. You ask your girlfriend to drive home so you can sit back with + your PDA and download the information to your laptop + + /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// ================================================================
_______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
