Check-in [cf2851923e]
Not logged in
Overview
SHA1:cf2851923ea48f69e37d82273cf1c6229a949514
Date: 2001-08-10 20:05:53
User: dz@debian.org
Comment:In tclreadlineSetup.tcl.in prefixed all global variables with package prefix to avoid polluting the global namespace.
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2001-08-10
20:56
[95608888ca] Leaf: added Massimo to AUTHORS (user: johannes@zellner.org, tags: trunk)
20:05
[cf2851923e] In tclreadlineSetup.tcl.in prefixed all global variables with package prefix to avoid polluting the global namespace. (user: dz@debian.org, tags: trunk)
2001-04-08
18:34
[07bc0bf2d9] added .cvsignore (user: johannes@zellner.org, tags: trunk)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified ChangeLog from [2522bfd3d9] to [b10692387c].

            1  +2001-08-10  Massimo Dal Zotto  <dz@debian.org>
            2  +
            3  +    * In tclreadlineSetup.tcl.in prefixed all global variables with
            4  +      package prefix to avoid polluting the global namespace.
            5  +      Removed also the global unused variable "a".
            6  +
     1      7   2001-01-10  Johannes Zellner  <johannes@zellner.org>
     2      8   
     3      9   	* configure.in: changed the check for readline/readline.h / readline.h
     4     10   
     5     11   2000-12-08  Johannes Zellner  <johannes@zellner.org>
     6     12   
     7     13       * reordered Makefile.am so that it always includes

Modified tclreadlineSetup.tcl.in from [b96052aeac] to [3ffc2c5574].

   132    132   
   133    133       uplevel #0 {
   134    134   
   135    135   	if {"" == [info commands ::tclreadline::readline]} {
   136    136   	    ::tclreadline::Init
   137    137   	}
   138    138   
   139         -	if {[catch {set a [::tclreadline::prompt1]}] && [info nameofexecutable] != ""} {
          139  +	if {[catch {::tclreadline::prompt1}] && [info nameofexecutable] != ""} {
   140    140   
   141    141   	    namespace eval ::tclreadline {
   142    142   		variable prompt_string
   143    143   		set base [file tail [info nameofexecutable]]
   144    144   
   145    145   		if {[string match tclsh* $base] && [info exists tcl_version]} {
   146    146   		    set prompt_string \
................................................................................
   259    259   
   260    260       eval Setup ${args}
   261    261   
   262    262       uplevel #0 {
   263    263   
   264    264   	while {1} {
   265    265   
          266  +	    # Try to transform {puts -nonewline stdout =>} into {concat =>}
   266    267   	    if [info exists tcl_prompt2] {
   267         -		set prompt2 $tcl_prompt2
   268         -	    } else {
   269         -		set prompt2 ">"
          268  +		regsub "puts\[ \t]*(-nonewline)?\[ \t](stdout)?" $tcl_prompt2 \
          269  +			"concat" tcl_prompt2
   270    270   	    }
   271    271   
   272    272   	    if {[catch {
   273    273   		if {"" != [namespace eval ::tclreadline {info procs prompt1}]} {
   274         -		    set LINE [::tclreadline::readline read \
          274  +		    set ::tclreadline::LINE [::tclreadline::readline read \
   275    275   		    [::tclreadline::prompt1]]
   276    276   		} else {
   277         -		    set LINE [::tclreadline::readline read %]
          277  +		    set ::tclreadline::LINE [::tclreadline::readline read %]
   278    278   		}
   279         -		while {![::tclreadline::readline complete $LINE]} {
   280         -		    append LINE "\n"
   281         -		    append LINE [tclreadline::readline read ${prompt2}]
          279  +		while {![::tclreadline::readline complete $::tclreadline::LINE]} {
          280  +		    append ::tclreadline::LINE "\n"
          281  +		    append ::tclreadline::LINE [::tclreadline::readline read [
          282  +		        if [info exists tcl_prompt2] {
          283  +			    eval $tcl_prompt2
          284  +			} else {
          285  +			    concat ">"
          286  +			}
          287  +		    ]]
   282    288   		}
   283    289   	    } ::tclreadline::errorMsg]} {
   284    290   		puts stderr [list tclreadline::Loop: error. \
   285    291   		$::tclreadline::errorMsg]
   286    292   		continue
   287    293   	    }
   288    294   
................................................................................
   290    296   	    # to add the line also to tclsh's history.
   291    297   	    #
   292    298   	    # I decided to add only lines which are different from
   293    299   	    # the previous one to the history. This is different
   294    300   	    # from tcsh's behaviour, but I found it quite convenient
   295    301   	    # while using mshell on os9.
   296    302   	    #
   297         -	    if {[string length $LINE] && [history event 0] != $LINE} {
   298         -		history add $LINE
          303  +	    if {[string length $::tclreadline::LINE] && [history event 0] != $::tclreadline::LINE} {
          304  +		history add $::tclreadline::LINE
   299    305   	    }
   300    306   
   301    307   	    if [catch {
   302         -		set result [eval $LINE]
   303         -		if {$result != "" && [tclreadline::Print]} {
   304         -		    puts $result
          308  +		set ::tclreadline::result [eval $::tclreadline::LINE]
          309  +		if {$::tclreadline::result != "" && [::tclreadline::Print]} {
          310  +		    puts $::tclreadline::result
   305    311   		}
   306         -		set result ""
          312  +		set ::tclreadline::result ""
   307    313   	    } ::tclreadline::errorMsg] {
   308    314   		puts stderr $::tclreadline::errorMsg
   309         -		puts stderr [list while evaluating $LINE]
          315  +		puts stderr [list while evaluating $::tclreadline::LINE]
   310    316   	    }
   311    317   
   312    318   	}
   313    319       }
   314    320   }
   315    321   
   316    322   proc Print {args} {