From: Pierre Baillet Date: 2002-11-04T07:47:53+09:00 Subject: [PATCH] Re: Readline Module and completion_proc --ADZbWkCsHQ7r3kzd Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Hello rubylovers, following this thread, i've written a quick patch for readline.c which allows the Proc object to receive a new supplementaty variable which contains the current buffer for the input line: Readline.completion_proc = Proc.new{ |to_complete, current_line| ... } This patch breaks backward compatibility with previous scripts using Readline but allows greater flexibility concerning the use of Readline in general. I don't know what is the best way to submit a patch, so please let me know if there is a more formal way. If any guru (Matz, maybe ?!) has a look at my patch, I'll be glad to hear your comments. If you are not a guru, comment anyway, i'd love some feedback! Cheers, -- Pierre Baillet Emacs, not just a way of life but a complete waste of disk space Alan Cox --ADZbWkCsHQ7r3kzd Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="readline.patch" --- readline.c.orig 2002-11-03 22:16:17.000000000 +0100 +++ readline.c.new 2002-11-03 22:18:26.000000000 +0100 @@ -121,7 +121,7 @@ return NULL; rl_attempted_completion_over = 1; case_fold = RTEST(rb_iv_get(mReadline, COMPLETION_CASE_FOLD)); - ary = rb_funcall(proc, rb_intern("call"), 1, rb_tainted_str_new2(text)); + ary = rb_funcall(proc, rb_intern("call"), 2, rb_tainted_str_new2(text), rb_tainted_str_new2(rl_line_buffer)); if (TYPE(ary) != T_ARRAY) ary = rb_Array(ary); matches = RARRAY(ary)->len; --ADZbWkCsHQ7r3kzd--