\begindata{text,268709248}
\textdsversion{12}
\template{help}


\chapter{\center{M3text: An editing package for

Modula-3 Programmers}}


\section{What M3text is 

}\leftindent{
M3text is an editing package for Modula-3 programmers.  It provides an editing 
interface similar to that used for text files in EZ, but shows the text of 
Modula programs in a fixed-width font.  M3text provides keybindings and menu 
features to support indentation of Modula program code and uses styles 
specified in the M3text template.


An interactive diff package called ezdiff is available for comparing your 
M3text files.  See the \italic{ez-diff}  help document for details.

}
\section{Starting M3text}

\leftindent{
At the Typescript prompt, type "ez \italic{file}.m" and press Enter.  Use of a 
.m extension tells EZ to load the M3text editing package, according to 
specifications in the global initialization file for EZ.  


If you create your own .ezinit file, you can override the global.ezinit file 
or add other file extensions that will load the M3text package.  You can also 
set various parameters of M3text, which are listed in the section below, 
"Customizing M3text in your .ezinit file."  For details about initialization 
files, see the \italic{initfiles} help document.

}
\section{How M3text works}

\leftindent{
When a M3text dataobject (usually a normal Modula source file) is read in, a 
set of styles are superimposed on it for the convenience of the programmer. 
 Comments are put in italic, Modula keywords are put in bold, and reserved 
identifiers are bold-italic.  None of the styles are actually written out with 
the code--they exist only during editing.  Modula-3 keywords and reserved 
identifiers are either all uppercase or all lowercase; mixed-case words will 
be ignored by M3text, just as they will be by the Modula-3 compiler.


M3text adds these keybindings to those provided by EZ:


\bold{The tab key.} Tab has three uses:

\leftindent{
1) If there is a selected region, all the lines within that region will be 
re-indented to what M3text considers the "correct" indentation.  


2) If there is no selected region and the text caret is positioned before any 
text on the current line (within the initial whitespace), then the line will 
be re-indented as above. 


3) If the text caret is positioned after some non-whitespace text on the line, 
it will insert enough whitespace to move to the caret to the next tab column. 
 Tab columns are positioned at multiples of four.  Any existing whitespace at 
the caret position will be counted as if it were inserted (so the tab key will 
skip over whitespace to the next tab column if it is sitting on whitespace). }


\bold{The Linefeed (^J) key.}   Linefeed does two things:  


\leftindent{1) It re-indents the current line, just in case it needs to be 
fixed up (since sometimes the indentation after typing something is different 
than without it, i.e., else). 


2) It inserts a newline, and then inserts the correct indentation for the new 
line (moving the caret to that point).  }


\bold{Note:} When the M3text package inserts whitespace, it automatically 
inserts the correct combination of tab and space characters, replacing spaces 
by tabs when possible without changing the look of the line.  (This applies 
unless the m3text-use-tabs parameter is set to 0.  See below.)}


\section{Pop-up Menu Meanings}

\leftindent{
In addition to the regular EZ menu options, M3text supplies an additional 
menu, the Modula-3 Text menu.  It contains the following options:

\leftindent{
\bold{Redo M-3 Styles:}  Invokes the "Redo M-3 Styles" function which will 
redo the styles in the m3text dataobject that is displayed. 


\bold{Indent line/region:}  Equivalent to pressing the tab key.


\bold{Compress region:}  If region isn't selected, will compress into a box 
all nearby lines indented with the current line.


\bold{Compress all inner indents:}  Compresses all regions in the program that 
are indented as far or farther than the current line.


\bold{Decompress all:}  Removes all the boxes and restores the compressed 
text.


\bold{Display Interface:}  Opens a window on the file containing the selected 
interface, if the cursor is positioned on an import name.


\bold{Display Module:}  Opens a window on the file containing the selected 
module.

 }}\section{

Customizing M3text in your .ezinit file}

\leftindent{
M3text has several parameters controlling its behavior which you can set in 
your own .ezinit file.  They are listed in bold with the default setting in 
italic:  


\leftindent{\bold{m3text-use-tabs\italic{  0}}

If 0, don't use tabs for whitespace.


\bold{m3text-cont-indent  2}    

Controls indentation of continued single statements.


\bold{\bold{m3text-level-indent}  \italic{4}}  

Controls indentation of nested block statements.

}
You should put each of the parameters you want to change at the end of each 
addfiletype to which it applies.  For example:


\typewriter{\smaller{addfiletype .m m3text 
"m3text-level-indent=2;m3text-use-tabs=0"}}}


\section{Related Tools}


Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help file for:


\leftindent{\italic{ctext}}

\leftindent{\italic{ltext

mtext}}

\leftindent{\italic{ptext}}

\leftindent{\italic{ez

ez-diff       }  (An interactive diff package for EZ)

\italic{initfiles}}

\enddata{text,268709248}
