[comp.sys.xerox] End to reverse-video PAGEFULLFNs

KARP@SUMEX-AIM.STANFORD.EDU (Peter Karp) (10/06/88)

What follows is a replacement for the standard Interlisp
PAGEFULLFN.  PAGEFULLFN is called when a window fills up
with output; the standard function supplied with Interlisp
turns the window reverse-video and waits for you to type
a character.

Rather than reverse-video the window, which I find annoying, the
function below fills your window with a pattern which you define.
I happen to like a lightly speckled pattern which you can get by

    (SETQ PAGEFULL.TEXTURE (CREATETEXTUREFROMBITMAP (EDITBM))

and using the bitmap editor to create an 11x11 bitmap with a single
black dot in the middle.  Otherwise it has the same functionality
as the default PAGEFULLFN.  Enjoy....




(PAGEFULLFN
  [LAMBDA (WINDOW)                  (* PKarp: "28-Sep-88 22:11")

          (* * Replacement for the system function that is called when output to a displaystream fills up the associated window.)

          (* * Actions: If the terminal input buffer is empty then we
fill the window with a distinctive pattern, wait till the user types
something, and then remove the pattern; else we just return because
the user has indicated we should pause.)


    (if (NOT (READP T))
        then (PROGN (BITBLT NIL NIL NIL WINDOW NIL NIL NIL 
                            NIL (QUOTE TEXTURE)
                            (QUOTE INVERT)
                            PAGEFULL.TEXTURE)
                    (CONTROL T)
                    (READC)
                    (CONTROL T)
                    (BITBLT NIL NIL NIL WINDOW NIL NIL NIL 
                            NIL (QUOTE TEXTURE)
                            (QUOTE INVERT)
                            PAGEFULL.TEXTURE])
-------

lane@SUMEX-AIM.STANFORD.EDU (Christopher Lane) (10/06/88)

Peter,

you might want to consider a formulation of the function something like:

(PAGEFULLFN
  (LAMBDA (WINDOW)             
          (if (NOT (READP T))
           then (RESETLST (RESETSAVE (CONTROL T))
                          (RESETSAVE (INVERTW WINDOW PAGEFULL.TEXTURE)
                                     `(INVERTW ,WINDOW ,PAGEFULL.TEXTURE))
                          (READC))))) 
  
This will restore the window both on the user typing a character and if an
error occurs, eg. the user types ^E (which leaves the window full of dots if
you use the function you provided).

Also, unless I'm missing something, it seems you want (CONTROL NIL) after your
READC, not (CONTROL T) again, as your function permanently leaves things in
the non-default state (the RESETSAVE version above fixes this problem).  You
might also want to remove ':'s in comments (on 'PKarp' and 'Actions') to make
the code easier to enter for post-Koto users (':' is the package marker).

Another problem with your PAGEFULLFN (and the rewrite above), at least under
Medley--haven't tried Koto, is that if you evaluate the following two forms
(in a small EXEC window) the window holding is not the same:

SYSFILES

(PROGN SYSFILES)

due to the READC & CONTROL interacting (or not) with the <RETURN>.  An
alternate approach which gets around this problem (works in Medley but might
need tuning for Koto) is:

(DEFINEQ (PAGEFULL.INVERTW (LAMBDA (WINDOW SHADE)
                              (INVERTW WINDOW (OR SHADE PAGEFULL.TEXTURE)))))

(CHANGENAME 'PAGEFULLFN 'INVERTW 'PAGEFULL.INVERTW)

which preserves the functionality of the original PAGEFULLFN but imposes a new
shade on it (note you can't use ADVISE here as INVERTW is both called twice,
once as part of a reset form, thus the second call would not be modified).

- Christopher