[Top][All Lists]

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

Re: ANN: ncurses-6.1-20180303

From: Kirill Kolyshkin
Subject: Re: ANN: ncurses-6.1-20180303
Date: Tue, 13 Mar 2018 11:28:04 -0700

On 12 March 2018 at 13:47, Thomas Dickey <address@hidden> wrote:
> On Mon, Mar 12, 2018 at 07:51:05PM +0100, Sven Joachim wrote:
> > On 2018-03-04 02:22 +0000, Thomas Dickey wrote:
> >
> > >     + modify generated terminfo.5 to not use "expand" and related width
> > >       on the last column of tables, making layout on wide terminals look
> > >       better (adapted from patch by Kir Kolyshkin).
> >
> > Unfortunately, this change leads to a warning from "man" on not so wide
> > terminals, reported by Debian's lintian tool.
> >
> > ,----
> > | $ MANWIDTH=80 man -l terminfo.5 > /dev/null
> > | <standard input>:483: warning [p 6, 2.3i, div `3tbd8,3', 0.2i]: can't 
> > break line
> > `----
> >
> > Could you please have a look?
> I noticed this last weekend (after code-freeze):
>         lintian warning for terminfo.src could be fixed by reducing lw25 to
>         lw24 in MKterminfo.sh

Well, it is set to 25 for a reason -- the longest element in the first column
(of all the tables that have lw25) is 25 characters. Here is my crude way
of figuring it out:

$ awk '/^\.TS/ {t=1; next;} /^\.TE/ {t=0; next} /T{$/ {if (t) {print;
s=1; next;}} /^T}$/ {s=0; next;} {if (t && !s) print}' < terminfo.5 |
awk -F $'\t' '{print length($1),$1}'  | sort -nr | head -5
25 enter_near_letter_quality
25 bit_image_carriage_return
24 hue_lightness_saturation
24 greater-than-or-equal-to
24 enter_horizontal_hl_mode

Besides, the warning does not go away (at least on my system), as it is
unrelated to the width of the first column.

The warning is caused by the following fragment (source):

max_micro_address       maddr   Yd      T{
maximum value in micro_..._address

which is rendered to:

            max_micro_address           maddr    Yd     maximum value in

So, groff, in its infinite wisdom, somehow calculates the last column
width to be
16 characters and then the "micro_..._address" is not fitting in as
it's 17 characters
long and can't be broken. One solution would be to use ellipsis unicode symbol
(…) instead of three periods, and groff even has support for it, but
again it might
not be universally available.

Also, while looking at it, I discovered one more issue, albeit very minor.
Apparently the original authors wanted all the tables to be aligned to each
other, so they used the "lw25 lw6 lw2 lw20" alignment, based on maximum
width of values in respective columns. But there are two cases of 7 character
words in column 2, which makes the last two tables (out of 6 using this
alignment) being non-aligned to others. The fix is to change lw6 to lw7.

Based on all of the above, I suggest to
 - leave the last column width as it was;
 - remove "expand" (as it is already done in latest snapshot);
 - and change the width of the second column from 6 to 7.

This is far from the best solution, but is a good compromise between
rendering on narrow and wide terminals, and there are no warnings.

Here's a patch against the latest snapshot (v6_1_20180303):

diff --git a/man/MKterminfo.sh b/man/MKterminfo.sh
index 1b6f8945..57e1b1d6 100755
--- a/man/MKterminfo.sh
+++ b/man/MKterminfo.sh
@@ -71,7 +71,7 @@ rm -f $sorted $temp $unsorted
 sed -n <$caps "\
 /^#%center/s, expand,,
-/^#%lw[1-9]/s, lw[1-9][0-9]*\., l.,
+/^#%lw25/s, lw6 , lw7 ,
 s/[ ][ ]*/ /g

reply via email to

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