I don't know where the configure part of the earlier patch came from --probably my experimentation on some source I found somewhere :-]
The patch I submitted was against a Mercurial clone that I made this morning. The last patch submitted is the nescessary and sufficient. Tim -----Original Message----- From: Bram Moolenaar <b...@moolenaar.net> Sent: 05 October 2011 19-31 To: Tim Brown <tim.br...@timb.net> Cc: vim_dev@googlegroups.com Subject: Re: racket (:mz) SEGV's vim Tim Brown wrote: > Please find attached a patch for the following issue: > > :mzscheme could be invoked before the mzscheme/racket libraries were > initialised, e.g. in startup scripts and on the command line. > > Therefore the following would SEGV: > vim +':mz 1' > > Even though: > :mz 1 > works when editing a file. > > mzscheme expects to be invoked by a "trampoline" that wraps around the > main() of the embedding environment -- and this trampoline is around > main_loop(). > > exe_pre_commands() and source_startup_scripts() are outside the scope > of the trampoline. > > This patch causes main() to be called in two parts. The first part > sets up vim's environment and globals, but does not execute any vim > commands (as far as I can tell). It then calls to mzscheme_init, which > eventually recurs into main(); which skips the initialisation, and > proceeds with anything that may perform commands. > > Notes: > * I pass fname and params between invocations of main() through the > static variables save_mz_fname and save_mz_params. There is > justification at the top of main() for doing so. I'm not so keen on > statics, myself -- so I've not re-declared fname and params > themselves. > * The other option would be to split main into two parts -- an > "initialisation" and a "commands" part. Then start up vim with: > main(argc, argv) > calls mzscheme_init(argc, argv, fname, params) > calls ... main_part2(argc, argv, fname, params) > > [or, in the case of !FEAT_MZSCHEME: main(argc,argv) calls > main_part2(argc, argv, fname, params)] > > I think I've done enough in main already! And, unless there is more > general merit in such a refactoring, this is as much disruption as I > need to cause :-) > > Thanks Sergey and Bram for your help! Thanks for the patch, I'll put it on the todo list. Is the configure change that was previously send also needed? -- Don't read everything you believe. /// Bram Moolenaar -- b...@moolenaar.net -- 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 /// -- 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