On Thu, Mar 11, 2010 at 02:26:47PM +0200, Élie Roux wrote: > 2010/3/4 Karl Berry <[log in to unmask]>: > > > > Like CTAN, TL already has numerous hyphen.cfg's, so I see no impossible > > barrier on that front. I agree with Robin's suggestion of "disguising" > > it as a .dtx. > > > > Of course, Will's original point about the so-far-insuperable barriers > > to updating babel remains. > > Hello, > > would the attached .dtx file be ok? The interesting differences are in > the attached diff. It loads english in the format, so there should't > be any problem left. In fact, it loads the first language in the > format, but as far as I can tell, it's quite mandatory for it to be > english, right? > > Is this really OK with the LPPL? > > Thank you, > -- > Elie \def\select@language#1{% > \expandafter\ifx\csname date#1\endcsname\relax > \@noopterr{#1}% > \else > + \ifx\directlua\@undefined\else > + \input \csname bbl@l@patterns@#1\endcsname\relax > + \expandafter\ifx\csname bbl@l@exceptions@#1\endcsname\relax\else > + \input \csname bbl@l@exceptions@#1\endcsname\relax > + \fi > + \message{Loading patterns for #1.}% > + \fi > \bbl@patterns{\languagename}% > \originalTeX > \expandafter\def\expandafter\originalTeX * Also \foreign@language and \hyphenrules call \[log in to unmask] Therefore it think, \bbl@patterns is the better place to hook into. * Calling \input later is quite dangerous: * A catcode table with defined catcodes is necessary, e.g. luatex.sty's \CatcodeTableLaTeX. Without a catcode table it's cumbersome to assign all input characters using \catcode. (We are talking about Unicode input, not the 256 bytes of TeX82). * Empty lines might generate \par tokens, not a good idea, if outer horizontal mode is active. This can be fixed by using a \vbox. * The files might define macros that shouldn't leak in. \begingroup \setbox0=\vbox{% % set catcode table \input ...\relax }% \endgroup Alternative: Using a lua file, included via \directlua. It's more robust and more efficient. But the lua files must be generated somehow. It's probably possible to use the hyph-utf8 project for this. Also a more elaborate logic can be used: If a lua hyphen file exists load that language dynamically using \directlua. Otherwise use the \input method or load the patterns at iniTeX time. Yours sincerely Heiko <[log in to unmask]>