# $EPIC: output_rewrite,v 1.3 2002/01/13 00:27:11 anders Exp $
Synopsis:
   set(4) output_rewrite 

Description:
    If this /SET is defined (by default, it is un-set), then every
    time a LOGICAL line of output is about to be sent to a window, the
    /SET value is expanded, and the result of that expansion is substituted
    for the original text.  The expansion is parsed in the context that:
       $0      The window refnum the output is going to
       $1-     The text itself.

Examples:
   This would cause all output to all windows to be preceded by +++
   /SET OUTPUT_REWRITE +++$1-

   This would return proceed all output to all windows with the output of
   the user defined function $myfunc() called with the window number.
   /SET OUTPUT_REWRITE $myfunc($0) $1-


Notes:
   When changing /set output_rewrite inside of an alias, please remember
   that $'s are expanded before the /set is called, and so things like
   $1- or $myfunc($0) would be expanded at the /set time and not at the
   rewrite time.  Make sure to double up your $$'s in such cases!

Practical:
   For every line of output that goes to the screen, /on window is
   thrown.  However, /on window cannot be recursively called, so
   there are some instances where output goes to the window without
   /on window having been thrown.  This makes it hard to write
   general purpose time stamp handlers.  Therefore, a general purpose
   way of doing final-editing on window output is needed.  This set
   provides that capability.

Performance Note:
    This is a very expensive operation, but is cheaper than using
    an /on window, and probably less of a hassle than redefining
    a zillion other /on's.  It also is pretty reliable, since it
    will always be honored for all lines of output.
