bug-groff
[Top][All Lists]
Advanced

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

[bug #61348] [troff] assertion in env.cpp:distribute_space() has to come


From: G. Branden Robinson
Subject: [bug #61348] [troff] assertion in env.cpp:distribute_space() has to come out
Date: Wed, 20 Oct 2021 01:08:04 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #3, bug #61348 (project groff):


[comment #1 comment #1:]
>   This happens when the selected adjustment is NOT just to the left
> margin.
> 
> I have changed the default adjustment to the left one in my code.
> 
>  void environment::set_family(symbol fam)
> @@ -646,7 +646,7 @@ environment::environment(symbol nm)
>    char_slant(0),
>    space_size(12),
>    sentence_space_size(12),
> -  adjust_mode(ADJUST_BOTH),
> +  adjust_mode(ADJUST_LEFT),
>    fill(1),
>    interrupted(0),
>    prev_line_interrupted(0),
> 
> I have seen to many warnings about "cannot adjust line".
> 
> @@ -2122,7 +2116,7 @@ void environment::possibly_break_line(in
>       extra_space_width = target_text_length - bp->width;
>        else if (bp->width > 0 && target_text_length > 0
>              && target_text_length > bp->width)
> -     output_warning(WARN_BREAK, "cannot adjust line");
> +     output_warning(WARN_BREAK, "cannot adjust line at both margins");
>        break;
>      case ADJUST_CENTER:
>        saved_indent += (target_text_length - bp->width)/2;
> 

Hi Bjarni,

I'm afraid I don't agree with many of your claims.

I have written at length before about the difference between "alignment" and
"adjustment", in spite of the unfortunate history of AT&T troff's conflation
of these ideas.

So it is true that the `distribute_space()` function should only be called
when an output line is being _adjusted_.

You are at liberty to alter GNU roff to left-align output by default; please
keep your local customizations in mind when you file defect reports.  Also I
would note that a much less intrusive way to get the same result is available:
you can simply put '.ad l' or '.na' in the `troffrc` file instead of changing
the way an object is initialized in the C++ source.

I don't think either of your patches are suitable for inclusion in GNU roff
(although they're fine for your personal use--apart from potentially getting
out of sync with documentation I don't see any problems with them for a
private build).  GNU roff's default adjustment mode is what it is for
continuity with the 45+ years of history of AT&T troff and its descendants. 
Regarding the second patch, I find it redundant if we define the word
"adjustment" scrupulously; I have tried to move our documentation in that
direction and if you spot any exceptions I would appreciate you pointing them
out to me.

> Adjustment to both margins does not make sense with nroff,

It's made sense for longer than many groff users have been alive.
Some people might not care for it, which is why we try to give them ways to
express alternative preferences reliably, like the AD string in our man(7).

>  and should therefore NOT be the default for nroff and man pages,
>  for example by using ".ds AD l" and ".ad l" in tmac files.

I simply don't agree, except perhaps for new macro packages that might get
written; they're free to choose different defaults because they have no legacy
of expectations to meet.

> Especially for a long single word, like web addresses (URL).

This is indeed an ergonomic problem sometimes, and I'm mulling over possible
remedies for it--at least if you're thinking of the same diagnostic messages I
am.


troff: backtrace: '.../groff/build/../tmac/an-ext.tmac':107: macro
'link-text-div'
troff: backtrace: '.../groff/build/../tmac/an-ext.tmac':126: macro 'UE'
troff: backtrace: file './gpinyin.1':294
troff:./gpinyin.1:294: warning [p 1, 13.3i]: cannot adjust line


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61348>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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