Changes to consider when moving to Tcl 8.6

My hope is that during the process of development and testing of Tcl 8.6 (and you ARE testing your code against the alpha releases, right?), that developers will add information here regarding changes that either are required, or perhaps are recommended, for Tcl or C code.


MG The text widget's default bindings seem to have changed pretty considerably - a lot of things are now handled via custom events instead of direct bindings (notably things which move the cursor and alter selection). For instance, "Select all text" is now <<SelectAll>> instead of a direct binding on <Control-/>. Also, on Windows, it seems that <Control-a> is also linked to <<SelectAll>> by default. So, if you have custom bindings to alter or add to any of those in your app, you may need to adjust them for 8.6.

IDG A related problem is how to write code that will 'just work' on any tcl version. In the case of the recent text widget changes, it seems to me that custom additions to the default behaviour might best be handled by adding a bindtag of lower priority than Text. This seems to catch the raw keystrokes that don't now reach Text bindings. Is there a better way?


HaO The workaround for list of namespace code was removed from the unknown handler. The following code worked for 8.5 but fails for 8.6 with error invalid command name "::namespace inscope ::myns myproc":

namespace eval myns {
    proc myproc {a} {puts $a}
    after 10 [list [namespace code myproc] "myparam"]
}

RLE (2012-01-21): Writing your example this way prevents the error message:

namespace eval myns {
    proc myproc {a} {puts $a}
    after 10 [list {*}[namespace code myproc] "myparam"]
}

MG It also works if you just remove the list

namespace eval myns {
    proc myproc {a} {puts $a}
    after 10 [namespace code myproc] "myparam"
}

HaO I got the habbit to write it like that (details on namespace code):

namespace eval myns {
    proc myproc {a} {puts $a}
    after 10 [namespace code [list myproc "myparam"]]
}