From d3a61700106dbb79ff2330517187ff04df63fdb7 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 1 Aug 2000 09:25:37 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 ++++++ configure.in | 3 ++ ext/tk/lib/tkafter.rb | 26 ++++++++++++++++-- ext/tk/lib/tktext.rb | 8 +++--- lib/shellwords.rb | 16 +++++------ ruby.c | 76 ++++++++++++++++++++++++++++----------------------- 6 files changed, 89 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8560a71564..2003a12f23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Aug 1 16:41:58 2000 Yukihiro Matsumoto + + * ruby.c (proc_options): global load path setting moved from + ruby_prog_init(). + + * ruby.c (incpush): renamed. push path entry at the END of the + load path array. This makes -I directories sorted in order in + the arguments. + Sat Jul 29 23:42:04 2000 Yukihiro Matsumoto * dir.c (dir_each): should check whether dir is closed during the diff --git a/configure.in b/configure.in index 19aa49c5ed..c108d80060 100644 --- a/configure.in +++ b/configure.in @@ -54,6 +54,8 @@ AC_ARG_ENABLE(fat-binary, TARGET_ARCHS="m68k `/usr/bin/arch`" fi fi + # to ensure AC_HEADER_SYS_WAIT works + AC_DEFINE(_POSIX_SOURCE) ;; esac # /usr/lib/arch_tool -archify_list $TARGET_ARCHS @@ -94,6 +96,7 @@ AC_PROG_LN_S AC_PROG_MAKE_SET # checks for UNIX variants that set C preprocessor variables +AC_AIX AC_MINIX AC_EXEEXT diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb index 55bfde4d52..fe3ee38740 100644 --- a/ext/tk/lib/tkafter.rb +++ b/ext/tk/lib/tkafter.rb @@ -1,6 +1,6 @@ # # tkafter.rb : methods for Tcl/Tk after command -# 1998/07/02 by Hidetoshi Nagai +# 2000/08/01 by Hidetoshi Nagai # require 'tk' @@ -37,7 +37,16 @@ class TkAfter ############################### def do_callback(*args) @in_callback = true - ret = @current_proc.call(*args) + begin + ret = @current_proc.call(*args) + rescue StandardError, NameError + if @cancel_on_exception + cancel + return nil + else + fail $! + end + end if @set_next set_next_callback(*args) else @@ -118,6 +127,8 @@ class TkAfter @after_id = nil @after_script = nil + @cancel_on_exception = true + set_procs(*args) if args != [] @running = false @@ -135,7 +146,16 @@ class TkAfter end def current_status - [@running, @current_sleep, @current_proc, @current_args, @do_loop] + [@running, @current_sleep, @current_proc, @current_args, + @do_loop, @cancel_on_exception] + end + + def cancel_on_exception? + @cancel_on_exception + end + + def cancel_on_exception=(mode) + @cancel_on_exception = mode end def running? diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index 163583f139..f7b3f84ba7 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -460,7 +460,7 @@ class TkText