XEROX SEdit-Patches 2 4 1 SEdit-Patches 1 4 By: Johannes A. G. M. Koomen (Koomen.wbst@Xerox or Koomen@CS.Rochester.edu) This document last edited on July 29, 1988 INTRODUCTION SEdit is a new display-oriented structure editor replacing DEdit. Initially implemented in the Koto release of Xerox Lisp, the first formal release of SEdit did not occur until the Lyric release of Xerox Lisp. Many people, however, are required or determined to remain in Koto. This module provides a number of patches necessary to make the Koto version usable. This document serves as a quick guide to the various patches and functionality upgrades. SEdit commands Meta-D : Define Function [new SEdit command] Prompts for a function name. Defines the function using the current selection as the body, then replaces the current selection by a call to the new function. Meta-M : Menu [removed SEdit command] Formerly attempted to attach a freemenu to the SEdit window. Due to incompatible freemenu descriptions between Koto and Lyric, this command has been disabled. Meta-O : Open Editor [patched SEdit command] Opens an SEdit window on the current selection. Patched so that it will handle any editable object, rather than just functions. Meta-T : Text Substitution [new SEdit command] Prompts for two patterns (sequences of characters containing 0 or more ESC characters). Performs a text substitution on the current selection, using pattern matching, with ESC characters in the pattern matching 0 or more characters in the target. If the patterns do not contain ESC characters, the patterns will be wrapped in two ESC characters. For example, if the current selection is (THE BAT IN (THE BASEMENT)), and the Text Substitution command is invoked with patterns "B" and "C", the resulting expression will be (THE CAT IN (THE CASEMENT)). Meta-^X : Done & Close [new SEdit command] Just like ^X, but also closes the window. In other words, using the keyboard to do the equivalent of closing the window with the mouse. SEdit interface (ADD.SEDIT.COMMAND keyspec commandfn {menulabel menucomment}) [function] keyspec is a character specification (or a list of them), where each character specification must be acceptable to CHARCODE. commandfn is a function of one argument, the edit context. The function should return T (otherwise SEdit will complain with "Unknown command: ..."). If menulabel and menucomment are given, SEdit will add the command to its command menu as well. (To get the command menu, hold the meta key down and click on the middle mouse button). (REMOVE.SEDIT.COMMAND commandfn) [function] commandfn is the same as in ADD.SEDIT.COMMAND. Removes the command from SEdit. (ADD.SEDIT.QUOTE quotestring quotefn) [function] quotefn is a function of one argument. SEdit will display a form (quotefn XXX) as quotestringXXX, and typing quotestring will cause SEdit to insert a form (quotefn ...) , with ... indicated with the Unfilled Slot marker. For instance, after (ADD.SEDIT.QUOTE "?" (FUNCTION PATTERNVAR)), the form (PATTERNVAR X) is displayed as ?X, and typing ? will cause ?-x- to be displayed. (SEDIT.GET.WINDOW.REGION context reason) [function] Called when SEdit needs a region for a new SEdit window. Its default implementation does what SEdit normally does, namely prompt for a region if none remembered. You are free to redefine it, or use a LispUsers module such as Tiled-SEdit which redefines it for you. reason is one of the (simulated) Common Lisp keywords :CREATE or :EXPAND. (SEDIT.SAVE.WINDOW.REGION context reason) [function] Called when SEdit no longer needs the region of a closed or shrunken SEdit window. Its default implementation does what SEdit normally does, namely remember the window region. You are free to redefine it, or use a LispUsers module such as Tiled-SEdit which redefines it for you. reason is one of the (simulated) Common Lisp keywords :CLOSE or :SHRINK. SEdit internals \\mark.context [patched SEdit internals] Patched so it will prepend "*" to the window title if changes have been made (the way it works in Lyric). \\linearize.form [patched SEdit internals] Patched to circumvent a bug: there was a reference to (fetch Unassigned of node) as one of the branches in the conditional under `first' which maybe NIL. Hence, wrapped it in an OR to compute some alternate valid indent value (dunno if it's right) instead. \\reparse.litatom [patched SEdit internals] Patched to fix a deadly bug (fatal crash) occurring when SEdit attempts to reparse the CADR of a LAMBDA or LET or PROG list after typing a litatom instead of a ParamList. Miscellany When loaded onto a Dorado, this patch file turns METASHIFT on, and makes the top blank key a backquote character ("`"). (LIST ((PAGE NIL (FOLIOINFO (ARABIC) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM) FORMATINFO (ARABIC)) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 42 72 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 444 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))))). ((8(8D PAGEHEADING RUNNINGHEADMODERN MODERN MODERN MODERNMODERN LOGO HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN O, .'.0),  x      G  <   $  D C*j, a- xz