Project

General

Profile

Actions

Feature #916

closed

Curses.crmodeとCurses.nocrmodeをモジュール関数に変更する

Added by kouji (Kouji Takao) almost 16 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:37551]

Description

=begin
高尾宏治です。

Curses.cbreak は Curses.crmode に alias してあります。
また、Curses.nocbreak も同様に Curses.nocrmode に alias してあります。
このため、Curses モジュールを include した場合にしか
Curses.crmode と Curses.nocrmode を利用できないようです。

require "curses"
include Curses

cbreak #=> OK
Curses.cbreak #=> OK

crmode # => OK
Curses.crmode #=> 例外 NoMethodError

Curses.crmode と Curses.nocrmode を alias ではなくモジュール関数として
定義したいのですが、いかがでしょうか。

Index: curses.c

--- curses.c (revision 20900)
+++ curses.c (working copy)
@@ -1498,8 +1498,8 @@
rb_define_module_function(mCurses, "noraw", curses_noraw, 0);
rb_define_module_function(mCurses, "cbreak", curses_cbreak, 0);
rb_define_module_function(mCurses, "nocbreak", curses_nocbreak, 0);

  • rb_define_alias(mCurses, "crmode", "cbreak");
  • rb_define_alias(mCurses, "nocrmode", "nocbreak");
  • rb_define_module_function(mCurses, "crmode", curses_nocbreak, 0);
  • rb_define_module_function(mCurses, "nocrmode", curses_nocbreak, 0);
    rb_define_module_function(mCurses, "nl", curses_nl, 0);
    rb_define_module_function(mCurses, "nonl", curses_nonl, 0);
    rb_define_module_function(mCurses, "beep", curses_beep, 0);
    =end

Related issues 1 (0 open1 closed)

Related to Backport200 - Backport #8222: Curses#crmode is not crmodeClosednagachika (Tomoyuki Chikanaga)04/05/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0