XEROX Lisp Users Packages 2 4 1 1 TEDITKEY 1 4 4 4 By: Greg Nuyens DESCRIPTION TEditKey is a package which provides a keyboard interface to TEdit. On a Dandelion, the interface takes advantage of the non-Alto keys. On Dorados and Dolphins, a window mimicking the Dlion function keys provides the same abilities. The abilities provided include allowing the user to alter the caret looks (the looks of characters typed in) or the selection looks. These commands are given using the Dlion function keys and/or metacodes (keys typed while a meta key is held down. The default meta key is the tab key, to alter this see User Switches, below). Other metakeys move the cursor within the document (beginning/end of line, back/forward character, up/down a line, etc.) Thus, many of the non-Alto keys are made to function in TEdit the way they are labeled. The following keys change their behaviour once TEditKey is loaded. CENTER modifies the justification of the paragraph(s) containing the current selection. If the selection was left justified, then hitting the CENTER key makes it centered. Hitting it again produces right and left justification. BOLD makes the selection bold. All other properties remain unchanged. Holding the shift key down while hitting BOLD, will make the selection become un-bold. ITALICS makes the selection italicized. Shift-ITALICS is the opposite. UNDERLINE makes the selection underlined. Shift-UNDERLINE is the opposite. SUPERSCRIPT superscripts the selection by a constant amount. Any relative superscripts (or subscripts) are maintained. Thus if "Xi" is selected in "the set Xi is empty" then pressing the SUPERSCRIPT button produces "the set Xi is empty". See USER SWITCHES below for how to set the increment. Shift-SUPERSCRIPT is the same as SUBSCRIPT SUBSCRIPT analogous to SUPERSCRIPT. SMALLER decreases the font size of the selection. All relative size differences are maintained. e.g. "this is bigger than that" produces "this is bigger than that". shift-SMALLER (labelled LARGER) does the opposite. DEFAULTS makes the selection have default looks. The default looks can be set to the current caret looks by typing shift-DEFAULTS The above keys all affect the caret looks if the keyboard key is held down when they are hit. Thus holding down KEYBOARD, and then hitting UNDERLINE, makes the caret looks be underlined. FONT change the font of the selection or caret looks according to the following table: (to alter this table see USER SWITCHES below:) 1 timesroman 2 helvetica 3 gacha 4 modern 5 classic 6 terminal 7 symbol 8 hippo Thus, to change the font of the selection to Classic, hold down FONT and hit '5'. To change the caret font to Classic, hold down FONT (to signal the font change) and KEYBOARD (to direct the change to the caret looks) then hit '5'. Note that this table is part of the menu displayed when the HELP button is pressed. KEYBOARD apply any changes that occur while this key is down to the caret looks instead of the selection. AGAIN is an ESCape key, which acts as the TEdit REDO syntax class. (see p 20.22 Interlisp Reference Manual) OPEN Opens a blank line at the current cursor position. FIND prompts the user for a target string, then searches from the selection forward. NEXT acts as the TEdit NEXT syntax class. EXPAND expands TEdit abbreviations. (see p. 20.31 IRM) HELP displays a menu of the keybindings until a mouse key is clicked. UNDO acts as the TEdit UNDO syntax class. Note that it still retains its TELERAID function as does STOP. ESC (the right arrow key on Dandelions) enters \, and | when shifted. (Recall that AGAIN is an escape key) As well as the previous functions available on the Dandelion's non-Alto keys, the following functions are available on the standard keyboard (thus usable on the Dandelion, Dolphin and Dorado). Each function is shown with the key that invokes it (in conjunction with the control (denoted ^) or meta (denoted #) key). Thus, for the sixth entry, holding down the metakey and hitting f (or "F") would move the caret one character forward. (To find out how to get a metakey see USER SWITCHES below.) #/ default the caret looks #= query caret looks #9 smaller caret font #0 larger caret font ^b back char ^f forward char ^p previous line ^n next line ^a beginning of line ^e end of line #< beginning of document #> end of document ^k kill line (delete from caret to end of line) ^o open line ^d delete character forward (also on shift backspace) ^t transpose characters #[ indent paralooks. also available on the MARGINS key. #] exdent paralooks. also available as shift-MARGINS. j justification change (same as CENTER key) #u uppercasify selection #l lowercasify selection #? show keybindings Note that the positions of any of these functions can be individually changed using TEDIT.SETFUNCTION (see p. 20.30 IRM). For wholesale customization see User Switches below. User Switches: TEDITKEY.METAKEY The user must chooses a metakey to make use of TEditKey. The value of the variable TEDITKEY.METAKEY is the name of the key which will be your metakey. For instance to make TAB (the default) your metakey, (SETQ TEDITKEY 'TAB) before loading TEditKey. (note that even in the standard system, TAB is available as Control-I). Alternately, METASHIFT will make the swat key a meta. (see p 18.9 of the IRM) The operation of TEditKey is controlled by the following (INITVARed) variables: TEDITKEY.LOCKTOGGLEKEY This is the key which will be turned into a lock-toggle. If it is non-NIL, that key is set to act as a lock-toggle. Thus hitting this switches the case of the typein. TEDITKEY.FONTS This is an eight element list of the fonts that are invoked by meta-1 through meta-8. The defaults are listed above. TEDIT.DEFAULT.CHARLOOKS This defines the looks that result when the DEFAULTS key is pressed or when default caret looks are requested. It is an instance of the CHARLOOKS datatype. To set it, for instance, to TIMESROMAN 10 type the following to the lisp top level. (SETQ TEDIT.DEFAULT.CHARLOOKS (CHARLOOKS.FROM.FONT (FONTCREATE 'TIMESROMAN 10))) Alternately, select an instance of the desired looks, and type shift-DEFAULTS TEDITKEY.VERBOSE if T (the default), the functions which modify the caret looks print feedback in the (TEdit) promptwindow. TEDITKEY.NESTWIDTH the distance (in points) that the indent and exdent functions move the margins. Initially 36 points (0.5 inches). \TK.SIZEINCREMENT the amount (in points) which the LARGER function increases the selection. (and conversely for SMALLER) Initially 2 points. TEDITKEY.OFFSETINCREMENT the amount (in points) which the SUBSCRIPT function raises the selection. (and conversely for SUPERSCRIPT) Initially 3 points. TEDIT.KEYBINDINGS the list which controls the mapping of keys to functions. It consists of triples of function name, list of CHARCODE-style character specifications, and a comment describing what the function does. (the comments are used by the automated menu building tools and their inclusion is encouraged) TEDIT.DLION.KEYACTIONS the list which specifies the keyactions of the non-Alto keys (to the left and right) on the DLion. TEDIT.DLION.FNKEYACTIONS the list which specifies the keyactions of the function keys (center, bold, etc.). TEDIT.DLION.KEYBINDINGS the list specifying the functions to be tied to the characters generated from above. The keynames in the CAR of each element are comments. Note that TEDIT.DLION.KEYACTIONS and TEDIT.DLION.KEYBINDINGS must be coordinated (similarly for TEDIT.DLION.FNKEYACTIONS and TEDIT.DLION.FNKEYBINDINGS). TEDIT.DLION.FNKEYBINDINGS analogous to TEDIT.DLION.KEYBINDINGS but for the fn keys. TEDIT.DLION.KEYSYNTAX the list of syntax classes to be applied to the DLION keys. The previous variables in conjunction with the following functions specify the effect of TEditKey. (TEDIT.INSTALL.KEYBINDINGS readtable) invokes the keyactions specified by TEDIT.DLION.KEYACTIONS and installs the values of TEDIT.KEYBINDINGS and TEDIT.DLION.KEYBINDINGS on readtable. (readtable defaults to TEDIT.READTABLE). (\TK.BUILD.MENU) function which builds the help menu from the values of the above variables (LIST ((PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 720 444 36) NIL) (TEXT NIL NIL (84 78 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 720 444 36) NIL) (TEXT NIL NIL (84 78 456 600) NIL))) (PAGE NIL NIL (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 SIZE 10 FAMILY GACHA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (282 24 72 36) NIL) (HEADING NIL (HEADINGTYPE BOO) (84 720 444 36) NIL) (TEXT NIL NIL (84 78 456 600) NIL))))) È $$È``È ``È`È ``È È ŠŠ8ŠŠ8 4ŠŠ8ŠŠ8ÈÈÈ PAGEHEADINGBOO HELVETICA  HELVETICA HELVETICA  HELVETICA HELVETICA LOGO HELVETICA HELVETICA   HRULE.GETFN HELVETICA  HRULE.GETFN HELVETICA HRULE.GETFN  HRULE.GETFN HELVETICA  HRULE.GETFN HELVETICA HRULE.GETFN HRULE.GETFN  HRULE.GETFN HELVETICA í> #Uœà™? ; “CA* Ô{¼ƒ    <ci5R'2Cgió  0 697-°TâOP©xôQMlu~'eU(<>c ‡  K z¹