I think Bram was asking you to use "diff -c"  or  "diff -u"  to create
the patch file.



On 6/15/06, Richard Emberson <[EMAIL PROTECTED]> wrote:
Attached is a patch file. Is this what you wanted?
Its been almost 20 years since I programmed in 'c'
and the vim 'c' code is rather hard to grok if one
is looking at it for the first time, so I do not
claim that my patch is the best way to do it.

It seems that after the function is defined, it is
then referenced by its number, but the function
definition code expects a function name.

Richard

Bram Moolenaar wrote:
> Richard Emberson wrote:
>
>> In the following I am creating a dictionary, associating a function
>> with the dictionary and then reassociating a new function
>> with the name of the original function.
>>
>> Try this without the fix and you get:
>> ADD
>> n=9
>> Error detected while processing /home/emberson/vim/foo.vim:
>> line   14:
>> E475: Invalid argument: 1
>> ADD
>> n=9
>>
>> Note that "1" is the index of the function in the dictionary.
>>
>> Try it with the fix you get:
>> ADD
>> n=9
>> MULTIPLY
>> n=20
>
> This makes sense.  Can you please provide a context diff so that it's
> easier to see what you are changing?
>


--
This email message is for the sole use of the intended recipient(s) and
may contain confidential information.  Any unauthorized review, use,
disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all
copies of the original message.


patch for eval.c:

18410c18410,18420
< while (arg[j] != NUL && (j == 0 ?  eval_isnamec1(arg[j])
---
> /* The name can be an index into a dictionary. */
> /* There maybe a better way, this demonstrates a fix. */
> while (arg[j] != NUL && VIM_ISDIGIT(arg[j]))
> ++j;
> if (arg[j] != NUL)
> {
> if (*arg == K_SPECIAL)
> j = 3;
> else
> j = 0;
> while (arg[j] != NUL && (j == 0 ?  eval_isnamec1(arg[j])
18413,18414c18423,18425
< if (arg[j] != NUL)
< emsg_funcname(_(e_invarg2), arg);
---
> if (arg[j] != NUL)
> emsg_funcname(_(e_invarg2), arg);
> }





Reply via email to