summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--doc/NEWS5
-rw-r--r--ext/readline/README14
-rw-r--r--ext/readline/readline.c34
4 files changed, 56 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 68a52cc228..43a645a6f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jun 19 18:19:30 2001 Akinori MUSHA <knu@iDaemons.org>
+
+ * ext/readline/readline.c: add new methods:
+ Readline::completion_append_character and
+ Readline::completion_append_character=.
+
Tue Jun 19 16:29:50 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (svalue_to_mvalue): new function to convert from svalue
diff --git a/doc/NEWS b/doc/NEWS
index ffcc6150ba..246e725d61 100644
--- a/doc/NEWS
+++ b/doc/NEWS
@@ -1,3 +1,8 @@
+: Readline::completion_append_characte
+: Readline::completion_append_character=
+
+ Added.
+
: Proc#yield
Added. This is equivalent to Proc#call except it does not check the
diff --git a/ext/readline/README b/ext/readline/README
index 8a5fe9120f..affe51f9e6 100644
--- a/ext/readline/README
+++ b/ext/readline/README
@@ -36,6 +36,17 @@ completion_case_fold
補完時に大文字小文字を区別しない場合、TRUEを返します。
+completion_append_character = char
+
+ 補完時に付加される文字を文字列で指定します。先頭の一文字が
+ 設定され、空文字列 ("") または nil を指定すると何も付加
+ されなくなります。
+
+completion_append_character
+
+ 補完時に付加される文字を文字列で返します。デフォルトは
+ 空白 (" ") です。
+
vi_editing_mode
VIモードになります。
@@ -50,6 +61,3 @@ HISTORY
ヒストリに対する操作はこの定数を通して行ってください。
配列と同じように扱えるようになっています。
-
-
- \ No newline at end of file
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index c8ed81ac51..6482f942b4 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -167,6 +167,36 @@ readline_s_emacs_editing_mode(self)
}
static VALUE
+readline_s_set_completion_append_character(self, str)
+ VALUE self, str;
+{
+ if (NIL_P(str)) {
+ rl_completion_append_character = '\0';
+ } else {
+ StringValue(str);
+
+ rl_completion_append_character = RSTRING(str)->ptr[0];
+ }
+
+ return self;
+}
+
+static VALUE
+readline_s_get_completion_append_character(self)
+ VALUE self;
+{
+ VALUE str;
+
+ if (rl_completion_append_character == '\0')
+ return Qnil;
+
+ str = rb_str_new("", 1);
+ RSTRING(str)->ptr[0] = rl_completion_append_character;
+
+ return str;
+}
+
+static VALUE
hist_to_s(self)
VALUE self;
{
@@ -395,6 +425,10 @@ Init_readline()
readline_s_vi_editing_mode, 0);
rb_define_singleton_method(mReadline, "emacs_editing_mode",
readline_s_emacs_editing_mode, 0);
+ rb_define_singleton_method(mReadline, "completion_append_character=",
+ readline_s_set_completion_append_character, 1);
+ rb_define_singleton_method(mReadline, "completion_append_character",
+ readline_s_get_completion_append_character, 0);
histary = rb_obj_alloc(rb_cObject);
rb_extend_object(histary, rb_mEnumerable);