XEROX DEDITAUG 2 4 1 DEDITAUG 1 4 By: Mitchell L Model 473 Edgell Road Framingham, MA 01701 Augmentation of DEDIT Note: Resets DEDIT when loaded. Notice and Acknowledgement: This package was developed while the author was an employee of Applied Expert Systems, Inc. (Apex), Cambridge, MA. The author thanks the company for its support and assumes full responsibility for the contents and maintenance of this package. SOFTWARE REQUIRED DEDITAUG.DCOM COMMANDS New Edit Menu command and DEDITTYPEINCOMS command YankTo (control-Y) YankTo is a collection of what are essentially movement macros that implement some common operations having to do with "brother" elements (Mth THRU Nth in TTY editor parlance). All operate on the TOP and NEXT elements (the two underlined selections, which must be brothers (elements of the same list). (In this documentation, TOP is assumed to be before NEXT, actually their ordering doesn't matter.) Several of the commands also use athird selection, a destination, which must be selected before the two brothers (and so isn't underlined). YankTo commands can be invoked either by the 'Move To' command that is added to the Edit Menu, or by typing control-Y. After typing a control-Y, you are prompted for a command name, as with control-Z. Only the first character of the response is considered; case is not significant. Most of the commands have subcommands. If an argument is omitted for either a subcommand or a command, a menu will appear with the available choices. (If you wan't to get rid of the control-Y command, just remove its entry from DEDITTYPEINCOMS.) Following are descriptions of the commands, expressed more or less in TTY editor terminology. The destination expression is referred to as 'HERE'. Subcommands are shown in braces. Note that AFTER and BEFORE implicitly include HERE; i.e., AFTER refers to AFTER HERE.) MoveTo MOVE TOP THRU NEXT TO {AFTER, BEFORE, HERE} CopyTo COPY TOP THRU NEXT TO {AFTER, BEFORE, HERE} Switch SWAP TOP THRU NEXT WITH HERE Wrap If the subcommand is one of {PROG, LET, LETS}, then MBD TOP THRU NEXT IN ( NIL &); if COND, MBD TOP THRU NEXT IN ( &); otherwise, result is ( TOP ... NEXT). The menu if subcommand is not specified includes: LET, LET*, PROG, PROGN, PROG1, COND, SELECTQ, RESETFORM, OR, AND, and *. For example, editing expression (A B (1 2 3 4 5)), if you select A then 2 then 4, then type control-Y followed by M, space, A, , the result will be (A 2 3 4 B (1 5)). If you next select A then B, then type control-Y followed by W and , and select LET from the menu that comes up, you get (LET NIL A 2 3 4 B)(1 5)) Obviously these don't add any capabilities, but they do saves xome buttoning, and the need to think carefully about control-key command stacking to avoid lots of redisplay, in situations that come up fairly frequently. YankTo commands are fully undoable. WARNINGS: If you Move or Switch expressions from one DEdit windowto another, the source window won't be reprinted until you next touch it. Copying EXP1 through EXPN to before EXP1 doesn't work because of idiosyncracies in DEdit's () command (used by CopyTo) such that after selecting A then A then C in the list (A B C D E F) then doing a (), the secondary selection is the entire list (same as the primary selection) rather than A. New EditComs TED TEDIT the current expression. Prompts for a window the first time, then reuse it subsequently. Use the TEDIT QUIT command to exit. [Note: If you TED a string, it is displayed without quotes in TEDIT, but they are effectively still there.] When you quit, ignore the warning that text hasn't been saved; quit anyway. PPTED Like TED, but prettyprint the expression to a file then edit that file. This is much slower than TED. It is necessary to PUT before QUITting if you want the edits to take, but this gives you a way to abort the edit -- simply QUIT without PUTting. NOTES: These macros are particularly good for editing comments. Also, they may be used to replace one expression with several. DONTUNCACHEFLG [Variable] Controls the "caching" of DEDIT windows. DEDIT originally caches only the second window you open. If DONTUNCACHEFLG is T, it will cache all of them, no matter how deeply you go, so that you don't have to respecify their regions each time you go back into DEDIT. If DONTUNCACHEFLG is a number, it will remember only that many (counting the initial DEDIT window as 1). ( DEDITINIT REGIONS ADDMACROS ADDCOMS] [Function] Initialize DEDIT, create a window for each region in REGIONS, and set DONTUNCACHEFLG to (MAX (OR DONTUNCACHEFLG 0)(LENGTH REGIONS)) (unless it is already T, in which case leave it alone). ADDMACROS are editmacros and usermacros to be added to the EditCom submenu, e.g. (Q TED PPTED). ADDCOMS are argument lists to which DEFDEDITCOM will be applied. This is the general mechanism for adding commands to the DEdit menu or submenus of DEdit menu entries. DEFDEDITCOM'S arguments are the name of the command (i.e., what is to appear on the menu), the form to evaluate to implement it (can be just the name of a function to call), the name of the DEditCom under whose submenu it should appear (NIL to add a top-level command), and the name of the command before which it should appear (otherwise it goes at end). This is pretty arcane; get help if you need it. You can also try looking at \DEDITCOMS, a list which RESETDEDIT sets to NIL and DEFDEDITCOM adds to, might help. (DODEDITINIT) [Function] (DEDITINIT DEDITREGIONS DEDITADDMACROS DEDITADDCOMS) (DODEDITINIT) is evaluated when the package is loaded and also placed on AFTERSYSOUTFORMS. It is therefore easier to set the values cof DEDITREGIONS, DEDITADDMACROS, and DEDITADDCOMS appropriately before you load the package than to call DEDITINIT explicitly. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))4H4 H( D PAGEHEADING RUNNINGHEAD(8(8MODERN MODERN MODERN MODERNLOGOMODERN MODERN MODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN   HRULE.GETFNMODERN  HRULE.GETFNMODERN    E%99+J7* D s fo! ).ez