* ext/readline/extconf.rb: check rl_vi_editing_mode() and

rl_emacs_editing_mode().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2005-05-19 16:26:50 +00:00
parent 3fd16970f3
commit 327e957c73
3 changed files with 34 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Fri May 20 01:24:33 2005 Shugo Maeda <shugo@ruby-lang.org>
* ext/readline/extconf.rb: check rl_vi_editing_mode() and
rl_emacs_editing_mode().
Thu May 19 23:33:09 2005 Shugo Maeda <shugo@ruby-lang.org> Thu May 19 23:33:09 2005 Shugo Maeda <shugo@ruby-lang.org>
* ext/readline/readline.c: supported libedit. fixed: [ruby-core:4858] * ext/readline/readline.c: supported libedit. fixed: [ruby-core:4858]

View File

@ -55,6 +55,9 @@ have_readline_var("rl_library_version")
have_readline_var("rl_event_hook") have_readline_var("rl_event_hook")
have_func("rl_cleanup_after_signal") have_func("rl_cleanup_after_signal")
have_func("rl_clear_signals") have_func("rl_clear_signals")
have_func("rl_vi_editing_mode")
have_func("rl_emacs_editing_mode")
have_func("rl_clear_signals")
have_func("replace_history_entry") have_func("replace_history_entry")
have_func("remove_history") have_func("remove_history")
create_makefile("readline") create_makefile("readline")

View File

@ -205,18 +205,28 @@ static VALUE
readline_s_vi_editing_mode(self) readline_s_vi_editing_mode(self)
VALUE self; VALUE self;
{ {
#ifdef HAVE_RL_VI_EDITING_MODE
rb_secure(4); rb_secure(4);
rl_vi_editing_mode(1,0); rl_vi_editing_mode(1,0);
return Qnil; return Qnil;
#else
rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_VI_EDITING_MODE */
} }
static VALUE static VALUE
readline_s_emacs_editing_mode(self) readline_s_emacs_editing_mode(self)
VALUE self; VALUE self;
{ {
#ifdef HAVE_RL_EMACS_EDITING_MODE
rb_secure(4); rb_secure(4);
rl_emacs_editing_mode(1,0); rl_emacs_editing_mode(1,0);
return Qnil; return Qnil;
#else
rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_EMACS_EDITING_MODE */
} }
static VALUE static VALUE
@ -236,10 +246,10 @@ readline_s_set_completion_append_character(self, str)
rl_completion_append_character = RSTRING(str)->ptr[0]; rl_completion_append_character = RSTRING(str)->ptr[0];
} }
} }
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */ #endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */
} }
@ -256,10 +266,10 @@ readline_s_get_completion_append_character(self)
str = rb_str_new("", 1); str = rb_str_new("", 1);
RSTRING(str)->ptr[0] = rl_completion_append_character; RSTRING(str)->ptr[0] = rl_completion_append_character;
return str; return str;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */ #endif /* HAVE_RL_COMPLETION_APPEND_CHARACTER */
} }
@ -283,10 +293,10 @@ readline_s_set_basic_word_break_characters(self, str)
RSTRING(str)->ptr, RSTRING(str)->len); RSTRING(str)->ptr, RSTRING(str)->len);
basic_word_break_characters[RSTRING(str)->len] = '\0'; basic_word_break_characters[RSTRING(str)->len] = '\0';
rl_basic_word_break_characters = basic_word_break_characters; rl_basic_word_break_characters = basic_word_break_characters;
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */ #endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */
} }
@ -301,6 +311,7 @@ readline_s_get_basic_word_break_characters(self, str)
return rb_tainted_str_new2(rl_basic_word_break_characters); return rb_tainted_str_new2(rl_basic_word_break_characters);
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */ #endif /* HAVE_RL_BASIC_WORD_BREAK_CHARACTERS */
} }
@ -324,10 +335,10 @@ readline_s_set_completer_word_break_characters(self, str)
RSTRING(str)->ptr, RSTRING(str)->len); RSTRING(str)->ptr, RSTRING(str)->len);
completer_word_break_characters[RSTRING(str)->len] = '\0'; completer_word_break_characters[RSTRING(str)->len] = '\0';
rl_completer_word_break_characters = completer_word_break_characters; rl_completer_word_break_characters = completer_word_break_characters;
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */ #endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */
} }
@ -342,6 +353,7 @@ readline_s_get_completer_word_break_characters(self, str)
return rb_tainted_str_new2(rl_completer_word_break_characters); return rb_tainted_str_new2(rl_completer_word_break_characters);
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */ #endif /* HAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS */
} }
@ -369,6 +381,7 @@ readline_s_set_basic_quote_characters(self, str)
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */ #endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */
} }
@ -383,6 +396,7 @@ readline_s_get_basic_quote_characters(self, str)
return rb_tainted_str_new2(rl_basic_quote_characters); return rb_tainted_str_new2(rl_basic_quote_characters);
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */ #endif /* HAVE_RL_BASIC_QUOTE_CHARACTERS */
} }
@ -410,6 +424,7 @@ readline_s_set_completer_quote_characters(self, str)
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */ #endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */
} }
@ -424,6 +439,7 @@ readline_s_get_completer_quote_characters(self, str)
return rb_tainted_str_new2(rl_completer_quote_characters); return rb_tainted_str_new2(rl_completer_quote_characters);
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */ #endif /* HAVE_RL_COMPLETER_QUOTE_CHARACTERS */
} }
@ -451,6 +467,7 @@ readline_s_set_filename_quote_characters(self, str)
return self; return self;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */ #endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */
} }
@ -465,6 +482,7 @@ readline_s_get_filename_quote_characters(self, str)
return rb_tainted_str_new2(rl_filename_quote_characters); return rb_tainted_str_new2(rl_filename_quote_characters);
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */ #endif /* HAVE_RL_FILENAME_QUOTE_CHARACTERS */
} }
@ -515,10 +533,11 @@ hist_set(self, index, str)
if (entry == NULL) { if (entry == NULL) {
rb_raise(rb_eIndexError, "invalid index"); rb_raise(rb_eIndexError, "invalid index");
} }
return str;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif #endif
return str;
} }
static VALUE static VALUE
@ -565,10 +584,11 @@ rb_remove_history(index)
free(entry); free(entry);
return val; return val;
} }
return Qnil;
#else #else
rb_notimplement(); rb_notimplement();
return Qnil; /* not reached */
#endif #endif
return Qnil;
} }
static VALUE static VALUE