I see your point.

Basically, if you application embeds MzScheme v.4+ you need to use
trampolined startup: all the Scheme activity should run inside a function
called from scheme_main_setup. Speaking of Vim it looks like:
1) At the end of VimMain in main.c we do mzscheme_main()
2) mzscheme_main in if_mzsch.c invokes scheme_main_setup(TRUE,
mzscheme_env_main, 0, NULL)
3) mzscheme_env_main does some basic initialisations and passes control back
to Vim calling its main_loop().

I think we can call mzscheme_main earlier, before Vim starts processing
command line or scripts. We can wrap the remaining part of VimMain into a
function and call it from mzscheme_env_main (reminds me continuation-passing
style :)
I cannot recall why I did not implement it like that.

On Oct 4, 2011 12:44 PM, "Tim Brown" <[email protected]> wrote:
>
> Sergey,
>
> Thanks for your help so far.
>
> On 3 October 2011 17:39, Sergey Khorev <[email protected]> wrote:
> >> could you confirm to me that:
> >>
> >> vim +':mz #f'
> >>
> >> works with racket-5.1.3
> >>
> >> It still cores on me. As does racket-5.0.1
> >
> > Ah, got you!
> > :mz from command line does not and will not work with any versions
> > newer than 3.x. Once Vim has initialised everything should work as
> > expected.
>
> Unfortunately, this is just a test case, and the +":mz #f" on the
> command line isn't actually what I want to do. I'm trying to put
> together a "syntax" which adds all of the racket keywords (which IMO,
> only racket would know) as :syntax... keywords.
>
> (In fact: http://www.vim.org/scripts/script.php?script_id=3757)
>
> Unfortunately, it is not the case that "Vim has initialised
> everything" as I am loading my first racket file which then tries to
> :source/:runtime the vim script via an :autocmd
>
> In fact, I have to wait until the file is loaded and displayed to me.
> *Then* (and this is the bit I deeply resent) I have to souce the file
> myself! (OK, so it's mapped to a key, but there's a principle here).
>
> So I have two questions for you:
>  * What is wrong with the way vim starts up that it is not ready to
> invoke :mzscheme on a command line, vim -u, syntax load or :autocmd?
>  * When, technically has "Vim ... initialised everything"?
>
> > In principle someone adventurous might refactor Vim startup code to fix
this...
>
> How adventurous?
> How much of this is at the vim end?
> How much of this is at the if_mzscheme/racket end?
>
> Tim
>
> --
> | Tim Brown <[email protected]> | M:+44(0)7771714159 | H:01372747875 |
>
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui