bugGNU roff - Bugs: bug #64602, [troff] `fl` request behavior...

 
 

bug #64602: [troff] `fl` request behavior difficult to rationalize

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sun 27 Aug 2023 08:05:01 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Documentation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 29 Dec 2023 07:42:57 AM UTC, comment #3: 

I forgot I had an open ticket about this.  It's fixed.


commit 8f004d83fc967a3b29253b2296d43ce54ad38b8d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Dec 27 15:57:09 2023 -0600

    [docs]: Revise explanation of `fl` request.

    This has been an annoying lacuna of groff documentation forever.

    $ printf '.c2 @\n123\n@fl\nABCDEF\nmore words\n' | groff -a
    <beginning of page>
    123 ABCDEF more words


A bug-closing ChangeLog entry will be in my next push.

G. Branden Robinson <gbranden>
Group administrator
Thu 31 Aug 2023 10:15:32 PM UTC, comment #2: 


comment #1:

>   The only output I see in the ps-file is "foobar".
>
>   How is the code supposed to alter the output?
>
>   Comments to explain the code are missing.


Comment #0 was written mainly as a note to myself because I have repeatedly wondered whether the `fl` request does anything at all in GNU troff.  I filed this because it does.

I don't have an answer to your question yet.

Long story short, I shall play an old notorious card.


/* You are not expected to understand this. */


And like Ritchie, at the time of writing, I don't understand it either.

That's the bug.  `fl`'s behavior needs to be understood by groff developers and documented so that users can understand it too.

G. Branden Robinson <gbranden>
Group administrator
Mon 28 Aug 2023 12:10:27 AM UTC, comment #1: 

  The only output I see in the ps-file is "foobar".

  How is the code supposed to alter the output?

  Comments to explain the code are missing.

Bjarni Ingi Gislason <bjarniig>
Sun 27 Aug 2023 08:05:01 PM UTC, original submission:  

In bug #64484, Deri brought something puzzling to my attention.

Observe the behavior of this input.


$ cat EXPERIMENTS/output-device.groff
foobar
.br
.ds a lorem\"
\X'1 X \(ti \*a'
.device 2 device \(ti \*a
.fl
\!x X 3 ! \(ti \*a
.output x X 4 output \(ti \*a
$ groff -Z EXPERIMENTS/output-device.groff
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
tfoobar
n12000 0
V24000
H72000
V24000
H72000
x X 1 X ~ lorem
wh2500
V24000
H74500
x X 2 device \(ti lorem
n12000 0
x X 3 ! \(ti lorem
x X 4 output \(ti lorem
x trailer
V792000
x stop


If we remove the `fl` (flush) request, "3" and "4" magically move to precede "1" and "2".


$ diff -u EXPERIMENTS/output-device.groff EXPERIMENTS/output-device2.groff
--- EXPERIMENTS/output-device.groff     2023-08-27 15:00:33.900430630 -0500
+++ EXPERIMENTS/output-device2.groff    2023-08-27 15:03:43.099885671 -0500
@@ -3,6 +3,5 @@
 .ds a lorem\"
 \X'1 X \(ti \*a'
 .device 2 device \(ti \*a
-.fl
 \!x X 3 ! \(ti \*a
 .output x X 4 output \(ti \*a
$ groff -Z EXPERIMENTS/output-device2.groff
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
md
DFd
tfoobar
n12000 0
x X 3 ! \(ti lorem
x X 4 output \(ti lorem
V24000
H72000
V24000
H72000
x X 1 X ~ lorem
wh2500
V24000
H74500
x X 2 device \(ti lorem
n12000 0
x trailer
V792000
x stop


What gives?  What's happening, and how do we explain this?

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 bjarniig (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  • -email is unavailable- added by gbranden (brought it to my attention)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-07 gbranden Item GroupIncorrect behaviour Documentation
    2023-12-29 gbranden StatusNeed Info Fixed
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-08-27 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-3e34.
    Corresponding source code