[-*- Text -*-] 4:24pm Friday, 25 July 1980 This file contains documentation on the Fortran library for Emacs. Library created and maintained by KMP@MIT-MC. Additions by RMS on 8/21/81 to go with changes received from DREA.  File: EFORTRAN, Node: Top, Up: (EMACS)LibCat, Next: Cmds This is a description of the Major Mode offered in Emacs by doing M-X Fortran Mode. * Menu: * Cmds:: Emacs commands defined while in Fortran Mode * Options:: Fortran Mode Settable Options * Ident:: Inserting or Removing card identification fields. * Output:: Converting Fortran output files to ordinary text.  File: EFORTRAN, Node: Cmds, Up: Top, Next: Options, Previous: Top " Runs ^R Fortran Read Hollerith. This will read a string from the echo area (ended with ) and insert it in the buffer as a hollerith string in the buffer. Eg, "ABC inserts 3HABC in the buffer. Tab Runs ^R Indent for Fortran. This will move leading digits toward the first column and program text toward column 7. A leading continuation line character) is stripped if it exists. With an argument, Tab will indent for continuation line, inserting a continuation character in column 6. Tab will try to leave the cursor in the same position on the line relative to the program text as the user was initially. Eg, in a line of text like "100x=y+5.", with the cursor between the y and the +, will change the text to "100 x=y+5." with the cursor still between the y and the +. M-; Goes to the previous line. If it is not a comment, a comment line is inserted. If it is a comment, the cursor is left just after the "C" which begins the comment. ^R Indent for Comment, the standard definition of M-;, is put on Meta-|. C-M-; On a non-comment line, this is a no-op. On a line which is a comment, will kill the text on the line, leaving the cursor at the head of a blank line. M-N Goes to down a line. If not on a comment line, creates a comment line. ^R Down Comment Line, the normal definition of M-N, is on C-M-N. M-P Goes up a line. If not on a comment line, creates a comment line. ^R Up Comment Line, the normal definition of M-P, is on C-M-P. Linefeed Typed at the end of a line, just indents the line normally. If typed in the middle of a line, moves the text of the rest of the line to column 7, preceding it with a continuation character in column 6 to denote continuation. M-J Indents the next line as a continuation line unconditionally. C-M-J Is the same as M-J M-^ Merges the current line with the previous, removing continuation character if necessary. M-M Puts the current date into columns 72 through 79 of the current line. M-= Types out information on the screen which points to columns 6 and 72 for purposes of not accidentally running over the end of the line. The text typed out is not inserted into the buffer, but it may type over some of the text on the screen. Typing C-L will flush the display left over from M-=.  File: EFORTRAN, Node: Options, Up: Top, Previous: Cmds, Next: Ident Some Fortran implementations allow the user to use more free-format coding style. In some such implementations, Tab is used as a convenient way of terminating the label field. Fortran Mode automatically recognizes files formatted in this way, and causes the indentation commands to keep the same style. If tabs are in use, the string "[Tabs]" appears in the mode line, and Rubout is redefined to turn a tab into spaces. (Use Control-Rubout to delete the tab as one character). The current style--tabs or no tabs--is remembered as the local value of the variable Fortran Indent With Tabs. Nonzero means tabs are in use. The default style for new files is controlled by the global value of that variable, which you can set in an init or evars file. Two commands are provided for changing files from one style to another. To reformat a file to use tabs, do M-X Fortran Tabify. To reformat the file to use six spaces instead, do M-X Fortran Untabify. These commands are not the same as the ordinary Tabify and Untabify commands. The latter are defined not to change the appearance of the text in any way. The special Fortran commands change six spaces to a tab, and therefore DO change the appearance of the file. The format-changing commands operate on the entire file unless you have narrowed, and automatically change Fortran Indent With Tabs. Both Fortran Tabify and Fortran Untabify expect a string argument, which is null if you call them with M-X and do not specify one. If you specify a non-null string argument, they save the original contents of the file for M-X Undo. With a null string argument, such as if you did not specify one, they do not save. The reason these functions do not always save is that saving large files is expensive and can run out of storage. Continuation Lines Fortran Mode defaultly uses "+" to denote continuation lines. Some Fortran implementations will not allow the "+" character for continuations, or some programmers may not find that character aesthetic. A different character may be selected for use as the continuation line character by putting into the variable Fortran Continuation Character, the ASCII value of the character to be used. eg, to use "*" (ascii 52 octal) you would do (in a minibuffer or an init file): * m.v Fortran Continuation Character  File: EFORTRAN, Node: Ident, Previous: Options, Up: Top, Next: Output Inserting and Removing Card Identification Fields. Card identification fields are the contents of columns 72 through 79 of each line. Often these are used to contain a name and sequential line numbers. Alternatively, they can be used to contain the date when the line was changed. Commands are provided to support both techniques. M-X Insert Identification Field inserts an identification field on every line of the file. Each identification field contains a name followed by a number. The name is either that of the current function or (at the beginning of the file) the file name. The rest of the eight available columns are filled with the number, which starts at 1 each time the name changes and increments for each successive line. A numeric argument to Insert Identification Field tells it to use at most four characters for the name, so that at least four digits are available for the number. M-X Remove Identification Field deletes the identification field of each line, as well as trailing spaces before it. Both Insert Identification Field and Remove Identification Field expect a string argument, which is null if you call them with M-X and do not specify one. If you specify a non-null string argument, they save the original contents of the file for M-X Undo. With a null string argument, such as if you did not specify one, they do not save. The reason these functions do not always save is that saving large files is expensive and can run out of storage. Id Fields Containing Date of Change ^R Date Line Modified makes the identification field of the current line contain today's date. This is on Meta-M in Fortran mode.  File: EFORTRAN, Node: Output, Previous: Ident, Up: Top Formatting Fortran Output The command M-X Format Fortran Output takes a file containing Fortran carriage control characters and converts it into an ordinary text file containing equivalent formatting done with CRLFs and formfeeds. A numeric argument specifies the page length to use. The default is 60 lines.