Enhanced and modified version of Per Abrahamsen's out-xtra.el