\newdimen\commahang \setbox0=\hbox{,} \commahang=\wd0
\newdimen\periodhang \setbox0=\hbox{.} \periodhang=\wd0
\newdimen\quotehang \setbox0=\hbox{`} \quotehang=\wd0
\newdimen\qquotehang \setbox0=\hbox{``} \qquotehang=\wd0
\newskip\zzz \def\allowhyphens{\nobreak\hskip\zzz}
\def\lqq{``} \def\rqq{''} \def\pnt{.}
\def\comma{,\kern-\commahang\kern\commahang}
\def\period{.\kern-\periodhang\kern\periodhang}
\def\rquote{'\kern-\quotehang\kern\quotehang}
\def\lquote{\ifhmode\kern\quotehang\vadjust{}\else\leavevmode\fi%
\kern-\quotehang`\allowhyphens}
\catcode`,=\active \let,=\comma \catcode`.=\active \let.=\period
\catcode`'=\active \def'{\futurelet\next\rqtest}
\catcode``=\active \def`{\futurelet\next\lqtest}
\def\rqtest{\ifx\next'\let\next=\rquotes\else\let\next=\rquote\fi\next}
\def\lqtest{\ifx\next`\let\next=\lquotes\else\let\next=\lquote\fi\next}
\def\rquotes'{\rqq\kern-\qquotehang\kern\qquotehang}
\def\lquotes`{\ifhmode\kern\qquotehang\vadjust{}\else\leavevmode\fi\kern-\
qquotehang\lqq\allowhyphens}

