[#47033] [ruby-trunk - Bug #8749][Open] Readline.readline stops STDOUT? — "no6v (Nobuhiro IMAI)" <nov@...>
9 messages
2013/08/07
[#47036] Re: [ruby-trunk - Bug #8749][Open] Readline.readline stops STDOUT?
— Tanaka Akira <akr@...>
2013/08/07
2013/8/7 no6v (Nobuhiro IMAI) <nov@yo.rim.or.jp>:
[#47564] [ruby-trunk - Bug #8719][Open] r42096 make bm_app_factorial.rb slow — "authorNari (Narihiro Nakamura)" <authorNari@...>
4 messages
2013/08/02
[#47565] [ruby-trunk - Bug #8719] r42096 make bm_app_factorial.rb slow
— "authorNari (Narihiro Nakamura)" <authorNari@...>
2013/08/02
[#47569] [ruby-trunk - Feature #8726][Open] Class#source_location — "takiuchi (Genki Takiuchi)" <genki@...21g.com>
14 messages
2013/08/03
[#47574] Re: [ruby-trunk - Feature #8726][Open] Class#source_location
— KOSAKI Motohiro <kosaki.motohiro@...>
2013/08/03
> Classオブジェクトが生成された場所を返す Class#source_location メソッドの実装を希望いたします。
[#47575] Re: [ruby-trunk - Feature #8726][Open] Class#source_location
— KOSAKI Motohiro <kosaki.motohiro@...>
2013/08/03
> なるせさん、わたし、あのバックトレースの整形処理がイマイチ理解できんのだが、
[#47609] Re: [ruby-cvs:49669] naruse:r42527 (trunk): refix r42525 set stdio_file only if stdio — Tanaka Akira <akr@...>
2013/8/12 <naruse@ruby-lang.org>:
7 messages
2013/08/12
[#47610] Re: [ruby-cvs:49669] naruse:r42527 (trunk): refix r42525 set stdio_file only if stdio
— "NARUSE, Yui" <naruse@...>
2013/08/12
あぁ、[ruby-dev:47608]見てませんでした。
[#47611] Re: [ruby-cvs:49669] naruse:r42527 (trunk): refix r42525 set stdio_file only if stdio
— Tanaka Akira <akr@...>
2013/08/12
2013年8月12日 11:38 NARUSE, Yui <naruse@airemix.jp>:
[#47614] Re: [ruby-cvs:49669] naruse:r42527 (trunk): refix r42525 set stdio_file only if stdio
— "NARUSE, Yui" <naruse@...>
2013/08/12
editline の問題は、editlineにはrl_getcがなく、かつreadline.cで、
[#47620] Ruby 2.1 開発者会議 2013-08-31 のお知らせ — "NARUSE, Yui" <naruse@...>
かなり暑いですが、こんにちは。
5 messages
2013/08/14
[#47649] Re: [ruby-changes:30564] akr:r42643 (trunk): * process.c (rb_proc_times): Use RB_GC_GUARD to guard objects from GC. — SASADA Koichi <ko1@...>
akr さん
4 messages
2013/08/21
[#47650] Re: [ruby-changes:30564] akr:r42643 (trunk): * process.c (rb_proc_times): Use RB_GC_GUARD to guard objects from GC.
— Tanaka Akira <akr@...>
2013/08/21
2013/8/21 SASADA Koichi <ko1@atdot.net>:
[#47663] Re: [ruby-core:56878] [ruby-trunk - misc #8835][Open] Introducing a semantic versioning scheme and branching policy — "Akinori MUSHA" <knu@...>
At Fri, 30 Aug 2013 21:49:34 +0900,
6 messages
2013/08/30
[#47664] Re: [ruby-core:56878] [ruby-trunk - misc #8835][Open] Introducing a semantic versioning scheme and branching policy
— KOSAKI Motohiro <kosaki.motohiro@...>
2013/08/30
MjAxMy84LzMwIEFraW5vcmkgTVVTSEEgPGtudUBpZGFlbW9ucy5vcmc+Og0KPiBBdCBGcmksIDMw
[ruby-dev:47617] [ruby-trunk - Bug #8782][Assigned] Don't set rl_getc_function on editline
From:
"naruse (Yui NARUSE)" <naruse@...>
Date:
2013-08-12 07:31:55 UTC
List:
ruby-dev #47617
Issue #8782 has been reported by naruse (Yui NARUSE).
----------------------------------------
Bug #8782: Don't set rl_getc_function on editline
https://bugs.ruby-lang.org/issues/8782
Author: naruse (Yui NARUSE)
Status: Assigned
Priority: Normal
Assignee: kouji (Kouji Takao)
Category: ext
Target version: current: 2.1.0
ruby -v: ruby 2.1.0dev (2013-08-12 trunk 42528) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
r42402 以来 OS X 等の editline 環境では #define rl_getc(f) EOF が使われるようになってしまって残念なことになっていたわけですが、
そもそも editline の readline wrapper は non ASCII に対応していません。
(editline 自体には UTF-8 のみの対応が入ったが、readline wrapper は src/readline.c の _getc_function を経由するので non ASCII は化ける)
ので、いっそ rl_getc_function を使わないようにしてはどうでしょう。
以下のようなパッチを当てると、readline なしの OS X の irb で日本語が使えるようになります。
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 0b121c1..bc0ee77 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -94,4 +94,5 @@ readline.have_func("clear_history")
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
readline.have_func("rl_delete_text")
+readline.have_func("el_init")
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 0f76d1a..85109f0 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -130,12 +130,7 @@ static VALUE readline_instream;
static VALUE readline_outstream;
#if defined HAVE_RL_GETC_FUNCTION
-
-#ifndef HAVE_RL_GETC
-#define rl_getc(f) EOF
-#endif
-
-static int readline_getc(FILE *);
+# ifndef HAVE_EL_INIT
static int
readline_getc(FILE *input)
{
@@ -187,6 +182,7 @@ readline_getc(FILE *input)
#endif
return FIX2INT(c);
}
+# endif
#elif defined HAVE_RL_EVENT_HOOK
#define BUSY_WAIT 0
@@ -1771,7 +1767,9 @@ Init_readline()
/* libedit check rl_getc_function only when rl_initialize() is called, */
/* and using_history() call rl_initialize(). */
/* This assignment should be placed before using_history() */
+# ifndef HAVE_EL_INIT
rl_getc_function = readline_getc;
+# endif
#elif defined HAVE_RL_EVENT_HOOK
rl_event_hook = readline_event;
#endif
--
http://bugs.ruby-lang.org/