%ģ VAX-11 Librarian V04-00 9OŚ©ŒŽ@õ\Ś©ŒŽĒŚČ 5  MED ­@õ\Ś©ŒŽ1 MEDF Med, short for mined (pronounced mi'ned), is a screen editor,F that displays a portion of a user's file on the screen, and anyF changes the user makes on the screen go into the file. Mined'sF greatest advantage over other screen editors is the ease withF which it allows the user to manipulate multiple files in the sameB editing session on a conventional (non-workstation) terminal. 2 ConventionsF This manual will use the following conventions: all commandF and option names will be enclosed in <> pairs, and the nameF inside will only appear in upper case when the item is actuallyF being defined (this is designed to make searching through thisF manual for a particular item easy). If an option can take onF only a limited set of values then these values will be displayed in upper case.F Control characters will often be displayed by prefixing theF corresponding upper case character with `^', that is `^C' refers to control-C.F In a few cases brackets (`[' `]') will be used to indicateF optional items, and ellipses (`...') to indicate an arbitrary repetition. 2 Starting' Mined may be invoked by typing,A mined [[file][%[num]] ...] [_] [-qualifiers ...] F , that is, typing `mined' and optionally following it withF various arguments. An argument with a filename will cause minedF to read in that filename, and start editing it, if more than oneF filename is given (separated by spaces), then the first file willF be the one mined starts editing, the second file will become theF alternate file (which maybe obtained by pressing from theF main file), any other files can be read in by the sequence@ . Wildcards are permitted on the command line.F If a number follows the filename, then when the user firstF edits that file mined will position the cursor on that line ofF the file (if no number is specified the cursor will be placed onF the first line). Since it is often useful to move to the end ofF the file, the number 0 is treated as meaning the last line ofF whatever file mined is currently editing. The line number must- be separated from the filename by a `%'.F If mined is given no filename arguments it will try to read inF the last file edited by the user, and position him at the sameF place in that file. If it is desirable to edit the same file asF last time, but also read in a bunch of other files an argument ofF `%' may be used to specify the previous file, and `%number' aF specific line number in that file. If the second argument isF either a `%' or `%number' then the last alternate file will beF read in. If mined is unable to find any files to edit then it3 will ente r help mode (see the command).F If one of the files that mined is to edit does not exist, thenF mined will create it, and warn the user that it is new (on theF bottom line of the screen). If this was actually a mistake, thenF as long as nothing is typed into this file it will vanish after leaving mined.F An argument of `_' will cause mined to switch the main andF alternate files. If `_' is the only argument, then the old mainF and  alternate files will be read in, but the new main will be the# old alternate, and vice versa.F The qualifier arguments are usually unnecessary, and are/ discussed under the section on qualifiers. 2 LeavingF There are two main ways to leave mined: the command,F the (^C on most terminals) command typed twice.F Typing will normally save all the files that the user hasF changed, and then return to the shell (or DCL), this is whatF should normally be used. The sequence abort may beF used to exit if the user has performed some horrible damage toF one of the files he is editing and does not save any files. SeeF the section on the command for more information. ThereF are various other arguments that an may take to helpF specify which files to save and which to ignore, see the sectionF on the command for more information.  Two interrupts willF leave the editor in the fastest possible way, saving nothing, andF making no record of what files were used in the session. For1 some caveats on interrupts see that section.F It is also possible to leave mined temporarily with anF interactive shell. Pressing will cause mined to goF to sleep, and start up another process running the shell (DCL onF VMS), which is the program that normally interprets commands. F From here the user may execute commands, run programs, etc. TypingE logoff (on VMS) ^D or logout on UN*XF will exit and remove the subprocess and then return to mined. TypingD atm (on VMS) (no equivalent on UN*X since< shells are so fast)F will exit the subprocess but will retain it for furtherF sequences. This is particular ly useful if you "pop"F back and forth from the editor to DCL on VMS frequently. TheF sequence will not save any files, so the user shouldF do that beforehand. The sequence may be used toF save all the files that have changed in this session. ReturningF to mined from a subshell is faster that starting up mined again1 (since the files need not be read in again).2 Basic_editingF This section should provide an elemen tary overview of editingF with mined. The commands of mined will vary from terminal toF terminal so no actual character sequences are given here.F Commands are indicated in the following by enclosing them in <>F pairs (later on options will also be enclosed in <> so be wary),F to find out what sequences go with what command ask someone, or& if you are brave enter help mode.F To enter (or overwrite) text, position the cursor at theF p roper place in the file, and type. To insert text pressF , type, and press again (to get back toF overwrite mode). To erase the last character typed press theF command, to erase the last word type . To% start a new line press .F The cursor may be positioned by using the arrow keys to do theF obvious, the key to move to the next tab stop (usuallyF represented by a `T' at the top o f the screen), to moveF to the previous tab stop and a return to move to the start of the next line.F The part of the file displayed on the screen may be changedF with <+page> <-page>, <+lines>, <-lines>, , . ToF move a full page forward (toward the end of the file) pressF <+page>, to move a full page backward (toward the start of theF file) press <-page>. To move a few lines forward press <+lines>,F to move a fe w lines backward press <-lines> (a return at theF bottom line will also move forward). If a line is longer thanF can be displayed on the screen, pressing will shift theF display to the right (to view more of the line), willF shift it to the left, and a return will return to the left margin.F To insert a blank line press , to delete a line pressF , to get back the last line deleted press . ToF p ick up the current line (save it somewhere without deleting it)F so it can be put into the file at random places press , toF put a copy of the line picked up into the file press . ToF delete the character under the cursor press , to delete/ the word after the cursor press .F Most of the commands listed above can take a numeric argumentF indicating how many whatevers are to be done. To give theF command an argument p ress the argument and the command.2 For example to insert four blank lines press, 4F . To exit the editor press (this will save all the filesF that have been changed. To exit without saving any files pressF a. To save the current file press . To useF another file press the file name and , to create a+ new file go through the same sequence.F To search (forward) for a string ty pe search stringF <+search>, to search backwards use <-search>. If no argument isF given to a search then the last argument will be used. To do aF search and replace (search for this string and replace it with this string) type,< search string replace string <+search>0 . A backward replace is similarly handled.F To get help press the command. This may seem circularF since it seems that you cannot get help until you know how (knowF the commands) at which point help is unnecessary; however, whenF the editor starts running it displays the character sequence forF the help command on the bottom line of the screen (this sequenceF will usually have funny blobs in it, these blobs indicate thatF the following character is a control character). Typing thisF sequence will usually put you in a brief help file devoted to theF terminal you are on, which will give what the commands are forF that terminal. If there is no such file for your terminal, thenF you will be forced to look at this monstrosity (which as you knowF is useless), however, do not despair. Pressing the commandF (Now if you don't know what this is you are in trouble) puts youF in the table of commands the editor keeps internally; it is3 rather cryptic but may be better than nothing.F If you do not like the way mined behaves, you will often fi!ndF that there is an option built in that will make mined work betterF (from your point of view). A description of what options do isF found in the section options, the description of each commandF should also state how that command is affected by mined'sF options. Options and commands may all be changed by going intoF the help list, and editing them to take on the desired values;F once this has been done correctly you will probably want to save "F what you have done (so that you don't have to change options eachF time you enter mined), this may be done by pressing whenF in the help list. For a better description see the command.2 Error_recoveryF Everyone makes mistakes. Mined has a number of ways to help' prevent mistakes from being fatal.F The most obvious problem is deleting something that should notF have been deleted. Almost all commands that delete thi#ngs (notF the ones that delete characters (since they are easy to getF back), but every other one) will put the text deleted in aF special buffer, called the restore buffer, text may be retreivedF from here by the command. Only the last thing deletedF will be saved in the restore buffer, but there is a special fileF called `#' which contains all the text that has been in theF restore buffer. The user may examine this file (# $)F find the text he deleted, pick it up (with the command),F go back to his original file (with ), and insert it where itF should be with the command. Note a rather peculiarF feature; text is not put in the # file until it has been removedF from the restore buffer, so the last line deleted is not in this file.F If the user discovers that he has totally destroyed the fileF he is editing, he can restore it to the condi %tion it was in theF last time it got saved by $reload( $fileF ), which will read the file back off the disk,, and get rid of the copy the editor had.F If the user discovers that he has totally destroyed all theF files he is editing, then he can use an abort exitF (a), to leave mined without saving any files. If itF is too late, and he has already saved some files (thus destroyingF t &hem), mined may have made backup copies of these filesF (depending on the option), which will contain the state& of the file when editing started.F Even assuming that the user has behaved perfectly, there areF still two other sources of errors, the computer, and minedF itself. The computer may run out of disk space, when thisF happens mined will detect it and inform the user that he may notF save files (if the user is trying ' to exit at the time, mined willF return to editing, and inform him that there was no disk space).F When this happens the user has several choices: he can ignore it,F and hope the problem will go away (that is continue trying toF save), he can attempt to save on a different file structureF (disk) that might have more space, or he can start an interactiveE shell (), and see if he can find any files to remove.F If the computer goes down, or (if mined crashes (or if the userF is "gandalfed"), then mined may have kept a record of all theF commands typed in, except for the last few, and this record may8 be used for recovery (see the section on recovery).2 Screen_displayF The screen is usually divided into several windows, of whichF the biggest is the file being edited. There is also a windowF down on the bottom line displaying status information (the nameF of the current file, th)e current line, etc.). As editingF progresses the screen can be divided into more windows, each withF its own files (or even several with the same file). NormallyF each window containing a file is surrounded by a box (to separateF them from other windows). Each border of the box around theF window currently being edited can convey some information. IfF there is a number in the upper left corner of the window then theF file has been shifted over; *the number indicates first column ofF it that is visible. The top border will often display severalF little tick marks (perhaps `T's); these indicate where tab stopsF have been set. The left border can indicate whether there isF text on the line, and if so whether the file is shifted over.F The right border can indicate whether there is any text out toF the right. The bottom border is useless. Any of these bordersF may be turned off, in which + case the lines or columns used to7 display them will be available for normal editing.F The user can set what is to be displayed on the status lineF (with the option), or even leave it invisible (inF which case it will be used for normal editing when possible).F Whenever mined feels that the user needs to be informed ofF something (search failure, that it is saving a file, etc.) itF will display a message on this line. Whenev ,er the user needs toF type an argument to a command, it will also be displayed on the bottom line. 2 FilenamesF Mined will accept a network nodename, access control string,F and disk in the standard format (optionally with colons replacedF by tilde). If a logical name is given followed by either a colonF or a tilde, and no nodenames have been found at that point, thenF the logical name will be translated. A standard DEC directoryF list may- follow; in fact, an expression like [FOO][BAR] isF accepted and becomes [FOO.BAR]. This is very useful since itF means that a logical name may contain a subdirectory list, andF then further subdirectory information may be given later. A pathF spec may also be given in the unix style or even in a mixture ofF the two. If a path spec begins with `/' then the logical nameF `SYS$UNIX:' will be translated and prepended to the rest of theF path spec.. If the first two characters are `~/' then the user'sF home directory (`SYS$LOGIN:') is translated and prepended,F `~mined/' prepends the mined home directory, and on some systemsF `~username/' will prepend that user's home directory. If none ofF these apply then the current directory is prepended.F Subdirectories may be specified by seperating directory namesF with `/'; there are also two special directory names `.' andF `..'; `.' i /s a noop, `..' means go up one level in theF subdirectory tree. Thus if SYS$UNIX = DR0:, SYS$DISK = DB1:,F SOURCE = SYS$UNIX:[USR.CMD.SOURCE], the users home directory isF DB1:[USR.TXR29970], and the current path is set to$ DB1:[USR.TXR29970.FOOBAR] then:< /sysexe/loginout.exe = DR0:[SYSEXE]LOGINOUT.EXE3 SYS$DISK~usr/bin/ls = DB1:[USR.BIN]LS8 SOURCE~../egrep.c = DR0:[USR.CMD]EGREP.CD ~/foobar/bigfi 0le = DB1:[USR.TXR29970.FOOBAR]BIGFILEA spam = DB1:[USR.TXR29970.FOOBAR]SPAM# spamsourc/spam.for =E DB1:[USR.TXR29970.FOOBAR.SPAMSOURC]SPAM.FORA [usr]txr29970/foobar/spam = DB1:[USR.TXR29970.FOOBAR]SPAM> timevx~~user~gww29971/foo = TIMEVX::USER:[GWW29971]FOOF . In many programs that use RMS, filenames that happen to be theF same as logical names are always treated as logical names. ThisF 1 will not happen in mined, logical names are only translated if- they are followed by a colon or a tilde.F If an access control string is given without a password (ieF with just a username) then mined will prompt for the password;F the password will not be echoed, and will not be placed in theF keystroke file. The password may be edited while being typed inF with RUBOUT, or ^H to delete the last character, ^U to delete theF entire entry, ^W 2 to delete back to the last space, and may be/ terminated with either RETURN or LINEFEED.F If no directory, device, or node specification is included inF a filename, then mined will search for the file on a list ofF directories called MPATH (which may be set from the environment,+ command line, or the function $mpath). 2 WildcardsF Mined accepts a unique set of wildcards that is a mixture ofF the unix and vms standards. A `?' may be u3sed to match anyF single character (it may be used inside a version number), theF curly brace characters `{}' may be used to enclose a set ofF characters one of which must match, a `*' may be used toF represent an arbitrary number of characters inside a directoryF name, a filename.extension, or a version number. If theF characters `...' are found where a directory is expected, then@ they refer to all directories below that point in t 4he tree.F These wildcards may be specified on the command line, or as an) argument to the $startwild function. 2 QualifiersF A qualifier is a command line argument beginning with eitherF `-' or `+'; they are used to set various flags in mined.F Qualifiers may be specified in any mix of upper and lower case,F and may be abbreviated as long as the specification is unique.F The argument of a qualifier is started by a `:' or an `=' and its 5B meaning is dependent on the qualifier. Valid qualifiers are:/ -medfile=file Specify an med file/ -cap=file Specify the termcap6 -home=file Specify the home directoryC -minedhome=dir Directory containing default .med filesH -term=arg Specify a terminal type (for use in termcap), -help Enter help mode.A -tempfile=file Specify a file to save editing statusB -keystroke=f6ile Specify a file to save user keystrokesF -shell=file Interactive shell to be run by B -comini=file Specify a macro to be done at start upM -tranini=file Specify a translated macro to be done at start upJ -recover=file Specify a file to be used to recover a session? +search=arg Search forward for arg in main file@ -search=arg Search backward for arg in main file/ -mpath=arg Se 7t the search path3 -sleep Mined may be restarted. 2 EnvironmentF If mined cannot find information anywhere else it will attemptF to read the following items from the environment. TheF environment is a set of global variables that the shell sends toF all its subprocesses, thus an environment variable need be setF only once. Instead of having to use the -term qualifier eachF time mined starts, the user need only set the 8TERM variable whenF he logs in. Under VMS the environment is simulated by logicalF names (formed by prepending a `$' to the variable name), thus theF logical name $TERM will be used for the environment variable5 TERM. The user may set this variable by typing,$ $ ASSIGN terminal_type $TERMF , where the "terminal_type" should be a name contained in theF TERMCAP.; file. The accepted logical name (environment) variables are:/ 9 $TERM The terminal type.0 $TERMCAP The termcap (file).0 $HOME The home directory.A $MINEDHOME The directroy containing .med files.) $MEDFILE An med file./ $SHELL Interactive shell.) $TEMPFILE A temp file.. $KEYSTROKE A keystroke file.; $COMINI A macro to be done at start up/ $TRANINI A translated ma :cro0 $MPATH Set the search pathF . In addition to the above, mined will also read the chain ofF logical names $SPL_DICTIONARY, $SPL_DICTIONARY_1,F $SPL_DICTIONARY_2, and so on. It will search the process logicalF name table for such a chain (stopping when one of the logicalF names fails to translate), then the group table, and then theF system. Each name that translates is treated as a path spec forF a dictiona ;ry to be loaded into the spelling corrector, if theF file does not exist mined will not complain (thus it would beF reasonable to have a system wide logical nameF $SPL_DICTIONARY=SYS$LOGIN:mined.dct, giving each user his ownF dictionary that is automagicly read in, if it is present, and ignoring it if it is not.2 Character_formatF When mined displays a character it will usually display it asF itself; however, there are< exceptions. All control charactersF are displayed as a special blob followed by the character beingF controlled (thus a control-A might appear as []A), a ruboutF character is displayed as two blobs. These blobs are treated asF though they were normal characters by most commands (thus it isF possible to search for the next blob, to delete a blob and leaveF the controlled character in its uncontrolled state, etc.), sinceF there is no key on most t =erminals labelled blob, there is a8 special command to generate this character.F When mined reads in a file it converts all control charactersF to their blobbed equivalent with the following exceptions:F control-J will be used to terminate a line, and control-I (tab)F may (depending on ) be converted into multipleF spaces. These conversions do not happen when mined is editingF text, so the user can insert a control-J >into the middle of aF line if he wants. When the file is read back in it will be usedF to break a line. When saving a file, all blobbed characters areF converted into the obvious control character, and multiple spaces> may be converted into tabs (depending on ).F Parity characters are not distinguished from normal charactersF on the display but the parity bit will be retained when inside aF file (thus reading in a file and saving it will not ? change it).F These characters have a special meaning inside translated macrosF (they represent commands). Parity characters may be added withF the $addchar function to . Searching will ignore theF parity bit, parity characters are not allowed inside a commandF character sequence, nor on the enter line (in these cases the bitF will be stripped off). A parity control-J or control-I will not& be treated as a newline or a tab.2 Changing_text @F The most necessary part of editing is entering text, in minedF this is easy, any printing characters typed by the user will beF put in the current file where the cursor is pointing, and theF cursor will move over one space to make room for the nextF character. Mined will either overwrite what was under the cursorF before, or move the rest of the line one space to the right andF insert the new character (if there is no text after the cursor onF A the current line these two modes are equivalent). The user mayF toggle between insert and overwrite modes by the command.F The user may also request that mined fill or justify text asF it is typed in. When filling multiple spaces are removed (unlessF they follow a period or some other character that terminates aF sentence (determined by the option), or unlessF they are leading spaces (indentation)). When Bthe user typesF beyond a certain point on the line (determined by the F option) mined will move to the next line, usually taking the wordF being typed along with the cursor. This word will be moved toF the next line, and indented by the same amount as the previousF line. If the user is typing at the end of a paragraphF (determined by the options , and )F then new lines will be added, otherwise the cursor wCill be movedF to the appropriate place on the next line (which will be refilledF to make room for any new words). When justifying, the line willF be filled first, and then justified. The last line of aF paragraph is never justified, only filled. Mined is somewhatF smart about control characters, it knows that control-H takes upF -1 spaces, and it assumes that all other control characters takeF no room; thus unfillable spaces may be inserted Dwith spaceF H space (this will look ugly in mined, but it will printF out properly). Normally mined does none of this processing andF leaves the text as entered, this is controlled by the option.F Some people like to pretend they are on a typewriter where theF bell rings whenever they type close enough to the right margin;F this may be done in mined by setting the optionF appropriately. Usually this flag is set Eto NEVER (never ring theF bell), because mined has better ways of doing this: either byF allowing mined to break the line automaticly in auto-fill orF auto-just modes, or by allowing mined to shift the screen overF whenever a character is typed on the right margin ( option).F One rather useful feature when programming (especially inF LISP) is automatic parenthesis matching (determined by theF and options). If this is set, thenF whenever a close parenthesis (determined by the F option) is typed a matching open parenthesis is searched for, andF the cursor is moved briefly to the open paren. If the closeF parenthesis is of a different type from the open parenthesis (orF if no open parenthesis is found) then the user may ask mined toF beep to indicate this mismatch (determined by the option). G 2 MessagesF Mined sometimes feels the need of giving the user a message,F this may occur because of an error (search failure, disk fullF when saving, etc.) or because the user asks for information.F Most messages will fit onto one line of the screen, and theseF will be displayed on the bottom line of the screen, errorF messages will stay on that line for commands, andF informative messages for one command (typing in t Hext does not affect the message).F If the message turns out to be longer than one line, thenF mined will take over part of the screen to display the text. TheF message will be typed out beginning on the line beneath theF current one, if this message takes more than just one screenfullF then mined will pause, and display `--- More---' at the bottom ofF the screen. To get more text the user should type a space, toF restart the message typeI a , to abort (get out of messageF mode) type any other command (this command will not be executed).F When mined reaches the end of a message a space will have noF effect, a will type the whole thing out again, and7 anything else will return to normal command level.F When in message mode, all input comes from the terminal, none will be read out of macros. 2 Commands= The following is a brief description of the commands:( J Normal editing seesion commands:G ENTER Start an argument sequence ( for another command).? RECALL Recall the last noncursor-motion argument.: ARG Enter a second argument to a command.< BACKS Delete the character before the cursor.7 BACKWORD Delete the word before the cursor.< DELCHAR Delete the character after the cursor.= DELWORD Delete the word beginning at the cursor.; QUOTE K Allow the insertion of a control char.( INSRTMD Toggle insert mode.4 LEFT Move the cursor one space left.5 RIGHT Move the cursor one space right.1 UP Move the cursor one line up.3 DOWN Move the cursor one line down.9 TAB Move the cursor to the next tabstop.> BACKTAB Move the cursor to the preceding tabstop.0 RETURN Move to start of next line.= INSERT_RETURN Insert L a newline and move to next line.9 HOME Move to upper left corner of screen.> +PAGE Move one page toward the end of the file.@ -PAGE Move one page toward the start of the file.A +LINES Move a few lines toward the end of the file.7 -LINES Move a few lines toward the start.9 RSHIFT Shift the screen a few spaces right.8 LSHIFT Shift the screen a few spaces left.( GOTO Goto specific l Mine.# MARK Set/goto mark.( REFRESH Refresh the screen.D +SEARCH Search for a string toward the end of the file.9 -SEARCH Search toward the start of the file.? +REGULAR Search for a regular expression toward the% end of the file.9 -REGULAR Search toward the start of the file.) OPEN Insert a blank line.0 CLOSE Delete a line, and save it.1 RESTORE Put down Nlast thing deleted.G PICK Pick up text (without deleting) and put in buffer.; APPEND Pick up text and append to the buffer.' PUT Put down the text., STORE Put text into a buffer.D EXIT Exit from the editor, saving all changed files.' USE Edit another file.$ SAVE Save this file.9 WIND Edit another file in its own window.$ CHWIND Change windows.. FILL O Fill or justify the file.H DO Execute a program to process a portion of the file.% HELP Enter help mode.< STATUS Examine the status of the files edited.8 SET Set the flags for the current file.) SRTAB Set/Reset a tabstop.- INTER The interrupt character., SIGNAL_STATUS Information interrupt.6 Editing session macro and evaluation commands:7 ENTER_COM Enter a mined com Pmand in the file.B TRANSLATE Translate the file to or from command format.7 EXECUTE Execute the file as a mined macro.I EVALUATE Use the contents of the named buffer as an argument.C DO_EVAL Evaluate an expression and ignore the results.- WHILE Start a repeat sequence.4 IF Conditionally execute commands.4 ELSE Conditionally execute commands.A END End a repeat sequence (and start exec Quting).+ STOP_REPEAT Abort an input stream.C MACRO_RETURN Return from a macro or a user defined command.' MSG Display a message.* INPUT Get text from a user.- BRK Enter the macro debugger 3 F The enter command is used to enter an argument(s) for aF command, which may consist of cursor motion or normal characters.F An argument containing normal characters may also include theF Rcharacter; it may be edited using the command toF delete characters and to delete words. Typing F again will always return to normal mode. A cursor motionF argument consists of several cursor motion commands, and is usedF to define a set of lines, or a rectangle over which the finalF command is to take effect (Cursor motion may be started by one ofF the following commands , , , , ,F , , , <+page>, <-page>, (and perhaps variousF user defined commands) and may be continued by any of the aboveE or , , , <+lines>, <-lines>, <+search>,F <-search>, <+regular>, <-regular>, , (these have other2 meanings if used directly after an )).F When is typed a blob appears on the screen where theF cursor was, and a prompt appears on the bottom line. The userF should type his argument, and T then enter the command. The blobA and prompt will disappear, and the command will be executed.3 Text_argumentsF Many commands need to specify a lump of text (to be deleted,F picked up, etc.); all of these commands will accept severalF different ways of specifying the desired text. There areF essentially two different types of arguments, cursor defined (theF movement of the cursor defines the text) and numeric (a specifiedF number of worUds, or paragraphs, etc.). These arguments may beF used three ways: as a number of lines, as a rectangle of text, orF as text starting from one location and going to another. OftenF mined will use the type of the argument to determine how to pickF it up, for instance a sentence specification should pick up text,F a line specification lines; however, cursor motion (and doubleF mode specifications) are treated differently. If isF set for WRAP, Vthen the text beginning at the initial cursorF position (where was pressed) to the final cursor positionF will be dealt with. If this option is set to RECTANGLE and thereF is no horizontal separation between the initial and final cursorF positions then the text used is all the lines from the initial toF the final line (inclusive). If there is horizontal separation,F the text is the delineated rectangle beginning at the initialF line and terminati Wng at the final line (inclusive) and beginningF at the leftmost horizontal position, and terminating one space# before the rightmost position.F A numeric specifier is of the formF [number][mode][,][number][mode]. If the full form is used thenF one number mode pair is used as a horizontal, and the other as aF vertical separation to define a box as above (which depends onF the option as the cursor motion box does X). The modeF specifies the type of thing to use, and the number specifies theF number of those things to deal with. If the number is omittedF then 1 is assumed, if the mode is omitted then `l' is oftenF assumed ( assumes `c' and which uses `w', etc.F ), if both are omitted then 1 of the default mode will be used. Valid modes are: c characters w words s sentences) e s- Yexpressions (vaguely) l lines b paragraphs p pages f files, n white space (non-printing)F . A character specifier defines a number of characters (this isF limited to one line), a line is fairly obvious, a paragraph isF delimitted by blank lines, indentation (depending on theF option) or by a line beginning with one of theF characters in ; Za page by a line starting with aF formfeed (^L), a file specifies the rest of the file. A word isF delimitted by the end of the current line, a space, a tab, aF comma, a semicolon, a period, an exclamation point, a questionF mark, a quote character, parentheses, brackets, and curly bracesF (these may be changed with the option, beware thatF decimal points in numbers are treated as periods). A sentence isF delimitted by a blank line, o [r a period, question mark,F exclamation point (these may be changed with )F followed by either a space or the end of the line. An s-F expression is either a word, a comment, a parenthetical element,F a quoted string or a single character that does not start any ofF these. The number may be either positive or negative, and2 indicates the direction of the specification. 3 F The command is used to \recover from mistakes inF ed arguments. Typing causes the editor to goF into enter mode, and display the last argument; this may beF edited in the normal fashion. Cursor motion may not be' recovered, and nulls the argument.3 F This command is used to pass several arguments to a command;F if used after an (or or ) it willF start a second argument (or nth) argument, if used elsewh ]ere itF will behave like an . may separate two typedF arguments, in which case the command may be used toF correct the first argument; if seperates a cursor definedF argument from a typed argument, there is no way to go back and revise the first argument. 3 F The command is used to delete a character in front ofF the cursor. It moves the cursor back one position, if this wouldF move the ^cursor off the screen, the screen is left shifted (theF reverse of typing a character on the right margin), if the cursorF is on column one then the option will be used toF determine behavior. If insert mode is on then the preceding charF (the one on top of which mined has just placed the cursor) willF be deleted and the rest of the line moved over to take its place,F in overwrite mode this character will be converted to a space.F does _ not set the restore buffer, any characters deletedF are lost. may not be given an argument (if used after anF enter it will delete the last character in the entered argument,$ and will die on cursor motion). 3 F The command is used to delete the word in front ofF the cursor. It moves the cursor back to the beginning of theF word, if this would move the cursor off the screen, the screen isF left shifted (the reverse o`f typing a character on the rightF margin), if there is no word in front of the cursor on theF current line and the option is on WRAP then the cursorF will move back over several lines until it finds a word,F otherwise ( is set to LINE) it will stick where it is.F When in insert mode any lines and characters passed over areF deleted, in overwrite mode the lines are left, and the charactersF are converted to spaces. may not be given an argumentF (if used after an enter it will delete the last word in theF entered argument, and will die on cursor motion). Any wordF removed (except from the enter line) will be put in the restore (!) buffer. 3 F The command will (by default) delete the characterF on which the cursor is positioned. will accept a textF specifier as an argument (see the subsection TEXT ARGUMENTS)F b where the default mode is character. deletes toF the end of the current line. does not set the restore8 buffer, any text deleted with this command is lost. 3 F The command will (by default) delete a word. WhereF a word starts at the cursor, includes any leading spaces, tabs,F and marks of punctuation, and contains any text up until the theF next word delimitter. will accept a text specifier asF c an argument (see the subsection TEXT ARGUMENTS) where the defaultF mode is word. If is set to WRAP, and more words areF specified than are on the current line, words will be deletedF from following lines. moves the cursor back toF a word delimitter, and does a normal there (that is itF deletes all of the word the cursor is sitting on. Any text. deleted is put in the restore (!) buffer. 3 F The d command is used to insert control characters in aF file. When saving a file (or executing a program) a F character followed by another character generates the control ofF the following character. That is A generates control-A,F etc. The sequence is a special case, and means aF rubout character. When reading in a file (or the output of aF program) control characters and rubouts will be translated to theF corresponeding sequences with the following exceptions:F newline (control-J) characters are used to delimit lines, and tabF (control-I) characters may be converted to the proper number ofF spaces (assuming tabstops every 8 characters). When insertingF text putting a I or J in the middle of a file willF not have any special meaning. A character behaves justF like a normal character except that for display purposes anyF character ffollowing is converted to the range of @ through _F inclusive. characters may be used as arguments to some commands. 3 F The command is used to toggle whether the editor isF in insert or overwrite mode. In overwrite mode characters typedF overwrite those on the screen, in insert mode characters typedF cause the rest of the line to be moved over to make room for theF new arrivals. also changes the effect gof andF , in overwrite mode these move back and change theF indicated character(s) to a space(s), in insert mode these moveF back and delete the text. will turn insert modeF on, will turn it off, any other argument is illegal.3 F The command moves the cursor one space left, if thisF would cause the cursor to move off the edge of the screen, thenF either the cursor willh appear at the right margin, or the screenF will be shifted (depending on option). F will accept an integer as an argument, and will perform that manyF s, the integer may be negative, in which case that manyF rights are performed. The integer may also be followed by a `w'F (`s', `e'), in which case the cursor moves over that many wordsF (sentences, expressions). As a special case the argument ^ isF accepted, and moves the i cursor to the first column with text onF it (or to column one, if either there is no text on the line, orF is set to SAVE), if the column is off theF screen, then the screen will be shifted to make it visible. This5 maybe used inside of, or to start cursor motion. 3 F The command moves the cursor one space right, if thisF would cause the cursor to move off the edge of the screen, thenF either the cursor will apjpear at the left margin, or the screenF will be shifted over to make room for it (depending on the valueF of ). will accept an integer as anF argument, and will perform that many s, the integer may beF negative, in which case that many lefts are performed. TheF integer may also be followed by a `w' (`s', `e'), and the cursorF moves over that many words (sentences, expressions). As aF special case the argument k $ is accepted, and moves the cursorF immediately after the last column that has any text in it (thisF does not include trailing spaces unless is setF to SAVE). If this column is off the screen, then the screen willF be shifted so that this column appears near the middle of theC screen. This maybe used inside of, or to start cursor motion.3 F The command moves the cursor to the next tab stop. AF from the r light margin moves to the first tabstop on theF screen. A that would place the cursor off the screen,F either moves it to the right margin, or shifts the screenF (depending on the value of ). will acceptF an integer as an argument, and performs that many s. This5 maybe used inside of, or to start cursor motion. 3 F The command moves the cursor to the preceding tabF stop. A from the left margin will either move theF cursor to the last tabstop on the screen or shift the screen toF find a preceding tab stop (depending on the value ofF ). Any other that would move the cursorF off the screen, will either position it on the left margin, orF shift the screen (depending on the value of ).F will accept an integer as an argument, and performsF that many ns. This maybe used inside of, or to start cursor motion.3 F The command moves the cursor one line up on the screenF (toward the start of the file). If this would move the cursorF off the top of the screen, either it appears at the bottom, orF the screen is scrolled (depending on the value ofF ). will accept an integer argument, andF performs that many s. This maybe used inside of, or to sotart cursor motion.3 F The command moves the cursor one line down the screenF (toward the end of the file). If this would move the cursor offF the bottom of the screen, then either it appears at the top, orF the screen is scrolled (depending on the value ofF ). will accept an integer argument, andF performs that many s. This maybe used inside of, or to start cursor motion. 3 pF The command moves the cursor to the beginning of theF next line. If the cursor is on the last line of the screen, thenF a will cause the screen to be scrolled (the amountF determined by ). The horizontal position of theF cursor is determined by the option. The cursor mayF be placed on the left margin, or in column one, or move to theF first non-space character (unless the line is blank, qin whichF case the indentation of the previous line will be used).F takes a positive integer argument to say how manyF returns to do, or a fraction of the screen. This maybe used* inside of, or to start cursor motion.3 F This command splits the current line at the cursor position,F and creates a new line beginning with the character under theF cursor. the cursor is then positioned at the start of the n rewF line (if this entails shifting or scrolling the screen it will beF handled as in ). If is on INDENT then theF new line will be indented the same amount as the previous line.F takes a positive integer argument to say how many newlines to insert.3 F The command moves the cursor to the upper left cornerF of the screen. It will not accept an argument. This maybe used* inside of, or to start cusrsor motion. 3 <+PAGE>F The <+PAGE> command moves one page toward the end of the fileF (a page is defined to be the number of lines in the currentF window). It takes an argument specifying the number of pages toA move. This maybe used inside of, or to start cursor motion. 3 <-PAGE>F The <-PAGE> command moves one page toward the start of theF file (a page is defined to be the number of lines in the currentF window). It takes an argu tment specifying the number of pages toF move. This command will not move before the start of the file,F an attempt to do so will stop at the start of the file. This5 maybe used inside of, or to start cursor motion. 3 <+LINES>F The <+LINES> command moves about one third of the number ofF lines in a page toward the end of the file (determined byF ). It takes an argument specifying the number ofF lines to move, or a screen ufraction. <+LINES> moves theF current line to the top of the screen. <+LINES> may be used in4 cursor motion (but not to start cursor motion). 3 <-LINES>F The <-LINES> command moves about one third of the number ofF lines in a page toward the start of the file (determined byF ). It takes an argument specifying the number ofF lines to move, or a screen fraction. This command will not moveF before the start of the file, van attempt to do so will stop atF the start of the file. <-LINES> moves the current line toF the bottom of the screen. <-LINES> may be used in cursor motion& (but not to start cursor motion). 3 F The command shifts the screen over so that long linesF may be read. By default it shifts the screen two tab stops toF the right (determined by the option), if the space ofF two tab stops is larger than the window width then w one fourth ofF the width plus 1 is used. will accept an integerF argument specifying the number of columns to shift, an integerF followed by `t' specifying the number of tabstops to shift, or aF screen fraction. makes the current column becomeF the left margin of the screen. may be used inside of& (but not to start) cursor motion. 3 F The command shifts the screen left so that theF x beginning of long lines may be read. By default it shifts theF screen two tab stops to the left (determined by the F option), if the space of two tab stops is larger than the widthF then one fourth of the window width plus 1 is used. F will accept an integer argument specifying the number of columnsF to shift, an integer followed by `t' specifying the number ofF tabstops, or a screen fraction. makes theF y current column become the right margin of the screen (if that isF possible). may be used inside of (but not to start) cursor motion.3 F The moves to a specific line in the file. A F without an argument moves to the start of the file. AnF moves to the end of the file. A with aF signed argument moves that many lines forward or backward in theF file. A with an argument zof 0 moves to the end of theF file. A followed by some other integer moves to thatF line. may be used in cursor motion (but not to start cursor motion).F If the line gone to is on the screen, no scrolling will beF done, otherwise the position of the new line (on the screen) isF determined by . The horizontal position of the3 cursor is always determined by .3 F Every file ins{tance contains a mark, initially this mark isF set at the end of the file. The command allows the userF to go to the mark, and to set the mark. will goto to theF mark. will set the mark to the current line.F will set the mark to the current line, andF move to the old mark. with a numeric argument will setF the mark on that line. may be used in cursor motion (but! not to start cursor m |otion).- The cursor is positioned as in 3 F The command is used to retype the screen. IfF someone has sent a message, or if (heaven forbid) the editor didF not update the screen properly, or if the screen has just decidedF to disappear of its own accord this command will bring it back.F If is used immediately after an it will refreshF the current line, if is given an argument of th }enF it will update the screen without clearing it (this is onlyF useful in macros), if used with any other argument, it behaves asF it normally does, and clears the screen (but leaves the argument intact). 3 <+SEARCH>F The <+SEARCH> command searches toward the end of the file forF a string. If it is given an argument, it will search for that,F otherwise it will use the last string searched for. As theF search occurs a message will a~ppear on the bottom specifying theF direction of search, and the search string. If the searchF succeeds the cursor will be moved to the matching textF (scrolling, and shifting the screen if necessary). If the searchF fails the cursor will remain where it was, and a messageF indicating failure will appear on the bottom line. InF significant case mode, a backslash will cause a letter followingF to match in either case. In  case insignificant mode (whereF letters match in either case), a backslash will force an exactF match. An may be used to abort a search (whenF is set to COOKED). <+SEARCH> may be used in cursorF motion (but not to start cursor motion). For more information# see the subsection on REPLACE. 3 <-SEARCH>F The <-SEARCH> command searches toward the start of the fileF for a string. If it is given an argument, it w€ill search forF that, otherwise it will use the last string searched for. As theF search occurs a message will appear on the bottom specifying theF direction of search, and the search string. If the searchF succeeds the cursor will be moved to the matching textF (scrolling, and shifting the screen if necessary). If the searchF fails the cursor will remain where it was, and a messageF indicating failure will appear on the bottom  line. InF significant case mode, a backslash will cause a letter followingF to match in either case. In case insignificant mode (whereF letters match in either case), a backslash will force an exactF match. An may be used to abort a search (ifF is set COOKED). <-SEARCH> may be used in cursorF motion (but not to start cursor motion). For more information see the following section. 4 ReplaceF Re‚placing text is part of the search commands. These commandsF actually take two arguments (separated by the command), theF first of these being the search string, the second a replaceF string. A search with no arguments will perform the lastF search/replace (that is if the last search/replace was a replaceF then a replace is done, otherwise a simple search is done). IfF the last search/replace command was a search then F is a ƒnormal search, if it were a replace then F will attempt to undo the last replace command (by moving oneF character in the opposite direction of the search, and reversingF the search and replace arguments. If arg is typedF then arg will be searched for. If arg1arg2F is typed then arg1 will be searched for and replaced by arg2. IfF arg1 is typed then then arg1 will be searchedF for and „ replaced by nothing. If arg2 isF typed then it will search for the last search text, and replace it by arg2. 3 <+REGULAR>F <+REGULAR> is very like <+search> except that variousF characters are treated specially. This command takes a regularF expression (defined below), and searches for it. A replace, string may be specified as with search.F If no argument is given to it will search forF … whatever the last or searched for. AnF will undo the last , or . AF with no argument that follows a successful F will match whatever the found (a replace will replaceF with whatever the replaced with). If a F follows an unsuccessful it will act on the literal argument of the . 3 <-REGULAR>F <-REGULAR> is †very like <-search> except that variousF characters are treated specially. This command takes a regularF expression (defined below), and searches for it. A replace, string may be specified as with search.4 Regular_expressionsF The search string may be a regular expression of the following form:= any character without special meaning matches itself.F ^ matches the beginning of a line if it is positioned so that/ it can,‡ otherwise it matches itself.F $ matches the end of a line if it is positioned so that it, can, otherwise it matches itself.: \ddd matches the octal character specified by ddd.2 \letter matches the letter in either case.- \char matches that character exactly.F [string] matches any of the characters specified by theF string. If the string begins with `^' then it will matchF characters not specified by theˆ second half. The string isF treated as a list of specifications of which there are twoF sorts: a single character spec is either a character or aF backslash sequence, a range spec consists of two characterF specs separated by `-'. An `^' found anywhere other thanF the first position is a character spec, a `-' found in theF first position or after a range spec is a character spec,F and a `]' found in the first posi‰tion or after a range spec is a character spec.F The concatenation of two regular expressions matches a aF string, the first part of which matches the first regularF expression, and the second part matches the second regular expression.C ex1|ex2 will match a string that matches either ex1 or ex2.B ex1&ex2 will match a string that matches both ex1 and ex2.1 ex? matches zero or one instances of ex.1 Š ex* matches zero or more instances of ex.@ ex+ matches at least one and maybe more instances of ex.F ex{num1:num2} matches num1 to num2 instances of ex. If num1F is omitted 0 is used, if num2 is omitted infinity is used, if :num2 is omitted num1 is used. (ex) matches ex.F ~ex matches a string which does not match ex. This almostF certainly does not mean what you think it does; forF instance the‹ null string is something that does not matchF almost anything. Thus ~(spam) will appear to match spam,F since it is actually matching the null string (or the `s',F or the `sp', or the `spa'), which is the same as spam. ToF get this operator to do what you want, you should probablyF use it in conjunction with the intersection operator, thusF (~(spam))&(....) will match any four character sequence that is not `spŒam'.F ch stops remembering text.F `<' and `>' have the highest priority, next `?' `*' `+' `{}',F then `~', then concatenation, and lastly alternation. This4 order may be altered using `()' as usual.F The replace string recognizes three metacharacters, `&' `$'F and `\'. If an `&' is used, then the text matching the searchF string will  be inserted at that point. `\ddd' produces the octalF character character ddd, and `\char' produces that character. IfA `$ch' is used then the text in register ch will be inserted.F If a register is used that has never been set, then the nullF string is inserted. If a register is not terminated then the endF of the string found is used to terminate it. If a register isF started more than once, then the first start will be used, and ifF it is terminaŽted more than once the last termination will be used.F If when a match is found it is the longest possible match4 starting from where the match was found. Thus,+ Fo{2:4}. spam<+regular>F on the input "Foooor" will produce "spam", not "spamor", orF "spamr". If this yields an ambiguous parsing for the registers,F then a parse will be chosen at random, and nothing will be stated, for instance,2 foo $a<+regular>= might produce either "bar" or "oobar" on input "foobar".F Like every thing else in mined, these characters areF changeable, and may even be turned off (when a character isF turned off it loses its special meaning unless preceded by theF quoting character (normally `\')). A character may be changed byF entering help mode (see the command) moving to the end ofF the line containing the desired ch aracter, and typing in theF replacement. A character may be toggled between on and off, byF moving to the front of the line and pressing `~'. The characters6 appear in the help list with the following names:L This is the character used to quote other chars9 normally to hide special meanings.M This starts a bunch (also called a character class): something like [a-zA-D] under unix.‘/ This terminates a bunch.M This causes a bunch to acquire the opposite meaning itM otherwise would have, thus [^a] would match any' character but a.M This is the character used inside of a bunch that7 indicates a range of characters.M This is the kleene star operator (zero-infinityH occurrences ’ of the preceding regular expression).M This means the preceding regular expression occurs) zero or one times.M This means the preceding regular expression occurs at" least once.6 This matches the end of a line.8 This matches the start of a line.2 This matches any character.M This forces both the regular expressi “on to the right8 and the one to the left to match.M This forces either the regular expression on the left,8 or the one on the right to match.M This forces the following regular expression not to match.; This is the obvious grouping symbol." As is this.M This is used to indicate that the preceding regular6” expression can occur n-m times.; This is used to terminate the above.M This is used inside of the above to start the second argument.J This is used to start putting text into a register.K This is used to stop putting text into the register.M This is used to get text out of the register (it can; only be used in t •he replace string).M This is used to get the entire match in the replace string.3 F The command inserts a blank line in the file. AnF with no argument inserts one blank line before the currentF line, an will accept a text argument and inserts theF specified amount before the current line (or at the currentF cursor position). An followed immediately by an –F divides the current line in two at the cursor (inserts a newline). 3 F The command deletes a line from the file. A F with no argument deletes the current line, a will acceptF a text argument and deletes the text starting with current lineF (or cursor position for rectangles) An followedF immediately by a joins the current line with the next,F and deletes any text of the curre —nt line after the cursor. Any: text deleted will be saved in the restore (!) buffer. 3 F The command is used to retrieve the text lastF deleted (text deleted with or may not beF restored). This has two purposes: it helps guard againstF mistakes, and it allows text to be moved from one place toF another with ease. A simple with no arguments restoresF the text at the current positio˜n, text removed with a rectangularF close is restored in a rectangle beginning at the cursor, andF moving over any text that was already there, text closed in lineF mode is restored by inserting those lines before the currentF line, while text deleted in wrap mode will be inserted beginningF at the cursor and moving the remainder of the line to the end ofF the restored text. will take an integer argument,F specifying the number of rest ™ores to do, and it will acceptF linear cursor motion to the same effect. Rectangular cursorF motion may be used if the item in the buffer is a rectangle, inF this case the buffer is expanded (duplicated) horizontally theF number of times specified by the horizontal size of theF rectangle, and vertically by the vertical size, and is thenF inserted. Note that all text that has been in the restore buffer# will reappear in the # buffer. š3 F The command remembers a line from the file. A F with a text argument picks up the specified text. An F followed by a picks up whatever is left on the current line.F may be used to store text into any file or buffer; ifF is given a second argument (or an invalid first argument)F it will be treated as the name of a file or buffer, (if the. buffer did not exist it will be created).› 3 F The command takes arguments exactly like the F command, except all text is appended to be buffer, rather thanF overwriting. Curious things will happen when a rectangular area is appended to other text.3 F The command is used to retrieve the text last picked.F This allows text to be copied from one place to another. AF simple with no arguments inserts the text at the currentF positœion, text picked with a rectangular pick is inserted in aF rectangle beginning at the cursor, and moving over any text thatF was already there, text picked in line mode is inserted beforeF the current line, while text picked in wrap mode will be insertedF beginning at the cursor and moving the remainder of the line toF the end of the restored text. will take an integerF argument, specifying the number of puts to do, and it will acceptF linear  cursor motion to the same effect. Rectangular cursorF motion may be used if the item in the buffer is a rectangle, inF this case the buffer is expanded (duplicated) horizontally theF number of times specified by the horizontal size of theF rectangle, and vertically by the vertical size, and is then inserted.F may also be used to get text out of any file or buffer,F if a second argument (or a first argument that is invalid) žisF given to then that argument will be treated as naming aF buffer or file. If this buffer name is followed by an openF parenthesis (`('), an expression (see the section onF expressions), and a close parenthesis (`)') then the indicated% line in that buffer will be put. 3 F The command takes text on the enter line, and puts itF in a buffer. If nothing is given to it complains. IfF only tex Ÿt is given then inserts this text in the currentF window at the cursor. If text and a buffer are given then theF buffer will have the text prepended as a new line. If the bufferF name is followed by an open parenthesis expression closeF parenthesis then that line of the buffer will be replaced (not inserted).3 F The command is used to leave the editor, in the normalF case all files changed will be saved on exit. Sev eral argumentsF are accepted by , the first is `save' which is the defaultF case, and saves all changed files. The next is `abort' whichF exits without saving any files, and the last are `every' andF `list' which list all files (all changed files) and allow theF user to specify whether to save them or not. The file name willF appear on the bottom line followed by a default value (usually y)F and a question mark, the user may respond with `y”', `n', `e',F `=', or a return. A `y' will save the file, an `n' will not, anF `e' will abort the exit process, and edit that file, a returnF will perform the default action, and an `=' allows the user toF rename, and save the file. If the editor detects anF unrecoverable internal error it will initiate the exit commandF itself. If a changed file cannot be saved (see above) then exitF will return to command mode, and allow the user to r¢ecover his work.3 F The command is one way of allowing the user to edit aF different file. If a is pressed with no argument, then theF alternate file (or the special file) for the current window willF be edited, and the file currently being edited becomes the newF alternate. If is pressed, then the next file ofF those specified on the command line will be edited. That is, if mined were entered with:) £ mined foo bar spam *.med F and the first file is being edited, the typing willF edit bar, after bar spam will be used, after spam all the med$ files on the current directory.F If is given a file name argument, then that file will beF read in, and the current file becomes the new alternate (the oldF alternate will not be available after this). If is given aF filename and a line number (separated by ) then t¤hat fileF will be edited with the cursor on the indicated line. If a F is requested on a file that has already been edited, then theF edited version will be used (This is not quite true, the fileF foobar and foobar; are treated as different files since theF editor will does not deal well with version numbers. and theF cursor will be placed on the line it was on before. If a F is requested on a file that does not exist, the user w „ill beF warned that the file is new and the editor will create anF internal version of this file, if nothing is typed in this fileF it will not be created on exit. If a user does not have writeF access to a file that is d the file will not be marked asF saveable (so this file will not be saved on exit, even if modified).F If a file does not contain any directory information (norF device/nodenames) then when mined searche¦s for the file it may beF told to search on several directories rather than just theF current one (in keeping with the idea of dsk: on twenex, or theF library search path on tops-10). To do this the user shouldF define a logical name $MPATH to be a list of device:directoryF specs separated by spaces (all devices must be disks, and noF nodenames are allowed). If mined cannot find a file on any ofF the directories it will attempt to create §it on the first one in the search path.F A file may be read in without tab conversion, by giving a null first argument, that is foobar: will read in foobar and leave any tabs in it as tabs.F Filenames beginning with '~', are treated in the fashion ofF berserkly file specs. That is ~/foo is the instance of foo foundF on the user's home directory, ~gwwcc022/foo is the instance ofF foo found on gwwcc022's login dir Øectory. On systems which do notF have a unix style password file, the later form will not work.F As a special kludge ~mined/ refers to the directory that minedF searches for its help file (and .med files). This works on all systems.F This command will also change the current local options to! match those of the new file.3 F The command is used to save the current file. If noF argument is given, then the file will ©be saved under the currentF name. If one argument is given, then the file will be savedF under that name. If two arguments are given (separated byF ), then the first will be interpreted as a text argumentF (which defaults to paragraphs if no mode is specified), and theF second as a file name. For example: saves all of theF current file with the current name. foo saves allF of the current file under the name of foŖo. 6lF saves the next 6 lines of the file under the current name. WhenF a file is saved, all trailing blanks may be removed (depending onF the value of the option), all leading blanksF may be converted to the appropriate number of tabs and spacesF (assuming 8 character tabs, depending on the value ofF ), and all quote sequences are converted to theF appropriate control characters (a tra «iling quote with noF character after it is converted to a rubout). If a save failsF (the user does not have write access to the file, directory doesF not exist, or there is no space on the disk) an error will beF indicated on the bottom line. may be used to save all the changed files.F On VMS if an explicit version number is given, then mined willF try to save onto that version (by opening the file, truncatingF it, and wri ¬ting), if this fails mined will then try to create aF version of the file with a version number that is one bigger thanF the biggest one currently on disk, if this also fails mined will give up.3 F The command is another way of editing a different file.F This command allows the user to partition his screen so that heF is looking at several files at once. Windows can only beF rectangles, and a new window can only be created in such ­a way asF to leave all current windows rectangles. To create a window theF cursor should be moved to a position on one of the margins,F pressing filename will cause a line to be drawnF across the screen from this margin to the opposite one, theF bottom (or right) half of the screen will become the new window,F and the text of the specified file will appear within. As withF the command, a line number may be specified (as a ®secondF argument). Pressing will remove the last windowF created. Pressing just (no argument) will retrieve theF last window destroyed. To change windows the command  should be used.F A file may be read in without tab conversion, by giving a null first argument, that is foobar: will read in foobar and leave any tabs in it as tabs.F This command will also change the current lo Æcal options to! match those of the new file. 3 F The command can be used to change from one window toF another. Pressing without an argument will cause theF current window to move to the next window created (or the firstF window if the current window is the last one created). If aF numeric argument is specified then the current window will beF changed to the window specified; changing to window n moves toF t °he nth window created. Thus changing to window 1 moves to theF main window, and if there are m windows on the screen changing to, window m moves to the last one created.F This command will also change the current local options to! match those of the new file. 3 F This command may be used to correct spelling of a portion ofF the user's file. If it is given with no argument then theF current line is corrected, if given a text ar±gument it will useF the specified text (with a default being a paragraph). OtherwiseF if the first character of the argument is a `!' then the rest ofF the argument is treated as a filename and the current dictionaryF is saved, if the first character is a `*' then the rest isF treated as a filename, which is read in and merged with theF current dictionary, if the first character is an `=' then theF rest of the argument is treated as a word to b ²e entered in theF dictionary. A line in a dictionary file is either a single wordF or two words specified by a space, in the first case the wordF will be treated as a correctly spelled word, and in the second asF a misspelled word that is always converted into the followingF word. See the section on environment, and on for& more information on dictionaries.F If a misspelled word is found mined will position a blob onF the miss ³pelling, and then display a line at the bottom of the screen like:: Spell optionally --> (? for help) or,6 Spell arbitrary --> arbitrary 1/2 (? for help)F . In the first case mined thinks the word is misspelled, but itF doesn't have any guesses as to what it might be. In the secondF case mined thinks the word is misspelled and has 2 suggestions ofF what it might be, the first of which is `arbitrary.' Resp“ondingF with a `?' causes mined to give a brief description of theF possible responses, an `r' or a will cause mined toF leave the word as it is, an `e' will retain the word and enter itF in the dictionary, an `a' (or or ) will abortF the correction and return to normal command mode, an `i' willF allow the user to enter a word of his own to replace the currentF one (mined will prompt whether to enter this word inµ theF dictionary), a response of `c' will cause mined to replace theF misspelling with the current suggestion a 'u' will also replaceF with mined's suggestion but mined will save this correction andF continue to make it in the future without asking the user, aF response of `>' or a space will cause mined to display the nextF suggestion, a response of `<' will display the previousF suggestion, a will refresh the display, and a `d' wi ¶llF delete the current word and proceed, a `b' will move back to theF previous word it asked about, and '^' will allow arbitraryF editing to the file (go into a recursive editing mode in whichF normal editing may be done, but from which a returns toF mode rather than exiting (if the user is editing a> different file when he s will be aborted)).3 F This command may be used to fill, justify, or center a ·potionF of the current file. The first argument is a standard textF argument, with a default size of one paragraph, the secondF argument is either fill, justify or center indicating what is toF be done to the text, if the second argument is omitted, theF current value of the option will be used (unless this is: AS_ENTERED in which case the text will be justified).F The algorithm used is quite stupid, no attempt is made to backF ø up, if difficulties are encountered, no attempt is made toF hyphenate words. When filling mined will look at one entireF paragraph, converts all newlines to spaces, and removes spaces soF that there will be only one space between any two words (unlessF the preceding word is terminated by one of the characters inF in which case there will be at least 2 spaces).F When this is done, lines will be recreated with the originalF i¹ndentation. Justified text is first filled, and then multiple+ spaces are inserted where appropriate.F If the text to fill is defined by a rectangle, then the lengthF of the rectangle specifies the number of lines to fill, and theF width of the rectangle determines a temporary value for .F Note that when words are referred to above, it means items> separated by spaces, not by the characters in .3 F ŗThe command executes a program. Part of the current fileF will be passed as input to the program, and all of its outputF (unless redirected) will be inserted in the file. If no argumentF is specified the last argument will be used. A commandF consists of an optional text argument (which defaults to 1F paragraph if not specified) followed by a program (withF arguments) which will be interpreted by the shell. The textF argum »ent (if present) should be followed by the command to= delimit it from the program specification. For example:# 1pnroff -meF would send the rest of this page to nroff to be formatted usingF the me macros, and the results would then replace the previousF text. The text used as input by the program can be retrieved! with the restore command.F To enter DCL commands and have them return output into a' window ¼(file) issue the following:& $ DCL_COMMAND_HERE F . Note that you can only have output come to you or you canF redirect input into the command, but you can't issue anF "interactive" DCL command such as EDIT or PHONE in this mode.. Use the case below for for such commands.F is a special case, and runs an interactive shellF (as specified by the SHELL environment variable). Spawn will beF done instead of ½ normal subprocess creation (ie symbols andF logical names will be retained). To obtain a DCL shell withoutF symbols shell should be defined as 'sys$sysroot:[sysexe]loginout' or something equivalent.3 F The command causes helpful text to appear in theF current window. The helpful text normally consists of a helpF file for the terminal (looked for on the directory from which theF med file was taken, if /usr/minedhome/la.m ¾ed is used as an medF file then /usr/minedhome/la.hlp is used as a help file), or if noF such file is found, then the standard doc file (this) will beF used. The alternate file will contain a list of commands and theF character sequences needed to generate them. An 1 may be used to obtain just the command list.F In the help list, the character sequences for the commands areF displayed literally (so if some of the commands are representedæF by special function keys this will not be noted). When in helpF mode pressing again will return to normal mode. ChangeF window will return to normal mode as long as the user is not inF the help window, returning to a help window returns to help mode.F The command list may also be used to change theF command, option and box sequences, and to create an med file forF the current terminal. To change an item the cursor should beĄF moved to that item, and the new value should be typed in (NoteF that for bars, if the new value commences with a `.' then an initF will be done; to allow for a leading `.' any leading backslashF (but no other) will be stripped off (Kludge). There are twoF methods for changing commands: the command may be enteredF literally, or the command may be entered using quote characters.F In the first case, the command should be delimitted by nulls,FĮ while in the second the command should be typed in normally, andF terminated by a or ( andF can be used for editing). In both cases an interruptF will abort the change. Options may be redefined by typing in theF new value, those which have a list of values may also be changedF by moving the cursor to them, and typing `~', `>', or `>'. Com-F mands and strings may be undefined by moving to them and typingF Ā `~'. An med file may be created by pressing . By defaultF the file will be on the current directory with the nameF (term).med where term is the value if the TERM environment variable.F Note that when in the help window, the current file's localF options will be edited, and any med file produced will indicateF that the current local options should be global. To edit the, global options type .F ThĆe help file may also be used to create a user definedF command (see that section). By pressing an when in theF help window, a new line will appear at the bottom of the currentF text, and the cursor will be moved there. This line will containF various fields (command name, character sequence to invoke it,F set of command flags, and a help message), any of these may beF set or reset by moving the cursor to the appropriate field and typing. ÄF A brief description of each item may be obtained by moving to that item and pressing `?'. 3 F The command gives a list of all the windows currentlyF used and the files in them (main file, followed by line number,F alternate file, line number, and whether this window is in aF special state). This list is followed by a list of all the filesF that have been read in by the user in this editing session, withF their names, Åthe version number, the length of the file, theF settings of all the flags for that file, and the file pro-F tection. Some files are normally invisible to the status displayF (things like macros) will force even these filesF to appear. When in status mode pressing again or F returns to normal mode; moving the cursor to a filename in theF file list, and typing will edit that file. MovingF the cursor to a Ę filename in that list, and typing  will save that file.F The command may also be used to change the status ofF the editor. The names of files, and whether they are read_only,F changed, etc. may be changed. The user should move the cursorF to the item he wishes to change and start typing (for a file nameF type the new name, and follow it with return. For a flag type aF ~ to toggle the status of the flag). For a protection typ Ēe inF the new protection, etc. Changing the status merely affects theF editor and its actions, it does not in any way affect the fileF itself; thus marking a file readonly does not change theF protection, nor does changing the name of the file do a renameF (however if the file is subsequently saved the new name will beF used), changing the file protection only affects the file when it is saved.F The status display also contains the Č values of variousF variables that might be useful for the user to know, and under1 some systems information about memory usage.3 F The command is used to set various parameters for theF current file. The format is arguments . AnF argument is either `=filename' in which case the window isF renamed, or is one of the strings `changed', `new', `modifiable',F `save', `command', `backedup', `rectangle', `text' É, `file', orF `visible' optionally preceded by a `~' (Arguments are separatedF by the command). If the argument is preceded by a `~' thenF that flag in the current file is turned off, otherwise the flag is turned on. Thus, ~saveF would cause the save bit of the current file to be reset. For a= complete description of the flags see the flags section.F An argument may also be =value or ~, in the firstF c Źase that item will be set to the proper value, the second caseF only applies to commands, and other string valued items where the$ entry is made undefined. Thus,( =/ will set the command to be a rubout.F Options may be set in a fashion similar to commands (seeF above), but options may also be made local. An argument ^F will make that option be local, and give it the current globalF value, if t Ėhe item is already local nothing happens. An argumentF v may be used to get rid of the local option, and restoreC the global value, if the option is not local this is an error.F The last type of argument that takes is a kludge thatF allows you to save the current mined setup into an .med file.F The format is !filename, and the setup is saved under thatF filename (if no file name is specified, then the file is terminal_type Ģ.med). 3 F The command is used to set and reset tabstops. Up toF 500 irregularly spaced tabs may be specified, and after that tabsF may be set every n columns out to infinity. The editor startsF each file with tabs every 8 spaces. To set tabs every n spacesF the user should type n. Pressing will setF a tab at a specific spot, pressing will remove a tab.F Pressing filename < ĶSRTAB> will use that file as a tabF file and read it to set the tab stops. When this is done, theF first line of the file is read, and tab stops will be set at allF non blank characters on that line, all previous user defined tab8 stops are removed but the tab multiple is retained. 3 F The command may be used to abort or macroF execution, searching, and file loading. At command level anF will forget any cha Īracters input that have not beenF examined, and a second interrupt following the first (without aF complete command in between the two) will terminate the editor.F In RAW mode interrupts may not be used to abort anything, in< RESET_RAW mode only programs and macros may be aborted.3 F This command generates an interrupt which mined catches, andF displays some indication of what state it is in. This command isF not fully imple Ļmented, during file input/output, programF execution, and searching, it will indicate what line it is on;F otherwise it just says Alive (at least it shows the machine isF up). On VMS systems this is only implemented if no  command is defined. 3 F This command is used to insert a command in a file. Syntax isF some command, thus inserts anF in the file. The command will be disp Šlayed by insertingF a special blob in front of the command name as displayed in theF help file. This command is only useful for andF . If is given a positive integer argument,0 it will insert the command that many times.F If is typed then mined will no longerF interpret your commands, instead they will be entered in theF current window. This mode may be exitted by the command.F Ń , , and commands behave as theyF normally do (so some limited editing is possible), andF may be used to quote these special commands (that isF to insert a type rather than just ). 3 F this command is used to convert between a fileF containing commands in the above format to commands in the parityF format. (this will be done auto Ņmaticly by the commandF if necessary, but use of this command will speed up macro startF up). If no argument is given the translation will be done on theF current file, otherwise it will be done on the specified file.A may be used to reverse this process. 3 F This command is used to execute the given buffer. Normally,F if an error occurs, or the user interrupts, then all buffersF being executed will Ó be aborted. may beF used so that if this is a nested and an error occurs6 then the enclosing will not be aborted.F Parameters may be passed to a macro by specifying them beforeF the macro name, separated from each other, and the name by F (at the moment only the first parameter may be cursor motion, andF it will be interpolated as #c,#l (the equivalent rectangular text# argument). Thus the sequence,4 Ō 1spamfoobar< will pass 1, null argument, "spam" to the macro foobar.F If the specified buffer has not been read into mined, thenF mined will check to see if it is a user defined command, and ifF it is will attempt to execute the library associated with it. IfF the buffer still does not exist, mined will attempt to read it8 off the disk (and will assume it to be translated). 3 F Take the argumenÕt, an expression evaluate it, leave the editorF with the result on the enter line. If the argument is split (ieF an argument command has been done) then only the last argument on> the line will be expanded, the others will be left alone. 3 C Take the argument, an expression evaluate it and ignore it. 3 F The command may be used to implement a while loop, aF for loop, or a forever loop. The command may take two arguments,F Ö the first being a condition, and the second a count. TheF condition indicates whether to continue the loop, it is evaluatedF each time through the loop, and as long as it is non-zero theF loop may continue (if this argument is not supplied it is assumedF to be always 1). The second argument gives the maximum number ofF times the loop may be executed, this argument is evaluated atF start up and that value will be used thereafter, if nothing isF × specified a count of infinity is assumed. A while loop may beF obtained by specifying only the first argument, a for loop byF setting the first argument to be 1, and a forever loop by notF giving any argument. If there are at least two arguments, andF the first is null (condition), then the secondF argument will be treated as the condition, and the third as theF count. Normally if an error occurs inside the then itF w Ųill be aborted as will any s, s, and macros thatF contain it; however, if the first argument is null (as above)C then errors will only cause the end of the current while loop.F If the user types a command at command level, he willF be prompted for a sequence of commands to repeat. This sequenceF may be edited by: the (or ) command to deleteF the last command entered, and the command to enter aF , a , a , or an command. If noF commands are given to be repeated, then the last will be executed.3 F The command takes an argument which it evaluates to aF number. It then prompts the user for a `then part'. This partF is a list of commands and is entered as above. If the numericF argument is non-zero the `then part' will be executed. LikeF and , if a null first arg Śument is givenF (number) then the surrounding macro will not beF terminated if the then part gets an error (the then part will always be terminated).3 F This command must follow an , it will prompt for text asF , and do, and will execute the text if the previousF failed. If an argument is given to an then it willF be evaluated, and if it ends up non-zero (and the previous F failed)Ū the text will be executed (another may follow oneF of this nature). As usual a null first argument is an error trap.3 F This command is used to terminate entry of commands inF , , and . In a the starts the$ execution of the repeated item.3 F The command aborts all command streams down toF the last repeat stream, and aborts that. If a positive argumentF Ü is given, it will abort that many repeat streams; if a negativeF argument is given it will abort that many streams. A stream isF one of the following: a list of commands in a , , or* , or the execution of a buffer.F This command will never abort the editor (unless something is5 wrong); the only way to exit is with the .3 F Will abort all execution streams down to the top macro, andF abort that. If Ż given a value then that will be returned on the. enter line to whatever invoked the macro.3 F Can be used by a macro to display a message. If given twoF arguments, then the first should be an integer. If this integerF is positive then the macro will be aborted. The absolute valueF of this integer is used as a time to display the message beforeF continuing. If there is only one argument, a pause of 1 will beF assumed. The second argument Ž (or the first if the were only one)1 is the message, this will be evaluated first 3 F Can be used in a macro to get a line of text from the user.F The first argument is treated as a buffer name into which theF text is put. If there is another argument it will be evaluatedF and used as a prompt string. Input may be terminated by aF which is successful, and an which leaves the4 buffer unchanged, any other commandß will abort.3 F This command enters the mined macro debugger, normally it willF show the macro currently being executed, if given an argument it5 will show that macro. See the debugger section.3 User_definable_commandsF Mined is not limited to just the commands listed above, mostF of the fun of mined comes in writing your own commands that willF do weird things when needed. In addition to the execute commandF which is one way of exten ąding the command set, mined allows usersF to attach a macro buffer to a terminal key sequence so that whenF a user types those keys, the buffer will be executed, or toF attach several key sequences to one command (for instance it isF often useful to have the arrow keys mean the obvious, and also; have the standard ADM3A ^J, ^K, ^L do the same thing).4 User_command_componentsF These commands come in two flavors: synonyms and macros. AF synonįym is just another way of executing one of the standardF mined commands, it should behave just like the standard command,F and when stored in a macro it will be indistinguishable from theF standard command. The other flavour is more interesting, it hasF a whole bunch of options for the user to set in addition to theF character sequence that will invoke it. The first and mostF obvious is the command name. This is the name of the buffer thatF mined āwill execute when the command is invoked, it is also theF name that is stored in untranslated macros. In a synonym, theF command name field is used to indicate of which mined command this command is a synonym.F The next item is the library name (this is optional); theF library tells mined how to load the macro if it is not alreadyF present, if no library is given and the specified buffer is notF loaded in mined, then mined will attempt to rćead in the buffer asF it would for an command where the buffer was not inF core. The reason for the library item is that reading eachF command off of a disk as a separate file is likely to be timeF consuming (especially on VMS), and further often a group ofF commands are related, so that if one is used, another is likelyF to be invoked shortly. If mined detects that a command is notF present, then it will the library w äith an argument ofF the command name it wants. A library will only be executed onceF per command (it may be executed several times to load differentF commands, but only if the library does not load them when it isF first executed), if it does not load the buffer then mined willF attempt to read it off of disk, if that fails mined gives up.F This field has no meaning for synonyms but may be set by the user.F The next items are a bunch åof flags that indicate how theF command should be used. These flags tell mined what kinds ofF arguments are legal for that command, and whether the command canF start or continue a cursor motion argument. The following flags are available:L strt_cur Indicates that this command may start cursor motion.F This means that if this command is typedF immediately after an then the editorF ę will be put in cursor motion mode, and the1 command will be executed.N in_cur Indicates that if the editor is in cursor motion mode,G then this command will continue cursor motion.G This does not imply, and is not implied by! strt_cur.K use_quote Indicates that the character arguments to this com-F mand may contain t ēhe command.F Otherwise mined will flag any such arguments" as errors.N use_arg Indicates that this command may take either one or two" arguments.L use_args Indicates that this command may take an arbitraryF number of arguments. If this flag is set,F then the above flag will be set automaticly,F and if č use_arg is reset, this one will be also.G use_curmotion Indicates that this command can use a cursorF motion argument. This flag may not be. specified with in_cur.I use_curargs Indicates that this command can use a cursorF motion argument, followed by an arbitraryF number of arguments. This flag is dependentF é on use_curmotion, use_arg, and use_args; it3 may not be set with in_cur.K unwind_env Indicates after this command has been executed, theF environment stack will be unwound to the depth0 it had before execution.F In a synonym these flags initialized to the flags for the+ mined command, and may not be changed.F The last item is a help message, this will be typed out if theF ź cursor is moved to the item, and a `?' is typed.It may also beF examined by $apropos. If a synonym has no help, then the message, of the synonymous command will be used.F On VMS any access control strings in the command name or' library will be typed out in full. 4 Creating_user_defined_commandsF These commands can be set and changed in the help window. ToF create such a command go into the help window, and press ;F this will a ėdd a line at the end of the window containing theF beginnings of a user definable command. Each field of a userF command may be changed by moving the cursor to that field, andF typing. If the name field is set to be the name of one ofF mined's built in commands (case is significant here) then the> command will be a synonym (the name LITERAL is reserved).4 Using_user_defined_commandsF User defined commands may be used just like any other cģommandF by typing in the character sequence, arguments may be passed to- the command via the enter line as usual.4 Writing_user_defined_commandsF When executing a user defined command is exactly the same as aF normal macro, and it should get at its arguments in the sameF fashion. The argument returning the macro name ($.0) returns the! command name of the command. 2 Debugger NOT YET IMPLEMENTED2 Command_optionsF Mined mķaintains a list of options that define what itsF commands do; each file may have a smaller list which willF supercede the global options when editing that file. The listF maintained by a file is referred to as a local option list, andF the options in it are local options. When editing both a programF source and the documentation that goes with it, it might beF useful to have the program text entered normally, but have theF documentation ī text entered in auto_fill mode; this could be done, by setting to be a local option.F When a , or command is typed in theF current local options will be removed, and the new ones will takeF effect. If a is typed, then the user will be allowed toF modify the local options (and if a modified option is not local,F the corresponding global one will be changed). An option may beF set as local (to this particular fil ļe) with the command,F which will make a local option with the same value as the global.F Options may be set with the and commands, and mayF be made local with the command. When in the help displayF moving to an option and typing in a new value will alter thatF value (many options will also allow the user to toggle throughF all the possible settings using `<' and `>'), a brief descriptionF of the option may be obtained by movšing to it, and typing `?'.@ The command may be used to alter an option by typing,'