This question is not too distantly related to my own on StackOverflow:
Exposing Symbols to $ContextPath
Leonid provides an interesting approach there that could be adapted to your problem.
Rojo provides a solution that creates "proxy symbols" but these are not 100% equivalent. Information
no longer works correctly for example:
?? Com`KSubsets
This only gives the name of the Symbol it points to an not the usage message or the definition.
I prefer using $PreRead
for situations like this (e.g. here). Although it only works interactively it has the advantage of using the actual symbols rather than proxies, so all the functions like Unprotect
, Information
, etc. work correctly.
Block[{$ContextPath}, Needs["Combinatorica`"]]
$PreRead = # /.
name_String?(StringMatchQ[#, "Com`*"] &) :>
With[{nn = StringReplace[name, "Com`" -> "Combinatorica`"]},
nn /; NameQ[nn]] &;
Now Information
et al work correctly:
?? Com`KSubsets
Dim Cmd-K
will give youDimension
$\endgroup$