Re: [BUG] italics run past where they should

2022-08-16 Thread G. Branden Robinson
Hi Alex,

At 2022-08-16T23:36:40+0200, Alejandro Colomar wrote:
> Okay, so I tried with Debian stable, and groff built from source
> doesn't have a bug there.
> 
> To reproduce the bug you need:
> 
> - Debian Sid
> - Any pager that does highlighting will do (tried less and batcat).
> - Any terminal emulator will do (tried xfce and xterm).
> - groff built from git HEAD

I find this utterly baffling.  If grotty(1) is producing the correct
escape sequences, then I cannot fathom how this can be a groff bug.

Furthermore, nothing about the way groff produces escape sequences for
graphic renditions has changed since groff 1.22.4.  (I _did_ add the OSC
8 feature, but it's off by default and the man page you're formatting
doesn't use them anyway, particularly not in the synopsis.)

One difference to keep in mind is that Debian's groff is patched to
recognize a "GROFF_SGR" environment variable, and disables SGR output
from grotty(1) by default.  So perhaps you could see if you can
reproduce it in Debian stable using its groff, but with GROFF_SGR=1 in
the environment.

In case it need be said, something I'm looking forward to as
co-maintainer of groff for Debian, if that eventuates and I don't
horrify Colin too badly in the meantime, is a serious reconsideration of
that patch.

Regards,
Branden


signature.asc
Description: PGP signature


[groff] 28/31: [ms]: Support pic(1) "flyback" feature.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 33c2f8cf681ff93804ea8a389f31f29764349d4e
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 01:04:08 2022 -0500

[ms]: Support pic(1) "flyback" feature.

* tmac/s.tmac (PF): Add macro; it does what `PE` formerly did, minus
  vertical spacing.

  (PE): Call `PF` and vertically space as before.

* doc/groff.texi (ms Insertions):
* doc/ms.ms (Tables, figures, equations, and references):
* tmac/groff_ms.7.man (Tables, figures, equations, and references):
  Document it.

* NEWS: Add item.

Fixes .

Also bump doc/ms.ms document date.
---
 ChangeLog   | 17 +
 NEWS|  3 +++
 doc/groff.texi  | 10 ++
 doc/ms.ms   | 19 ++-
 tmac/groff_ms.7.man | 13 +++--
 tmac/s.tmac |  5 -
 6 files changed, 55 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 87900afd4..8615277ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2022-08-15  G. Branden Robinson 
+
+   [ms]: Support pic(1) "flyback" feature.
+
+   * tmac/s.tmac (PF): Add macro; it does what `PE` formerly did,
+   minus vertical spacing.
+   (PE): Call `PF` and vertically space as before.
+
+   * doc/groff.texi (ms Insertions):
+   * doc/ms.ms (Tables, figures, equations, and references):
+   * tmac/groff_ms.7.man (Tables, figures, equations, and
+   references): Document it.
+
+   * NEWS: Add item.
+
+   Fixes .
+
 2022-08-15  G. Branden Robinson 
 
* tmac/s.tmac (@PS): Validate better; check for 2 arguments
diff --git a/NEWS b/NEWS
index c3b710950..306be4bab 100644
--- a/NEWS
+++ b/NEWS
@@ -387,6 +387,9 @@ o The s (ms) macro package's `RP` macro recognizes a new 
optional
   the latter will continue to be supported for backward compatibility.
   Optional arguments to `RP` can be given in any order.
 
+o The s (ms) package now offers a `PF` macro, supporting the pic(1)
+  preprocessor's "flyback" feature.
+
 o The "a4.tmac" file has been dropped from the distribution.  Its
   successor, "papersize.tmac", has been present and documented for
   nearly 20 years.  See subsection "Paper size" of groff(1).
diff --git a/doc/groff.texi b/doc/groff.texi
index 85adaf9e3..904bad805 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3968,10 +3968,12 @@ use.
 @endDefmac
 
 @DefmacList {PS, , ms}
-@DefmacListEndx {PE, , ms}
-Demarcate a diagram to be processed by the @code{pic} preprocessor.  You
-can create @code{pic} input manually or by using a program such as
-@code{xfig}.
+@DefmacItemx {PE, , ms}
+@DefmacListEndx {PF, , ms}
+@code{PS} begins a picture to be processed by the @command{gpic}
+preprocessor; either of @code{PE} or @code{PF} ends it, the latter with
+``flyback'' to the vertical position at its top.  You can create
+@code{pic} input manually or with a program such as @code{xfig}.
 @endDefmac
 
 @DefmacList {EQ, [@Var{align} [@Var{label}]], ms}
diff --git a/doc/ms.ms b/doc/ms.ms
index c2eec839e..b19c4fe21 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -22,8 +22,8 @@
 .nr TC-MARGIN \w'00' \" expect 2-digit page numbers at most
 .ie t .nr PI 3.5n
 .el   .nr PI 4n
-.ND July 2022
-.EH '%''July 2022'
+.ND August 2022
+.EH '%''August 2022'
 .EF 
 .OH 'Using \f[I]groff\f[] with the \f[I]ms\f[] macros''%'
 .OF 
@@ -2396,14 +2396,23 @@ T{
 \&.PS
 .br
 \&.PE
+.br
+\&.PF
 T} T{
-Demarcate a diagram to be processed by the
+.CW .PS
+begins a picture to be processed by the
 .I pic
-preprocessor.
+preprocessor;
+either of
+.CW .PE
+or
+.CW .PF
+ends it,
+the latter with \[lq]flyback\[rq] to the vertical position at its top.
 .
 You can create
 .I pic
-input manually or by using a program such as
+input manually or with a program such as
 .I xfig (1).
 T}
 _
diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index eb9af571b..e64c9b464 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -1481,9 +1481,18 @@ examples of its use.
 .B .PS
 .TQ
 .B .PE
-Demarcate a diagram to be processed by the
+.TQ
+.B .PF
+.B .PS
+begins a picture to be processed by the
 .I pic
-preprocessor.
+preprocessor;
+either of
+.B .PE
+or
+.B .PF
+ends it,
+the latter with \[lq]flyback\[rq] to the vertical position at its top.
 .
 .
 .TP
diff --git a/tmac/s.tmac b/tmac/s.tmac
index ec9602489..bdc5fd0bf 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2070,9 +2070,12 @@ along with this program.  If not, see 
.
 .\}
 .HTML-IMAGE
 ..
-.de PE
+.de PF
 .HTML-IMAGE-END
 .par@reset
+..
+.de PE
+.PF
 .sp \\n[DD]u+.5m
 ..
 .\" 

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 30/31: NEWS: Add item for me(7)'s `PF` macro.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit b4bf6ddaf4b4bd3a5fe67826e5635c2b013dc5b0
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 21:08:54 2022 -0500

NEWS: Add item for me(7)'s `PF` macro.
---
 NEWS | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 306be4bab..288901551 100644
--- a/NEWS
+++ b/NEWS
@@ -316,6 +316,10 @@ o The e (me) macro package's `$v` and `$V` registers have 
been renamed
   are expected to set them if desired, unlike other registers and
   strings beginning with "$".
 
+o The e (me) and s (ms) macro packages now offer a `PF` macro,
+  supporting the pic(1) preprocessor's "flyback" feature.  Thanks to
+  Dave Kemper.
+
 o The m (mm) macro package now recognizes a `V` register to set the
   vertical spacing for the document.  Like the existing `S`, it must be
   set from the command line.  Further, both registers are interpreted
@@ -387,9 +391,6 @@ o The s (ms) macro package's `RP` macro recognizes a new 
optional
   the latter will continue to be supported for backward compatibility.
   Optional arguments to `RP` can be given in any order.
 
-o The s (ms) package now offers a `PF` macro, supporting the pic(1)
-  preprocessor's "flyback" feature.
-
 o The "a4.tmac" file has been dropped from the distribution.  Its
   successor, "papersize.tmac", has been present and documented for
   nearly 20 years.  See subsection "Paper size" of groff(1).

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 16/31: groff_man_style(7): Drop claim about \c behavior.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 61e1f10ea969db1f465de4057fa92471beaa3355
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 05:20:47 2022 -0500

groff_man_style(7): Drop claim about \c behavior.

groff 1.22.4's groff(7) page said, "Anything after this escape on the
same line is ignored except \R (which works as usual)."

This wasn't true (see Savannah #61935) and I am entertaining a groff
extension to make it even less true than it is.

Consider the following.

.\" Put args in quotation marks.
.de QUOTE
\[lq]\\$*\[rq]
..
.nf
And indeed there will be time
To wonder, \c
.QUOTE Do I dare?\c
and, \c
.QUOTE Do I dare?
.fi
.pl \n[nl]u

$ nroff -Tascii EXPERIMENTS/prufrock.groff
And indeed there will be time
To wonder, "Do I dare?and, "Do I dare?"
---
 tmac/groff_man.7.man.in | 4 
 1 file changed, 4 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 3b884b9f9..9a296a977 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2499,10 +2499,6 @@ as in
 .BR .EX / .EE
 examples.
 .
-Nothing after
-.B \ec
-on the input line is formatted.
-.
 The next line is interpreted as usual and can `include' a macro call
 (contrast with
 .BI \e newline\/\c

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 27/31: doc/groff.texi: Fix missing bracket in synopsis.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 86484635302b9d127b2592f3af003910264c74a2
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 00:35:11 2022 -0500

doc/groff.texi: Fix missing bracket in synopsis.
---
 doc/groff.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 311d93f80..85adaf9e3 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -3974,7 +3974,7 @@ can create @code{pic} input manually or by using a 
program such as
 @code{xfig}.
 @endDefmac
 
-@DefmacList {EQ, [@Var{align} [@Var{label}], ms}
+@DefmacList {EQ, [@Var{align} [@Var{label}]], ms}
 @DefmacListEndx {EN, , ms}
 Demarcate an equation to be processed by the @code{eqn} preprocessor.
 The equation is centered by default; @var{align} can be @samp{C},

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 25/31: [mm]: Add new `PY` macro for pic flyback support.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9101cecb3b2a7b08f5469497faffc0e2ba5001eb
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 00:00:02 2022 -0500

[mm]: Add new `PY` macro for pic flyback support.

* contrib/mm/m.tmac (PY): Add new macro.

  (PE): Replace `init@reset` call with `PY` (and then space by half a
  vee as before).

* contrib/mm/groff_mm.7.man (PY): Document it.

Fixes .
---
 NEWS  |  3 +++
 contrib/mm/ChangeLog  | 10 ++
 contrib/mm/groff_mm.7.man | 12 
 contrib/mm/m.tmac |  5 -
 4 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 1ddf66b6f..c3b710950 100644
--- a/NEWS
+++ b/NEWS
@@ -334,6 +334,9 @@ o The m (mm) and s (ms) macro packages no longer manipulate 
the set of
 o The m (mm) and s (ms) macro packages' `R` macros now work analogously
   to their `B` and `I` macros instead of ignoring their arguments.
 
+o The m (mm) package now offers a `PY` macro, which serves the function
+  of `PF` (end pic(1) picture with flyback) from other macro packages.
+
 o The "ptx.tmac" macro file, a counterpart to the GNU coreutils ptx(1)
   command for generating permuted indexes, is now installed.  It has
   long been part of the source distribution.
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 9c996bc5d..5e59c6a17 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,13 @@
+2022-08-14  G. Branden Robinson 
+
+   * m.tmac (PY): Add new macro.
+   (PE): Replace `init@reset` call with `PY` (and then space by
+   half a vee as before).
+
+   * groff_mm.7.man (PY): Document it.
+
+   Fixes .
+
 2022-08-14  G. Branden Robinson 
 
* m.tmac (@warning, @error): Stop pointlessly using no-break
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index 7696bf46d..f085028cb 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -2903,6 +2903,18 @@ mode.
 .
 .
 .TP
+.B PY
+Picture end with flyback.
+.
+Ends a
+.MR @g@pic @MAN1EXT@
+picture,
+returning the vertical position to where it was prior to the picture.
+.
+This is a GNU extension.
+.
+.
+.TP
 .BR R \~\c \" space in roman because we must use 2-font macro with \c
 .RI [ roman-text\~\c
 .RI [ previous-font-text ]]\~.\|.\|.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index b024e22e4..f616292a1 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2405,8 +2405,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 .  if r ds*format .if !\\n[ds*lvl] .ne (u;\\$1)+1v
 .\}
 ..
-.de PE
+.de PY
 .init@reset
+..
+.de PE
+.PY
 .SP .5
 ..
 .\" ### module eq ###

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 31/31: groff_mm(7): Revise discussion of eqn features.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 342a115cdeb1a4d1f4a7e16e2fbfcb53516d7cd7
Author: G. Branden Robinson 
AuthorDate: Tue Aug 16 04:55:58 2022 -0500

groff_mm(7): Revise discussion of eqn features.

* Stop using the term "delimiter" confusingly.  It has a clear meaning
  within the eqn language, and this isn't it.
* Apply DRY principle.
* Recast.
---
 contrib/mm/groff_mm.7.man | 65 ---
 1 file changed, 33 insertions(+), 32 deletions(-)

diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index f085028cb..1136f88c2 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -1191,11 +1191,15 @@ See
 This macro defines string
 .BR TPeh .
 .
+.
 .TP
 .B EN
-Equation end, see
+End equation input preprocessed by
+.MR @g@eqn @MAN1EXT@ ;
+see
 .BR EQ .
 .
+.
 .TP
 .B EOP
 End-of-page user-defined macro.
@@ -1243,42 +1247,40 @@ the default is to center.
 See
 .BR PIC .
 .
-.TP
-.BI EQ\  \fR[\fPlabel\fR]\fP
-Equation start.
 .
-.BR EQ / EN
-are the delimiters for equations written for
+.TP
+.BR EQ \~[\c
+.IR label ]
+Start equation input preprocessed by
 .MR @g@eqn @MAN1EXT@ .
 .
-.BR EQ / EN
-must be inside of a
-.BR DS / DE
-pair, except if
 .B EQ
-is used to set options for
+and
+.B EN
+macro calls bracket an equation region.
+.
+Such regions must be contained in displays
+.RB ( DS / DE ),
+except when the region is used only to configure
 .I @g@eqn
-only.
+and not to produce output.
 .
-The
+If present,
 .I label
-argument appears at the right margin of the equation,
-centered vertically within the
-.BR DS / DE
-block,
-unless register
-.B Eq
-is\~1.
+appears at the aligned to the right and
+centered vertically within the display;
+see register
+.BR Eq .
 .
-Then the label appears at the left margin.
 .
-.IP
-If there are multiple
-.BR EQ / EN
-blocks within a single
-.BR DS / DE
-pair,
-only the last equation label (if any) is printed.
+If multiple
+.I eqn \" generic
+regions occur within a display,
+only the last
+.I label
+(if any)
+is used.
+.
 .
 .TP
 .BI EX\  "\fR[\fPtitle \fR[\fPoverride \fR[\fPflag \fR[\fPrefname\fR\fP"
@@ -4041,12 +4043,11 @@ If set to\~1, eject page before each first-level 
heading.
 .
 Default is\~0.
 .
+.
 .TP
 .B Eq
-Equation labels are left-aligned if set to\~0 and right-aligned if
-set to\~1.
-.
-Default is\~0.
+aligns equation labels to the left of a display if 1,
+and to the right if 0 (default).
 .
 .
 .TP

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 15/31: groff_man*(7): Use plan9port's formal name.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 4571cd8bc62d968c1a56740bed8fa5af0bc228df
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 05:18:49 2022 -0500

groff_man*(7): Use plan9port's formal name.
---
 tmac/groff_man.7.man.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index fa12cd7d8..3b884b9f9 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1225,7 +1225,7 @@ see
 .I \%an\-ext.tmac
 in section \(lqFiles\(rq below.
 .
-The plan9port project's
+Plan\~9 from User Space's
 .I troff \" plan9port
 implements
 .BR .MR .
@@ -3171,7 +3171,7 @@ and
 .BR .UR / .UE .
 .\" ...along with implementations of OP, EX, and EE.
 .
-The plan9port project's
+Plan\~9 from User Space's
 .I troff \" plan9port
 introduced
 .B .MR

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 29/31: groff_ms(7): Adjust dead-tree typography.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 96c7ea4f96ba5ff8a185eb30ac0b44758e144d26
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 01:05:07 2022 -0500

groff_ms(7): Adjust dead-tree typography.
---
 tmac/groff_ms.7.man | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index e64c9b464..d60eb7e97 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -1546,6 +1546,8 @@ as an unnumbered heading
 .RB ( .SH ).
 .
 .
+.br
+.ne 2v
 .P
 Attempting to place a multi-page table inside a keep can lead to
 unpleasant results,
@@ -2225,6 +2227,9 @@ and
 .B XH
 implementations support the following pair of callback macros:
 .
+.
+.br
+.ne 4v
 .TP
 .B \%.XN\-INIT
 .TQ
@@ -2846,6 +2851,8 @@ Macro Package\[rq];
 Larry Kollar and G.\~Branden Robinson.
 .
 .
+.br
+.ne 5v
 .TP
 .I @DOCDIR@/\:\%msboxes\:.ms
 .TQ

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 14/31: groff_man_style(7): Adjust dead-tree typography.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e3501a9351abfcdae236ef1021e89b171f711bae
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 05:16:53 2022 -0500

groff_man_style(7): Adjust dead-tree typography.

Give quote-like characters ' " and ` some "elbow room" when they are
themselves quoted.  No effect on terminal output.
---
 tmac/groff_man.7.man.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 9380e7dc0..fa12cd7d8 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2684,7 +2684,7 @@ Basic Latin neutral apostrophe.
 .
 Some
 output devices replace
