This predicate should probably also be able to retrieve the name of the current module.
?- module(tex). Warning: tex is not a current module (created) true. tex: ?- module(X). ERROR: Arguments are not sufficiently instantiated tex: ?- module(tex). true.