From: Jeff Hobbs Date: Sat, 23 Feb 2002 06:52:40 +0000 (+0000) Subject: * tkcon.tcl (AddSlaveHistory): changed history to not add the X-Git-Tag: tkcon-2-4~29 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=14986b8a4f66caa198152e8b77c316c8db7674c2;p=tkcon * tkcon.tcl (AddSlaveHistory): changed history to not add the command if it is the same as the previous command (it will still be evaluated). (soderstrom) Added panedwindow and labelframe as recognized Tk commands. --- diff --git a/ChangeLog b/ChangeLog index 2cc53bb..0906396 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-02-22 Jeff Hobbs + + * tkcon.tcl (AddSlaveHistory): changed history to not add the + command if it is the same as the previous command (it will still + be evaluated). (soderstrom) + Added panedwindow and labelframe as recognized Tk commands. + 2002-01-24 Jeff Hobbs **** TKCON 2.3 RELEASE **** diff --git a/tkcon.tcl b/tkcon.tcl index 3790848..5b1d564 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -702,7 +702,7 @@ proc ::tkcon::EvalCmd {w cmd} { $w insert output $cmd\n stdin } } elseif {$OPT(calcmode) && ![catch {expr $cmd} err]} { - EvalSlave history add $cmd + AddSlaveHistory $cmd set cmd $err set code -1 } @@ -735,7 +735,7 @@ proc ::tkcon::EvalCmd {w cmd} { } } } - EvalSlave history add $cmd + AddSlaveHistory $cmd if {$code} { if {$OPT(hoterrors)} { set tag [UniqueTag $w] @@ -781,6 +781,21 @@ proc ::tkcon::EvalOther { app type args } { } } +## ::tkcon::AddSlaveHistory - +## Command is added to history only if different from previous command. +## This also doesn't cause the history id to be incremented, although the +## command will be evaluated. +# ARGS: cmd - command to add +## +proc ::tkcon::AddSlaveHistory cmd { + set ev [EvalSlave history nextid] + incr ev -1 + set code [catch {EvalSlave history event $ev} lastCmd] + if {$code || [string compare $cmd $lastCmd]} { + EvalSlave history add $cmd + } +} + ## ::tkcon::EvalSend - sends the args to the attached interpreter ## Varies from 'send' by determining whether attachment is dead ## when an error is received @@ -4062,8 +4077,8 @@ proc tcl_unknown args { lappend tkcmds bell bind bindtags button \ canvas checkbutton clipboard destroy \ entry event focus font frame grab grid image \ - label listbox lower menu menubutton message \ - option pack place radiobutton raise \ + label labelframe listbox lower menu menubutton message \ + option pack panedwindow place radiobutton raise \ scale scrollbar selection send spinbox \ text tk tkwait toplevel winfo wm if {[lsearch -exact $tkcmds $name] >= 0 && \