% A package for typesetting long names (of files, e-mail addresses,
% lisp-functions, etc) while allowing breaking (at `/', `.', `-',
% etc).
%
% Based on a similar package by Donald Arsenau (asnd@erich.triumf.ca)
% and Eric Eide (eeide@jaguar.cs.utah.edu). 

% Load style only once.

\@ifundefined{ttemail}{}{\endinput}

% Introduce another language, one without any hyphenation patterns:

\newlanguage \ttname@lang

% First, define the simple \ttname:

\DeclareRobustCommand{\ttname}[1]{{\ttfamily  \language\ttname@lang
  \def \-{\discretionary{\textrm{-}}{}{}}%
  #1}}

% Then define \ttfilename which allows breaking after `/':

\DeclareRobustCommand{\ttfilename}[1]{{\ttfamily  \language\ttname@lang
  \@tempcnta = \hyphenchar\font  \hyphenchar\font = `/
  {\def \-{\discretionary{\textrm{-}}{}{}}%
   \def \nb/{\mbox{/}}%
   \@ifnextchar/{\nb}{}#1}%
  \hyphenchar\font = \@tempcnta}}

% Then define \ttemail which allows breaking after `.':

\DeclareRobustCommand{\ttemail}[1]{{\ttfamily  \language\ttname@lang
  \@tempcnta = \hyphenchar\font  \hyphenchar\font = `.
  {\def \-{\discretionary{\textrm{-}}{}{}}%
   \def \nb.{\mbox{.}}%
   \@ifnextchar.{\nb}{}#1}%
  \hyphenchar\font = \@tempcnta}}

% Then define \ttlispname which allows breaking after `-':

\DeclareRobustCommand{\ttlispname}[1]{{\ttfamily  \language\ttname@lang
  \@tempcnta = \hyphenchar\font  \hyphenchar\font = `-
  {\def \-{\discretionary{\textrm{-}}{}{}}%
   \def \nb-{\mbox{-}}%
   \@ifnextchar-{\nb}{}#1}%
  \hyphenchar\font = \@tempcnta}}
