123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873 |
- THE UCI-LISP EDITOR
- (Translated to Standard LISP)
- SLISP provides an extremely powerful form-oriented editor. This
- facility allows the user to easily alter function definitions,
- variable values and property list entries. It thereby makes it
- entirely unnecessary for the user to employ a conventional text
- editor in the maintenance of programs. This document is a guide
- to using the editor. Certain features of the UCI-LISP editor have
- not been incorporated in the translated editor, and we have tried
- to mark all such differences.
- Section 1: User Entry to Editor
- This section describes normal user entry to the editor (EDITF,
- EDITP and EDITV) and the editing commands which are available.
- This section is by no means complete. In particular, material
- covering programmed calls to the editor routines is not treated.
- Consult the UCI LISP manual for further details.
- To edit a function named FOO do
- *(EDITF FOO)
- To edit the value of an atom named BAZ do
- *(EDITV FOO)
- To edit the property list of an atom named FOOBAZ do
- *(EDITP FOO)
- Warning, editing the property list of an atom may position pointers at
- unprintable structures. It is best to use the F (find) command before
- trying to print property lists. This editor capability is variable from
- implementation to implementatio.
- The Editor will prompt with
- -E-
- *
- You can then input any editor command. The input scanner is not very smart.
- It terminaes its scan and begins processing when it sees a printable character
- immediately followed by a carriage return. Do not use escape to terminate
- an editor command. If the editor seems to be repeatedly requesting input
- type P<ret> (print the current expression) or some other command that will
- ordinarily do no damage, but will terminate the input soliciitation.
- The following set of topics makes a good 'first glance' at the
- editor.
- Entering the editor: EDITF, EDITV.
- Leaving the editor: OK.
- Editor's attention: CURRENT-EXP.
- Changing attention: POS-INTEGER, NEG-INTEGER, 0, ^, NX, BK.
- Printing: P, PP.
- Modification: POS-INTEGER, NEG-INTEGER, A, B, :, N.
- Changing parens: BI, BO.
- Undoing changes: UNDO.
- For the more discriminating user, the next topics might be some
- of the following.
- Searches: PATTERN, F, BF.
- Complex commands: R, SW, XTR, MBD, MOVE.
- Changing parens: LI, LO, RI, RO.
- Undoing changes: TEST, UNBLOCK, !UNDO.
- Other features should be skimmed but not studied until it appears
- that they may be useful.
-
- SECTION 2: Editor Command Reference
- (A exp1 exp2 ... expn) edit cmnd
- This command inserts exp1 thru expn (arbitrary LISP expressions)
- after the current expression. This is accomplished by doing an UP
- and a (-2 exp1 exp2 ... expn) or an (N exp1 exp2 ... expn), as
- appropriate. Note the way in which the current expression is
- changed by the UP.
- (B exp1 exp2 ... expn) edit cmnd
- This command inserts exp1 thru expn (arbitrary LISP forms) before
- the current expression. This is accomplished by doing an UP
- followed by a (-1 exp1 exp2 ... expn). Note the way in which the
- current expression is changed by the UP.
- (BELOW com n) edit cmnd
- This command changes the current expression in the following manner.
- The edit command com is executed. If com is not a recognized
- command, then (_ com) is executed instead. Note that com should
- cause ascent in the edit chain (i.e., should be equivalent to
- some number of zeroes). BELOW then evaluates (note!) n and
- descends n links in the resulting edit chain. That is, BELOW
- ascends the edit chain (does repeated 0s) looking for the link
- specified by com and stops n links below that (backs off n 0s).
- If n is not given, 1 is assumed.
- BF pat edit cmnd
- (BF pat flg) edit cmnd
- This command performs a backwards find, searching for pat (an
- edit pattern). Search begins with the expression immediately
- before the current expression and proceeds in reverse print
- order. (If the current expression is the top level expression,
- the entire expression is searched in reverse print order.)
- Search begins at the end of each list, and descends into each
- element before attempting to match that element. If the match
- fails, proceed to the previous element, etc. until the front
- of the list is reached. At that point, BF ascends and backs
- up, etc.
- The search algorithm may be slightly modified by use of the second
- form of the command. Possible flgs and their meanings are as
- follows.
- T - begins search with the current expression rather than
- with the preceeding expression at this level.
- NIL or missing - same as BF pat.
- NOTE: if the variable UPFINDFLG is non-NIL, the editor does
- an UP after the expression matching pat is located. Thus,
- doing a BF for a function name yields a current expression
- which is the entire function call. If this is not desired,
- UPFINDFLG may be set to NIL. UPFINDFLG is initially T.
- BF is protected from circular searches by the variable MAXLEVEL.
- If the total number of CARs and CDRs descended into reaches
- MAXLEVEL (initially 300), search of that tail or element is
- abandoned exactly as though a complete search had failed.
- (BI n1 n2) edit cmnd
- This command inserts a pair of parentheses in the current
- expression. (Note that parentheses are ALWAYS balanced, and
- hence must be added or removed in pairs.) A left paren is
- inserted before element n1 of the current expression. A right
- paren is inserted after element n2 of the current expression.
- Both n1 and n2 are usually integers, and element n2 must be to
- the right of element n1.
- (BI n1) is equivalent to (BI n1 n1).
- The NTH command is used in the search, so that n1 and n2 may
- be any location specifications. The expressions used will
- be the first element of the current expression in which the
- specified form is found at any level.
- (BIND coms) edit cmnd
- This command provides the user with temporary variables for
- use during the execution of the sequence of edit commands coms.
- There are three variables available: #1, #2 and #3. The binding
- is recursive and BIND may be executed recursively if necessary.
- All variables are initialized to NIL. This feature is useful
- chiefly in defining edit macros.
- BK edit cmnd
- The current expression becomes the expression immediately preceeding
- the present current expression. This command generates an error
- if the current expression is the first expression in the list.
- (BO n) edit cmnd
- The BO command removes a pair of parentheses from the nth element
- of the current expression. The parameter n is usually an integer.
- The NTH command is used in the search, however, so that any
- location specification may be used. The expression referenced is
- the first element of the current expression in which the specified
- form is found at any level.
- (CHANGE loc TO exp1 exp2 ... expn) edit cmnd
- This command replaces the current expression after executing the
- location specification loc by exp1 ... expn.
- (COMS arg1 arg2 ... argn) edit cmnd
- This command evaluates its argi and executes them as edit commands.
- (COMSQ com1 com2 ... comn) edit cmnd
- This command executes each comi as an edit command
- At any given time, the attention of the editor is focused on a
- single expression or form. We call that form the current expression.
- Editor commands may be divided into two broad classes. Those
- commands which change the current expression are called attention-
- changing commands. Those commands which modify structure are
- called structure modification commands.
- DELETE edit cmnd
- This command deletes the current expression. If the current
- expression is a tail, only the first element is deleted. This
- command is equivalent to (:).
- E form edit cmnd
- (E form) edit cmnd
- (E form T) edit cmnd
- This command evaluates form. The first form of the command is
- valid only when typed in from the TTY. (E form) evaluates form
- and prints the value on the terminal. The form (E form T)
- evaluates form but does not print the result.
- (EDITF fn coms) fsubr
- This function initiates editing of the function whose name is
- fn. The argument coms is an optional sequence of edit
- commands. If coms is present, no terminal input is requested
- or required. The commands in coms are executed and EDITF
- returns fn. If coms is not present, then the editor will
- ask for keyboard input.
- (EDITFNS fn-list coms) fsubr
- This function applies the sequence of editor commands, coms, to each
- of several functions. The argument fn-list is evaluated, and should
- evaluate to a list of function names. Coms will be applied to each
- function in fn-list, in turn. Errors in editing one function will
- not affect editing of others. The editor call is via EDITF, so that
|