bugGNU roff - Bugs: bug #64233, [troff] make requests' treatment...

 
 

bug #64233: [troff] make requests' treatment of Boolean arguments more consistent

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Mon 22 May 2023 05:32:39 AM UTC
   
 
Category:  Core Severity:  1 - Wish
Item Group:  Feature change Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 07 Sep 2024 01:39:29 PM UTC, comment #2: 


commit c7f4885869b2db096f78bd30e685253cdc4b3891
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Sep 2 01:58:36 2024 -0500

    [troff]: `kern` req now works like `color` et al.

    The `kern` request now interprets arguments with negative values as
    instructions to disable the corresponding feature, using the *roff
    integer-to-Boolean conversion idiom instead of the C/C++ one.  Thus, if
    you invoke this request with a register interpolation, the outcome
    agrees with an `if` test of the register's value.

    * src/roff/troff/node.cpp: Demote type of global `global_kern_mode` from
      `int` to `bool`.

      (set_kerning_mode): Assign value to `global_kern_mode` using *roff
      integer-to-Boolean conversion idiom.  When no argument is present,
      assign using Boolean, not integer, literal.

      (init_node_requests): Back `.kern` register with an object of class
      `readonly_boolean_register` instead of `readonly_register`.

    * doc/groff.texi.in (Ligatures and Kerning):
    * man/groff.7.man (Request short reference):
    * man/groff_diff.7.man (New requests):
    * NEWS: Document it.


G. Branden Robinson <gbranden>
Group administrator
Tue 20 Feb 2024 04:36:04 AM UTC, comment #1: 

"I was back at the flat so quick that I nearly met myself coming out." — P. G. Wodehouse

In groff development, I suppose, 9 months is speedy.

(The truth is, I'd forgotten I filed this.)


commit d592ab9e3d3f9efeacece25ed8b03676031bd02e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun Feb 11 10:21:25 2024 -0600

    [troff]: Alter color, cp, linetabs, vpt requests.

    [troff]: The `color`, `cp`, `linetabs`, and `vpt` requests now interpret
    arguments with negative values as instructions to disable the
    corresponding feature, using the *roff integer-to-Boolean conversion
    idiom instead of the C/C++ one.  Thus, if you invoke these requests with
    a register interpolation, the outcome agrees with an `if` test of the
    register's value.

    * src/roff/troff/div.cpp (vertical_position_traps):
    * src/roff/troff/env.cpp (widow_control_request) [WIDOW_CONTROL]
      (line_tabs_request):
    * src/roff/troff/input.cpp (activate_color, compatible): Do it.

    * doc/groff.texi.in (Tabs and Fields, Colors, Vertical Position Traps)
      (Compatibility Mode):
    * man/groff.7.man (Syntax reference conventions)
      (Request short reference):
    * man/groff_diff.7.man (New requests): Document it.


G. Branden Robinson <gbranden>
Group administrator
Mon 22 May 2023 05:32:39 AM UTC, original submission:  

In *roff, negative values are false when interpreted in a Boolean context.

But there are some nitty exceptions.


.color 0
.tm \n[.color]
0
.color -1
.tm \n[.color]
1


Explore making this more consistent.

G. Branden Robinson <gbranden>
Group administrator

 

(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 (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-20 gbranden Severity3 - Normal 1 - Wish
        Item GroupWarning/Suspicious behaviour Feature change
        StatusNone Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-05-22 gbranden Item GroupNone Warning/Suspicious behaviour

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code