groff
[Top][All Lists]
Advanced

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

Help wanted from me(7) users (was: [bug #59812] tbl: interferes with .nm


From: G. Branden Robinson
Subject: Help wanted from me(7) users (was: [bug #59812] tbl: interferes with .nm line numbering)
Date: Thu, 25 Feb 2021 18:04:46 +1100
User-agent: NeoMutt/20180716

Hi folks,

I could use some help from "me" macro package users, as I have no
facility with the package myself.

Background: In 2011, tbl grew some Werner wizardry to cope with some me
features that were interacting badly with tables.

Here's the commit message:

commit b69062693d3360efce9d4d63fac337be21e07db7
Author: Werner LEMBERG <wl@gnu.org>
Date:   Wed Jul 20 18:44:50 2011 +0000

    Improve line numbering support in tbl and with me macros.

    * tmac/e.tmac (n1, n2, TH, PS): Implement it.
    (@h, @n, @o, @t, @k, )b, (c, (q, )q, (l, )l, (f, @q, PE): Updated.
    * doc/meref.me: Document changes.

    * src/preproc/tbl/table.cpp (ROW_START_LINE_REG, ROW_SAVE_LINE_REG,
    ROW_MAX_LINE_REG, REPEATED_NM_SET_MACRO, REPEATED_NM_SUS_MACRO): New
    macros.
    (table::init_output): Define REPEATED_NM_SET_MACRO and
    REPEATED_NM_SUS_MACRO.
    (table::print_single_hline, table::print_double_hline,
    table::define_bottom_macro, table::do_row, table::do_top,
    table::do_bottom): Updated.

    * doc/webpage.ms: Updated.

Last November, Olle Lögdahl reported a bug in tbl interaction with
the .nm request[1].  The details are described below in my own commit
messages and includes a root-cause analysis of the problem.

I also verified that Werner's change caused the misbehavior reported by
Olle; when I "reverted" the patch to table.cpp by commenting out every
added line, the bad behavior did not manifest.

But just reverting the patch was not a tempting option because (1)
Werner knows what he's doing and (2) it would probably regress the
problem originally observed.  However, I don't know what it was; traffic
on this list for July 2011 doesn't reveal anything.

So I could use the help of a practiced me(7) user, particularly of the
macros noted in Werner's commit above, to verify that my fix has not
regressed desirable me(7) behavior.

I'd be happy to write a regression test for groff's me(7) macros to
maintain ongoing correct functionality; I just need a minimal
reproducing case to base it on.  If we get one, it would be our very
first test for me(7)...

At 2021-02-25T01:47:08-0500, G. Branden Robinson wrote:
> Update of bug #59812 (project groff):
> 
>                   Status:               Confirmed => Fixed                  
>              Assigned to:                    None => gbranden               
>              Open/Closed:                    Open => Closed                 
>          Planned Release:                    None => 1.23.0                 
> 
>     _______________________________________________________
> 
> Follow-up Comment #4:
> 
> 
> commit 633de5c27e299ba9421ca8ba298a5bc90e56ff1c (HEAD -> master,
> origin/master, origin/HEAD)
> Author: G. Branden Robinson <g.branden.robinson@gmail.com>
> Date:   Thu Feb 25 17:28:43 2021 +1100
> 
>     Fix Savannah #59812.
>     
>     Fix bug where having line numbering off but the output line number
>     register \n[ln] set to a positive value would cause tbl(1) table rows to
>     spontaneously become numbered.  Use new \n[.nm] register to determine
>     whether line numbering is enabled.
>     
>     * src/preproc/tbl/table.cpp (table::init_output, table::do_row,
>       table::do_bottom): Predicate all conditions on \n[ln] additionally on
>       \n[.nm].
>     
>     Thanks to Olle Lögdahl for the report.  Problem appears to date back to
>     commit b69062693d3360efce9d4d63fac337be21e07db7, 20 July 2011.
>     
>     Fixes <https://savannah.gnu.org/bugs/?59812>.
> 
> commit b80434b3ebaef62fb8951c4b0b7c3de023742f1d
> Author: G. Branden Robinson <g.branden.robinson@gmail.com>
> Date:   Thu Feb 25 15:08:56 2021 +1100
> 
>     Add regression test for Savannah #59812.
>     
>     * src/preproc/tbl/tests/cooperate-with-nm-request.sh: Do it.
>     * src/preproc/tbl/tbl.am (tbl_TEST): Run test.
>     
>     Test will fail at this commit.
> 
> commit 8ebfa98ccdaead192ff13232107d2f376f8115a8
> Author: G. Branden Robinson <g.branden.robinson@gmail.com>
> Date:   Thu Feb 25 09:32:18 2021 +1100
> 
>     Implement new read-only register ".nm".
>     
>     It reports the enablement status of output line numbering (caused by the
>     .nm request) irrespective of the temporary suspension of numbering with
>     the .nn request.  Needed because there was no way to introspect its
>     state, tbl(1) needs to do so, and the writable line number register
>     \n[ln] is not a reliable proxy for it.
> 
>     * src/roff/troff/env.h: Add get_numbering_nodes(), returning `int`,  to
>       public interface of `environment` class.
>     * src/roff/troff/env.cpp: Implement get_numbering_nodes().
>     
>     * src/roff/groff/tests/dot-nm_register_works.sh: Test it.
>     * src/roff/groff/groff.am (groff_TESTS): Run test.
>     
>     * doc/groff.texi (Miscellaneous):
>     * man/groff_diff.7.man (Language/New number registers):
>     * man/groff.7.man (Registers/Read-only registers): Document it.
>     
>     * NEWS: Add item.
> 
> 
>     _______________________________________________________
> 
> Reply to this item at:
> 
>   <https://savannah.gnu.org/bugs/?59812>

Regards,
Branden

[1] https://lists.gnu.org/archive/html/groff/2020-11/msg00103.html

Attachment: signature.asc
Description: PGP signature


reply via email to

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