Patch for Vim with Ruby 1.9

118 views
Skip to first unread message

Masaki Suketa

unread,
Jul 26, 2009, 8:10:07 AM7/26/09
to vim...@vim.org
Hello,

I re-made a patch for VIM which works with Ruby 1.9.
It affects file src/if_ruby.c, src/configure.in src/auto/configure.
This patch provides the following features.
(This patch is for Ruby 1.9, but keeps backword compatibility.
I tested this patch works with ruby 1.8.7.)

(1) check ruby header directory in Ruby 1.9 (and Ruby 1.8).
The header directory in Ruby 1.9 is different from Ruby 1.8.

(2) using Ruby1.9 C API instead of Ruby 1.8, although, this patch
works with ruby 1.8 (keeping backword compatibility.)

(3) setting encoding of Ruby String with Ruby 1.9.
(String encoding is new feature in Ruby 1.9.)

This patch is for Vim 7.2.234(Subversion revision 1577).

Regards,
Masaki Suketa

vim7-ruby19.patch

James Vega

unread,
Jul 26, 2009, 9:40:54 AM7/26/09
to vim...@googlegroups.com
On Sun, Jul 26, 2009 at 09:10:07PM +0900, Masaki Suketa wrote:
> I re-made a patch for VIM which works with Ruby 1.9.

Will this also work with 1.9.1, which (again) changed Ruby's API/ABI and
where they expect Ruby libraries to reside? If not, it might be good to
modify the patch to support 1.9.1 while changes are being made to the
Ruby code.

--
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jame...@jamessan.com>

signature.asc

Masaki Suketa

unread,
Jul 26, 2009, 10:03:46 AM7/26/09
to vim...@googlegroups.com
Hello,

James Vega wrote:
> On Sun, Jul 26, 2009 at 09:10:07PM +0900, Masaki Suketa wrote:
>> I re-made a patch for VIM which works with Ruby 1.9.
>
> Will this also work with 1.9.1, which (again) changed Ruby's API/ABI and
> where they expect Ruby libraries to reside? If not, it might be good to
> modify the patch to support 1.9.1 while changes are being made to the
> Ruby code.

Sorry, I did not write my ruby environment.
I tested the patch works with:
+ ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
+ ruby 1.9.1p243 (2009-07-16 revision 24174) [i686-linux]
+ ruby 1.9.2dev (2009-07-26 trunk 24278) [i686-linux]

And I have not tested with Ruby 1.9.0.
I have tested my Linux box only.

Regards,
Masaki Suketa

red-agent

unread,
Jul 27, 2009, 1:21:12 PM7/27/09
to vim_dev
Works like a charm.
Tested it with Ruby 1.9.1_p129-r99 on my Linux (Gentoo) box.

Everything works except for some minor glitches with rubycomplete
omnicompletion.
Sometimes this pops up:
`
Error detected while processing function rubycomplete#Complete:
line 22:
ArgumentError: comparison of Hash with Hash failed
Press ENTER or type command to continue
`
>  vim7-ruby19.patch
> 9KПросмотретьЗагрузить

Masaki Suketa

unread,
Jul 28, 2009, 6:11:01 AM7/28/09
to vim...@googlegroups.com
Hello, Thank you for your reporting.

red-agent wrote:
> Works like a charm.
> Tested it with Ruby 1.9.1_p129-r99 on my Linux (Gentoo) box.
>
> Everything works except for some minor glitches with rubycomplete
> omnicompletion.
> Sometimes this pops up:
> `
> Error detected while processing function rubycomplete#Complete:
> line 22:
> ArgumentError: comparison of Hash with Hash failed
> Press ENTER or type command to continue
> `
>

I need more detail information to fix it.
Could you show me the script when the error message pops up?

Regards,
Masaki Suketa

red-agent

unread,
Jul 29, 2009, 3:57:37 AM7/29/09
to vim_dev
Nothing to show, really.
That mostly happens when trying to complete the constant, like class
name...

