Letting Tab Work on Proc's Without Package

Created by CecilWesterhof.

I have written a library which I use in my command-line. First I had in my .tclshrc:

package require dcblUtilities

# In this case there is no risk of conflicts, so I 'import everything'.
namespace import ::dcblUtilities::*

But if I then want to use tab expansion I need to put ::dcblUtilities:: before the proc I want to expand, which I really do not like. So I now have:

package require dcblUtilities

# In this case there is no risk of conflicts, so I 'import everything'.
# I want tab to work on the proc's of dcblUtilities on the command-line
foreach procedure  [namespace eval dcblUtilities {namespace export}] {
    interp alias {} $procedure {} ::dcblUtilities::$procedure
}

In this way both getCleanOutput and ::dcblUtilities::getCleanOutput are defined. And now I can type getC give tab and get getCleanOutput. Which I find very helpfull.


As always: comments, tips and questions are appreciated.