{\catcode`_ = 11

% Retain all the following definitions outside of the group.
% (We have the group in the first place to restore _'s catcode cleanly.)
\globaldefs = 1

% If we've defined a special macro `\slot_#1' to expand to the glyph
% name, use it. Otherwise, just use what we're given.
% 
% No provision here for \usedas or \ligature or other slot commands.
\def\doslot#1{%
  \expandafter\ifx\csname slot_#1\endcsname \relax
    \def\temp{#1}%
  \else
    \edef\temp{\csname slot_#1\endcsname}%
  \fi
  \setslot{\temp}\csname ligs_#1\endcsname\endsetslot
}
\def\slot_Agrave{\uctop{Agrave}{agrave}}
\def\slot_Acircumflex{\uctop{Acircumflex}{acircumflex}}
\def\slot_Egrave{\uctop{Egrave}{egrave}}
\def\slot_Ecircumflex{\uctop{Ecircumflex}{ecircumflex}}
\def\slot_Edieresis{\uctop{Edieresis}{edieresis}}
\def\slot_Icircumflex{\uctop{Icircumflex}{icircumflex}}
\def\slot_Idieresis{\lctop{Idieresis}{idieresis}}
\def\slot_Ugrave{\uctop{Ugrave}{ugrave}}
\def\slot_Ucircumflex{\uctop{Ucircumflex}{ucircumflex}}
\def\slot_Yacute{\uctop{Yacute}{yacute}}
\def\slot_yacute{\lctop{Yacute}{yacute}}
\def\slot_Ccedilla{\uc{Ccedilla}{ccedilla}}
\def\slot_ccedilla{\lc{Ccedilla}{ccedilla}}
\def\slot_Ntilde{\uctop{Ntilde}{ntilde}}
\def\slot_ntilde{\lctop{Ntilde}{ntilde}}
\def\slot_acircumflex{\lctop{Acircumflex}{acircumflex}}
\def\slot_ecircumflex{\lctop{Ecircumflex}{ecircumflex}}
\def\slot_ocircumflex{\lctop{Ocircumflex}{ocircumflex}}
\def\slot_ucircumflex{\lctop{Ucircumflex}{ucircumflex}}
\def\slot_aacute{\lctop{Aacute}{aacute}}
\def\slot_eacute{\lctop{Eacute}{eacute}}
\def\slot_oacute{\lctop{Oacute}{oacute}}
\def\slot_uacute{\lctop{Uacute}{uacute}}
\def\slot_agrave{\lctop{Agrave}{agrave}}
\def\slot_egrave{\lctop{Egrave}{egrave}}
\def\slot_ograve{\lctop{Ograve}{ograve}}
\def\slot_ugrave{\lctop{Ugrave}{ugrave}}
\def\slot_adieresis{\lctop{Adieresis}{adieresis}}
\def\slot_edieresis{\lctop{Edieresis}{edieresis}}
\def\slot_odieresis{\lctop{Odieresis}{odieresis}}
\def\slot_udieresis{\lctop{Udieresis}{udieresis}}
\def\slot_Aring{\uctop{Aring}{aring}}
\def\slot_icircumflex{\lctop{Icircumflex}{icircumflex}}
\def\slot_aring{\lctop{Aring}{aring}}
\def\slot_iacute{\lctop{Iacute}{iacute}}
\def\slot_Adieresis{\uctop{Adieresis}{adieresis}}
\def\slot_igrave{\lctop{Igrave}{igrave}}
\def\slot_Odieresis{\uctop{Odieresis}{odieresis}}
\def\slot_Udieresis{\uctop{Udieresis}{udieresis}}
\def\slot_Eacute{\uctop{Eacute}{eacute}}
\def\slot_idieresis{\lctop{Idieresis}{idieresis}}
\def\slot_Ocircumflex{\uctop{Ocircumflex}{ocircumflex}}
\def\slot_Aacute{\uctop{Aacute}{aacute}}
\def\slot_Atilde{\uctop{Atilde}{atilde}}
\def\slot_atilde{\lctop{Atilde}{atilde}}
\def\slot_Iacute{\uctop{Iacute}{iacute}}
\def\slot_Igrave{\uctop{Igrave}{igrave}}
\def\slot_Oacute{\uctop{Oacute}{oacute}}
\def\slot_Ograve{\uctop{Ograve}{ograve}}
\def\slot_Otilde{\uctop{Otilde}{otilde}}
\def\slot_otilde{\lctop{Otilde}{otilde}}
\def\slot_Scaron{\uctop{Scaron}{scaron}}
\def\slot_scaron{\lctop{Scaron}{scaron}}
\def\slot_Uacute{\uctop{Uacute}{uacute}}
\def\slot_Ydieresis{\uctop{Ydieresis}{ydieresis}}
\def\slot_ydieresis{\lctop{Ydieresis}{ydieresis}}
\def\slot_ff{\lclig{FF}{ff}}
\def\slot_fi{\lclig{FI}{fi}}
\def\slot_fl{\lclig{FL}{fl}}
\def\slot_ffi{\lclig{FFI}{ffi}}
\def\slot_ffl{\lclig{FFL}{ffl}}
\def\slot_IJ{\uclig{IJ}{ij}}
\def\slot_ij{\lclig{IJ}{ij}}
\def\slot_SS{\uclig{SS}{germandbls}}

\def\ligs_rangedash{\ligature{LIG}{hyphen}{punctdash}}
\def\ligs_ff{%
  \ligature{LIG}{\lc{I}{i}}{\lclig{FFI}{ffi}}
  \ligature{LIG}{\lc{L}{l}}{\lclig{FFL}{ffl}}}
\def\ligs_exclam{\ligature{LIG}{quoteleft}{exclamdown}}
\def\ligs_quoteright{\ligature{LIG}{quoteright}{quotedblright}}
\def\ligs_comma{\ligature{LIG}{comma}{quotedblbase}}
\def\ligs_hyphen{\ligature{LIG}{hyphen}{rangedash}}
\def\ligs_less{\ligature{LIG}{less}{guillemotleft}}
\def\ligs_greater{\ligature{LIG}{greater}{guillemotright}}
\def\ligs_question{\ligature{LIG}{quoteleft}{questiondown}}
\def\ligs_quoteleft{\ligature{LIG}{quoteleft}{quotedblleft}}
\def\ligs_f{%
  \ligature{LIG}{\lc{I}{i}}{\lclig{FI}{fi}}
  \ligature{LIG}{\lc{F}{f}}{\lclig{FF}{ff}}
  \ligature{LIG}{\lc{L}{l}}{\lclig{FL}{fl}}}

} % end of group
