[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>

I'm really sorry if this isn't the place to talk about this. I've

25 messages 2005/03/21
[#4606] Re: New block syntax — "David A. Black" <dblack@...> 2005/03/21

Hi --

[#4629] Re: New block syntax — "Sean E. Russell" <ser@...> 2005/03/30

On Monday 21 March 2005 16:17, David A. Black wrote:

[#4648] about REXML::Encoding — speakillof <speakillof@...>

Hi.

15 messages 2005/03/31
[#4659] Re: about REXML::Encoding — "Sean E. Russell" <ser@...> 2005/04/04

On Thursday 31 March 2005 09:44, speakillof wrote:

[PATCH] giving acces readline to rl_line_buffer

From: "Cs. Henk" <csaba-ml@...>
Date: 2005-03-09 12:49:09 UTC
List: ruby-core #4533
Hi!

The patch attached gives acces ruby's readline to rl_line_buffer.
It's essential for putting together a context sensitive completion.
(Eg., in case of irb, filename completion within strings, method
name/variable completion elsewhere).

Csaba

Attachments (1)

readline-line_buffer.diff (857 Bytes, text/x-diff)
diff -uNar ruby-orig/ext/readline/readline.c ruby/ext/readline/readline.c
--- ruby-orig/ext/readline/readline.c	2005-03-03 23:47:37.000000000 -0700
+++ ruby/ext/readline/readline.c	2005-03-09 05:36:32.615770664 -0700
@@ -694,6 +694,16 @@
     return result;
 }
 
+static VALUE
+readline_s_line_buffer(self)
+    VALUE self;
+{
+    rb_secure(4);
+    if (rl_line_buffer == NULL)
+	return Qnil;
+    return rb_tainted_str_new2(rl_line_buffer);
+}
+
 void
 Init_readline()
 {
@@ -746,6 +756,7 @@
 			       readline_s_set_filename_quote_characters, 1);
     rb_define_singleton_method(mReadline, "filename_quote_characters",
 			       readline_s_get_filename_quote_characters, 0);
+    rb_define_singleton_method(mReadline, "line_buffer", readline_s_line_buffer, 0);
 
     history = rb_obj_alloc(rb_cObject);
     rb_extend_object(history, rb_mEnumerable);

In This Thread

Prev Next