% in this version the escape character is '@'
%
\chardef\active 13
\chardef\other = 12
\def\deactivate{%
\catcode`\\ =\other
\catcode`\} =\other
\catcode`\{ =\other
\catcode`\& =\other
\catcode`\$ =\other
\catcode`\# =\other
\catcode`\~ =\other
\catcode`\_ =\other
\catcode`\^ =\other
\catcode`\% =\other
}
\def\makeactive#1{\catcode`#1=\active\ignorespaces}
%
{\makeactive\^^M%
\makeactive\^^K%
\gdef\obeywhitespace{%
\makeactive\^^M%
\makeactive\^^K%
\let^^M = \newline%
\let^^K =\onespace%
\aftergroup\removebox % kill extra paragraph at end
\obeyspaces }}
%
\newdimen\spc   \spc=1.22ex
\newdimen\tbspc \tbspc=4.88ex
\def\newline{\par\indent}
\def\tabtospaces{\hskip1\tbspc}
\def\onespace{\hskip1\spc}
\newdimen\savedparskip
%
\def\removebox{\setbox0=\lastbox}
\def\verbatim{\begingroup\deactivate\obeywhitespace
\catcode`\@=0% '@' = new & temporary escape character 
}
%
\def\ttverbatim{\begingroup\tt\deactivate\obeywhitespace}
%
%\def\endverbatim{\endgroup\parskip=\savedparskip\ }
\def\endverbatim{\endgroup\parskip=\savedparskip{}}
\def\displayverbatim{%
\ttverbatim
\parindent=1.5em\noindent
\catcode`\@=0% '@' = new & temporary escape character 
}
\def\enddisplayverbatim{\endgroup\parskip=\savedparskip\par}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\edef\quot{@}
\catcode`\@=\active
\newskip\ttglue \ttglue=.5em plus .2em minus .1em
{\gdef@{\savedparskip=\parskip\parskip=0pt\ttverbatim\spaceskip=\ttglue\let@=\endverbatim}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\AT{{\tt \char64}}

