bugGNU roff - Bugs: bug #42978, [PATCH] tbl does not restore the...

 
 

bug #42978: [PATCH] tbl does not restore the tab settings

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Wed 13 Aug 2014 07:29:51 PM UTC
   
 
Category:  Preprocessor tbl Severity:  2 - Minor
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 21 Oct 2020 07:05:05 AM UTC, comment #3: 


commit d0e03cf610aa4e7bb9a549535bcce8ba5f8b9435
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Oct 20 23:39:06 2020 +1100

    [tbl] Save and restore tab stops.

    * src/preproc/tbl/table.cpp (table::init_output): Save the value of
      \n[.tabs] when starting a table.  In the reset macro, restore the
      saved value.

    Based on a patch by Bjarni Ingi Gislason (tweaked to use a more
    normative preprocessor symbol; "REG"s aren't "NAME"s).

    Fixes <https://savannah.gnu.org/bugs/index.php?42978>.

commit e462a5e55180c22e3263335d172db1043020c22f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Oct 20 23:39:38 2020 +1100

    Add regression test for Savannah #42978.

    As usual, this fails right now, but the next commit will fix it.


G. Branden Robinson <gbranden>
Group administrator
Wed 15 Nov 2017 01:49:31 AM UTC, comment #2: 


  The example in the former contributions can not be used unaltered as the
tabs were changed to spaces, both in the web page and the e-mails.

>From b99c35f5ecd0518677fa53706807a61df01ed789 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Wed, 15 Nov 2017 01:37:37 +0000
Subject: [PATCH] src, tbl, table.cpp: Save the ".tabs" register to restore it
 later

  When "tbl" changes the tab-settings, the inital settings are not stored and
can thus not be restored at the end of its processing.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 src/preproc/tbl/table.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index ad2a3064..41daed67 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -62,6 +62,7 @@ const int DEFAULT_COLUMN_SEPARATION = 3;
 #define ROW_MAX_LINE_REG PREFIX "lnmx"
 #define REPEATED_NM_SET_MACRO PREFIX "rlns"
 #define REPEATED_NM_SUS_MACRO PREFIX "rlnx"
+#define SAVED_TABS_REG PREFIX "tabs"

 // this must be one character
 #define COMPATIBLE_REG PREFIX "c"
@@ -1762,11 +1763,13 @@ void table::init_output()
          ".ie \\n[.u] .fi\n"
          ".el .nf\n"
          ".ce \\n[.ce]\n"
+         ".ta \\\\*[" SAVED_TABS_REG "]\n"
          "..\n"
          ".nr " SAVED_INDENT_REG " \\n[.i]\n"
          ".nr " SAVED_FONT_REG " \\n[.f]\n"
          ".nr " SAVED_SIZE_REG " \\n[.s]\n"
          ".nr " SAVED_FILL_REG " \\n[.u]\n"
+         ".ds " SAVED_TABS_REG " \\n[.tabs]\n"
          ".nr T. 0\n"
          ".nr " CURRENT_ROW_REG " 0-1\n"
          ".nr " LAST_PASSED_ROW_REG " 0-1\n"
--
2.15.0


Bjarni Ingi Gislason <bjarniig>
Wed 13 Aug 2014 07:33:22 PM UTC, comment #1: 

  Had to use "verbatim" markup!

Package: groff
Version: 1.22.2
Severity: normal
Tags: upstream
Charmap: ISO-8859-1

  The GNU tbl command changes the setting of the tabs and does not
restore them when finished.

  Example

.TH TBS-TEST 1 "12-08-2014"
.LP
.TS
l l.
Line 1, first column    second column
Line 2, first column    second column
.TE
.EX
#!/bin/sh
case $#
1)
        if something; then
                this
        else
                the other thing
        fi
;;
esac
.EE

  Output from "man -l ..." is:

TBS-TEST(1)                 General Commands Manual                TBS-TEST(1)



       Line 1, first column   second column
       Line 2, first column   second column
       #!/bin/sh
       case $#
       1)
                           if somthing; then
                                           this
                           else
                                           the other thing
                           fi
       ;;
       esac



                                  12-08-2014                       TBS-TEST(1)
## End of man output


Bjarni Ingi Gislason <bjarniig>
Wed 13 Aug 2014 07:29:51 PM UTC, original submission:  

Package: groff
Version: 1.22.2
Severity: normal
Tags: upstream
Charmap: ISO-8859-1

  The GNU tbl command changes the setting of the tabs and does not
restore them when finished.

  Example

.TH TBS-TEST 1 "12-08-2014"
.LP
.TS
l l.
Line 1, first column    second column
Line 2, first column    second column
.TE
.EX
#!/bin/sh
case $#
1)
        if something; then
                this
        else
                the other thing
        fi
;;
esac
.EE

  Output from "man -l ..." is:

TBS-TEST(1)                 General Commands Manual                TBS-TEST(1)



       Line 1, first column   second column
       Line 2, first column   second column
       #!/bin/sh
       case $#
       1)
                           if somthing; then
                                           this
                           else
                                           the other thing
                           fi
       ;;
       esac



                                  12-08-2014                       TBS-TEST(1)
## End of man output

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by schwarze (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-21 gbranden Item GroupFeature change Incorrect behaviour
        StatusConfirmed Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2020-10-13 barx Carbon-CopyRemoved 93119 -
    2020-10-13 barx Summarytbl does not restore the tab settings [PATCH] tbl does not restore the tab settings
    2018-02-16 schwarze CategoryNone Preprocessor tbl
        Severity3 - Normal 2 - Minor
        Item GroupNone Feature change
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code