EMAS-A Monday 13th February Extract from ECCE (found in file HELPER:AUXHELP.ECCEHELP last altered 31/05/88 at 16.29.44) ECCE ---- The Edinburgh Compatible Context Editor is available on EMAS as a standard command. It is described in the EMAS-3 User's Guide. References in [...] brackets in the summary sections 2, 3 & 4 are to descriptions (of new or modified facilities) given in sections 5, 6 & 7. Contents Page 1 The ECCE command 1 2 Simple commands 1 3 Summary of special (%) commands 2 4 Command Qualifiers 2 5 1985 (a): changes to ECCE 3 6 1985 (b): changes to ECCE 5 7 Jan/Feb 1986: Changes to ECCE 6 1 The ECCE command ------------------ ECCE(oldfile) - to amend an existing file ECCE(oldfile,newfile) - creates (or overwrites) 'newfile' with the edited 'oldfile', leaving 'oldfile' unaltered. ECCE(,newfile) - creates (or overwrites) 'newfile' 2 Simple commands ----------------- A ADJUST the current paragraph according to the %A parameters when in primary input mode [Section 5] ABSTRACT all text between the last NOTEd position and the file pointer when in secondary input mode B BREAK: insert a newline at the current position C cause CASE inversion of the next character if a letter D/TEXT/ DELETE the first occurrence of TEXT on the current line E ERASE the next character F/TEXT/ FIND the first occurrence of TEXT G GET a line of input H move HORIZONTALLY to the column number specified [Section 7] I/TEXT/ INSERT TEXT at the current position J JOIN the current line to the next line K KILL the current line L LEFT shift the file pointer by one character position M MOVE the file pointer to the next line N NOTE the current position (secondary input mode only) O OK the spelling of the word just queried (by Q) [Sections 5&7] P PRINT the current line Q QUERY the spelling of the next unknown word in the file [Sections 5&7] R RIGHT shift the file pointer by one character position S/STR/ SUBSTITUTE STR for the TEXT just FOUND, UNCOVERED or VERIFIED T/TEXT/ TRAVERSE TEXT. Move file pointer past next occurrence on current line U/TEXT/ UNCOVER TEXT. Remove all characters between the file pointer and the next occurrence of TEXT on the current line V/TEXT/ VERIFY that TEXT occurs immediately to the right of the file pointer W Macro invocation X Macro invocation Y Macro invocation Z Macro invocation ^ Mark the current position. Second use on same file line defines a string which can be referred to by @. [Section 5] 3 Summary of special (%) commands --------------------------------- %A Assign, or get report of, parameters used in ADJUSTing paragraphs (command 'A') [Section 5] %B write BACKUP copy to file ECCE#BACKUP %C CLOSE the editing session and delete ECCE#BACKUP if it exists %D control output of DATA (non-printable) characters [Section 6] %F FULL monitoring %H get HELP information (branches to View file describing ECCE) [Section 5] %I use contents of specified file as terminal INPUT [Section 7] %L LOWER case terminal (letter case in search strings significant) %M MONITOR normally (default) %O secondary OUTPUT mode %P save PROFILE of currently defined macros and modes %Q QUIT edit without writing output file; confirmation requested [Section 5] %R RETRIEVE state of file before last file-changing command line [Section 5] %S SECONDARY input mode %T TERSE monitoring (used to be %Q - quiet) [Section 5] %U UPPER case terminal (letter case in search strings not significant) %V VERIFY syntax (file assumed to be source IMP) [Section 7] %W-%Z Macro definitions; print current definition if new definition not given %^ Unwind editing to before last command line (cf %R) [Section 5] 4 Command Qualifiers -------------------- ( ) Bracket a group of commands for purposes of repetition and failure n Repeat last command line n times ? Optional execution of command \ Invert the failure condition - succeed if and only if the command fails , Alternative execution (IF-THEN-ELSE...) " Can be used in place of a text string; stands for the LAST string used with this command. Following Q, F" will find the next occurrence of the Queried word. [Section 5] @ Refers to last primary or secondary file text defined by use of a ^....^ pair. Thus I@, F@, U@, etc. [Section 5] !command Invoke an EMAS Subsystem command during editing; ECCE can be called recursively in this way 5 1985 (a): changes to ECCE --------------------------- %R Retrieves editing - unwinds to before last file-changing command line. %^ Unwinds to before last command line, whether it changed the file or not. %H Help facility - branches to VIEW command without closing edit session. %T Terse monitoring. (Replaces %Q - quiet.) %Q Quit (abandon edit). Y/N confirmation required following %Q. %A Adjust (formatting) facility. Used with 'A' command (see below). Adjusts paragraphs. Parameters are specified in the form >%A=pstart, start, line, justify, print, sgapxs E.g. >%a=0, 0, 75, 1, 1, 1 (these are the defaults) Any parameters not specified retain their former values. Parameters cannot be set negative; any attempt to do so is ignored. pstart: Starting column position for first line of paragraph. (Column positions go from 1 upwards - invalid settings are ignored.) If pstart=0, column position of start of first input line is used. start: Starting column position for subsequent lines. If start is greater than pstart, so that the first line of the paragraph is 'outdented' with respect to the remainder, then no spaces are added or removed from the outdented part of the first line when the paragraph is Adjusted. If start=0, column position of start of second input line is used. line: Column position for end of line (maximum). If line=0, column position of end of first input line is used. justify: =0 lines filled but not right justified #0 lines filled and right justified. print: =0 paragraph not printed as it is Adjusted #0 paragraph printed as it is Adjusted. sgapxs The number of EXTRA spaces to be inserted between sentences. Parameter settings are remembered by the Profile (%P) facility. >%A (no parameter settings) causes current settings to be printed. __________________________ A Adjusts current paragraph (lines delimited by blank lines or beginning or end of file), according to %A parameters (see above). No adjusting is done if current line is blank. In either case 'A' moves current position to start of next non-blank line. The meaning of 'A' in secondary input mode ('Abstract') is unchanged. " can be used instead of a delimited string. Refers to the last string specified with the command (D,F,I,T,V etc.) For example: >f/Fred/ s/Joe/ m3 f" s" first " = /Fred/, second " = /Joe/ Q Query spelling. Moves to next questionable word (i.e. not found in System dictionary or user's private dictionary). See also 'O'. A 'word' is any sequence of characters delimited by spaces or newlines, and discarding appended punctuation. Case is ignored, as are one-letter words. Once a questionable word has been found it will not be found again in the same session. Q can be followed by S, the text replaced being the questionable word. Following Q, F" can be used to find subsequent occurences of the word (see above). Any digit following Q specifies range of search, in lines. Thus Q3 looks for a questionable word in the next three lines - it does NOT execute Q three times. O Spelling OK. Can ONLY be used following Q - thus repetition (e.g. O2) is not allowed. Causes word found by Q to be put into user's private dictionary (text file ECCE#TDICT in user's process). The dictionary created by the Subsystem editor EDIT (file E#EDITDICT) will be used, and added to, if present; in this case ECCE#TDICT will also be added to, but will only contain the words OK'd via ECCE. If Q is not followed by O then the word is not put into the user's dictionary. ^ Can be used in a command line. Two occurrences delimit text within a line of the primary or secondary file, as defined by the current position when ^ is specified. Thus: Here^ is a short piece of text >f/short/^r0^ would delimit the text 'short piece of text'. Delimited text can subsequently be referenced by use of @ instead of a normal string. Thus: >f@ following the above command line would find the next occurrence of the string 'short piece of text'. The current position must stay on the same file line while the two ^s are given, and the file must not be altered during this process. The start and finish positions can be specified in either order. Further examples: >m-0(^r0^bi@m)0 causes every line in the file to be repeated. >^(rv/ /\)*^(pf@)0 marks the text from the current position to the next space (or end-of-line), and then locates and prints all subsequent occurrences of it. >L0P 17 1945 Dec >R2^R5^E-5R*I@P 17 Dec 1945^ useful for moving columns within a table 6 1985 (b): changes to ECCE --------------------------- When using ECCE on EMAS via PAD connections, it is possible to insert non- printable characters inadvertantly: for example, if one types Ctrl+H while inputting text, then a backspace character will end up in one's file, and the effect when the line containing it is printed can be rather disconcerting (the character before the backspace is overprinted by the character following it!). Other control characters which can cause trouble are TAB, ESC, FF. ECCE has therefore been changed so that all non-printable characters appearing in 'G' command input or in any text string are ignored. For those users who WANT to insert or look for control characters, the symbol '&' is now defined as a delimiter of text comprising hexadecimal digits. Thus, the form >I&1B& causes an Escape code (X'1B') to be inserted. Such strings can contain digits 0-9, A-F, a-f. The digits are taken in twos, each pair representing one byte. If an odd number of digits is contained in the string then a leading 0 is assumed. The form >i&^L& is also allowed, i.e. the circumflex symbol followed by another character. ^L in the above string stands for Ctrl+L (FF, or X'0C'). Output of non-printing characters --------------------------------- A new command, %D, is now provided. It can be assigned values 0 (default), 1 or 2: >%D=2 When ECCE prints a line containing non-printing characters, it does one of three things: 1) If %D=0 is in force, it prints the whole line, including control characters. 2) If %D=1 is in force, it prints a '?' at the position of the non-printing character. 3) If %D=2 is in force, it prints a '?' at the position of the non-printing character, and also rings the terminal's bell (if it has one). The form >%D (no parameter) gives an explanation of the facilities provided for outputting lines containing non-printable characters. The %D value can be saved for future sessions with ECCE, by use of the %P (profile) command. 7 Jan/Feb 1986: Changes to ECCE ------------------------------- 1) The command >%I=file is now permitted, where 'file' exists and is accessible for reading. It is assumed to contain a series of commands to ECCE, just as they would be typed at the terminal. When the %I command is given, the contents of the specified file are obeyed. The facility is also available with SHOW and RECAP. The %I facility is thus in a sense an extended form of the ECCE macro feature. Note that by using the '!command' facility to call a Subsystem command from within ECCE, it is possible to call ECCE itself, to edit the %I file contents during the ECCE session in which it is to be used. 2) Depending on whether ECCE, SHOW or RECAP was called, the editor will start by looking for a file called ECCE#START, SHOW#START or RECAP#START. If there is such a file, it will be obeyed like a %I file (see previous item). For example, if file ECCE#START contained %U (F/gold/PM)* M-* %L the effect would be that ECCE would start by printing out every line of the file containing the word "gold" (in small or capital letters), then move back to the start of the file. It would then prompt for user input in the normal way. If ECCE#START finished with %C, however, then ECCE would return to Command level directly. 3) The command H is now available. It causes the current position to be moved on the current line. For example, >H12 causes the current position to be moved on the current line (i.e. 'Horizontally') to just before column 12. This may mean that the current position is moved left or right, depending on where it is initially. If the line currently does not extend to the specified column then space characters are appended to it so that it does. Notes a) H is unusual in that it does NOT take a repetition count: as explained above, the number following it is a column number. b) H can be used in Secondary input mode, but will fail if space characters would have to be added to the line to reach the column specified. c) H0 and H are both treated as H1, the first column. 5) Spelling check facilities: embedded symbols (not letters and not digits) are now allowed within words; e.g. co-ordinate, ABCD99.DATA, d'Avignon. Previously such symbols were treated as word separators. The system dictionary used by the spelling checker within ECCE (and, incidentally, by EDIT) has been updated (February 1986), and now contains the same words as the dictionary used by the KNTLIB spelling checker SPELL. 4) >%V invokes an IMP syntax checker. The file being edited is assumed to be an IMP source program. The current position within the file when %V is used is irrelevant. The current position is moved by %V to the first detected error, or to the end of the program. Notes: a) %V does not take account of the declaration of variables, and thus will not detect 'name not set', 'name set twice', etc. b) %V does check that %begin/%end, %start/%finish and %cycle/%repeat are properly nested. If a nesting error is detected, a summary of the current incomplete nesting structure within the current routine (or function or map or main program) is given. c) The structure of the program is saved at regular intervals as the syntax check proceeds, to help speed up subsequent uses of %V (e.g. after a detected error has been corrected). d) %V can also be applied to secondary input files.