-.RB \(lq \(aq \(rq
+.RB \(lq\| \(aq \|\(rq
 with a right single quotation mark.
 .
 .
@@ -2708,7 +2708,7 @@ Basic Latin quotation mark
 Use in macro calls to prevent
 .\" This page prefers double quotes, but not here because they are more
 .\" confusing to the eye when another double quote is what is quoted!
-.RB \(oq \(dq \(rq
+.RB \(oq\| \(dq \|\(rq
 .\" AT: .RB ` """'
 from being interpreted as beginning a quoted argument,
 or simply for readability.
@@ -2760,7 +2760,7 @@ for example,
 Basic Latin grave accent.
 .
 Some output devices replace
-.RB \(lq \(ga \(rq
+.RB \(lq\| \(ga \|\(rq
 with a left single quotation mark.
 .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 18/31: tbl(1): Document nroff mode vertical space issue.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 7925122f390decc2cdcc6072645b9e16190587ad
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 05:59:16 2022 -0500

tbl(1): Document nroff mode vertical space issue.

For me, at least, this knowledge was hard-won.  :-|
---
 src/preproc/tbl/tbl.1.man | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/src/preproc/tbl/tbl.1.man b/src/preproc/tbl/tbl.1.man
index 36dc21141..d97e312e1 100644
--- a/src/preproc/tbl/tbl.1.man
+++ b/src/preproc/tbl/tbl.1.man
@@ -1555,6 +1555,21 @@ so the
 .B u
 column modifier has no effect.
 .
+On terminal devices,
+horizontal rules and box borders occupy a full vee of space;
+this amount is doubled for
+.B doublebox
+tables.
+.
+Tables using these features thus require more vertical space in
+.I nroff
+mode than in
+.I troff
+mode:
+write
+.B ne
+requests accordingly.
+.
 .
 .P
 A text block within a table must be able to fit on one page.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 17/31: groff_man_style(7): Clarify and tighten wording.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e683a7670651bea6c8e7afd399ef424ca676a2a7
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 05:52:53 2022 -0500

groff_man_style(7): Clarify and tighten wording.
---
 tmac/groff_man.7.man.in | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 9a296a977..7661359f0 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -613,18 +613,14 @@ and
 and sentence endings are still detected and additional inter-sentence
 space applied.
 .
-If a user
-(or one of
-.IR groff 's
-localization support macro files)
-has changed the additional inter-sentence space amount,
-the latter process can change the rendering of,
+If the amount of additional inter-sentence is altered,
+the rendering of,
 for instance,
 regular expressions using
 .B .\&
 or
 .B ?\&
-followed by multiple spaces.
+followed by multiple spaces can change.
 .
 Use the non-printing input break escape sequence
 .B \(rs&

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 26/31: [ms]: Validate `PS` arguments better.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit b16ad66b8e4d50ba0b76536833eab853fc2ff8d0
Author: G. Branden Robinson 
AuthorDate: Mon Aug 15 00:24:48 2022 -0500

[ms]: Validate `PS` arguments better.

* tmac/s.tmac (@PS): Validate better; check for 2 arguments exactly.

Also improve diagnostic message wording.
---
 ChangeLog   | 5 +
 tmac/s.tmac | 7 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 4bddb824d..87900afd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-15  G. Branden Robinson 
+
+   * tmac/s.tmac (@PS): Validate better; check for 2 arguments
+   exactly.
+
 2022-08-14  G. Branden Robinson 
 
[pic]: Recognize `.PY` as synonym of `.PF`.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 15df9dc81..ec9602489 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2058,7 +2058,12 @@ along with this program.  If not, see 
.
 .de @PS
 .br
 .sp \\n[DD]u
-.ie \\n[.$]<2 .@error bad arguments to .PS (not preprocessed with pic?)
+.ie !\\n[.$]=2 \{\
+.  ds pic*msg .PS: expected 2 arguments, got \\n[.$]\"
+.  as pic*msg ; not preprocessed with pic?\"
+.  @error \\*[pic*msg]
+.  rm pic*msg
+.\}
 .el \{\
 .  ds@need (u;\\$1)+1v
 .  in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 12/31: groff_man_style(7): Relocate material.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit b612a98bc5c70f22fc0e6465480bf02f9a63d3f8
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 12:44:04 2022 -0500

groff_man_style(7): Relocate material.

Shift special character discussion so we can give it a leading
paragraph.
---
 tmac/groff_man.7.man.in | 280 
 1 file changed, 140 insertions(+), 140 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index a0057b683..aa1a94764 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2477,146 +2477,6 @@ and PDF.
 .
 .
 .TP
-.B \e\-
-Minus sign or basic Latin hyphen-minus.
-.
-This escape sequence produces the Unix command-line option dash in the
-output.
-.
-.RB \(lq \- \(rq
-is a hyphen in the
-.I roff
-language;
-some output devices replace it with U+2010
-(hyphen)
-or similar.
-.
-.
-.TP
-.B \e(aq
-Basic Latin neutral apostrophe.
-.
-Some
-output devices replace
-.RB \(lq \(aq \(rq
-with a right single quotation mark.
-.
-.
-.br
-.ne 3v
-.TP
-.B \e(oq
-.TQ
-.B \e(cq
-Opening (left) and closing (right) single quotation marks.
-.
-Use these for paired directional single quotes,
-\(oqlike this\(cq.
-.
-.
-.TP
-.B \e(dq
-Basic Latin quotation mark
-(double quote).
-.
-Use in macro calls to prevent
-.\" This page prefers double quotes, but not here because they are more
-.\" confusing to the eye when another double quote is what is quoted!
-.RB \(oq \(dq \(rq
-.\" AT: .RB ` """'
-from being interpreted as beginning a quoted argument,
-or simply for readability.
-.
-.
-.RS
-.IP
-.\" from src/preproc/eqn/eqn.1.man
-.EX
-\&.TP
-\&.BI \(dqsplit \e(dq\(dq text \e(dq
-.EE
-.RE
-.
-.
-.br
-.\" XXX: We need only 2v, but 2v more are necessary due to bad
-.\" interaction with TP's own use of the ne request.
-.ne 4v
-.TP
-.B \e(lq
-.TQ
-.B \e(rq
-Left and right double quotation marks.
-.
-Use these for paired directional double quotes,
-\(lqlike this\(rq.
-.
-.
-.TP
-.B \e(em
-Em-dash.
-.
-Use for an interruption\(emsuch as this one\(emin a sentence.
-.
-.
-.TP
-.B \e(en
-En-dash.
-.
-Use to separate the ends of a range,
-particularly between numbers;
-for example,
-\(lqthe digits 1\(en9\(rq.
-.
-.
-.TP
-.B \e(ga
-Basic Latin grave accent.
-.
-Some output devices replace
-.RB \(lq \(ga \(rq
-with a left single quotation mark.
-.
-.
-.TP
-.B \e(ha
-Basic Latin circumflex accent
-(\(lqhat\(rq).
-.
-Some output devices replace
-.RB \(lq \(ha \(rq
-with U+02C6
-(modifier letter circumflex accent)
-or similar.
-.
-.
-.TP
-.B \e(rs
-Reverse solidus
-(backslash).
-.
-The backslash is the default escape character in the
-.I roff
-language,
-so it does not represent itself in output.
-.
-Also see
-.B \ee
-below.
-.
-.
-.TP
-.B \e(ti
-Basic Latin tilde.
-.
-Some output devices replace
-.RB \(lq \(ti \(rq
-with U+02DC
-(small tilde)
-or similar.
-.
-.
-.TP
 .B \ec
 End a text line without inserting space or attempting a break.
 .
@@ -2787,6 +2647,146 @@ source than
 escape sequences do.
 .
 .
+.TP
+.B \e\-
+Minus sign or basic Latin hyphen-minus.
+.
+This escape sequence produces the Unix command-line option dash in the
+output.
+.
+.RB \(lq \- \(rq
+is a hyphen in the
+.I roff
+language;
+some output devices replace it with U+2010
+(hyphen)
+or similar.
+.
+.
+.TP
+.B \e(aq
+Basic Latin neutral apostrophe.
+.
+Some
+output devices replace
+.RB \(lq \(aq \(rq
+with a right single quotation mark.
+.
+.
+.br
+.ne 3v
+.TP
+.B \e(oq
+.TQ
+.B \e(cq
+Opening (left) and closing (right) single quotation marks.
+.
+Use these for paired directional single quotes,
+\(oqlike this\(cq.
+.
+.
+.TP
+.B \e(dq
+Basic Latin quotation mark
+(double quote).
+.
+Use in macro calls to prevent
+.\" This page prefers double quotes, but not here because they are more
+.\" confusing to the eye when another double quote is what is quoted!
+.RB \(oq \(dq \(rq
+.\" AT: .RB ` """'
+from being interpreted as beginning a quoted argument,
+or simply for readability.
+.
+.
+.RS
+.IP
+.\" from src/preproc/eqn/eqn.1.man
+.EX
+\&.TP
+\&.BI \(dqsplit \e(dq\(dq text \e(dq
+.EE
+.RE
+.
+.
+.br
+.\" XXX: We need only 2v, but 2v more are necessary due to bad
+.\" interaction with TP's own use of the ne request.
+.ne 4v
+.TP
+.B \e(lq
+.TQ
+.B \e(rq
+Left and right double quotation marks.
+.
+Use these for paired directional double quotes,
+\(lqlike this\(rq.
+.
+.
+.TP
+.B \e(em
+Em-dash.
+.
+Use for an interruption\(emsuch as this one\(emin a sentence.
+.
+.
+.TP
+.B \e(en
+En-dash.
+.
+Use to separate the ends of a range,
+particularly between numbers;
+for example,
+\(lqthe digits 1\(en9\(rq.
+.
+.
+.TP
+.B \e(ga
+Basic Latin grave accent.
+.
+Some output devices replace
+.RB \(lq \(ga \(rq
+with a left single quotation mark.
+.
+.
+.TP
+.B \e(ha
+Basic Latin circumflex accent
+(\(lqhat\(rq).
+.
+Some output devices replace
+.RB \(lq \(ha \(rq
+with U+02C6
+(modifier letter circumflex accent)
+or similar.
+.
+.
+.TP
+.B \e(rs
+Reverse solidus

[groff] 10/31: [docs]: Document plan9port troff support for `\~`.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 14eebb6b7471de5903098178cc6b11db49289864
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 11:59:26 2022 -0500

[docs]: Document plan9port troff support for `\~`.

Update Plan 9 from User Space troff info thanks to Dan Cross's superfast
merge of my pull request.

https://github.com/9fans/plan9port/pull/567
---
 doc/groff.texi  |  9 +
 man/groff_diff.7.man| 17 -
 tmac/groff_man.7.man.in | 15 ---
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 7b407485c..311d93f80 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -16669,10 +16669,11 @@ implementations will likely be ignored; escape 
sequences that are
 For example, the adjustable, non-breaking escape sequence @code{\~}
 @c BEGIN Keep in sync with groff_diff(7) and groff_man_style(7).
 is also supported by Heirloom Doctools @code{troff} 050915 (September
-2005), @code{mandoc} 1.9.5 (2009-09-21), and @code{neatroff} (since
-commit 1c6ab0f6e, 2016-09-13), but not by Plan@tie{}9 @code{troff},
-Solaris @code{troff}, or Documenter's Workbench @code{troff}.
-@c as of this writing, 2022-08-12
+2005), @code{mandoc} 1.9.5 (2009-09-21), @code{neatroff} (commit
+1c6ab0f6e, 2016-09-13), and Plan@tie{}9 from User Space @code{troff}
+(commit 93f8143600, 2022-08-12), but not by Solaris or Documenter's
+Workbench @code{troff}s.
+@c as of this writing, 2022-08-13
 @c END Keep in sync with groff_diff(7) and groff_man_style(7).
 @xref{Manipulating Filling and Adjustment}.
 
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index f760d924b..9f16f183e 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -5175,17 +5175,16 @@ is also supported by Heirloom Doctools
 050915 (September 2005),
 .I mandoc
 1.9.5 (2009-09-21),
-and
 .I neatroff
-(since commit 1c6ab0f6e,
+(commit 1c6ab0f6e,
 2016-09-13),
-but not by Plan\~9
-.IR troff , \" Plan 9
-Solaris
-.IR troff , \" Solaris
-or Documenter's Workbench
-.IR troff . \" DWB
-.\" as of this writing, 2022-08-12
+and Plan\~9 from User Space
+.I troff \" Plan 9
+(commit 93f8143600,
+2022-08-12),
+but not by Solaris or Documenter's Workbench
+.IR troff s. \" Solaris, DWB
+.\" as of this writing, 2022-08-13
 .\" END Keep in sync with groff.texi node "Other Differences" and
 .\" groff_man_style(7).
 .
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 3c97f9001..30bf71df6 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2421,15 +2421,16 @@ extension also supported by Heirloom Doctools
 1.9.5 (2009-09-21),
 and
 .I neatroff
-(since commit 1c6ab0f6e,
+(commit 1c6ab0f6e,
 2016-09-13),
-but not by Plan\~9
-.IR troff , \" Plan 9
-Solaris
-.IR troff , \" Solaris
+Plan\~9 from User Space
+.I troff \" Plan 9
+(commit 93f8143600,
+2022-08-12),
+but not by Solaris
 or Documenter's Workbench
-.IR troff . \" DWB
-.\" as of this writing, 2022-08-12
+.IR troff s. \" Solaris, DWB
+.\" as of this writing, 2022-08-13
 .\" END Keep in sync with groff.texi node "Other Differences" and
 .\" groff_diff(7).
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 23/31: [pic]: Refactor `flyback_flag`.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 52964e94c67fbf0c8dc167464f90c925caf2f2ed
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 22:47:29 2022 -0500

[pic]: Refactor `flyback_flag`.

* src/preproc/pic/main.cpp:
* src/preproc/pic/pic.h:
* src/preproc/pic/troff.cpp: Rename to `want_flyback`.

* src/preproc/pic/main.cpp:
* src/preproc/pic/pic.h: Demote type from `int` to `bool`.

* src/preproc/pic/main.cpp (top_input::get, top_input::peek): Use
  parentheses to clarify operation precedence.
---
 ChangeLog | 14 ++
 src/preproc/pic/main.cpp  |  8 
 src/preproc/pic/pic.h |  2 +-
 src/preproc/pic/troff.cpp |  4 ++--
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ee3612acc..1ae835017 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-08-14  G. Branden Robinson 
+
+   [pic]: Refactor `flyback_flag`.
+
+   * src/preproc/pic/main.cpp:
+   * src/preproc/pic/pic.h:
+   * src/preproc/pic/troff.cpp: Rename to `want_flyback`.
+
+   * src/preproc/pic/main.cpp:
+   * src/preproc/pic/pic.h: Demote type from `int` to `bool`.
+
+   * src/preproc/pic/main.cpp (top_input::get, top_input::peek):
+   Use parentheses to clarify operation precedence.
+
 2022-08-14  G. Branden Robinson 
 
* src/preproc/eqn/eqn.1.man: Expand to include lists of
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 7c6be9a23..233e4c177 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -24,7 +24,7 @@ extern "C" const char *Version_string;
 output *out;
 char *graphname;   // the picture box name in TeX mode
 
-int flyback_flag;
+bool want_flyback = false;
 int zero_length_line_flag = 0;
 // Non-zero means we're using a groff driver.
 int driver_extension_flag = 1;
@@ -94,7 +94,7 @@ int top_input::get()
  ungetc(d, fp);
if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
  eof = 1;
- flyback_flag = c == 'F';
+ want_flyback = (c == 'F');
  return EOF;
}
push_back[0] = c;
@@ -166,7 +166,7 @@ int top_input::peek()
  ungetc(d, fp);
if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
  eof = 1;
- flyback_flag = c == 'F';
+ want_flyback = (c == 'F');
  return EOF;
}
push_back[0] = c;
@@ -217,7 +217,7 @@ int top_input::get_location(const char **filenamep, int 
*linenop)
 
 void do_picture(FILE *fp)
 {
-  flyback_flag = 0;
+  want_flyback = false;
   int c;
   if (!graphname)
 free(graphname);
diff --git a/src/preproc/pic/pic.h b/src/preproc/pic/pic.h
index 0d86183d9..d052c1a89 100644
--- a/src/preproc/pic/pic.h
+++ b/src/preproc/pic/pic.h
@@ -111,7 +111,7 @@ void lex_warning(const char *message,
 
 void lex_cleanup();
 
-extern int flyback_flag;
+extern bool want_flyback;
 extern int command_char;
 // zero_length_line_flag is non-zero if zero-length lines are drawn 
 // as dots by the output device
diff --git a/src/preproc/pic/troff.cpp b/src/preproc/pic/troff.cpp
index 256aa29ab..ad8998446 100644
--- a/src/preproc/pic/troff.cpp
+++ b/src/preproc/pic/troff.cpp
@@ -298,14 +298,14 @@ void troff_output::finish_picture()
   line_thickness(BAD_THICKNESS);
   last_fill = -1.0;// force it to be reset for each picture
   reset_color();
-  if (!flyback_flag)
+  if (!want_flyback)
 printf(".sp %.3fi+1\n", height);
   printf(".if \\n(" FILL_REG " .fi\n");
   printf(".br\n");
   printf(".nr " EQN_NO_EXTRA_SPACE_REG " 0\n");
   // this is a little gross
   set_location(current_filename, current_lineno);
-  fputs(flyback_flag ? ".PF\n" : ".PE\n", stdout);
+  fputs(want_flyback ? ".PF\n" : ".PE\n", stdout);
 }
 
 void troff_output::command(const char *s,

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 24/31: [pic]: Recognize `.PY` as synonym of `.PF`.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 1ac8764fa7f3b91e7d2a84261edbdc84c1ae4158
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 23:52:40 2022 -0500

[pic]: Recognize `.PY` as synonym of `.PF`.

* src/preproc/pic/main.cpp:
* src/preproc/pic/pic.h: Add new Boolean variable,
  `want_alternate_flyback` to record `.PY` usage.

* src/preproc/pic/main.cpp (top_input::get, top_input::peek): Recognize
  it.  Update diagnostic messages to mention it.

  (main): Define `PY` troff macro as empty if not defined.

* src/preproc/pic/troff.cpp (troff_output::finish_picture): Don't
  advance the vertical position if `want_alternate_flyback`.  Write out
  the `PY` macro call if it was on the input.

* src/preproc/pic/pic.1.man: Document it.

* tmac/pic.tmac (PY): Define the same as `PF`.

* NEWS: Add item.

Fixes .

Also drop old-style Emacs file-local variable settings.
---
 ChangeLog | 24 
 NEWS  | 10 ++
 src/preproc/pic/main.cpp  | 15 ++-
 src/preproc/pic/pic.1.man | 47 ++-
 src/preproc/pic/pic.h |  2 +-
 src/preproc/pic/troff.cpp |  9 +++--
 tmac/pic.tmac |  5 +++--
 7 files changed, 89 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ae835017..4bddb824d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2022-08-14  G. Branden Robinson 
+
+   [pic]: Recognize `.PY` as synonym of `.PF`.
+
+   * src/preproc/pic/main.cpp:
+   * src/preproc/pic/pic.h: Add new Boolean variable,
+   `want_alternate_flyback` to record `.PY` usage.
+
+   * src/preproc/pic/main.cpp (top_input::get, top_input::peek):
+   Recognize it.  Update diagnostic messages to mention it.
+   (main): Define `PY` troff macro as empty if not defined.
+
+   * src/preproc/pic/troff.cpp (troff_output::finish_picture):
+   Don't advance the vertical position if `want_alternate_flyback`.
+   Write out the `PY` macro call if it was on the input.
+
+   * src/preproc/pic/pic.1.man: Document it.
+
+   * tmac/pic.tmac (PY): Define the same as `PF`.
+
+   * NEWS: Add item.
+
+   Fixes .
+
 2022-08-14  G. Branden Robinson 
 
[pic]: Refactor `flyback_flag`.
diff --git a/NEWS b/NEWS
index ec8447044..1ddf66b6f 100644
--- a/NEWS
+++ b/NEWS
@@ -115,6 +115,16 @@ o The GNU extension
   to use 'o' and 'n' as left and right delimiters, respectively.  If
   yours does, consider swapping them, or select others.
 
+pic
+---
+
+o The token `.PY` is now recognized as a synonym of `.PF` to work around
+  a name space collision with the m (mm) macro package, which uses the
+  same name for a page footer management macro.  (This problem dates
+  back at least to Unix System V Release 2, 1983.)  You should continue
+  to use `.PF` to end pictures with flyback unless a similar problem
+  faces your document.
+
 Macro packages
 --
 
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 233e4c177..114ca2158 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -25,6 +25,8 @@ output *out;
 char *graphname;   // the picture box name in TeX mode
 
 bool want_flyback = false;
+// groff pic supports '.PY' to work around mm package stepping on 'PF'.
+bool want_alternate_flyback = false;
 int zero_length_line_flag = 0;
 // Non-zero means we're using a groff driver.
 int driver_extension_flag = 1;
@@ -88,13 +90,14 @@ int top_input::get()
 c = getc(fp);
 if (c == 'P') {
   c = getc(fp);
-  if (c == 'F' || c == 'E') {
+  if (c == 'E' || c == 'F' || c == 'Y') {
int d = getc(fp);
if (d != EOF)
  ungetc(d, fp);
if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
  eof = 1;
  want_flyback = (c == 'F');
+ want_alternate_flyback = (c == 'Y');
  return EOF;
}
push_back[0] = c;
@@ -133,7 +136,7 @@ int top_input::get()
   bol = 0;
   if (c == EOF) {
 eof = 1;
-error("end of file before .PE or .PF");
+error("end of file before .PE, .PF, or .PY");
 error_with_file_and_line(current_filename, start_lineno - 1,
 ".PS was here");
   }
@@ -160,13 +163,14 @@ int top_input::peek()
 c = getc(fp);
 if (c == 'P') {
   c = getc(fp);
-  if (c == 'F' || c == 'E') {
+  if (c == 'E' || c == 'F' || c == 'Y') {
int d = getc(fp);
if (d != EOF)
  ungetc(d, fp);
if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
  eof = 1;
  want_flyback = (c == 'F');
+ want_alternate_flyback = (c == 'Y');
  return EOF;
}
push_back[0] = c;
@@ -287,7 +291,7 @@ void do_picture(FILE *fp)
 

[groff] 06/31: pic(1): Guard dot from end-of-sentence detection.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 0fd411def4db9ad56fe31aa0658d64c59f824b86
Author: G. Branden Robinson 
AuthorDate: Thu Aug 11 22:31:34 2022 -0500

pic(1): Guard dot from end-of-sentence detection.
---
 src/preproc/pic/pic.1.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/preproc/pic/pic.1.man b/src/preproc/pic/pic.1.man
index fd02d6df8..7c4a4eca5 100644
--- a/src/preproc/pic/pic.1.man
+++ b/src/preproc/pic/pic.1.man
@@ -179,9 +179,9 @@ Lines beginning with
 are not passed through transparently.
 .
 Lines beginning with
-.B .
+.B .\&
 are passed through with the initial
-.B .
+.B .\&
 changed to
 .BR \[rs] .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 09/31: [docs]: Shift discussion of `\~` portability.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit cc1af07711c7b8ea3a060b3b76c8353ddf270b1d
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 03:38:46 2022 -0500

[docs]: Shift discussion of `\~` portability.

* doc/groff.texi (Request and Macro Arguments): Move from here...
  (Other Differences): ...to here.

* man/groff_diff.7.man (Implementation differences):
* tmac/groff_man.7.man.in (Portability): Sync with the above.
---
 doc/groff.texi  | 21 +++--
 man/groff_diff.7.man| 35 +++
 tmac/groff_man.7.man.in | 25 +
 3 files changed, 75 insertions(+), 6 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index c9e0a5403..7b407485c 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6578,12 +6578,7 @@ solution, using escaped spaces, can be found in 
documents prepared for
 @acronym{AT} @code{troff}.  Nevertheless, it is not optimal in most
 situations, since @w{@samp{\ }} inserts a fixed-width, non-breaking
 space.  GNU @code{troff} provides the @code{\~} escape sequence to
-insert an adjustable, non-breaking space.@footnote{@code{\~} is also
-supported by Heirloom Doctools @code{troff} 050915 (September 2005),
-@code{mandoc} 1.9.5 (2009-09-21), and @code{neatroff} (since commit
-1c6ab0f6e, 2016-09-13), but not by Plan@tie{}9 @code{troff}, Solaris
-@code{troff}, or DWB @code{troff} or @code{onroff}.}
-@c as of this writing, 2022-08-12
+insert an adjustable, non-breaking space.
 
 @cindex @code{"}, in a macro argument
 @cindex double quote, in a macro argument
@@ -16667,6 +16662,20 @@ referred to it as a ``living fossil''.} should be 
migrated to another
 @node Other Differences, , Compatibility Mode, Implementation Differences
 @subsection Other Differences
 
+@code{groff} request names unrecognized by other @code{troff}
+implementations will likely be ignored; escape sequences that are
+@code{groff} extensions are liable to be formatted literally.
+@cindex @code{\~}, incompatibilities with @acronym{AT} @code{troff}
+For example, the adjustable, non-breaking escape sequence @code{\~}
+@c BEGIN Keep in sync with groff_diff(7) and groff_man_style(7).
+is also supported by Heirloom Doctools @code{troff} 050915 (September
+2005), @code{mandoc} 1.9.5 (2009-09-21), and @code{neatroff} (since
+commit 1c6ab0f6e, 2016-09-13), but not by Plan@tie{}9 @code{troff},
+Solaris @code{troff}, or Documenter's Workbench @code{troff}.
+@c as of this writing, 2022-08-12
+@c END Keep in sync with groff_diff(7) and groff_man_style(7).
+@xref{Manipulating Filling and Adjustment}.
+
 @cindex @code{\A}, incompatibilities with @acronym{AT} @code{troff}
 @cindex @code{\|}, incompatibilities with @acronym{AT} @code{troff}
 @cindex @code{\^}, incompatibilities with @acronym{AT} @code{troff}
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 0c53f7d82..f760d924b 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -5157,6 +5157,41 @@ compatibility mode.
 .
 .P
 .I groff
+request names unrecognized by other
+.I troff \" generic
+implementations will likely be ignored;
+escape sequences that are
+.I groff
+extensions are liable to be formatted literally.
+.
+For example,
+the adjustable,
+non-breaking escape sequence
+.B \[rs]\[ti]
+.\" BEGIN Keep in sync with groff.texi node "Other Differences" and
+.\" groff_man_style(7).
+is also supported by Heirloom Doctools
+.I troff \" Heirloom
+050915 (September 2005),
+.I mandoc
+1.9.5 (2009-09-21),
+and
+.I neatroff
+(since commit 1c6ab0f6e,
+2016-09-13),
+but not by Plan\~9
+.IR troff , \" Plan 9
+Solaris
+.IR troff , \" Solaris
+or Documenter's Workbench
+.IR troff . \" DWB
+.\" as of this writing, 2022-08-12
+.\" END Keep in sync with groff.texi node "Other Differences" and
+.\" groff_man_style(7).
+.
+.
+.P
+.I groff
 does not allow the use of the escape sequences
 .BR \[rs]| ,
 .BR \[rs]\[ha] ,
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 5eb6155bc..3c97f9001 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2409,6 +2409,31 @@ CSTR\e\(ti#8 documents the B\e\(tilanguage.
 .RE
 .
 .
+.\" BEGIN Keep in sync with groff.texi node "Other Differences" and
+.\" groff_diff(7).
+.IP
+This escape sequence is a
+.I groff
+extension also supported by Heirloom Doctools
+.I troff \" Heirloom
+050915 (September 2005),
+.I mandoc
+1.9.5 (2009-09-21),
+and
+.I neatroff
+(since commit 1c6ab0f6e,
+2016-09-13),
+but not by Plan\~9
+.IR troff , \" Plan 9
+Solaris
+.IR troff , \" Solaris
+or Documenter's Workbench
+.IR troff . \" DWB
+.\" as of this writing, 2022-08-12
+.\" END Keep in sync with groff.texi node "Other Differences" and
+.\" groff_diff(7).
+.
+.
 .TP
 .B \e&
 Non-printing input break.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 22/31: [mm]: Tweak diagnostic handling.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit bd06e20cd9692b427293619843a0623e49c37689
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 22:25:08 2022 -0500

[mm]: Tweak diagnostic handling.

* contrib/mm/m.tmac (@warning, @error): Stop pointlessly using no-break
  control character when invoking the `tm` request, which never
  causes a break in formatted output.  (Management of the standard
  output and standard error streams is the user's responsibility.)

  (@error): Drop old-fashioned asterisk banners around error
  diagnostics.  Stop invoking `ab` with redundant and sometimes
  misleading arguments.  In groff 1.23, `ab` exits silently if given
  none.  We've already issued a diagnostic and moreover not all problems
  are with "syntax"; some are semantic.
---
 contrib/mm/ChangeLog | 12 
 contrib/mm/m.tmac|  9 -
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 1e58d80e9..9c996bc5d 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,15 @@
+2022-08-14  G. Branden Robinson 
+
+   * m.tmac (@warning, @error): Stop pointlessly using no-break
+   control character when invoking the `tm` request, which never
+   causes a break in formatted output.  (Management of the standard
+   output and standard error streams is the user's responsibility.)
+   (@error): Drop old-fashioned asterisk banners around error
+   diagnostics.  Stop invoking `ab` with redundant and sometimes
+   misleading arguments.  In groff 1.23, `ab` exits silently if
+   given none.  We've already issued a diagnostic and moreover not
+   all problems are with "syntax"; some are semantic.
+
 2022-08-14  G. Branden Robinson 
 
* m.tmac (PS): Validate better; check for 2 arguments exactly.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index e642b9a3c..b024e22e4 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -390,15 +390,14 @@ Index array!index
 .vs \\n[@vs]u
 ..
 .de @warning
-'tm \\*[@mm]:\\n[.F]:\\n[.c]: warning: \\$*
+.tm \\*[@mm]:\\n[.F]:\\n[.c]: warning: \\$*
 .if \\n[D] .backtrace
 ..
+.\" All errors are fatal.
 .de @error
-'tm **
-'tm \\*[@mm]:\\n[.F]:\\n[.c]: error: \\$*
+.tm \\*[@mm]:\\n[.F]:\\n[.c]: error: \\$*
 .if \\n[D] .backtrace
-'tm **
-.ab \\*[@mm]: syntax error; aborting
+.ab
 ..
 .de misc@toupper
 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 05/31: [docs]: Fix content, style, and markup nits.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit acae9d3827237c702ea5fc3315a7f35273f757e0
Author: G. Branden Robinson 
AuthorDate: Thu Aug 11 17:32:11 2022 -0500

[docs]: Fix content, style, and markup nits.

* man/groff_font.5.man:
  - Tighten wording.
  - Use RS/RE macro pairs to inset syntax synopsis within a paragraph
instead of `IP`, which starts a new one.

* src/roff/groff/groff.1.man:
  - Mention the "pager problem"; these programs often do violence to the
terminal escape sequences emitted by grotty(1).  Tell the reader
where to find more information.
  - Update example to use installed groff command names.
  - Recast to avoid using examples as a hatch to escape
sentence-terminal puncutation.
  - Fix man page rendering example to remove ".man" suffix, an artifact
of the groff source tree.
  - Tighten wording.

* doc/groff.texi (Invocation Examples): Sync with content of "Examples"
  section of groff(1), and annotate synchrony.
  (Font Description File Format): Sync with groff_font(5) changes.
  (Invoking groff): Mark chapter as reviewed for quotation mark usage.
---
 doc/groff.texi | 97 +++---
 man/groff_font.5.man   | 27 ++---
 src/roff/groff/groff.1.man | 23 ++-
 3 files changed, 83 insertions(+), 64 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 073fa98b3..b79f7655a 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -846,6 +846,9 @@ contributed much of the material on the @file{ms} macro 
package.
 @c =
 @c =
 
+@codequotebacktick on
+@codequoteundirected on
+
 @node Invoking groff, Tutorial for Macro Users, Introduction, Top
 @chapter Invoking @code{groff}
 @cindex invoking @code{groff}
@@ -1307,9 +1310,6 @@ Do not postprocess the output of @code{gtroff}.  Normally 
@code{groff}
 automatically runs the appropriate postprocessor.
 @end table
 
-@codequotebacktick off
-@codequoteundirected off
-
 
 @c =
 
@@ -1581,57 +1581,73 @@ groff -Tps -dpaper=a4l -P-pa4 -P-l -ms foo.ms > foo.ps
 
 @c =
 
+@c BEGIN Keep parallel with groff(1), section "Examples".
 @node Invocation Examples,  , Paper Size, Invoking groff
 @section Invocation Examples
 @cindex invocation examples
 @cindex examples of invocation
 
-This section lists several common uses of @code{groff} and the
-corresponding command lines.
+@code{roff} systems are best known for formatting man pages.  Once a
+@command{man} librarian program has located a man page, it may execute
+a @code{groff} command much like the following.
 
 @Example
-groff file
+groff -t -man -Tutf8 /usr/share/man/man1/groff.1
 @endExample
 
-@noindent
-This command processes @file{file} without a macro package or a
-preprocessor.  The output device is the default, @samp{ps}, and the
-output is sent to @code{stdout}.
+The librarian will also pipe the output through a pager, which might not
+interpret the SGR terminal escape sequences @command{groff} emits for
+boldface, underlining, or italics; see the @cite{grotty@r{(1)}} man page
+for a discussion.
+
+To process a @code{roff} input file using the preprocessors
+@command{gtbl} and @command{gpic} and the @file{me} macro package in the
+way to which AT @code{troff} users were accustomed, one would type (or
+script) a pipeline.
 
 @Example
-groff -t -mandoc -Tascii file | less
+gpic foo.me | gtbl | gtroff -me -Tutf8 | grotty
 @endExample
 
-@noindent
-This is basically what a call to the @code{man} program does.  GNU
-@code{troff} processes the man page @file{file} with the @file{mandoc}
-macro file (which in turn loads either the @file{man} or the @file{mdoc}
-macro package), using the @command{tbl} preprocessor and the
-@code{ascii} output device.  Finally, the @command{less} pager displays
-the result.
+Using @command{groff}, this pipe can be shortened to an equivalent
+command.
+
+@Example
+groff -p -t -me -T utf8 foo.me
+@endExample
+
+An even easier way to do this is to use @command{grog} to guess the
+preprocessor and macro options and execute the result by using the
+command substitution feature of the shell.
 
 @Example
-groff -X -m me file
+$(grog -Tutf8 foo.me)
+@endExample
+
+Each command-line option to a postprocessor must be specified with any
+required leading dashes @samp{-}
+@c No GNU roff postprocessor uses long options for anything except
+@c --help or --version.
+@c or @samp{--}
+because @command{groff} passes the arguments as-is to the postprocessor;
+this permits arbitrary arguments to be transmitted.  For example, to
+pass a title to the @command{gxditview} postprocessor,
+the shell commands
+
+@Example
+groff -X -P 

[groff] 03/31: groff(1): Fix unescaped hyphen.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 2e5a9c79f0b28b1f31a3e741ce3fe3483c2fa49b
Author: G. Branden Robinson 
AuthorDate: Tue Aug 9 14:21:05 2022 -0500

groff(1): Fix unescaped hyphen.

Thanks to Dave Kemper for the catch.
---
 src/roff/groff/groff.1.man | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/roff/groff/groff.1.man b/src/roff/groff/groff.1.man
index 44861c4fe..c79ea5790 100644
--- a/src/roff/groff/groff.1.man
+++ b/src/roff/groff/groff.1.man
@@ -1801,7 +1801,7 @@ constructing a pipeline to page the output.
 .RS
 .P
 .EX
-groff \-t \-man -Tutf8 /usr/share/man/man1/groff.1.man | less \-R
+groff \-t \-man \-Tutf8 /usr/share/man/man1/groff.1.man | less \-R
 .EE
 .RE
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 21/31: [mm]: Validate `PS` macro calls better.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e3335548f7b1bc13d48371bcd0641499e6f8ad56
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 22:08:48 2022 -0500

[mm]: Validate `PS` macro calls better.

* contrib/mm/m.tmac (PS): Validate better; check for 2 arguments
  exactly.

Also recast diagnostic message to state expectations clearly instead of
calling arguments "bad", which is vague.
---
 contrib/mm/ChangeLog | 4 
 contrib/mm/m.tmac| 6 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 5f23c39f5..1e58d80e9 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-14  G. Branden Robinson 
+
+   * m.tmac (PS): Validate better; check for 2 arguments exactly.
+
 2022-08-14  G. Branden Robinson 
 
* m.tmac (PS): Refactor; drop dead code.  The `pic*in` register
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index a81d621fa..e642b9a3c 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2397,7 +2397,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 .de PS
 .br
 .SP .5
-.ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
+.ie !\\n[.$]=2 \{\
+.  ds pic*msg PS: expected 2 arguments, got \\n[.$]\"
+.  as pic*msg ; not preprocessed with pic?\"
+.  @error \\*[pic*msg]
+.\}
 .el \{\
 .  if r ds*format .if !\\n[ds*lvl] .ne (u;\\$1)+1v
 .\}

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 20/31: [mm]: Refactor; drop dead code in `PS` macro.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 4c40d20e7bfdd753f8c4b76c90319533078342d2
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 22:06:25 2022 -0500

[mm]: Refactor; drop dead code in `PS` macro.

* contrib/mm/m.tmac (PS): Refactor; drop dead code.  The `pic*in`
  register was used only for dead stores; it was never read or tested.
---
 contrib/mm/ChangeLog |  5 +
 contrib/mm/m.tmac| 10 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 16d7ccba8..5f23c39f5 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-14  G. Branden Robinson 
+
+   * m.tmac (PS): Refactor; drop dead code.  The `pic*in` register
+   was used only for dead stores; it was never read or tested.
+
 2022-08-04  G. Branden Robinson 
 
* m.tmac (initialization): In nroff mode, surround automatically
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 5ba66c534..a81d621fa 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -2395,19 +2395,11 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 ..
 .\" ### module pic ###
 .de PS
-.nr pic*in 0
 .br
 .SP .5
 .ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
 .el \{\
-.  if !\\n[ds*lvl] .ne (u;\\$1)+1v
-.\" should be contained between .DS/.DE
-.if r ds*format \{\
-.  if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
-.  nr pic*in \\n[.i]
-.\" .  in +(u;\\n[.l]-\\n[.i]-\\$2/2)
-.  \}
-.  \}
+.  if r ds*format .if !\\n[ds*lvl] .ne (u;\\$1)+1v
 .\}
 ..
 .de PE

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 08/31: groff_man*(7): Adjust dead-tree typography.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 2d722b94286e28ffa603c39f761561e42d36334e
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 03:37:10 2022 -0500

groff_man*(7): Adjust dead-tree typography.
---
 tmac/groff_man.7.man.in | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 1d5db0183..5eb6155bc 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -741,6 +741,8 @@ again excepted);
 see subsection \(lqFont style macros\(rq below.
 .
 .
+.br
+.ne 4v
 .TP
 .B .P
 .TQ
@@ -2320,6 +2322,8 @@ grave accent,
 tilde).
 .
 .
+.br
+.ne 2v
 .TP
 .B \e\(dq
 Comment.
@@ -2457,6 +2461,8 @@ output devices replace
 with a right single quotation mark.
 .
 .
+.br
+.ne 3v
 .TP
 .B \e(oq
 .TQ
@@ -2491,6 +2497,10 @@ or simply for readability.
 .RE
 .
 .
+.br
+.\" XXX: We need only 2v, but 2v more are necessary due to bad
+.\" interaction with TP's own use of the ne request.
+.ne 4v
 .TP
 .B \e(lq
 .TQ

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 01/31: groff_man*(7): Fix content nits.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a7c8d0fb9569ea2486c9ead838d27d57220ecd03
Author: G. Branden Robinson 
AuthorDate: Fri Aug 5 12:46:03 2022 -0500

groff_man*(7): Fix content nits.

Strictly, no macro ever accepts any arguments "on the next line" (use of
input line continuation notwithstanding).  We already refer to input
traps in this document so be equally candid here.

Also, push more usage advice into groff_man_style(7).
---
 tmac/groff_man.7.man.in | 22 +++---
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 8230c64f1..7c2fd0ac4 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1689,36 +1689,28 @@ escape sequences in subsection \(lqPortability\(rq 
below.
 _endif()dnl
 .P
 Unlike the above font style macros,
-the font style alternation macros below accept only arguments on the
-same line as the macro call.
+the font style alternation macros below set no input traps;
+they must be given arguments to have effect.
 .
 Italic corrections are applied as appropriate.
 .
-If space is required within one of the arguments,
+_ifstyle()dnl
+If a space is required within an argument,
 first consider whether the same result could be achieved with as much
-clarity by using the single-style macros on separate input lines.
+clarity by using single-style macros on separate input lines.
 .
 When it cannot,
 double-quote an argument containing embedded space characters.
 .
 Setting all three different styles within a word
 presents challenges;
-_ifstyle()dnl
 it is possible with the
 .B \ec
 and/or
 .B \ef
 escape sequences,
-but
-_endif()dnl
-see subsection \(lqPortability\(rq
-_ifnotstyle()dnl
-in
-.MR groff_man_style @MAN7EXT@
-for approaches.
-_endif()dnl
-_ifstyle()dnl
-below for caveats.
+but see subsection \(lqPortability\(rq
+below for approaches.
 _endif()dnl
 .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 02/31: groff_man_style(7): Fix terminology nit.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 402da0123b6c21bf778e938406b3ad558544535c
Author: G. Branden Robinson 
AuthorDate: Fri Aug 5 13:42:28 2022 -0500

groff_man_style(7): Fix terminology nit.

Say "split" instead of "break", to avoid confusion with "break" concept
in formatted output.
---
 tmac/groff_man.7.man.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 7c2fd0ac4..8a4268daa 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2344,7 +2344,7 @@ a series of lines ending in backslash-newline appears to
 .I groff
 as a single input line.
 .
-Use this escape sequence to break excessively long input lines for
+Use this escape sequence to split excessively long input lines for
 document maintenance.
 .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 11/31: groff_man_style(7): Document portability of `\:`.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 4dc92d1ad89801a18cd7b6b03bd98a7a6351e690
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 12:30:30 2022 -0500

groff_man_style(7): Document portability of `\:`.

Lift information from comments to formatted text.

None of the AT device-independent troff descendants except for
Heirloom appear to support it; see their `getch()` function definitions
in "n1.c".
---
 tmac/groff_man.7.man.in | 23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 30bf71df6..a0057b683 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2368,10 +2368,6 @@ are still honored.
 .
 .TP
 .B \e:
-.\" Heirloom Doctools troff since release 050915 (2005-09-15)
-.\" mandoc since 2018-12-15 (released in 1.14.5, 2019-03-10)
-.\" neatroff since 399a4936, 2014-02-17
-.\" Plan 9 troff does not appear to support it.
 Insert a non-printing break point.
 .
 A word can break at such a point,
@@ -2390,6 +2386,25 @@ hyphenation only after certain explicit hyphens within a 
word.
 See subsection \[lq]Hyperlink macros\[rq] above for an example.
 .
 .
+.IP
+This escape sequence is a
+.I groff
+extension also supported by Heirloom Doctools
+.I troff \" Heirloom
+050915 (September 2005),
+.I mandoc
+1.14.5 (2019-03-10),
+and
+.I neatroff
+(commit 399a4936,
+2014-02-17),
+but not by Plan\~9,
+Solaris,
+or Documenter's Workbench
+.IR troff s. \" Plan 9, Solaris, DWB
+.\" as of this writing, 2022-08-13
+.
+.
 .TP
 .B \e\(ti
 Adjustable non-breaking space.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 19/31: eqn(1): List recognized primitives, predef macros.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 8f841ba67cc98dc5bb8ade57c440261819e71067
Author: G. Branden Robinson 
AuthorDate: Sun Aug 14 19:34:24 2022 -0500

eqn(1): List recognized primitives, predef macros.

* src/preproc/eqn/eqn.1.man: Expand to include lists of recognized
  primitives and predefined macros.

Also eliminate "Controlling delimiters" subsection, relocating the
extended behavior of the "delim" primitive to the "Extended primitives"
subsection.

Also discuss the necessity of quoting at greater length.  See
.
---
 ChangeLog |   5 +
 src/preproc/eqn/eqn.1.man | 228 +++---
 2 files changed, 202 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 61bee309c..ee3612acc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-14  G. Branden Robinson 
+
+   * src/preproc/eqn/eqn.1.man: Expand to include lists of
+   recognized primitives and predefined macros.
+
 2022-08-04  G. Branden Robinson 
 
* NEWS: Add item for new groff mm `V` register support.
diff --git a/src/preproc/eqn/eqn.1.man b/src/preproc/eqn/eqn.1.man
index 90b38215c..dc75f1632 100644
--- a/src/preproc/eqn/eqn.1.man
+++ b/src/preproc/eqn/eqn.1.man
@@ -8,7 +8,7 @@
 .\" Legal Terms
 .\" 
 .\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2022 Free Software Foundation, Inc.
 .\"
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
@@ -213,21 +213,6 @@ or
 .
 .
 .\" 
-.SS "Controlling delimiters"
-.\" 
-.
-.I eqn
-recognizes
-.RB \[lq] "delim on" \[rq]
-as a command to restore the delimiters which have been previously
-disabled with a call to
-.RB \[lq] "delim off" \[rq].
-.
-If delimiters haven't been specified,
-these commands have no effect.
-.
-.
-.\" 
 .SS "Automatic spacing"
 .\" 
 .
@@ -331,6 +316,46 @@ subsequently appear in an equation.
 .
 .
 .\" 
+.SS Primitives
+.\" 
+.
+.I @g@eqn
+supports without alteration the AT
+.I eqn \" AT
+primitives
+.BR above ,
+.BR back ,
+.BR bar ,
+.BR bold ,
+.BR define ,
+.BR down ,
+.BR fat ,
+.BR font ,
+.BR from ,
+.BR fwd ,
+.BR gfont ,
+.BR gsize ,
+.BR italic ,
+.BR left ,
+.BR lineup ,
+.BR mark ,
+.BR matrix ,
+.BR ndefine ,
+.BR over ,
+.BR right ,
+.BR roman ,
+.BR size ,
+.BR sqrt ,
+.BR sub ,
+.BR sup ,
+.BR tdefine ,
+.BR to ,
+.BR under ,
+and
+.BR up .
+.
+.
+.\" 
 .SS "New primitives"
 .\" 
 .
@@ -685,6 +710,19 @@ picture.
 .SS "Extended primitives"
 .\" 
 .
+.I @g@eqn
+recognizes an
+.RB \[lq] on \[rq]
+argument to the
+.B delim
+primitive specially;
+restoring any delimiters that have been previously disabled with
+.RB \[lq] "delim off" \[rq].
+.
+If delimiters haven't been specified,
+neither of these commands have effect.
+.
+.
 .TP
 .BI col\~ n\~\c
 .BR {\~ .\|.\|.\& \~}
@@ -1204,22 +1242,110 @@ Remove definition of
 making it undefined.
 .
 .
-.LP
-Besides the macros mentioned above,
-the following definitions are available:
-.BR Alpha ,
-.BR Beta ,
-\&.\|.\|.,
-.B Omega
-(this is the same as
-.BR ALPHA ,
-.BR BETA ,
-\&.\|.\|.,
-.BR OMEGA ),
-.B ldots
-(three dots on the baseline),
+.\" 
+.SS "Predefined macros"
+.\" 
+.
+.I @g@eqn
+supports the predefined macros offered by AT
+.I eqn:
+.BR and ,
+.BR approx ,
+.BR arc ,
+.BR cos ,
+.BR cosh ,
+.BR del ,
+.BR det ,
+.BR dot ,
+.BR dotdot ,
+.BR dyad ,
+.BR exp ,
+.BR for ,
+.BR grad ,
+.BR half ,
+.BR hat ,
+.BR if ,
+.BR inter ,
+.BR Im ,
+.BR inf ,
+.BR int ,
+.BR lim ,
+.BR ln ,
+.BR log ,
+.BR max ,
+.BR min ,
+.BR nothing ,
+.BR partial ,
+.BR prime ,
+.BR prod ,
+.BR Re ,
+.BR sin ,
+.BR sinh ,
+.BR sum ,
+.BR tan ,
+.BR tanh ,
+.BR tilde ,
+.BR times ,
+.BR union ,
+.BR vec ,
+.BR == ,
+.BR != ,
+.BR += ,
+.BR \-> ,
+.BR <\- ,
+.BR << ,
+.BR >> ,
 and
-.BR dollar .
+.RB \[lq] .\|.\|. \[rq].
+.
+The lowercase classical Greek letters are available as
+.BR alpha ,
+.BR beta ,
+.BR chi ,
+.BR delta ,
+.BR epsilon ,
+.BR eta ,
+.BR gamma ,
+.BR iota ,

[groff] 04/31: groff_man*(7): Tighten and generalize.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 4f4dbf92ba4525332b3c00448a74ff28b9bf1e27
Author: G. Branden Robinson 
AuthorDate: Wed Aug 10 13:25:38 2022 -0500

groff_man*(7): Tighten and generalize.

"tty" isn't an "output device"; that is, it is not a recognized argument
to the troff `-T` option.  Recast.

Also include reminder that we should hook up the plumbing for hyperlink
support in PDF.
---
 tmac/groff_man.7.man.in | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 8a4268daa..1d5db0183 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1189,12 +1189,9 @@ Email addresses are bracketed with
 and other forms of hyperlink with
 .BR .UR / .UE .
 .
-Hyperlinked text is supported on the
-.BR html ,
-.BR tty ,
-and
-.B xhtml
-output devices;
+Hyperlinked text is supported on HTML
+.\", PDF,
+and terminal output devices;
 terminals and pager programs must support ECMA-48 OSC\~8 escape
 sequences
 (see

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 13/31: groff_man_style(7): Clarify spec char portability.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit fd09dfe8851d3a1b95cc0255eb0f92369ee4bc96
Author: G. Branden Robinson 
AuthorDate: Sat Aug 13 12:47:20 2022 -0500

groff_man_style(7): Clarify spec char portability.

Discuss the portability of the reverse solidus and quotation characters,
but point out that device-independent troffs can support them without a
recompile.
---
 tmac/groff_man.7.man.in | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index aa1a94764..9380e7dc0 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -2647,6 +2647,21 @@ source than
 escape sequences do.
 .
 .
+.P
+Several special characters are also widely portable.
+.
+AT
+.I troff
+did not `define' the reverse solidus or quotation characters listed
+below,
+but any of its descendants,
+like Plan\~9 or Solaris
+.IR troff , \" Plan 9, Solaris
+can support them by defining their glyphs in font description files;
+see
+.MR groff_font @MAN5EXT@ .
+.
+.
 .TP
 .B \e\-
 Minus sign or basic Latin hyphen-minus.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 07/31: doc/groff.texi: Fix factual error about mandoc.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 8a49f10dd2c0cac10401f54318bc0c16d5acc552
Author: G. Branden Robinson 
AuthorDate: Fri Aug 12 20:15:03 2022 -0500

doc/groff.texi: Fix factual error about mandoc.

mandoc began recognizing the `\~` escape sequence in 1.9.5 (2009-09-21),
not 1.14.5 (2019-03).  Thanks to Ingo Schwarze for the correction.

https://lists.gnu.org/archive/html/groff/2022-08/msg00078.html

https://cvsweb.bsd.lv/mandoc/Attic/chars.in?rev=1.1=text/x-cvsweb-markup
https://cvsweb.bsd.lv/mandoc/NEWS?rev=1.1=text/x-cvsweb-markup
---
 doc/groff.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index b79f7655a..c9e0a5403 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6580,10 +6580,10 @@ situations, since @w{@samp{\ }} inserts a fixed-width, 
non-breaking
 space.  GNU @code{troff} provides the @code{\~} escape sequence to
 insert an adjustable, non-breaking space.@footnote{@code{\~} is also
 supported by Heirloom Doctools @code{troff} 050915 (September 2005),
-@code{neatroff} (since commit 1c6ab0f6e, 2016-09-13), and @code{mandoc}
-1.14.5 (March 2019) but not by Plan@tie{}9 @code{troff}, Solaris
+@code{mandoc} 1.9.5 (2009-09-21), and @code{neatroff} (since commit
+1c6ab0f6e, 2016-09-13), but not by Plan@tie{}9 @code{troff}, Solaris
 @code{troff}, or DWB @code{troff} or @code{onroff}.}
-@c as of this writing, 2022-03-21
+@c as of this writing, 2022-08-12
 
 @cindex @code{"}, in a macro argument
 @cindex double quote, in a macro argument

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 01/01: ChangeLog: Fix typo.

2022-08-16 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 5b7382dbc7b28c5611400810f31124d2c89e54b2
Author: G. Branden Robinson 
AuthorDate: Fri Aug 5 02:59:27 2022 -0500

ChangeLog: Fix typo.
---
 ChangeLog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2190e5c0a..61bee309c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,7 @@
* src/preproc/eqn/lex.cpp (do_delim): Recognize "delim on" even
in compatibility mode, enabling tbl to toggle eqn delimiter
recognition when it is run in compatibility mode as well.
-   * src/preproc/eqn/eqn.1.man (Controlling delimiteres): Update.
+   * src/preproc/eqn/eqn.1.man (Controlling delimiters): Update.
* NEWS: Add item.
 
Fixes .  Thanks to Bjarni

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


Re: deroff availability

2022-08-16 Thread Laurens Kils-Hütten
Am Wed, Aug 17, 2022 at 03:47:31AM + schrieb DJ Chase:
> Does anyone know how I could get a copy of deroff(1) on my machine
> (Fedora Linux 36)? It’s not in the repos — or seemingly any Linux repos
> for that matter — and I can’t seem to find the source for it.

The Arch Linux User Repository (AUR) is a valuable source here.

I found https://aur.archlinux.org/packages/deroff 
which in turn points to http://www.moria.de/~michael/deroff/
et voilà!

That said, I was facing the same problem on my Arch system, and will try to 
compile deroff from the sources, now.
 
Cheers,

lkh

-- 
https://octodon.social/web/@lkh
xmpp: l...@jabber.de
IRC: lkh on Libera.chat and others
Signal: +491627291956
Discord: lkh#2319



Re: About groff and dformat

2022-08-16 Thread Riza Dindir
Hello Thomas,

Finally I was able to use the dformat without problems. The problem
was the order in the pipe. In the original paper the author provided
an example on the order of the preprocessors. I did not have the
correct order. It should have been

!sh dformat.sh format-test.ms | pic | tbl | eqn | groff -ms > main.ps

That solved the problem, and I can create the dformat in the document.

Thanks for the help.

Regards,
Riza

On Wed, Aug 17, 2022 at 6:59 AM Riza Dindir  wrote:
>
> Hello Thomas,
>
> To make sure, I have this in my dformat.sh
>
> awk -f dformat.awk $*
>
> I tried with the dformat.awk that I have found
> (https://github.com/arnoldrobbins/dformat) and the dformat.awk that
> you have pointed out (https://github.com/sathlan/dformat). But still I
> am getting the same error message and the dformat picture is displayed
> partially.
>
> What is the version of groff (mine is 1.22.4), and awk (mine is
> 20210215) that you are using? Clearly I must be doing something wrong.
>
> Although I could just remove inline equations from the dformat spec in
> the document, I would like to understand what is wrong.
>
> Regards,
> Riza
>
> On Tue, Aug 16, 2022 at 9:59 PM Thomas Dupond  wrote:
> >
> > Riza Dindir  wrote:
> >
> > > Hello All,
> >
> > Hi!
> >
> > > I am trying to get dformat to work. What I did was this.
> > >
> > > I first tried to include an example dformat script into my document. I
> > > got the first example from the troff.org site
> > > (https://troff.org/prog.html). The first example for the dformat
> > > processor. That example has been using inline equations/math
> > > expressions.
> > >
> > > Then I went and got the dformat awk script. That script I got from
> > > (https://github.com/arnoldrobbins/dformat) which might not be the
> > > original script.
> >
> > I know the following github repo is a transcript of the dformat by
> > Jon L. Bentley:
> >
> > https://github.com/sathlan/dformat
> >
> > I had no problem generating your document with it. :)
> >
> > > Anyways I have this simple document.
> > >
> > > .TL
> > > Some format
> > > .NH
> > > deneme
> > > .EQ
> > > delim @@
> > > .EN
> > > .LP
> > > .begin dformat
> > > style bitwid 0.08
> > > style charwid 0
> > > style recspread 0.3
> > > noname
> > > --16 Frame
> > > --16 Frame
> > >   A1:   --16 Frame
> > > --16 Frame
> > > --8-dashed ...
> > > noname
> > >   A2:   8--8 Flags
> > > 8--8 Status
> > > --8 @roman Chunk sub 1@
> > >   B1:   --8 @roman Chunk sub 2@
> > > --8-dashed ...
> > > --8 @roman Chunk sub m@
> > > 16--16 CRC
> > >   A3:   8--8 Flags
> > > noname
> > >   B2:   8--8 @roman Data sub 1@
> > > 8--8 @roman Data sub 2@
> > > 8--8 @roman Data sub 3@
> > > 8--8 @roman Data sub 4@
> > > --8-dashed ...
> > > 8--8 @roman Data sub n-1@
> > > 8--8 @roman Data sub n@
> > > 6--6 Length
> > >   B3:   10--10 Channel #
> > > pic line dotted from A1.sw to A2.nw
> > > pic line dotted from A1.se to A3.ne
> > > pic line dotted from B1.sw to B2.nw
> > > pic line dotted from B1.se to B3.ne
> > > .end
> > >
> > > And am running the command line as
> > >
> > > !sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps
> > >
> > > The command says this
> > >
> > > pic::98: syntax error before '\'
> > > pic::98: giving up on this picture
> > >
> > > Does anybody use dformat? Which dformat script are you using?
> > >
> > > Regards,
> > > Riza
> > >
> > >
> >
> > --
> > Regards,
> > Thomas



Re: About groff and dformat

2022-08-16 Thread Riza Dindir
Hello Thomas,

To make sure, I have this in my dformat.sh

awk -f dformat.awk $*

I tried with the dformat.awk that I have found
(https://github.com/arnoldrobbins/dformat) and the dformat.awk that
you have pointed out (https://github.com/sathlan/dformat). But still I
am getting the same error message and the dformat picture is displayed
partially.

What is the version of groff (mine is 1.22.4), and awk (mine is
20210215) that you are using? Clearly I must be doing something wrong.

Although I could just remove inline equations from the dformat spec in
the document, I would like to understand what is wrong.

Regards,
Riza

On Tue, Aug 16, 2022 at 9:59 PM Thomas Dupond  wrote:
>
> Riza Dindir  wrote:
>
> > Hello All,
>
> Hi!
>
> > I am trying to get dformat to work. What I did was this.
> >
> > I first tried to include an example dformat script into my document. I
> > got the first example from the troff.org site
> > (https://troff.org/prog.html). The first example for the dformat
> > processor. That example has been using inline equations/math
> > expressions.
> >
> > Then I went and got the dformat awk script. That script I got from
> > (https://github.com/arnoldrobbins/dformat) which might not be the
> > original script.
>
> I know the following github repo is a transcript of the dformat by
> Jon L. Bentley:
>
> https://github.com/sathlan/dformat
>
> I had no problem generating your document with it. :)
>
> > Anyways I have this simple document.
> >
> > .TL
> > Some format
> > .NH
> > deneme
> > .EQ
> > delim @@
> > .EN
> > .LP
> > .begin dformat
> > style bitwid 0.08
> > style charwid 0
> > style recspread 0.3
> > noname
> > --16 Frame
> > --16 Frame
> >   A1:   --16 Frame
> > --16 Frame
> > --8-dashed ...
> > noname
> >   A2:   8--8 Flags
> > 8--8 Status
> > --8 @roman Chunk sub 1@
> >   B1:   --8 @roman Chunk sub 2@
> > --8-dashed ...
> > --8 @roman Chunk sub m@
> > 16--16 CRC
> >   A3:   8--8 Flags
> > noname
> >   B2:   8--8 @roman Data sub 1@
> > 8--8 @roman Data sub 2@
> > 8--8 @roman Data sub 3@
> > 8--8 @roman Data sub 4@
> > --8-dashed ...
> > 8--8 @roman Data sub n-1@
> > 8--8 @roman Data sub n@
> > 6--6 Length
> >   B3:   10--10 Channel #
> > pic line dotted from A1.sw to A2.nw
> > pic line dotted from A1.se to A3.ne
> > pic line dotted from B1.sw to B2.nw
> > pic line dotted from B1.se to B3.ne
> > .end
> >
> > And am running the command line as
> >
> > !sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps
> >
> > The command says this
> >
> > pic::98: syntax error before '\'
> > pic::98: giving up on this picture
> >
> > Does anybody use dformat? Which dformat script are you using?
> >
> > Regards,
> > Riza
> >
> >
>
> --
> Regards,
> Thomas



deroff availability

2022-08-16 Thread DJ Chase
Hi everyone,

Does anyone know how I could get a copy of deroff(1) on my machine
(Fedora Linux 36)? It’s not in the repos — or seemingly any Linux repos
for that matter — and I can’t seem to find the source for it.

I’ve also tried to find similar tools, such as roff2text, but that
actually (poorly) formats the text.

Cheers,
-- 
DJ Chase
They, Them, Theirs



Re: Standardize roff

2022-08-16 Thread Alexis



Sam Varshavchik  writes:


I believe that for man pages, roff
should've been replaced by Docbook XML a long time ago.


Personally, i'm grateful that it hasn't. Apart from Ingo's 
thorough critique of DocBook:


   https://undeadly.org/cgi?action=article=20190419101505

i doubt i'd have had as much enthusiasm for creating the man page 
ports of s6-related documentation if i'd had to use DocBook, 
rather than being able to use mdoc(7). In fact i probably wouldn't 
have done them at all.



Alexis.



Re: Standardize roff

2022-08-16 Thread Sam Varshavchik

Ingo Schwarze writes:


Hi San,

Sam Varshavchik wrote on Sun, Aug 14, 2022 at 08:20:34PM -0400:
> Ingo Schwarze writes:
>> DJ Chase wrote on Sat, Aug 13, 2022 at 05:27:34PM +:

>>> Have we ever considered a de jure *roff standard?

>> No, i think that would be pure madness given the amount of working
>> time available in any of the roff projects.

> I tinkered with something like this some years ago, but I took a slightly
> different approach.
>
> I converted man pages

What kind of manual pages?


The ones that are the subject of discussions on linux-...@vger.kernel.org.


> from 'roff source to Docbook XML using a … pretty large Perl script.

That sounds very foolish on several levels.


Well, I had some free time the other day, and had nothing better to do.


First, and most obviously, you seem to be duplicating esr@'s work
on doclifter:

  http://www.catb.org/~esr/doclifter/
  https://gitlab.com/esr/doclifter/-/blob/master/doclifter


Seems so, except that I tailored my logic to man pages, and specifically to  
the linux-...@vger.kernel.org manpages.



Second, quick and dirty Perl-style parsing is usually not good
enough to parse roff code, and a huge script is not particularly
good for readability and maintainability.


Yes, arbitrary roff code will not fly very far. But something that's  
tailored can produce productive results.



Yes, i know the same resevations would apply to esr@'s work,
which is a giant Python 3 script.  But at least there is some
evidence that his work was able to find significant numbers of
real issues in real manual pages.


Yes, there are plenty of issues there. I fed quite a few patches to Mr.  
Kerrisk when he maintained them, based on my scripts chewing through them.  
There were plenty of mismatched .nf/.fi, and other things of that sort.




> Once a year, or so, when I have nothing better to do I pull the current
> man  page tarball and reconvert it. I usually need to tinker the Perl
> script, here and there, each time.
>
> The Docbook folks provide a stylesheet that converts Docbook XML
> back to 'roff.

Yikes.  That thing is by far the worst man(7) code generator existing
on this planet.  If at all possible, you should avoid that toolchain
like the plague.


I do not view it as an authoritative source of man sources, but more of  
backwards compatibility. I believe that for man pages, roff should've been  
replaced by Docbook XML a long time ago.


That was really the original impetus for my Perl hacking: to see how  
feasible it would be to convert the existing man pages to Docbook XML. My  
end result showed that at least that it was doable; and I think that the  
Docbook XML stylesheet for man pages would've been an acceptable way to get  
some roff source generated from Docbook XML that's shown by the man command.



> The end result you get is standardized 'roff, whatever that means.

Absolutely not.  The result is utter crap.  It is rarely even
syntactically valid, let alone reasonable style.


I should've used "consistent" instead of "standardized". Different man pages  
from different sources use different ways of rendering the same content,  
i.e. function names. Sometimes it's in bold. Sometimes it's in italic.  
Sometimes it's something else. With consistent semantic markup a   
in every man page would've produced the same markup in the generated roff  
source.





pgpVD7G808LBH.pgp
Description: PGP signature


Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar

Hi Branden,

On 8/16/22 22:52, Alejandro Colomar wrote:

Hi Branden,

On 8/16/22 18:58, Alejandro Colomar wrote:
Heh, I just installed three virtual machines: debian stable, testing, 
and unstable.  Guess what?  None of them reproduce the issue.


This is very weird.  AFAIR, the only difference that I have compared 
to a clean Sid install, is that I have groff(1) from source, but you 
also have it.  What else can I have that may be doing this weird thing?


Building and installing groff from source from git HEAD in the Sid clean 
machine triggers the bug (nothing else did).  I'm now almost convinced 
it's groff.


I'll try in the stable machine, just to check.


Okay, so I tried with Debian stable, and groff built from source doesn't 
have a bug there.


To reproduce the bug you need:

- Debian Sid
- Any pager that does highlighting will do (tried less and batcat).
- Any terminal emulator will do (tried xfce and xterm).
- groff built from git HEAD

Cheers,

Alex


--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar

Hi Branden,

On 8/16/22 18:58, Alejandro Colomar wrote:
Heh, I just installed three virtual machines: debian stable, testing, 
and unstable.  Guess what?  None of them reproduce the issue.


This is very weird.  AFAIR, the only difference that I have compared to 
a clean Sid install, is that I have groff(1) from source, but you also 
have it.  What else can I have that may be doing this weird thing?


Building and installing groff from source from git HEAD in the Sid clean 
machine triggers the bug (nothing else did).  I'm now almost convinced 
it's groff.


I'll try in the stable machine, just to check.

The weird thing is that you can't reproduce it.

Cheers,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: About groff and dformat

2022-08-16 Thread Thomas Dupond
Riza Dindir  wrote:

> Hello All,

Hi!

> I am trying to get dformat to work. What I did was this.
> 
> I first tried to include an example dformat script into my document. I
> got the first example from the troff.org site
> (https://troff.org/prog.html). The first example for the dformat
> processor. That example has been using inline equations/math
> expressions.
> 
> Then I went and got the dformat awk script. That script I got from
> (https://github.com/arnoldrobbins/dformat) which might not be the
> original script.

I know the following github repo is a transcript of the dformat by
Jon L. Bentley:

https://github.com/sathlan/dformat

I had no problem generating your document with it. :)

> Anyways I have this simple document.
> 
> .TL
> Some format
> .NH
> deneme
> .EQ
> delim @@
> .EN
> .LP
> .begin dformat
> style bitwid 0.08
> style charwid 0
> style recspread 0.3
> noname
> --16 Frame
> --16 Frame
>   A1:   --16 Frame
> --16 Frame
> --8-dashed ...
> noname
>   A2:   8--8 Flags
> 8--8 Status
> --8 @roman Chunk sub 1@
>   B1:   --8 @roman Chunk sub 2@
> --8-dashed ...
> --8 @roman Chunk sub m@
> 16--16 CRC
>   A3:   8--8 Flags
> noname
>   B2:   8--8 @roman Data sub 1@
> 8--8 @roman Data sub 2@
> 8--8 @roman Data sub 3@
> 8--8 @roman Data sub 4@
> --8-dashed ...
> 8--8 @roman Data sub n-1@
> 8--8 @roman Data sub n@
> 6--6 Length
>   B3:   10--10 Channel #
> pic line dotted from A1.sw to A2.nw
> pic line dotted from A1.se to A3.ne
> pic line dotted from B1.sw to B2.nw
> pic line dotted from B1.se to B3.ne
> .end
> 
> And am running the command line as
> 
> !sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps
> 
> The command says this
> 
> pic::98: syntax error before '\'
> pic::98: giving up on this picture
> 
> Does anybody use dformat? Which dformat script are you using?
> 
> Regards,
> Riza
> 
> 

-- 
Regards,
Thomas



Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar

Hi Branden,

On 8/16/22 15:31, G. Branden Robinson wrote:

At 2022-08-16T15:13:54+0200, Alejandro Colomar wrote:

That's weird; I used both xterm and xfce-terminal, and both seem to
reproduce it.  I documented all of the software I used to reproduce it
in this message:




Ah right, thanks.  I installed the xfce4-terminal package (0.8.10-1) and
couldn't reproduce it there, either.


Do you have any Debian Sid system (all of my computers are running
some variant of Sid; most are Debian, and one is Devuan)?


My days of running unstable are in the past, I'm afraid, at least until
I get moving on joining Colin Watson as groff package maintainer, at
which time I'll have to get comfortable with it again.  But before that,
we gotta release groff 1.23.

I think it might be a good idea at this point to see if we can narrow
down which terminal escape sequences are working incorrectly.

What do you see if you run the following shell command?

$ printf '\e[1mbold\e[7minversebold\e[27mbold\e[22mnormal\e[0m\n'

Regards,
Branden


Heh, I just installed three virtual machines: debian stable, testing, 
and unstable.  Guess what?  None of them reproduce the issue.


This is very weird.  AFAIR, the only difference that I have compared to 
a clean Sid install, is that I have groff(1) from source, but you also 
have it.  What else can I have that may be doing this weird thing?


Cheers,

Alex

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar



On 8/16/22 15:31, G. Branden Robinson wrote:

printf '\e[1mbold\e[7minversebold\e[27mbold\e[22mnormal\e[0m\n'


I see what the words tell.  Nothing weird.

--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


About groff and dformat

2022-08-16 Thread Riza Dindir
Hello All,

I am trying to get dformat to work. What I did was this.

I first tried to include an example dformat script into my document. I
got the first example from the troff.org site
(https://troff.org/prog.html). The first example for the dformat
processor. That example has been using inline equations/math
expressions.

Then I went and got the dformat awk script. That script I got from
(https://github.com/arnoldrobbins/dformat) which might not be the
original script.

Anyways I have this simple document.

.TL
Some format
.NH
deneme
.EQ
delim @@
.EN
.LP
.begin dformat
style bitwid 0.08
style charwid 0
style recspread 0.3
noname
--16 Frame
--16 Frame
  A1:   --16 Frame
--16 Frame
--8-dashed ...
noname
  A2:   8--8 Flags
8--8 Status
--8 @roman Chunk sub 1@
  B1:   --8 @roman Chunk sub 2@
--8-dashed ...
--8 @roman Chunk sub m@
16--16 CRC
  A3:   8--8 Flags
noname
  B2:   8--8 @roman Data sub 1@
8--8 @roman Data sub 2@
8--8 @roman Data sub 3@
8--8 @roman Data sub 4@
--8-dashed ...
8--8 @roman Data sub n-1@
8--8 @roman Data sub n@
6--6 Length
  B3:   10--10 Channel #
pic line dotted from A1.sw to A2.nw
pic line dotted from A1.se to A3.ne
pic line dotted from B1.sw to B2.nw
pic line dotted from B1.se to B3.ne
.end

And am running the command line as

!sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps

The command says this

pic::98: syntax error before '\'
pic::98: giving up on this picture

Does anybody use dformat? Which dformat script are you using?

Regards,
Riza



Re: Regarding groff and eqn

2022-08-16 Thread Riza Dindir
Thank you Branden, that was it. Now I can create an inline math
expression, although the inline math expression was nonsense in the
document :)

On Tue, Aug 16, 2022 at 4:23 PM Riza Dindir  wrote:
>
> Oh oh. Tooo many mistakes. What was i thinking. Will try these. Thanks.
>
> On Tue, Aug 16, 2022, 13:17 G. Branden Robinson 
>  wrote:
>>
>> At 2022-08-16T12:56:30+0300, Riza Dindir wrote:
>> > I am using groff 1.22.4 on FreBSD 13.1. Wanted to write inline
>> > equations (in a document that uses ms macros), and it does not give me
>> > any inline equations. I must be missing something or doing something
>> > wrong.
>> >
>> > Here is my simple document.
>> >
>> > .TH
>> > Inline math
>>
>> Not related to your issue, but I think you mean "TL", the "title" macro,
>> not "TH", which is useful only inside tables ("TS"/"TE").
>>
>> > .NH
>> > Start
>> > .LP
>> > .EQ
>> > delim $$
>> > .EN
>> > .LP
>> > This is some paragraph with inline math: $sum from 1 to 10 = 5 + x$.
>> >
>> > I do process this with
>> >
>> > pic inline-math.ms | groff -ms > main.ps
>> >
>> > But all I get in the document is a centered line with delim $$
>> > following with the paragraph that is given as the last line in the
>> > document.
>> >
>> > How could I do inline math expressions in paragraphs?
>>
>> The equation preprocessor is eqn, not pic.
>>
>> Try this.
>>
>> eqn inline-math.ms | groff -ms > main.ps
>>
>> You can also do this.
>>
>> groff -e -ms > main.ps
>>
>> Regards,
>> Branden



Re: [BUG] italics run past where they should

2022-08-16 Thread G. Branden Robinson
At 2022-08-16T15:13:54+0200, Alejandro Colomar wrote:
> That's weird; I used both xterm and xfce-terminal, and both seem to
> reproduce it.  I documented all of the software I used to reproduce it
> in this message:
> 
> 

Ah right, thanks.  I installed the xfce4-terminal package (0.8.10-1) and
couldn't reproduce it there, either.

> Do you have any Debian Sid system (all of my computers are running
> some variant of Sid; most are Debian, and one is Devuan)?

My days of running unstable are in the past, I'm afraid, at least until
I get moving on joining Colin Watson as groff package maintainer, at
which time I'll have to get comfortable with it again.  But before that,
we gotta release groff 1.23.

I think it might be a good idea at this point to see if we can narrow
down which terminal escape sequences are working incorrectly.

What do you see if you run the following shell command?

$ printf '\e[1mbold\e[7minversebold\e[27mbold\e[22mnormal\e[0m\n'

Regards,
Branden


signature.asc
Description: PGP signature


Re: [BUG] italics run past where they should

2022-08-16 Thread G. Branden Robinson
Hi Alex,

At 2022-08-16T13:57:00+0200, Alejandro Colomar wrote:
> On 8/16/22 03:59, G. Branden Robinson wrote:
> > I didn't realize you were waiting on me--sorry.  It would be good if
> > you could collect the pager output _including terminal escape
> > sequences_, for instance using the script(1) command (as Ralph
> > pointed out).  Attach it to your email.  It should then be possible
> > to see which sequences are being sent, and then either confirm or
> > overturn my hypothesis.
> 
> Sure.  It is attached.  To reproduce it:
> 
[ $ script ]
> $ man membarrier
> /cmd[ENTER]
> q
> $ ^D

I'm sorry to say I just can't reproduce what you are seeing.  I used
several combinations of pager and terminal emulator.

XTerm(370)
# GNOME Terminal 3.38.3 using VTE 0.66.1 +BIDI +GNUTLS +ICU +SYSTEMD
more from util-linux 2.36.1
less 581.2 (POSIX regular expressions)
less 551 (GNU regular expressions)

(Using "more" was pointless since it doesn't highlight search matches
anyway.)

Here's the relevant synopsis line indicating the terminal control
sequences present.  This is from my typescript.

   ESC[1mint membarrier(int ESC[4mESC[22mcmdESC[24mESC[1m, unsigned

When I do the search (with gnome-terminal and less 551), it changes to
this.

ESC[10;1H   ESC[1mint membarrier(int 
ESC[4mESC[22mESC[7mcmdESC[27mESC[24mESC[1m, unsigned

So let's decode these sequences.  The key to interpreting ISO 6429
escape sequences is, once you see ESC [ (the "control sequence
introducer"), skip ahead to the last character before proper terminal
contents.  In the first exhibit, that's an "m" every time.

We can then look up the meanings in the xterm ctlseqs.ms document.

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

We see that CSI sequences ending in "m" are "character attributes",
exactly what we expect.  These are all pretty simply, there's only one
parameter given to each.  They are 1, 4, 22, 24, and 1 again.

Per the document, we have:

1   bold
4   underlined
22  normal (weight, i.e., not "bold" or "faint")
24  not underlined

(Typographers would say "light" rather than "faint", but on the other
hand the underlying subject is a standard for _video_ terminals.)

Seems reasonable: all we've got in that synopsis line is bold and
"italics".  The shift to normal is expected since "cmd" is not supposed
to be both bold _and_ underlined.

Okay, now let's consider the post-search output.

We have a new sequence, one ending in "H".  We can guess its function
since every line after the search looks like this, with a highly
suggestive parameter pattern.  Nevertheless we'll go to the document.

"H" is the sequence for cursor positioning.  We can see that

  ESC [ 10 ; 1 H

means to move the cursor to the 10th row, 1st character.  (Character
cell addresses in ISO 6429 are 1-based, not 0-based.)

(For you, it's line 14 since I'm reading the membarrier(2) man page on
my Debian-based system, not your bleeding edge version with the
"LIBRARY" section heading near the top of the page.)

We can disregard this.  less(1) has simply redrawn the screen line by
line rather than scrolling it or using some other technique.  (If a
pager were written to use curses, we might see "optimized" screen
updates that only redrew the character cells that needed to change.  But
let's be glad of the waste, because it makes the typescript _much_
easier to interpret.)

So what remains?  We see the four familiar from before plus two new
ones.

7   inverse
27  positive (i.e., not inverse)

Furthermore the use of these two escape sequences precisely brackets
"cmd", the search pattern.

I have to say I just don't see a problem here.  I think it is time to
consider the possibility of a bug in the terminal emulator you're using.
Which one is it?  Try different ones.

Regards,
Branden


signature.asc
Description: PGP signature


Re: Regarding groff and eqn

2022-08-16 Thread Riza Dindir
Oh oh. Tooo many mistakes. What was i thinking. Will try these. Thanks.

On Tue, Aug 16, 2022, 13:17 G. Branden Robinson <
g.branden.robin...@gmail.com> wrote:

> At 2022-08-16T12:56:30+0300, Riza Dindir wrote:
> > I am using groff 1.22.4 on FreBSD 13.1. Wanted to write inline
> > equations (in a document that uses ms macros), and it does not give me
> > any inline equations. I must be missing something or doing something
> > wrong.
> >
> > Here is my simple document.
> >
> > .TH
> > Inline math
>
> Not related to your issue, but I think you mean "TL", the "title" macro,
> not "TH", which is useful only inside tables ("TS"/"TE").
>
> > .NH
> > Start
> > .LP
> > .EQ
> > delim $$
> > .EN
> > .LP
> > This is some paragraph with inline math: $sum from 1 to 10 = 5 + x$.
> >
> > I do process this with
> >
> > pic inline-math.ms | groff -ms > main.ps
> >
> > But all I get in the document is a centered line with delim $$
> > following with the paragraph that is given as the last line in the
> > document.
> >
> > How could I do inline math expressions in paragraphs?
>
> The equation preprocessor is eqn, not pic.
>
> Try this.
>
> eqn inline-math.ms | groff -ms > main.ps
>
> You can also do this.
>
> groff -e -ms > main.ps
>
> Regards,
> Branden
>


Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar



On 8/16/22 14:40, G. Branden Robinson wrote:

Hi Alex,

At 2022-08-16T13:57:00+0200, Alejandro Colomar wrote:

On 8/16/22 03:59, G. Branden Robinson wrote:

I didn't realize you were waiting on me--sorry.  It would be good if
you could collect the pager output _including terminal escape
sequences_, for instance using the script(1) command (as Ralph
pointed out).  Attach it to your email.  It should then be possible
to see which sequences are being sent, and then either confirm or
overturn my hypothesis.


Sure.  It is attached.  To reproduce it:


[ $ script ]

$ man membarrier
/cmd[ENTER]
q
$ ^D


I'm sorry to say I just can't reproduce what you are seeing.  I used
several combinations of pager and terminal emulator.


:(



XTerm(370)
# GNOME Terminal 3.38.3 using VTE 0.66.1 +BIDI +GNUTLS +ICU +SYSTEMD
more from util-linux 2.36.1
less 581.2 (POSIX regular expressions)
less 551 (GNU regular expressions)

(Using "more" was pointless since it doesn't highlight search matches
anyway.)

Here's the relevant synopsis line indicating the terminal control
sequences present.  This is from my typescript.

ESC[1mint membarrier(int ESC[4mESC[22mcmdESC[24mESC[1m, unsigned

When I do the search (with gnome-terminal and less 551), it changes to
this.

ESC[10;1H   ESC[1mint membarrier(int 
ESC[4mESC[22mESC[7mcmdESC[27mESC[24mESC[1m, unsigned

So let's decode these sequences.  The key to interpreting ISO 6429
escape sequences is, once you see ESC [ (the "control sequence
introducer"), skip ahead to the last character before proper terminal
contents.  In the first exhibit, that's an "m" every time.

We can then look up the meanings in the xterm ctlseqs.ms document.

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

We see that CSI sequences ending in "m" are "character attributes",
exactly what we expect.  These are all pretty simply, there's only one
parameter given to each.  They are 1, 4, 22, 24, and 1 again.

Per the document, we have:

1   bold
4   underlined
22  normal (weight, i.e., not "bold" or "faint")
24  not underlined

(Typographers would say "light" rather than "faint", but on the other
hand the underlying subject is a standard for _video_ terminals.)

Seems reasonable: all we've got in that synopsis line is bold and
"italics".  The shift to normal is expected since "cmd" is not supposed
to be both bold _and_ underlined.

Okay, now let's consider the post-search output.

We have a new sequence, one ending in "H".  We can guess its function
since every line after the search looks like this, with a highly
suggestive parameter pattern.  Nevertheless we'll go to the document.

"H" is the sequence for cursor positioning.  We can see that

   ESC [ 10 ; 1 H

means to move the cursor to the 10th row, 1st character.  (Character
cell addresses in ISO 6429 are 1-based, not 0-based.)

(For you, it's line 14 since I'm reading the membarrier(2) man page on
my Debian-based system, not your bleeding edge version with the
"LIBRARY" section heading near the top of the page.)

We can disregard this.  less(1) has simply redrawn the screen line by
line rather than scrolling it or using some other technique.  (If a
pager were written to use curses, we might see "optimized" screen
updates that only redrew the character cells that needed to change.  But
let's be glad of the waste, because it makes the typescript _much_
easier to interpret.)

So what remains?  We see the four familiar from before plus two new
ones.

7   inverse
27  positive (i.e., not inverse)

Furthermore the use of these two escape sequences precisely brackets
"cmd", the search pattern.

I have to say I just don't see a problem here.  I think it is time to
consider the possibility of a bug in the terminal emulator you're using.
Which one is it?  Try different ones.


That's weird; I used both xterm and xfce-terminal, and both seem to 
reproduce it.  I documented all of the software I used to reproduce it 
in this message:




Do you have any Debian Sid system (all of my computers are running some 
variant of Sid; most are Debian, and one is Devuan)?  Could you try there?


Cheers,

Alex



Regards,
Branden


--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: Standardize roff

2022-08-16 Thread Ingo Schwarze
Hi San,

Sam Varshavchik wrote on Sun, Aug 14, 2022 at 08:20:34PM -0400:
> Ingo Schwarze writes:
>> DJ Chase wrote on Sat, Aug 13, 2022 at 05:27:34PM +:

>>> Have we ever considered a de jure *roff standard?

>> No, i think that would be pure madness given the amount of working
>> time available in any of the roff projects.

> I tinkered with something like this some years ago, but I took a slightly  
> different approach.
> 
> I converted man pages

What kind of manual pages?

> from 'roff source to Docbook XML using a … pretty large Perl script.

That sounds very foolish on several levels.

First, and most obviously, you seem to be duplicating esr@'s work
on doclifter:

  http://www.catb.org/~esr/doclifter/
  https://gitlab.com/esr/doclifter/-/blob/master/doclifter

Second, quick and dirty Perl-style parsing is usually not good
enough to parse roff code, and a huge script is not particularly
good for readability and maintainability.

Yes, i know the same resevations would apply to esr@'s work,
which is a giant Python 3 script.  But at least there is some
evidence that his work was able to find significant numbers of
real issues in real manual pages.

> Once a year, or so, when I have nothing better to do I pull the current
> man  page tarball and reconvert it. I usually need to tinker the Perl
> script, here and there, each time.
> 
> The Docbook folks provide a stylesheet that converts Docbook XML
> back to 'roff.

Yikes.  That thing is by far the worst man(7) code generator existing
on this planet.  If at all possible, you should avoid that toolchain
like the plague.

It is so bad that for years, bogus reports caused by that totally
broken toolchain have caused the majority of invalid mandoc bug
reports.

> The end result you get is standardized 'roff, whatever that means.

Absolutely not.  The result is utter crap.  It is rarely even
syntactically valid, let alone reasonable style.

> But, yes, the effort require to clean up and standardize the formatting
> of man pages would be mammoth. There's more inconsistency across the
> various man pages, from various sources, than consistency.

That isn't completely untrue, but all the same, mandoc copes well
enough with more than 95% of valid real-world manual pages, and groff
with 100%.  In a nutshell, the only stuff that breaks with groff
is manual pages that are completely invalid, usually coming from
the official DocBook XML toolchain, and in rarer cases coming from
other broken man(7) generators.

All this is barely related to the question of standardizing roff(7),
though.  Roff is much more than manual pages.

Yours,
  Ingo



Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar



On 8/16/22 13:57, Alejandro Colomar wrote:

Hi Branden,

On 8/16/22 03:59, G. Branden Robinson wrote:

I didn't realize you were waiting on me--sorry.  It would be good if you
could collect the pager output _including terminal escape sequences_,
for instance using the script(1) command (as Ralph pointed out).  Attach
it to your email.  It should then be possible to see which sequences are
being sent, and then either confirm or overturn my hypothesis.


Sure.  It is attached.  To reproduce it:



And of course, I forgot:

$ script

$ man membarrier
/cmd[ENTER]
q
$ ^D


Cheers,

Alex



Regards,
Branden




--
Alejandro Colomar



OpenPGP_signature
Description: OpenPGP digital signature


Re: [BUG] italics run past where they should

2022-08-16 Thread Alejandro Colomar

Hi Branden,

On 8/16/22 03:59, G. Branden Robinson wrote:

I didn't realize you were waiting on me--sorry.  It would be good if you
could collect the pager output _including terminal escape sequences_,
for instance using the script(1) command (as Ralph pointed out).  Attach
it to your email.  It should then be possible to see which sequences are
being sent, and then either confirm or overturn my hypothesis.


Sure.  It is attached.  To reproduce it:

$ man membarrier
/cmd[ENTER]
q
$ ^D


Cheers,

Alex



Regards,
Branden


--
Alejandro Colomar



typescript
Description: Binary data


OpenPGP_signature
Description: OpenPGP digital signature


Re: One Page Dungeon Layout in groff?

2022-08-16 Thread Deri
On Tuesday, 16 August 2022 10:18:17 BST Ralph Corderoy wrote:
> > Interestingly if you use the command "convert file.png file.pdf" a
> > valid pdf is produced which works with gropdf.
> 
> That was Laurens' original command but I found the convert(1) here
> sticks an ASCII NUL after the title, which pdfinfo pipes to grep which
> stops the dimensions being extracted by gropdf.

Hi Ralph,

Yes, it uses UTF-16 in the string as well. However, using the git version of 
PDFPIC it now works with the Ascii Null, I think Branden added a filter for 
the nulls to the pdfinfo command in January.

Cheers 

Deri






Re: Standardize roff (was: *roff `\~` support)

2022-08-16 Thread Ingo Schwarze
Hi Alejandro,

Alejandro Colomar wrote on Mon, Aug 15, 2022 at 01:59:24PM +0200:
> On 8/14/22 21:43, DJ Chase wrote:

>> Do you think that a descriptive/trailing standard could be beneficial
>> or would you still say that it could mostly hinder *roff
>> implementations?

When prepared with diligence and without falling for featurism,
it might be useful because the common subset of the major roff
implementations is large enough that it would likely be possibly
prepare portable roff documents following such a standard.

However, such a standard could likely *not* include *any* of the
best features of any of the implementations: yes, implementations
have diverged that much - not quite as bad as make(1), but still more
than many other classical Unix programs.  Consequently, only authors
with modest needs could possibly consider adhering to the standard.
To provide some striking examples, the standard could include neither
the mom(7) macro set - which is a killer feature of groff - nor the
mdoc(7) macro set - which has been an important feature of groff for
more than 30 years and of mandoc for more than 10 years.

This is all theoretical though - as i explained, the effort required
for developing such a (necessarily seriously stunted) standard is
prohibitive.

[...]
> But we can achieve something very similar by documenting the differences 
> between known roff alternatives somewhere.  And that's likely to be much 
> easier.

That's a much lower bar than a standard, but don't underestimate
the effort involved even in that.

A few very small parts of that already exist.

For example,

  https://mandoc.bsd.lv/man/man.options.1.html

documents command line options of some roff(1) and man(1)
implementations, mostly intended for people who see themselves
forced to invent a new command line option - which should of course
be avoided if at all possible because the tangle of existing options
is already terrifying.

For example,

  https://man.openbsd.org/roff.7

documents roff requests and roff escape sequences; search for
"extension" in that page.  Even though this page focusses on groff,
Heirloom, and mandoc and does not mention Plan 9, neatroff, or other
implementations, the amount of compatibility information scattered
around that page is already larger than what would seem healthy for
most user-facing documentation.  It's OK here because this page is
geared more towards developers than towards users.
Also, note that this page is already very long even though it is
extremely terse - so terse that it is insufficient for learning
how to use most of the features mentioned.

> In the Linux man-pages we document when a function is in ISO C or in 
> POSIX, but also when it's not standardized but present in other Unix 
> systems (so that it has some degree of portability), or when it is 
> Linux-only.  Maybe having something similar in groff's manual pages 
> would be effective.

Except that the bulk, and in particular the core, of groff functionality
is *not* described in manual pages in the first place.  Would you
want to litter groff.texi with compatibility information throughout?
That would likely cause a significant increase in size, almost certainly
a very signifant decrease in maintainability, and possibly it might also
somewhat decrease readability.

> For example, for .MR, we were discussing that probably it would be good 
> to add a note like "(since groff 1.23.0)" and maybe it could also state 
> which other roff (or mandoc) implementations support it.

But that feels like an exception rather than the rule.  It seems
warranted for this particular case because we are introducing a
new feature without consideration for compatibility that will cause
information loss for end-users unless something unusual is done
about it.  Hopefully, we are not going to turn that vice into a habit.

The particular case of .MR is somewhat specific to manual pages, too.
If people prepare a typeset document using many advanced features with
groff or Heirloom, they are used to the fact that it won't work with
the other, nor with Plan 9.  That's not a major problem because most of
the time, the author is the only person who really needs to typeset a
document.  Nowadays, the average reader will only read the PDF version,
which is totally different from the situation with manual pages.

Yours,
  Ingo



Savannah bug->email gateway problems affecting groff

2022-08-16 Thread G. Branden Robinson
[CCing Bob Proulx]

This message just is not showing up on the savannah-hackers-public list
(after two attempts 6 hours apart), so maybe there is more than one
email problem going on.

groff list subscribers may wish to consult
https://lists.gnu.org/archive/html/savannah-hackers-public/2022-08/index.html
for context.

I'd like to push some commits but I'm worried that gateway might be
affected too.

- Forwarded message from "G. Branden Robinson" 
 -

Date: Mon, 15 Aug 2022 21:25:30 -0500
From: "G. Branden Robinson" 
To: savannah-hackers-pub...@gnu.org
Subject: Savannah bug->email gateway problems

Hi folks,

Possibly related to the recent DoS-driven outage...

The bug-groff list hasn't gotten any updates on applicable Savannah
tickets for the groff group since sometime on 12 August.

https://lists.gnu.org/archive/html/bug-groff/2022-08/index.html

And when I update such a ticket, as with
, the page reload hangs forever.

If this is happening for multiple projects, this might be related to the
giant mail backlog that was observed.

(I see that bug-gnu-emacs, by contrast, seems to have been churning
along this whole time without trouble, so the problem may be restricted
to a subset of Savannah projects.)

https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-08/index.html

Can this be fixed, and the queued-up ticket updates (re)processed if
necessary?  The availability of ticket history via email archives is
extremely valuable for groff development, since it gives me multiple
lines of attack when searching.

Regards,
Branden



- End forwarded message -


signature.asc
Description: PGP signature


Re: Regarding groff and eqn

2022-08-16 Thread G. Branden Robinson
At 2022-08-16T12:56:30+0300, Riza Dindir wrote:
> I am using groff 1.22.4 on FreBSD 13.1. Wanted to write inline
> equations (in a document that uses ms macros), and it does not give me
> any inline equations. I must be missing something or doing something
> wrong.
> 
> Here is my simple document.
> 
> .TH
> Inline math

Not related to your issue, but I think you mean "TL", the "title" macro,
not "TH", which is useful only inside tables ("TS"/"TE").

> .NH
> Start
> .LP
> .EQ
> delim $$
> .EN
> .LP
> This is some paragraph with inline math: $sum from 1 to 10 = 5 + x$.
> 
> I do process this with
> 
> pic inline-math.ms | groff -ms > main.ps
> 
> But all I get in the document is a centered line with delim $$
> following with the paragraph that is given as the last line in the
> document.
> 
> How could I do inline math expressions in paragraphs?

The equation preprocessor is eqn, not pic.

Try this.

eqn inline-math.ms | groff -ms > main.ps

You can also do this.

groff -e -ms > main.ps

Regards,
Branden


signature.asc
Description: PGP signature


Regarding groff and eqn

2022-08-16 Thread Riza Dindir
Hello All,

I am using groff 1.22.4 on FreBSD 13.1. Wanted to write inline
equations (in a document that uses ms macros), and it does not give me
any inline equations. I must be missing something or doing something
wrong.

Here is my simple document.

.TH
Inline math
.NH
Start
.LP
.EQ
delim $$
.EN
.LP
This is some paragraph with inline math: $sum from 1 to 10 = 5 + x$.

I do process this with

pic inline-math.ms | groff -ms > main.ps

But all I get in the document is a centered line with delim $$
following with the paragraph that is given as the last line in the
document.

How could I do inline math expressions in paragraphs?

Thank you in advance for your help.

Regards,
Riza



Re: One Page Dungeon Layout in groff?

2022-08-16 Thread Dave Kemper
On 8/15/22, Ralph Corderoy  wrote:
> First, pdfinfo(1) was writing a NUL byte as part of the name of the PDF
> produced by ImageMagick's convert(1)

This has been reported as a bug
(http://gitlab.freedesktop.org/poppler/poppler/-/issues/776) but
doesn't seem universally regarded as such by the poppler team.
Comment there if you want to lobby for it.

> and that caused grep to just say
> the file matching instead of giving the image's dimensions.

This happens with groff 1.22.4 (the only released groff that includes
pdfpic), but has since been fixed in
http://savannah.gnu.org/bugs/?58206.  So if you compile your own groff
from the git bleeding edge, this shouldn't be an issue.



Re: One Page Dungeon Layout in groff?

2022-08-16 Thread Ralph Corderoy
Hi Deri,

> It starts a hash with "<<" but fails to close it with ">>". Each hash
> entry is a key/value pair where the key is preceded by a "\". The
> endstream should follow after a stream but that is missing.

Thanks for digging deeper.

> Interestingly if you use the command "convert file.png file.pdf" a
> valid pdf is produced which works with gropdf.

That was Laurens' original command but I found the convert(1) here
sticks an ASCII NUL after the title, which pdfinfo pipes to grep which
stops the dimensions being extracted by gropdf.

$ convert map.png map.pdf
$ pdfinfo map.pdf | sed -n l
 →  Title:  map\000$
Producer:   https://imagemagick.org$
CreationDate:   Tue Aug 16 10:16:59 2022 BST$
ModDate:Tue Aug 16 10:16:59 2022 BST$
Tagged: no$
UserProperties: no$
Suspects:   no$
Form:   none$
JavaScript: no$
Pages:  1$
Encrypted:  no$
Page size:  1440 x 1440 pts$
Page rot:   0$
File size:  127000 bytes$
Optimized:  no$
PDF version:1.3$
$ pdfinfo map.pdf | grep 'Page size'
Binary file (standard input) matches
$

That's why I moved from convert(1) to gm(1) only to hit a new problem.
:-)

-- 
Cheers, Ralph.