bugGNU roff - Bugs: bug #51609, [PATCH] [hdtbl] fix code style nits

 
 

bug #51609: [PATCH] [hdtbl] fix code style nits

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Fri 28 Jul 2017 11:17:23 PM UTC
   
 
Category:  Macro - others/general Severity:  3 - Normal
Item Group:  Lint Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 22 Jan 2022 07:20:57 AM UTC, comment #12: 

There was one part of this ticket that was arguably not lint.


commit 5dc52d9d7865955cf3aef71af74fc99110f5e5a5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Nov 1 03:17:07 2017 -0400

    hdtbl.tmac-u: Fix ignored escape sequence.

    The escape '\c' removes everything after it, except "\R..." ("info
    groff").

    Fixes Savannah #51609.

    Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
    Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>

diff --git a/contrib/hdtbl/hdtbl.tmac-u b/contrib/hdtbl/hdtbl.tmac-u
index 04305f960..a6b2bf37a 100644
--- a/contrib/hdtbl/hdtbl.tmac-u
+++ b/contrib/hdtbl/hdtbl.tmac-u
@@ -65,7 +65,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .ds t*cptn "".sp .4" \
             ".t*pv 1.0 1.0" \
             ".ad l" \
-            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\c\k*"\"
+            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\k*\c"\"
 .
 .
 .\" %beginstrip%


It turns out it was, however.  The ordering of these escape sequences makes no difference.

Illustration:


$ cat EXPERIMENTS/horizontal-mark-after-interruption.roff
.nf
going to set mark A\kA\c
\(emmark set
going to set mark B\c\kB
\(emmark set
going to set mark C\cfoobarbaz\kC
\(emmark set
Mark A is \nA.
Mark B is \nB.
Mark C is \nC.


The fact that registers 'B' and 'C' are not zero means that

> The escape '\c' removes everything after it, except "\R..." ("info groff").


...the foregoing claim is incorrect.

I'll see if our Texinfo manual misstates this matter.

G. Branden Robinson <gbranden>
Group administrator
Thu 02 Nov 2017 07:03:26 AM UTC, comment #11: 

Thanks, Werner.  I've fixed the two stragglers.


commit 19a0a27582d9680537641589b47c6214ee74928e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Nov 2 02:53:21 2017 -0400

    hdtbl.tmac-u: Terminate string defs with comment.

    Per Werner Lemberg and for consistency with the rest of the package,
    which is otherwise scrupulous about this (80 out of 82 string defs).

    String undefs were left alone.

    See Savannah #51609 for discussion.

    Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>

diff --git a/contrib/hdtbl/hdtbl.tmac-u b/contrib/hdtbl/hdtbl.tmac-u
index a6b2bf37..822ca6cc 100644
--- a/contrib/hdtbl/hdtbl.tmac-u
+++ b/contrib/hdtbl/hdtbl.tmac-u
@@ -111,8 +111,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .  nr t*# +1
 .
 .  \" Save current location for error checking at end
-.  ds t*FN \\[.F]
-.  ds t*LN \\[.c]
+.  ds t*FN \\[.F]\"
+.  ds t*LN \\[.c]\"
 .
 .  t*getarg cols \\$@\"        from here string `args' contains the rest of \\$@
 .  ie "\\*[cols]"" \


G. Branden Robinson <gbranden>
Group administrator
Wed 01 Nov 2017 08:15:00 AM UTC, comment #10: 
  • You can configure git to not shout if there are trailing spaces...
  • I consider it good practise to always finish `.ds' (with a string argument) and friends with `\"'.  In case some are missing I suggest to add them.
Werner LEMBERG <wl>
Group administrator
Wed 01 Nov 2017 07:13:59 AM UTC, comment #9: 

Thanks, Werner. I guess I should mention that I was aware of that, but we have git these days shouting warnings at us if we add trailing whitespace to lines, and the practice is not consistently followed in the file.  So I was not sure.

$ grep -nE '^\.\s+ds' contrib/hdtbl/hdtbl.tmac-u | grep -v '"$'
114:.  ds t*FN \\[.F]
115:.  ds t*LN \\[.c]
172:.    ds t*bc\\n[t*#]
182:.    ds width
248:.    ds a\\n[t#]
288:.  ds #t#r \\n[t*#]*\\n[t*r#\\n[t*#]]\"             table row identifier
343:.  ds #trc \\*[#t#r]*\\n[c#\\*[#t#r]]\"   table cell identifier
410:.    ds *
451:.  ds #t#r \\n[t*#]*\\n[t*r#\\n[t*#]]\"             refresh table row identifier
824:.  ds #t#r \\n[t*#]*\\n[t*r#\\n[t*#]]\"             refresh table row identifier

G. Branden Robinson <gbranden>
Group administrator
Wed 01 Nov 2017 07:09:24 AM UTC, comment #8: 


> Can someone tell me what the point is of having all these string definitions end with a null comment?


This is even in the info manual (section 5.19, `Strings'): It prevents accidental addition of trailing spaces, which are not ignored by `.ds'.

Werner LEMBERG <wl>
Group administrator
Wed 01 Nov 2017 03:01:23 AM UTC, comment #7: 

The cosmetic half of this ticket is fixed in d0f0f3fffadaa2c28e8aabe919dfbf6ca3a73d61.

G. Branden Robinson <gbranden>
Group administrator
Wed 01 Nov 2017 03:00:21 AM UTC, comment #6: 

By "all these", I mean:

    42  .ds t*hl s\"
    43  .ds t*vl s\"
    44  .ds t*tal l\"
    45  .ds t*hal b\"
    46  .ds t*val t\"
    47  .ds t*ff \\n[.fam]\"
    48  .ds t*fst \\n[.f]\"
    49  .ds t*fsz 1 1\"
    50  .ds t*fgc red4\"
    51  .ds t*bgc bisque\"
    52  .ds t*bc red4\"

    65  .ds t*cptn "".sp .4" \
    66              ".t*pv 1.0 1.0" \
    67              ".ad l" \
    68              "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\c\k*"\"

    73  .\" for better error messages
    74  .ds nth-1 st\"
    75  .ds nth-2 nd\"
    76  .ds nth-3 rd\"


G. Branden Robinson <gbranden>
Group administrator
Wed 01 Nov 2017 02:58:01 AM UTC, comment #5: 

Can someone tell me what the point is of having all these string definitions end with a null comment?

G. Branden Robinson <gbranden>
Group administrator
Mon 30 Oct 2017 03:36:08 AM UTC, comment #4: 

Thanks, Bjarni!

G. Branden Robinson <gbranden>
Group administrator
Sun 29 Oct 2017 06:43:15 PM UTC, comment #3: 


  I got an email with the content of what I had put into the window on the
web-site.

  I think this empty display on the web-site has happened to me once before,
and the cause was, that I had forgotten to add a last line
"<hyphen-minus>verbatim<hyphen-minus>", as the first line in the window was
<plus>verbatim<plus>.

  So there is somewhere a bug in the display software, showing nothing when
"<hyphen-minus>verbatim<hyphen-minus>" line is missing.

  Here is what the received e-mail contained ("Details:".  I added '>' to
the first line)):

>From 5eee8669823ae738770b59cb2a616c554c40fdde Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Fri, 28 Jul 2017 22:17:15 +0000
Subject: [PATCH] src: hdtbl.tmac-u: Fix one formatting and one bug

  Increase space between sentences.

  The escape '\c' removes everything after it, except "\R..." ("info groff").

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 contrib/hdtbl/hdtbl.tmac-u | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/hdtbl/hdtbl.tmac-u b/contrib/hdtbl/hdtbl.tmac-u
index 069f9ce5..54be05d3 100644
--- a/contrib/hdtbl/hdtbl.tmac-u
+++ b/contrib/hdtbl/hdtbl.tmac-u
@@ -19,7 +19,7 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
Public License
 for more details.

 You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

 ..
 .
@@ -66,7 +66,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
 .ds t*cptn "".sp .4" \
             ".t*pv 1.0 1.0" \
             ".ad l" \
-            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\c\k*"\"
+            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\k*\c"\"
 .
 .
 .\" %beginstrip%
--
2.13.2


Bjarni Ingi Gislason <bjarniig>
Sun 29 Oct 2017 04:51:35 PM UTC, comment #2: 

gbranden: No, this is indeed an empty ticket without any information whatsoever.  You should probably close it as invalid.

Ingo Schwarze <schwarze>
Group Member
Sun 29 Oct 2017 02:22:58 AM UTC, comment #1: 

I see neither an attachment nor a non-blank "original submission" to this bug. Is the problem on my end?

G. Branden Robinson <gbranden>
Group administrator
Fri 28 Jul 2017 11:17:23 PM UTC, original submission:  


From 5eee8669823ae738770b59cb2a616c554c40fdde Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Fri, 28 Jul 2017 22:17:15 +0000
Subject: [PATCH] src: hdtbl.tmac-u: Fix one formatting and one bug

  Increase space between sentences.

  The escape '\c' removes everything after it, except "\R..." ("info groff").

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 contrib/hdtbl/hdtbl.tmac-u | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/hdtbl/hdtbl.tmac-u b/contrib/hdtbl/hdtbl.tmac-u
index 069f9ce5..54be05d3 100644
--- a/contrib/hdtbl/hdtbl.tmac-u
+++ b/contrib/hdtbl/hdtbl.tmac-u
@@ -19,7 +19,7 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.

 You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

 ..
 .
@@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
 .ds t*cptn "".sp .4" \
             ".t*pv 1.0 1.0" \
             ".ad l" \
-            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\c\k*"\"
+            "\m[\\*[t*fgc]]Table \\n+[t*cptn]:\0\k*\c"\"
 .
 .
 .\" %beginstrip%
--
2.13.2

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 wl (Posted a comment)
  • -email is unavailable- added by schwarze (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-22 gbranden Summary[PATCH] src: hdtbl.tmac-u: Fix one formatting and one bug [PATCH] [hdtbl] fix code style nits
    2022-01-22 gbranden Item GroupNone Lint
    2018-11-05 gbranden Open/ClosedOpen Closed
        Planned ReleaseNone 1.22.4
    2017-11-01 gbranden StatusIn Progress Fixed
    2017-11-01 gbranden StatusNeed Info In Progress
    2017-11-01 gbranden StatusIn Progress Need Info
    2017-11-01 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2017-10-30 gbranden StatusNeed Info None
    2017-10-29 gbranden CategoryNone Macro - others/general
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code