John Beckett

unread,
Jul 29, 2009, 4:35:29 AM7/29/09
to vim...@googlegroups.com
Please bottom post on this list. Quote a small (relevant) part
of the message you are replying to, and put your text underneath.

See the list guidelines:
http://groups.google.com/group/vim_use/web/vim-information

Masaki Suketa

unread,
Jul 29, 2009, 9:53:35 AM7/29/09
to vim...@googlegroups.com
Hello,

At 07/29/2009 04:57 PM, red-agent wrote:
> Nothing to show, really.
> That mostly happens when trying to complete the constant, like class
> name...

I've not been able to produce the same error in my environment.
I'm not a heavy user of rubycomplete omnicompletion.
So, it seems to me to take a while to solve it.
Anyway, thank you for your reporting.

Regards,
Masaki Suketa

Pavel Kunc

unread,
Aug 16, 2009, 8:10:07 AM8/16/09
to vim_dev
Hi,

I've problems with the compilation on the Mac. First of all the Mac
layout of the ruby install is a bit different so it looks for header
files in the different directory but with few symlinks it sort of
works. VIM compiles but with this results:

...
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/if_ruby.o if_ruby.c
if_ruby.c: In function ‘get_buffer_line’:
if_ruby.c:754: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘linenr_T’
if_ruby.c: In function ‘set_buffer_line’:
if_ruby.c:795: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘linenr_T’
if_ruby.c: In function ‘buffer_delete’:
if_ruby.c:841: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘long int’
if_ruby.c: In function ‘buffer_append’:
if_ruby.c:875: warning: format ‘%d’ expects type ‘int’, but argument 3
has type ‘long int’
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/os_macosx.o os_macosx.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/os_mac_conv.o
os_mac_conv.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 -o objects/netbeans.o netbeans.c
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-
unknown-pragmas -pipe -I. -Iproto -DMACOS_X_UNIX -no-cpp-precomp -I/
Developer/Headers/FlatCarbon -g -O -I/usr/local/ruby-1.9.1-p243/
lib/ruby/1.9.1/i386-darwin9.7.0 version.c -o objects/version.o
gcc -L. -L/usr/local/lib -L/usr/local/lib -o Vim objects/
buffer.o objects/charset.o objects/diff.o objects/digraph.o objects/
edit.o objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/
ex_docmd.o objects/ex_eval.o objects/ex_getln.o objects/fileio.o
objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o
objects/if_cscope.o objects/if_xcmdsrv.o objects/main.o objects/mark.o
objects/memfile.o objects/memline.o objects/menu.o objects/message.o
objects/misc1.o objects/misc2.o objects/move.o objects/mbyte.o objects/
normal.o objects/ops.o objects/option.o objects/os_unix.o objects/
pathdef.o objects/popupmnu.o objects/quickfix.o objects/regexp.o
objects/screen.o objects/search.o objects/spell.o objects/syntax.o
objects/tag.o objects/term.o objects/ui.o objects/undo.o objects/
window.o objects/gui.o objects/pty.o objects/gui_macvim.o objects/
MMBackend.o objects/MacVim.o objects/if_ruby.o objects/os_macosx.o
objects/os_mac_conv.o objects/netbeans.o objects/version.o -
framework Cocoa -framework Carbon -lncurses -liconv -lruby -
lpthread -ldl -lobjc
Undefined symbols:
"_ruby_errinfo", referenced from:
_ruby_errinfo$non_lazy_ptr in if_ruby.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [Vim] Error 1

I'm on Ruby 1.9.1p243

Any suggestions I could fix this?

Thanks a lot

Pavel

Pavel Kunc

unread,
Aug 24, 2009, 6:39:42 AM8/24/09
to vim_dev
Sorry my, my fault. Running autoconf; ./configure; make did the job!
Thank you for the Patch!

Pavel
Reply all
Reply to author
Forward
0 new messages