summaryrefslogtreecommitdiffstats
path: root/library/console.tcl
diff options
context:
space:
mode:
authorstanton <stanton>1998-09-29 00:25:03 (GMT)
committerstanton <stanton>1998-09-29 00:25:03 (GMT)
commitc16d45ef706cbb616125e57ec8a1f809bae3c9df (patch)
tree99c199f65b7d32755dc8f0ee5cc773bd922a74a6 /library/console.tcl
parentd3b37a36ad09da1989ef6c53fd6fddc71deb2d72 (diff)
downloadtk-c16d45ef706cbb616125e57ec8a1f809bae3c9df.zip
tk-c16d45ef706cbb616125e57ec8a1f809bae3c9df.tar.gz
tk-c16d45ef706cbb616125e57ec8a1f809bae3c9df.tar.bz2
initial tk8.1a2 version
Diffstat (limited to 'library/console.tcl')
-rw-r--r--library/console.tcl36
1 files changed, 18 insertions, 18 deletions
diff --git a/library/console.tcl b/library/console.tcl
index d2c28b2..c046e21 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -4,7 +4,7 @@
# can be used by non-unix systems that do not have built-in support
# for shells.
#
-# SCCS: @(#) console.tcl 1.45 97/09/17 16:52:40
+# SCCS: @(#) console.tcl 1.47 98/01/02 17:42:06
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
#
@@ -108,7 +108,7 @@ proc tkConsoleSource {} {
-filetypes {{"Tcl Scripts" .tcl} {"All Files" *}}]
if {"$filename" != ""} {
set cmd [list source $filename]
- if [catch {consoleinterp eval $cmd} result] {
+ if {[catch {consoleinterp eval $cmd} result]} {
tkConsoleOutput stderr "$result\n"
}
}
@@ -136,12 +136,12 @@ proc tkConsoleInvoke {args} {
}
if {$cmd == ""} {
tkConsolePrompt
- } elseif [info complete $cmd] {
+ } elseif {[info complete $cmd]} {
.console mark set output end
.console tag delete input
set result [consoleinterp record $cmd]
if {$result != ""} {
- .console insert insert "$result\n"
+ puts $result
}
tkConsoleHistory reset
tkConsolePrompt
@@ -168,7 +168,7 @@ proc tkConsoleHistory {cmd} {
prev {
incr histNum -1
if {$histNum == 0} {
- set cmd {history event [expr [history nextid] -1]}
+ set cmd {history event [expr {[history nextid] -1}]}
} else {
set cmd "history event $histNum"
}
@@ -182,7 +182,7 @@ proc tkConsoleHistory {cmd} {
next {
incr histNum
if {$histNum == 0} {
- set cmd {history event [expr [history nextid] -1]}
+ set cmd {history event [expr {[history nextid] -1}]}
} elseif {$histNum > 0} {
set cmd ""
set histNum 1
@@ -213,7 +213,7 @@ proc tkConsolePrompt {{partial normal}} {
if {$partial == "normal"} {
set temp [.console index "end - 1 char"]
.console mark set output end
- if [consoleinterp eval "info exists tcl_prompt1"] {
+ if {[consoleinterp eval "info exists tcl_prompt1"]} {
consoleinterp eval "eval \[set tcl_prompt1\]"
} else {
puts -nonewline "% "
@@ -221,7 +221,7 @@ proc tkConsolePrompt {{partial normal}} {
} else {
set temp [.console index output]
.console mark set output end
- if [consoleinterp eval "info exists tcl_prompt2"] {
+ if {[consoleinterp eval "info exists tcl_prompt2"]} {
consoleinterp eval "eval \[set tcl_prompt2\]"
} else {
puts -nonewline "> "
@@ -271,7 +271,7 @@ proc tkConsoleBind {win} {
if {[%W tag nextrange sel 1.0 end] != ""} {
%W tag remove sel sel.first promptEnd
} else {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
break
}
}
@@ -280,14 +280,14 @@ proc tkConsoleBind {win} {
if {[%W tag nextrange sel 1.0 end] != ""} {
%W tag remove sel sel.first promptEnd
} else {
- if [%W compare insert <= promptEnd] {
+ if {[%W compare insert <= promptEnd]} {
break
}
}
}
foreach left {Control-a Home} {
bind $win <$left> {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
tkTextSetCursor %W {insert linestart}
} else {
tkTextSetCursor %W promptEnd
@@ -302,32 +302,32 @@ proc tkConsoleBind {win} {
}
}
bind $win <Control-d> {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Control-k> {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
%W mark set insert promptEnd
}
}
bind $win <Control-t> {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Meta-d> {
- if [%W compare insert < promptEnd] {
+ if {[%W compare insert < promptEnd]} {
break
}
}
bind $win <Meta-BackSpace> {
- if [%W compare insert <= promptEnd] {
+ if {[%W compare insert <= promptEnd]} {
break
}
}
bind $win <Control-h> {
- if [%W compare insert <= promptEnd] {
+ if {[%W compare insert <= promptEnd]} {
break
}
}
@@ -353,7 +353,7 @@ proc tkConsoleBind {win} {
}
foreach left {Control-b Left} {
bind $win <$left> {
- if [%W compare insert == promptEnd] {
+ if {[%W compare insert == promptEnd]} {
break
}
tkTextSetCursor %W insert-1c