From 94b0ff2646fa3a7cdbf1289d63c8ac7349645d6b Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Sun, 8 Apr 2001 18:34:32 +0000 Subject: [PATCH 1/3] added .cvsignore --- .cvsignore | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .cvsignore diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000..954fcc6 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,24 @@ +aclocal.m4 +config.cache +config.h +config.log +config.status +configure +deb +dist +htdocs +libtclreadline.la +libtool +Makefile +Makefile.in +patches +pkgIndex.tcl +stamp-h +stamp-h.in +tclreadline-*.tar.gz +tclreadline.h +tclreadlineInit.tcl +tclreadline.lo +tclreadline.n +tclreadlineSetup.tcl +unused From 1978f452a9db532a74ff97b88b02e0e547901979 Mon Sep 17 00:00:00 2001 From: Massimo Dal Zotto Date: Fri, 10 Aug 2001 20:05:53 +0000 Subject: [PATCH 2/3] In tclreadlineSetup.tcl.in prefixed all global variables with package prefix to avoid polluting the global namespace. --- ChangeLog | 6 ++++++ tclreadlineSetup.tcl.in | 38 ++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d67a34..d510100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-08-10 Massimo Dal Zotto + + * In tclreadlineSetup.tcl.in prefixed all global variables with + package prefix to avoid polluting the global namespace. + Removed also the global unused variable "a". + 2001-01-10 Johannes Zellner * configure.in: changed the check for readline/readline.h / readline.h diff --git a/tclreadlineSetup.tcl.in b/tclreadlineSetup.tcl.in index 9acbcb5..3f48535 100644 --- a/tclreadlineSetup.tcl.in +++ b/tclreadlineSetup.tcl.in @@ -136,7 +136,7 @@ proc Setup {args} { ::tclreadline::Init } - if {[catch {set a [::tclreadline::prompt1]}] && [info nameofexecutable] != ""} { + if {[catch {::tclreadline::prompt1}] && [info nameofexecutable] != ""} { namespace eval ::tclreadline { variable prompt_string @@ -263,22 +263,28 @@ proc Loop {args} { while {1} { + # Try to transform {puts -nonewline stdout =>} into {concat =>} if [info exists tcl_prompt2] { - set prompt2 $tcl_prompt2 - } else { - set prompt2 ">" + regsub "puts\[ \t]*(-nonewline)?\[ \t](stdout)?" $tcl_prompt2 \ + "concat" tcl_prompt2 } if {[catch { if {"" != [namespace eval ::tclreadline {info procs prompt1}]} { - set LINE [::tclreadline::readline read \ + set ::tclreadline::LINE [::tclreadline::readline read \ [::tclreadline::prompt1]] } else { - set LINE [::tclreadline::readline read %] + set ::tclreadline::LINE [::tclreadline::readline read %] } - while {![::tclreadline::readline complete $LINE]} { - append LINE "\n" - append LINE [tclreadline::readline read ${prompt2}] + while {![::tclreadline::readline complete $::tclreadline::LINE]} { + append ::tclreadline::LINE "\n" + append ::tclreadline::LINE [::tclreadline::readline read [ + if [info exists tcl_prompt2] { + eval $tcl_prompt2 + } else { + concat ">" + } + ]] } } ::tclreadline::errorMsg]} { puts stderr [list tclreadline::Loop: error. \ @@ -294,19 +300,19 @@ proc Loop {args} { # from tcsh's behaviour, but I found it quite convenient # while using mshell on os9. # - if {[string length $LINE] && [history event 0] != $LINE} { - history add $LINE + if {[string length $::tclreadline::LINE] && [history event 0] != $::tclreadline::LINE} { + history add $::tclreadline::LINE } if [catch { - set result [eval $LINE] - if {$result != "" && [tclreadline::Print]} { - puts $result + set ::tclreadline::result [eval $::tclreadline::LINE] + if {$::tclreadline::result != "" && [::tclreadline::Print]} { + puts $::tclreadline::result } - set result "" + set ::tclreadline::result "" } ::tclreadline::errorMsg] { puts stderr $::tclreadline::errorMsg - puts stderr [list while evaluating $LINE] + puts stderr [list while evaluating $::tclreadline::LINE] } } From 07f96dfdd173026fc1ecaf46b9a54f0c6e9656f4 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 10 Aug 2001 20:56:14 +0000 Subject: [PATCH 3/3] added Massimo to AUTHORS --- AUTHORS | 1 + ChangeLog | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/AUTHORS b/AUTHORS index 1114d1d..fb8c5e1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Johannes Zellner http://www.zellner.org/ Mark Patton +Massimo Dal Zotto diff --git a/ChangeLog b/ChangeLog index d510100..c91dba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-08-10 Johannes Zellner + + * added Massimo to AUTHORS + 2001-08-10 Massimo Dal Zotto * In tclreadlineSetup.tcl.in prefixed all global variables with