This version dated 06-sep-80 Eric B. Levy Computer Graphics Lab - 264/125 Jet Propulsion Laboratory 4800 Oak Grove Dr. Pasadena, Calif. 91103 To build the editor, use @ued. This will build three versions. This is a modified version of the Conroy unix editor. This version has some improvements and fixes the problem with no automatic backup that this editor had. This release includes a few new modules which implement a screen editor capa- bility for TELE-RAY terminals. All the additional code for this is in modules edi07-8,11. Edi09,10,12,13,14 are various support modules and new command implementations. The supplied source for these modules is the the output of a macro processor (input is supplied as well, see the mp macro-11 preproces- sor elsewhere if you want to modify it using source). The modules Vedi07,Vedi08, and Vedi11 are vt-100 versions of the screen editor. The Editor goes into screen mode in steps. Initially it is in line mode Which is sutable for any terminal. The `B' command begins windowing the text but its still basically a line oriented editor. The tags and multiple line commands must be issued here. Also there is not currently a delete line in screen mode, so it must be done at command level. The screen mode is entered via the `L' command. When in screen mode, all commands are issued via control characters. The read with special terminators is used but could be simulated (poorly) with a single character read-no-echo followed by echoing the characters one at a time unless the input were one of the special terminators. Currently, any non-implemented control code causes an exit of screen mode back to command level. NOTE-WELL The screen and view modes rely on hardware tabs. Thus hardware tab needs to be enabled. On version 3.1 or less this may present prob- lems. The vt100 versions worked on the vax in window mode; vax doesn't support 3.2 driver calls yet. Hardware tabs must be set and io.wal needs to be modified to io.wlb!pass-all. On the tele-ray versions the tabs are set by the program. The screen mode also sets various characteristics using the `set mutiple' qio(edi11). These are saved and later restored by the program. The view mode works on 3.1+ but the screen mode most certainly requires the 3.2 full duplex driver (uses the read with user specified break table). The sizer module has been replaced with a version that was taken from the multitasker and is claimed to be O.S. independent (Ias/Rsx). I have not yet tried it on IAS. This version fixes the problem with lines exactly 64 chars in length on the big editor version. The editor attempts to read all kinds of ascii files (even pip listing files) and make sense out of them. I have doubts about whether it handles Fortran Carriage control in all cases. Since internaly it stores strings as asciz text, It would blow up on any nulls imbedded into the text file. Therefore, the input routine has been modified to change nulls to 177's. Module Edi05 is the one that reads the command line via a QIOW$. A version is supplied (gedi05) which uses get-command-line instead. Very useful for edit- ing scripts etc. There is a dummy module (gedi11) which is used to build the get-cmd-line ver- sion without the new screen editing features. Screen editing and get-cmd- line don't mix very well. The task tests for its invoked name (xxx part of ...xxx) to see if the first letter is "e". If it is then the editor swaps the "c" and "s" commands in its jump table. This makes "c" the substitute command and "s" the change com- mand. Old EDI users find this a nice bridge (since and work the same as EDI as well). An undocumented option (see the "o" command) is "oe" which performs the same result. Note there is no reverse option. A recent addition is to print all non-printing characters as ? so they may be seen. Tabs are not affected. Because of the problem with imbedded nulls (which caused failures) a mod has been made which changes these on input to 177. They are then displayed as ?. An example ged command file which takes advantage of a quirk in the editor but is very useful, is given in example.cmd. Some documentation has been found but is only in text form (i.e. not a runoff file). See file ued.d. The command 'qq' now will exit without the warning message. An invalid e command will not destroy the pointers any more. (as a check against people typing exit) The multi-char putbak routine has been fixed to work on 1 char. After looking thru the lastest release of this editor by the author, I have implemented upper/lower case conversions. The & character in the output side of a substitute command may have 3 escape sequences following: &\l same as & except convert to lower case. &\u same as & except convert to upper case. &\t same as & except toggle case &\r same as & except reverse all characters. The last option can be used (with some bit of dificulty) to reverse fields on a line (with multiple substitute commands). The D command may no longer have additional information on the line preceding the carriage return. This eliminates the possibility of two D's (caused by keyboard bounce) deleting 2 lines. DP is permmitted however. The 3.2 version of truncate seems to be in worse shape than 3.1. In 3.1 a file which was just created and was only 1 block long (e.g. 1/5) would not get truncated. In 3.2, when this occurs, the program doing the truncate gets hung or gives a `file accessed for write' error message. Hence, I have rein- corporated edi06 which nop's out the truncate and does a close instead. I think that this problem only happens when using the X command, (write NEXT version). In older versions of this editor, the escape character `\' needed to be dou- bly escaped in the rightside of the global command since it was removing each first escape character (looking for newlines). This has been changed, such that only the newline character itself needs to be escaped, thus a command like the one in example.cmd only needs the one escape character: g/.*/c//&=&/+c//(&)=(&)/+c//run &\/prm="test"/ /\ / \ / \ The following is the only current documentation on the l command. A few new modifications have been added recently to the editor. The `L' com- mand places you into `intra-Line' edit mode. It looks like: l or, l# or, lpattern or, l/pattern/ Where: # is a decimal number specifying the column to move the cursor to (on the current line) pattern is a regular editor pattern without the need for any delimeters around it. /pattern/ is also a regular editor pattern, used when one wants to begin with # or specfiy a previous pattern by specifying the null pattern // - note only the `/' is a valid delimeter here. When a pattern is specified, the first such occurance is matched. The cursor then appears on the first character of the pattern. When a number is specified that column number is moved to. If neither a pattern or a number are specified, then the previous margin tag is used. If none was set, then it goes to column one. Note that entering l mode using the column number option sets the margin tag to that column as well. Text is typed in place right on top of existing text. Various commands are available which permit manipulation of text and cursor placement. Commands in `L-mode' are the `escape', `carriage return' and various control characters. (Depress the control key simultaneously with the particular key) Command Summary J and K These are the cursor left and right keys j is left <--- and k is right ---> Y and H These are the up (Y) and down (H) cursor keys. Return This is used to move the cursor down AND return to the left margin. The left margin can be set to any column via either the l#, l/pattern/, or using the control-t command (see latter). The l/pattern/ is a variable margin. Escape This is identical to the Return command except the cursor moves Up first. Note: the Vertical cursor commands do not move the cursor but scroll the screen instead. Thus a window is allways maintained around the text being worked on. U Undo, This will restore the current line to its original state provided you have not moved the cursor to another line. Each time you move the line is permanently stored. Tab and B Tab is the standard tab feature, it does not place spaces into the text, it just positions the cursor. Control-B is a backtab. Do not use the backtab key as it will not work. W Word tab function. This moves the cursor to then next word (defined as letters and numbers). It wraps around if necessary T Margin Tag. Sets a left margin where the cursor currently resides. Subsequent escape or return commands move the cursor up or down but also back to the tabstop. E Enter text mode. This places you into a mode where each line ended with a carriage return will automatically insert a blank line after the current line. This mode ends with either another control-e or by exiting screen mode (with a control-n). P Position. This depends on a pattern. If a pattern was entered then control-P positions at the next occurance of the pattern. If the pattern was not on the line, no movement. Wraps if necessary. If no pattern was specified, move to tabstop. The control-t and control-p are mutually exclusive and also switch between the two types of margin settings. R and L These move text either right or left. All text from the cursor to the end of the line is moved. Data moved left past the cursor is deleted (like the del char local function on telerays ) Data moved to the right is not lost beyond column 80. It is lost after column 240 however. (right move is like insert char). A Adjust text. This moves everything on the right of the cursor over to the curser. Useful to line up comments. O Open text. This command first moves as far to the right as possible any text to the right of the curser. The movement is only cosmetic however and is done so that one may still see the text. Internally all text to the right of the cursor is blanked out (after it is saved away for later recall). Then you may type in text, position the cursor etc. When you type any of the following: control-E,Z,C, return, or escape The saved text is appended onto the end of the current line or if the line ends in spaces but the cursor is to the right of the end of the line, it will be tacked on at the cursor. Even if you overtype text which was moved to the right, it is still all attached to the end. N Control-N exits l-mode, currently any non-used control code may be used as well, but the N is the one most likely to stay. This is the way to specify that no pattern exists which has an effect on the T and P commands as well as escape and return. V This command splits the current line at the cursor. All text to the right is placed on the next line (where room has been made for it). If the cursor is at the beginning or end of the line it still splits the line but acts as though there were `null' strings. Thus if at the beginning of the line, it inserts a line and likewise if at the end of the line. The previous line (remembered and restored by the control-u) is not affected. This can be a problem, or it can be sneakily used to make copies of the current line. Try it to see what happens. Notes ----- Be very careful if you type beyond column 80. Sometimes the terminal will wrap the cursor for you with out the editor's knowledge. The next time you issue a cursor command you may end up in a place you did not expect. If you think the editor is lost, type control-N and a b l to redraw the screen. The screen is only a display and has no bearing on what is actu- ally stored internally. When at the top of the file and you attempt to go up one line you will be no- tified and the cursor will stay put. When at the bottom and you attempt to go down one line, a null line will be appended to the end of the file and you may continue to type. When entering and leaving l-mode the underline will be removed or restored. If undesirable, then the l option in command mode (*ol ) will toggle a flag which will turn off/on this feature. (only on teleray versions). Lastly, Control-? prints a 2-line quicky on the bottom 2 lines. I have been experimenting with (successfully) creating the editor as a mul- tiuser task (the M+ tkb is supplied on 3.2). To do this on 3.2 one can build it /mu then build a fake common area (like fcsres) which the readonly part of the /mu task is coppied into. Then build a second fake task which references the common area and copy the first library reference into the one the /mu puts into the task image (its the first one and it has the name field as null). Install the common and then the editor and it works. I have therefore put a conditionalization into the source of the editor which fiddles with read/only psect declarations. Note that Dec still can't handle directives which reference readonly psects (so don't move the mark times etc.). The sym- bol `mutask' if defined, activates readonly psect macros. The line buffer sized has been bumped to 240 or so now that we run a mul- tiuser task. (see lbs in edi00 if this is too large for your system). The control-z (from the editor, not from screen mode) exit has been changed to perform a write-attributes of the protection which is gotten via a read-attributes of the protection field on the last file read with an `e' command. The protection cell (edi00) is initally 160000 which is {rwed,rwed,rwed,r} for sys, own, grp, wld fields. The problem of running out of temp file space has been reduced somewhat as a missing `file close' on temp file i/o error has been put in. The editor used to simply refuse to do any further file opens (fsrsz of only 1). The problem of a `teco-ed to death' file is somewhat better. Oversize records are reported and truncated, but reading continues. The O? option now reports the f.err status left in f.err+fdb on the last file operation. The teleray requires delays (done with mark times) when rapidly scrolling and changing of field modifiers. However, the newer models have a faster repeat and scrolling thru a file would cause the return or escape's to be buffered via typeahead. This is undesirable since when one releases the key one wishes to have the effect stopped immediately. Edi07 has been modified to not delay when the distance to scroll is only 1 line or we are in `l' mode in which case only 1 line would be moved anyway. A new set of commands is possible if one permits 2 letter commands. Thus, to get more command possibilities, the N command means New command. Thus Nx will be a secondary dispatcher for new command x. Currently the Nc command is de- fined and is used to encrypt the file according to a key. Usage: (1,$)ncKEY... up to 40 chars (blanks count) This is just an implementation of software tools exclusive or crypting. Since asciz text and newlines are a problem, 8 bit ascii has been enabled. Only the newline and null characters are encoded in 8 bits. (1,$)ns#/from/to New Substitute This is a variation on the substitute command. It is identical except that the defaults are 1,$ and # to substitute all. Thus: ns/from/to is a change every occurance of from -> to. The editor now has a modest text processing capability. Text may be filled and right margin justified using the nf command. The command looks like: (1,$)nf n1,n2,n3... Where n1...n5 are optional and serve to set various parameters. The parameters are also displayed using the F command in window mode. Parameters: 1 left margin 2 right margin 3 indent factor may be 0 4 spacing 5 justify flag 0=no justify, 1=justify If any parameters are null, then the values are not affected. Example: To change only the indent factor to 5. nf ,,5 Line ranges are set using the T command. If line 0 is specified, then only the parameters are changed. The right and left margin may be set by having the program measure the current size of the first line to be formatted by specifying `.' as the only parameter. Example: nf. Line zero is also allowed with the `.' parameter. The tag function has been cleaned up somewhat. In most cases the tags are kept tied to the lines they were set on - even if moved, copied, or when portions are added and deleted. If the tags are on lines which are deleted the tags are moved up/down depending on which tag is deleted. If both tags are deleted, (i.e. the lines they were on) in one command, then tags are deleted also. Note that the tags are set on every range specified. Also, if the nf command is used and 1,$ is defaulted, the tags are set to 1,$. The z command still allows multiple line listings without affecting the tags (nor the location of dot). The macro command has been modified to permit either a tab or an `~' (wiggly character) to delimit the comment from the macro. Also, if a control b (ascii 2) is found in the text of the macro it is converted into a newline character on the putback. This enables multiple commands in a single line macro. Note that macros can call other macros in a nested fassion. The control-b is also used in the fill command to take the place of a blank which is part of the text. This can be used in the text if desired, but once the text is filled the control-b's are converted to spaces. In l-mode (screen mode) tabs and backtabs are handled entirely by the program which always outputs explicit cursor positioning commands. There is now a new option which permits half tabs (i.e. every 4 character positions instead of every 8). The oh option toggles this on and off. Default is off. Note that it has no effect on tab operations anywhere else. There is now a delete line function (tele-rays only) in l-mode. It is the control-g. The code for scrolling the teleray (in l-mode) has been shortened somewhat since it can assume that no field modifiers need to be fiddled with. This makes the screen scroll much faster giving a smoother responce. However, a bug exists now which causes the help text (control-?) to not be cleared and thus scrolls up the screen along with everything else.