Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id o23CHEh8025603 for ; Wed, 3 Mar 2010 13:17:15 +0100 Received: (qmail 28711 invoked by alias); 3 Mar 2010 12:17:09 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 03 Mar 2010 12:17:07 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx097) with SMTP; 03 Mar 2010 13:17:07 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id o23CErNq002514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Mar 2010 13:14:54 +0100 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o22N14op023869; Wed, 3 Mar 2010 13:14:48 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 401633 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 3 Mar 2010 13:14:48 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id o23CEmuD032542 for ; Wed, 3 Mar 2010 13:14:48 +0100 Received: from mail-bw0-f212.google.com (mail-bw0-f212.google.com [209.85.218.212]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o23CEW4N003213 for ; Wed, 3 Mar 2010 13:14:35 +0100 Received: by bwz4 with SMTP id 4so993395bwz.8 for ; Wed, 03 Mar 2010 04:14:44 -0800 (PST) Received: by 10.204.8.75 with SMTP id g11mr5978423bkg.172.1267618483943; Wed, 03 Mar 2010 04:14:43 -0800 (PST) Received: from localhost ([41.238.235.146]) by mx.google.com with ESMTPS id 13sm3661853bwz.15.2010.03.03.04.14.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Mar 2010 04:14:43 -0800 (PST) References: <20100301194054.GA4037@khaled-laptop> <20100303051417.GF3850@khaled-laptop> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Whitelist: Message-ID: <20100303121440.GB8116@khaled-laptop> Date: Wed, 3 Mar 2010 14:14:40 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Khaled Hosny Subject: Re: Babel, LuaTeX and hyphenation To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <20100303051417.GF3850@khaled-laptop> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p77e5KAPs1l6v/Sb97LojnDtMgfETrECMLUO9erHzOJe+OynZRhvlGqvET/J 3dm2vHWnQHIuidpgLhS+P7NNYz+zyHLMY9yCwGRsqrpGviweXX18EflQoe2CeNobnBdTGZnrLK0n C/DJg==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de X-Scanned-By: MIMEDefang 2.63 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 6309 --huq684BweRXVnRxX Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Wed, Mar 03, 2010 at 07:14:17AM +0200, Khaled Hosny wrote: > On Tue, Mar 02, 2010 at 11:19:01AM +1030, Will Robertson wrote: > > On 02/03/2010, at 6:10 AM, Khaled Hosny wrote: > > > > > Trying to fix this for Babel, i.e. hyphenation patterns are only loaded > > > when requested, I patched hyphen.cfg file to do so when running under > > > LuaTeX. It seems to work, as far as my tests go, except that would need > > > to explicitly select a language or there will be now hyphenations i.e. > > > Bebel don't seem to load any language by default (unlike plain TeX), and > > > I'm not sure how to handle this. > > > > > > Patch is attached for your comments. > > > > > > Without doing any tests myself, this looks fine to me. > > (Which of course doesn't mean anything.) > > > > My only comment for now is that the line > > > > \ifcsname bbl@l@exceptions@#1\endcsname > > > > should be better written without assuming eTeX: > > > > \expandafter\ifx\csname bbl@l@exceptions@#1\endcsname\relax\else > > OK, attached a new patch. Actually attaching the patch this time. After Robin's comment, I think the main issue now is to get english hyphenation patterns loaded by default (either in the format or whenever babel is loaded), but I don't really know how. Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer --huq684BweRXVnRxX Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="hyphen.cfg.diff" diff --git a/hyphen.cfg b/hyphen.cfg index 0465777..b86750c 100644 --- a/hyphen.cfg +++ b/hyphen.cfg @@ -48,7 +48,11 @@ \ifx\ProvidesFile\@undefined \def\ProvidesFile#1[#2 #3 #4]{% \wlog{File: #1 #4 #3 <#2>}% - \toks8{Babel <#3> and hyphenation patterns for }% + \ifx\directlua\@undefined% + \toks8{Babel <#3> and hyphenation patterns for }% + \else% + \toks8{Babel <#3> }% + \fi% \let\ProvidesFile\@undefined } \def\ProvidesLanguage#1[#2 #3 #4]{% @@ -57,7 +61,11 @@ \else \let\bbl@tempa\ProvidesFile \def\ProvidesFile#1[#2 #3 #4]{% - \toks8{Babel <#3> and hyphenation patterns for }% + \ifx\directlua\@undefined% + \toks8{Babel <#3> and hyphenation patterns for }% + \else% + \toks8{Babel <#3> }% + \fi% \bbl@tempa#1[#2 #3 #4]% \let\ProvidesFile\bbl@tempa} \def\ProvidesLanguage#1{% @@ -153,6 +161,12 @@ \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 + \fi \bbl@patterns{\languagename}% \originalTeX \expandafter\def\expandafter\originalTeX @@ -306,7 +320,9 @@ \expandafter\addlanguage\csname l@#1\endcsname \expandafter\language\csname l@#1\endcsname \def\languagename{#1}% - \global\toks8\expandafter{\the\toks8#1, }% + \ifx\directlua\@undefined + \global\toks8\expandafter{\the\toks8#1, }% + \fi \begingroup \bbl@get@enc#1:\@@@ \ifx\bbl@hyph@enc\@empty @@ -314,7 +330,11 @@ \fontencoding{\bbl@hyph@enc}\selectfont \fi \lefthyphenmin\m@ne - \input #2\relax + \ifx\directlua\@undefined + \input #2\relax + \else + \expandafter\gdef\csname bbl@l@patterns@#1\endcsname{#2} + \fi \ifnum\lefthyphenmin=\m@ne \else \expandafter\xdef\csname #1hyphenmins\endcsname{% @@ -336,7 +356,11 @@ \else \ifx\bbl@tempa\space \else - \input #3\relax + \ifx\directlua\@undefined + \input #3\relax + \else + \expandafter\gdef\csname bbl@l@exceptions@#1\endcsname{#3} + \fi \fi \fi } --huq684BweRXVnRxX--