;skip 1 ;vsp 5 ;squish ;lftmar 0 ;topmar 0 ;botmar 0 ;kset BOLIO;FONT1 KST,BOLIO;FONT1 KST,BOLIO;FONT2 KST,BOLIO;FONT3 KST,BOLIO;37VRBL KST,BOLIO;30FLSP KST "‡"A  SK's Documentation q1 "Debugging code that uses the window system "`  0.1 Debugging code that uses the window system " PUser‚programs‚that‚make‚use‚of‚the‚screen‚organization‚and‚standardization‚facilities   provided‚by‚the‚window‚system‚are‚frequently‚in‚a‚somewhat‚dicult‚position.‚If‚that   interface‚to‚the‚window‚system‚does‚not‚work,‚there‚seems‚to‚be‚no‚way‚at‚all‚to‚nd‚out   what‚îis‚îgoing‚îon.‚Similarly,‚debugging‚code‚associated‚with‚switching‚between‚windows‚can   be‚dicult‚since‚there‚may‚be‚no‚place‚to‚print‚debugging‚output‚at‚the‚time‚such‚code‚is   executing.‚ " PThis‚section‚tries‚to‚describe‚some‚of‚the‚aids‚provided‚by‚the‚system.‚It‚in‚no‚way   purports‚ to‚ be‚ a‚ general‚ description‚ of‚ how‚ to‚ debug‚ LISP‚ code.‚ " PThe‚îsimplest‚îthing‚îyou‚îcan‚îdo,‚to‚îsee‚îif‚îa‚îcertain‚îplace‚îin‚îthe‚îprogram‚îis‚îbeing‚reached,   is‚to‚add‚a‚call‚to‚the‚function‚tv:beep‚at‚that‚point.‚This‚simple‚technique‚can‚be   surprisingly‚ helpful.‚   "  cold-load-stream Variable  This‚is‚the‚stream‚used‚in‚constructing‚the‚initial‚LISP‚machine‚environment,‚before  the‚window‚system‚itself‚has‚been‚loaded.‚It‚has‚the‚advantage‚that‚it‚does‚not  attempt‚îto‚îinterface‚îwith‚îthe‚îrest‚îof‚the‚window‚system,‚or‚vice‚versa.‚It‚will‚never  deexpose‚any‚windows‚or‚lock‚any‚locks.‚It‚types‚out‚one‚character‚at‚a‚time,‚by  calling‚the‚microcode‚directly,‚and‚has‚very‚simpleminded‚ideas‚about‚end‚of‚line  exceptions‚and‚more‚breaks.‚When‚it‚is‚waiting‚for‚typein,‚it‚does‚not‚go‚blocked,  scheduling‚is‚turned‚o‚in‚fact,‚a‚special‚blinker‚is‚blinked‚manually,‚and‚characters  read‚ directly‚ from‚ the‚ hardware‚ buer.‚ " PIf‚îyou‚îcall‚îthe‚îfunction‚îtv:kbd-use-cold-load-stream‚îyou‚îwill‚îget‚îa‚î"break-loop"‚using   the‚îcold-load-stream.‚This‚will‚type‚out‚all‚over‚your‚screen‚but‚otherwise‚will‚not‚interact   with‚the‚window‚system‚in‚any‚way.‚Type‚p‚to‚continue.‚Note‚that‚when‚the‚break‚is   entered,‚the‚ package‚ you‚ are‚ typing‚ into‚ is‚ typed‚ out,‚because‚îthe‚îpackage‚îin‚îthe‚îwho-line‚îis   not‚ maintained‚ by‚ the‚ cold-load-stream.‚Indeed,‚nothing‚ in‚ the‚ who-line‚ will‚ be‚ maintained.‚ " PWhenever‚the‚system‚gets‚an‚error‚in‚the‚keyboard‚process,‚the‚scheduler‚or‚the‚mouse   process,‚the‚ error‚ handler‚ uses‚ the‚ cold-load-stream‚ rather‚ than‚ terminal-io.‚ " PIf‚eh:error-handler-io‚is‚non-nil,‚the‚error‚handler‚will‚use‚that‚stream‚rather‚than   terminal-io.‚So,‚if‚you‚set‚eh:error-handler-io‚to‚tv:cold-load-stream,‚errors‚are   assured‚ not‚ to‚ share‚ bugs‚ in‚ the‚îuser's‚îwindow.‚Their‚îtypeout‚îmay‚îclobber‚îthe‚îscreen,‚but‚îit   won't‚modify‚the‚position‚of‚the‚user's‚typeout‚so‚far‚or‚anything‚like‚that.‚Also,‚the‚ESC   BREAK‚breakpoint‚will‚use‚this‚variable,‚so‚if‚terminal-io‚gets‚locked,‚you‚can‚nd‚out   why‚if‚you‚have‚set‚eh:error-handler-io.‚Similarly,‚if‚you‚set‚trace-output,‚the‚stream   that‚the‚trace‚package‚uses‚for‚its‚typeout,‚to‚the‚cold‚load‚stream,‚its‚functions‚will‚in‚no   way‚ interfere‚ with‚ the‚ code‚ being‚ traced,‚even‚ if‚ it‚ has‚ bugs‚ in‚ its‚ window‚ system‚ interface.‚ " PAdditionally,‚you‚can‚get‚into‚a‚break‚loop‚using‚the‚cold‚load‚stream,‚either‚by‚using   the‚ESC‚CALL‚command‚from‚the‚keyboard,‚or‚the‚Emergency‚Break‚item‚in‚the‚"Other"   system‚menu.‚From‚there‚you‚can‚inspect‚the‚state‚of‚your‚process‚and/or‚windows‚and   continue‚ without‚ risk‚ of‚ interfering‚ with‚ them.‚You‚ might‚ use‚îthis‚îto‚îset‚îeh:error-handler-   io‚îif‚îyou‚îhad‚înot‚îset‚îit‚îto‚îthe‚îcold-load‚îstream‚in‚advance,‚then‚p‚and‚type‚ESC‚BREAK ":  DSK:LMWIND;WDEBUG 6 S1-DEC-80î "‡"A  SK's Documentation q2 The window error handler "`  to‚ force‚ your‚ program‚ into‚ the‚ error‚ handler.‚   "=  0.2 The window error handler " PThis‚îsection‚îdescribes‚îthe‚îwindow‚oriented‚error‚handler,‚which‚can‚be‚gotten‚from‚the   standard‚ keyboard‚ error‚ handler‚ by‚ typing‚ Control-Meta-W‚ to‚ the‚ ‚ prompt.‚ " PThe‚error‚handler‚window‚is‚divided‚into‚six‚panes.‚At‚the‚bottom‚is‚a‚lisp‚window,   which‚ordinarily‚provides‚a‚read-eval-print‚loop,‚similar‚to‚the‚regular‚keyboard‚error   handler.‚More‚ commands‚ are‚ available‚ by‚ using‚ the‚ mouse‚ in‚ the‚ other‚ windows‚ as‚îdescribed   below.‚ " PAt‚the‚top‚is‚a‚display‚of‚the‚disassembled‚or‚ground‚code‚for‚the‚currently‚selected   stack‚frame,‚depending‚on‚whethere‚or‚not‚it‚is‚compiled.‚It‚has‚a‚scroll-bar,‚but‚is   otherwise‚ not‚ sensitive‚ to‚ the‚ mouse.‚ " PNext‚are‚the‚args‚and‚locals‚windows,‚side‚by‚side,‚displaying‚the‚names‚and‚values‚of   the‚arguments‚to‚the‚current‚stack‚frame‚and‚its‚local‚variables,‚or‚are‚greyed‚out‚if‚there   are‚ none.‚They‚îalso‚îhave‚îa‚îscroll‚îbar.‚Clicking‚îthe‚îmouse‚îon‚îthe‚îname‚îof‚îan‚îargument‚îwill   print‚îthe‚îname‚îand‚îthe‚îvalue‚îin‚the‚lisp‚window.‚Clicking‚on‚just‚the‚value‚will‚print‚it‚in   the‚ lisp‚ window.‚The‚ mouse‚ will‚ highlight‚ any‚ relevant‚ quantity‚ that‚ you‚ are‚ pointing‚ to.‚ " PNext‚is‚the‚stack‚window,‚which‚displays‚in‚a‚pseudo-list‚format‚the‚functions‚and   arguments‚on‚the‚stack.‚Clicking‚on‚a‚function‚or‚argument‚or‚sublists‚of‚them‚will‚cause   them‚to‚be‚printed‚in‚the‚lisp‚window‚as‚in‚the‚argument‚or‚local‚windows.‚Also,‚clicking   the‚ mouse‚ to‚ the‚ left‚ of‚ a‚ line‚ containing‚ a‚ particular‚ stack‚ frame‚ will‚ make‚ the‚ error‚îhandler   select‚ that‚ frame,‚changing‚ what‚ the‚ above‚ three‚ windows‚ show.‚ " PBelow‚ this,‚and‚ above‚ the‚ lisp‚ window,‚is‚ the‚ command‚ menu‚ for‚ the‚ error‚îhandler.‚The   available‚ commands‚ are‚ and‚ what‚ they‚ do‚ are:‚   "  What error `Reprints‚ the‚ error‚ message‚ for‚ the‚ current‚ error,‚in‚ the‚ lisp‚ window.‚   "  Quit one level  `Exits‚just‚the‚window‚error‚handler,‚like‚Meta-Z‚in‚the‚keyboard‚error  `handler.‚   "  Exit `Like‚ C-Z‚ in‚ the‚ regular‚ error‚ handler.‚   "  Arglist `Asks‚for‚the‚name‚of‚a‚function,‚which‚can‚be‚typed‚on‚the‚keyboard,‚or  `moused‚if‚it‚is‚on‚the‚screen.‚Picking‚an‚actor‚or‚a‚closure‚will‚ask‚for‚the  `message‚name‚to‚that‚actor‚and‚print‚the‚arguments‚to‚its‚method‚for‚that  `message.‚Picking‚a‚line‚of‚a‚stack‚frame‚from‚the‚stack‚window‚will‚try‚to  `align‚the‚printout‚of‚the‚arguments‚with‚what‚value‚was‚supplied‚in‚that  `position‚ in‚ that‚ frame.‚   "  Describe `Asks‚for‚an‚object‚which‚can‚be‚gotten‚with‚the‚mouse‚or‚typed‚in,‚and  `prints‚ out‚ its‚ description‚ in‚ the‚ lisp‚ window.‚   "  Edit `Reads‚a‚name‚of‚a‚function‚in‚the‚same‚fashion‚as‚the‚Arglist‚command‚and  `invokes‚ the‚ editor‚ on‚ that‚ function.‚ "D  DSK:LMWIND;WDEBUG 6 S1-DEC-80î "‡"A  SK's Documentation q3 lThe Screen Editor "`  Retry `Attempts‚ to‚ restart‚ the‚ current‚ frame,‚like‚ the‚ Control-Meta-R‚ command.‚   "  Return a value  `Asks‚for‚the‚name‚of‚a‚value‚(which‚can‚be‚selected‚with‚the‚mouse)‚and  `returns‚ it‚ from‚ the‚ current‚ frame,‚like‚ Control-R.‚   "  Continue `Like‚Control-C,‚except‚that‚the‚mouse‚can‚be‚used‚to‚select‚a‚function‚to  `substitute,‚or‚ whatever‚ object‚ it‚ asks‚ you‚ for‚ in‚ order‚ to‚ continue.‚   "  Set arg `Select‚an‚argument‚or‚local‚with‚the‚mouse‚and‚type‚or‚mouse‚a‚new‚value  `to‚ be‚ substituted‚ in.‚   "  Search `Like‚ the‚ Control-S‚ command,‚except‚ that‚ the‚ mouse‚ can‚ be‚ used.‚   "  Throw `Like‚îControl-T,‚it‚îasks‚îfor‚a‚tag‚and‚a‚value‚and‚throws‚there,‚the‚mouse‚of  `course‚ can‚ be‚ used.‚   "  Specials `Types‚ out‚ the‚ special‚ bindings‚ of‚ the‚ current‚ stack‚ frame‚ in‚ the‚ lisp‚ window.‚   "  T   "  NIL `Ordinarily‚just‚supply‚those‚symbols‚as‚arguments‚or‚values‚for‚other  `commands,‚also‚ can‚ be‚ used‚ to‚ answer‚ yes‚ or‚ no‚ questions.‚   "=  0.3 The Screen Editor " PThis‚section‚describes‚the‚screen‚editor,‚which‚is‚used‚to‚reshape‚and‚move‚windows   around‚ on‚ the‚ screen.‚ " PThe‚screen‚editor‚is‚gotten‚from‚the‚system‚menu‚with‚the‚Edit‚Screen‚command.   Ordinarily‚ it‚ will‚îenter‚îthe‚îscreen‚îeditor‚îimmediately,‚editing‚îthe‚îwhole‚îscreen.‚However,‚if   the‚window‚that‚the‚mouse‚is‚over‚is‚a‚frame,‚you‚have‚an‚option‚of‚editing‚that‚frame‚or   the‚whole‚screen;‚another‚pop-up‚menu‚will‚appear‚with‚the‚possible‚superiors‚you‚can‚call   the‚ screen‚ editor‚ on.‚ " PThe‚ screen‚ editor‚îworks‚îby‚îdisplaying‚îa‚îmenu‚îof‚îcommands.‚You‚îselect‚îa‚îcommand‚îand   the‚îmenu‚îdisappears‚îand‚îthe‚îcommand‚îis‚îexecuted.‚If‚îyou‚îneed‚îto‚îpoint‚îat‚îa‚îwindow‚as‚an   argument‚to‚the‚command,‚it‚will‚tell‚you‚to‚in‚the‚who-line‚and‚by‚changing‚the‚shape‚of   the‚ mouse‚ cursor.‚After‚ executing‚ the‚ command,‚the‚ screen‚ editor's‚ menu‚ will‚ appear‚ again.‚ " PThe‚ commands‚ in‚ the‚ screen‚ editor‚ menu‚ are:‚   "  Bury `Click‚ on‚ a‚ window‚ with‚ the‚ mouse‚ and‚ it‚ will‚ be‚ sent‚ a‚ bury‚ message.‚   "  Expose `Gives‚another‚menu‚of‚the‚deexposed‚inferiors‚of‚the‚screen,‚selecting‚one  `will‚expose‚it.‚[I‚think‚actually‚it‚asks‚you‚to‚point‚at‚a‚partially‚exposed  `window‚ and‚ pulls‚ it‚ to‚ the‚ top,‚rather‚ than‚ giving‚ a‚ menu.]‚   "  Quit `Exits‚ the‚ screen‚ editor.‚   "  Undo `Attempts‚to‚restore‚the‚state‚from‚before‚the‚last‚screen‚editor‚command.  `Beeps‚ if‚ it‚ cannot.‚   "  Move window  `Click‚on‚a‚window‚with‚the‚mouse‚and‚a‚large‚outline‚of‚it‚will‚follow‚the ".  DSK:LMWIND;WDEBUG 6 S1-DEC-80î "‡"A  SK's Documentation q4 lThe Screen Editor "` `mouse‚ around‚ until‚ released,‚and‚ that‚ window‚ will‚ be‚ moved‚ there.‚   "  Reshape `Click‚îon‚îa‚îwindow‚with‚the‚mouse,‚then‚click‚the‚two‚new‚positions‚for‚the  `upper-left‚ and‚ lower-right‚ corners‚ of‚ that‚ window.‚   "  Move multiple  `Clicking‚ on‚îa‚îwindow's‚îedge‚îor‚îcorner‚îwill‚îadd‚îor‚îsubtract‚îit‚îfrom‚îthe‚îlist‚îof  `things‚to‚be‚moved.‚Holding‚down‚the‚mouse‚after‚clicking‚will‚move‚the  `whole‚îlot‚îaround‚until‚the‚button‚is‚released,‚and‚the‚windows‚involved‚will  `be‚ modied‚ accordingly.‚As‚ a‚ special‚ hack,‚if‚ you‚ add‚ an‚ edge‚îor‚îcorner‚îthat  `abuts‚ another‚ edge‚ or‚ corner,‚that‚ other‚ edge‚ or‚ corner‚îwill‚îbe‚îadded‚îtoo.‚If  `that‚ isn't‚ what‚ you‚ wanted,‚click‚ on‚ the‚ new‚îone‚îand‚îit‚îwill‚îturn‚îo‚î(the‚îrst  `one‚ will‚ not‚ turn‚ o‚ too‚ of‚ course).‚   "  Move single `Click‚on‚single‚edges‚or‚corners‚with‚the‚left‚button‚and‚move‚them‚around  `by‚holding‚down‚the‚button.‚Click‚any‚other‚button‚when‚done.‚Note‚that  `this‚ command‚ is‚ slightly‚îdierent‚îfrom‚îthe‚îother‚îmovement‚îcommands,‚in‚îthat  `it‚ keeps‚ repeating‚ until‚ explicitly‚ exited.‚   "  Expand window  `Click‚ a‚ window‚ with‚ the‚ mouse‚ and‚ it‚ will‚ be‚ expanded‚ to‚ occupy‚ as‚îmuch‚îof  `the‚ neighboring‚ whitespace‚ and‚ deexposed‚ windows‚ as‚ possible.‚   "  Expand all `Attempts‚îto‚îll‚îup‚îall‚îwhitespace‚îby‚îexpanding‚îneighboring‚windows‚into‚one  `another,‚that‚is,‚no‚window‚is‚actually‚moved,‚it‚will‚always‚occupy‚at‚least  `all‚of‚the‚area‚it‚did‚before.‚It‚doesn't‚always‚manage‚to‚get‚rid‚of‚all  `whitespace,‚but‚always‚produces‚a‚stable‚position‚relative‚to‚its‚own  `transformation.‚ "‡"‡"‡"‡"‡"‡"=  DSK:LMWIND;WDEBUG 6 S1-DEC-80î "‡"A  SK's Documentation q5 Variable Index "` eVariable Index "`  cold-load-stream  . (. F. d. .  . >. \. z. . 6. U. t. . 2. Q. p. . .. M. l. . *. I. h. . &. E. d. . ". A1 "‡"‡"‡"‡"‡"‡"‡"‡"‡"‡"‡"\   S1-DEC-80î "‡"A  SK's Documentation ti sTable of Contents "` JTable of Contents "`   0.1 Debugging code that uses the window system 4. R. p. . .. M. l. . *. I. h. . &. E. d. . ". A1   0.2 The window error handler O. m.  . ). G. e. . !. ?. ]. {. . 7. U. s. . /. M. k. . '. E. d. . ". A2   0.3 The Screen Editor j. . &. D. b. . . <. Z. x. . 4. R. p. . .. M. l. . *. I. h. . &. E. d. . ". A3 "  Variable Index s. . /. M. k.  . '. E. c. . . =. [. y. . 5. S. q. . .. M. l. . *. I. h. . &. E. d. . ". A5 "‡"‡"‡"‡"‡"‡"‡"‡"‡"‡"b   S1-DEC-80î