aboutsummaryrefslogtreecommitdiffstats
path: root/z36.c
diff options
context:
space:
mode:
authorJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:40:57 +0000
committerJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:40:57 +0000
commit26230a416563decd82a0af827c0987b8628c5ef9 (patch)
treeff226c95db8ba7104bc0f8b1d16a3a4b481c6949 /z36.c
parent51fe0cfa3e3ba27f55ff7d14a7fe077cc31ed0b7 (diff)
downloadlout-26230a416563decd82a0af827c0987b8628c5ef9.tar.gz
Lout 3.34.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@37 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'z36.c')
-rw-r--r--z36.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/z36.c b/z36.c
index c9a4a65..7f1e1d0 100644
--- a/z36.c
+++ b/z36.c
@@ -1,7 +1,7 @@
/*@z36.c:Hyphenation: Declarations@*******************************************/
/* */
-/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.33) */
-/* COPYRIGHT (C) 1991, 2006 Jeffrey H. Kingston */
+/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.34) */
+/* COPYRIGHT (C) 1991, 2007 Jeffrey H. Kingston */
/* */
/* Jeffrey H. Kingston (jeff@it.usyd.edu.au) */
/* School of Information Technologies */
@@ -1077,10 +1077,30 @@ OBJECT Hyphenate(OBJECT x)
/* for each word y of x, try to hyphenate it */
for( link = Down(x); link != x; link = NextDown(link) )
{ Child(y, link);
+ if( is_word(type(y)) && word_hyph(y) )
+ {
+ /* don't hyphenate a word preceding &<len>h */
+ if( NextDown(link) != x )
+ {
+ Child(z, NextDown(link));
+ if( type(z) == GAP_OBJ && mode(gap(z)) == HYPH_MODE )
+ word_hyph(y) = FALSE;
+ }
+ }
if( !is_word(type(y)) || string(y)[0] == '\0' || !word_hyph(y) )
{
if( type(y) == GAP_OBJ && mode(gap(y)) == HYPH_MODE )
+ {
nobreak(gap(y)) = FALSE;
+
+ /* don't hyphenate a word following &<len>h */
+ if( NextDown(link) != x )
+ {
+ Child(z, NextDown(link));
+ if( is_word(type(z)) )
+ word_hyph(z) = FALSE;
+ }
+ }
continue;
}
debug1(DHY, DD, "Hyphenate() examining %s", EchoObject(y));
@@ -1112,7 +1132,7 @@ OBJECT Hyphenate(OBJECT x)
/* if a - ended the run, hyphenate there only */
if( key[stop] == CH_HYPHEN )
{
- /* actually, don't hyphenate if the hyphen is last in the word [thanks Uwe] */
+ /* don't hyphenate if the hyphen is last in the word [thanks Uwe] */
if( key[stop+1] == '\0' )
continue;