\begindata{text,538504676}
\textdsversion{12}
\template{help}
\define{global
}
\define{index
menu:[Title,Index~91]
attr:[FontFace Italic Int Set]}
\define{indexi
menu:[Title,InvisibleIndex~92]
attr:[Script PreviousScriptMovement Point -2]
attr:[FontFace Italic Int Set]}


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

Pascal Programmers}}


\section{What Ptext is \


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


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

}
\section{Starting Ptext}

\leftindent{
At the command prompt, type "ez \italic{file}.p" or "ez\italic{ file}.pas" 
and press Enter.  Use of a .p or .pas extension tells EZ to load the ptext 
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 ptext package.  You 
can also set various parameters of ptext, which are listed in the section 
below, "Customizing Ptext in your .ezinit file."  For details about 
initialization files, see the \italic{\helptopic{initfiles}} help document.

}
\section{How Ptext works}

\leftindent{
When a ptext dataobject (usually a normal Pascal source file) is read in, a 
set of styles are superimposed on it for the convenience of the programmer. 
 Comments are put in italic and Pascal keywords are put in bold.  None of 
these styles are actually written out with the code--they exist only during 
editing.  At the programmer's option, the keywords may be automatically 
lower-cased, upper-cased,  capitalized, or left unaltered.


Ptext 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 ptext 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 ptext 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 ptext-use-tabs parameter is set to 0.  See below.)}


\section{Pop-up Menu Meanings}

\leftindent{
In addition to the regular EZ menu options, Ptext supplies a fourth menu, 
the Pascal-2 Text menu.  It contains two options:

\leftindent{
\bold{Redo Styles:}  Invokes the "Redo Pascal Styles" function which will 
redo the styles in the ptext dataobject that is displayed. \



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

 }}\section{\


Customizing Ptext in your .ezinit file}

\leftindent{
Ptext 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{ptext-brace-indent  \italic{0} }\


Controls indentation of braces at the start of a line.


\bold{ptext-use-tabs\italic{  1}}

If 0, don't use tabs for whitespace.


\bold{ptext-cont-indent  }\italic{\bold{4}}    \


Controls indentation of continued single statements.


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


Controls indentation of nested block statements.


\bold{\bold{ptext-case-level-indent}}\bold{ \italic{8}}  \


Controls indentation of statements within a case statement.


\bold{ptext-id-style}  \italic{\bold{capit}}

Controls automatic case-conversion of keywords.  May be any of 
\italic{upper} (convert keywords to all caps), \italic{lower} (convert 
keywords to all lowercase), \italic{capit} (capitalized all keywords), or 
\italic{plain} (leave all keywords untouched).}


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 .p ptext 
"ptext-level-indent=3;ptext-id-style=lower"}}}


\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{\helptopic{ctext}}}

\leftindent{\italic{\helptopic{ltext}}}

\leftindent{\italic{\helptopic{mtext}}}

\leftindent{\italic{\helptopic{ez}

\helptopic{ez-diff}       }  (An interactive diff package for EZ)

\italic{\helptopic{initfiles}}}


\begindata{bp,538485504}
\enddata{bp,538485504}
\view{bpv,538485504,1,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538504676}
