groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] hyphenation issues


From: Werner LEMBERG
Subject: Re: [groff] hyphenation issues
Date: Sat, 05 May 2018 15:43:35 +0200 (CEST)

>> > +  static int n_max = (HYPHEN_NOT_LAST_LINE | HYPHEN_NOT_LAST_CHARS
>> > +    | HYPHEN_NOT_FIRST_CHARS | HYPHEN_LAST_CHAR
>> > +    | HYPHEN_FIRST_CHAR);
>> 
>> s/static int/int const/?

Please use `const int' – there is no single instance of `int const' in
the groff code.

>> Given the enum,
>> 
>>     enum {
>>       HYPHEN_NOT_LAST_LINE = 2,
>>       HYPHEN_NOT_LAST_CHARS = 4,
>>       HYPHEN_NOT_FIRST_CHARS = 8,
>>       HYPHEN_LAST_CHAR = 16,
>>       HYPHEN_FIRST_CHAR = 32
>>     };
>> 
>> I'd suggest adding
>> 
>>     HYPHEN_NONE = 0,
>>     HYPHEN_DEFAULT = 1,
>>     HYPHEN_MAX = 63 // Or whatever the local naming convention is.

Yes.

>> Then test for
>> 
>>     n > HYPHEN_MAX
>>     n & HYPHEN_DEFAULT && n & ~HYPHEN_DEFAULT
>> 
>> in addition to the existing
>> 
>>     n & HYPHEN_FIRST_CHAR && n & HYPHEN_NOT_FIRST_CHARS
>>     n & HYPHEN_LAST_CHAR && n & HYPHEN_NOT_LAST_CHARS
> 
> Werner, what do you think?

I prefer that.  It's always a bit problematic ORing enumeration values
(I know how to circumvent that limitation, but...)


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]