static VALUE vim_message(VALUE self, VALUE str)
{
    char *buff, *p;

    str = rb_obj_as_string(str);
    buff = ALLOCA_N(char, RSTRING(str)->len);
    strcpy(buff, RSTRING(str)->ptr);
    p = strchr(buff, '\n');
    if (p) *p = '\0';
    MSG(buff);
    return Qnil;
}

static void ruby_io_init(void)
{
    extern VALUE rb_defout;

    rb_defout = rb_obj_alloc(rb_cObject);
    rb_define_singleton_method(rb_defout, "write", vim_message, 1);
    rb_define_global_function("p", f_p, -1);
}

