[groff] 01/03: [gropdf] Passing just "\" as a bookmark problem.

2024-05-14 Thread Deri James
deri pushed a commit to branch master
in repository groff.

commit 2cf8f41d3f9985da0670ddd2cbc07837d5433299
Author: Deri James 
AuthorDate: Wed May 8 18:39:30 2024 +0100

[gropdf] Passing just "\" as a bookmark problem.

* src/devices/gropdf/gropdf: it ends up as a pdf string "(\)",
which is treated as an escaped bracket and the string is not
terminated! Solution is to embed the "\" in octal notation,
i.e. (\134).
---
 src/devices/gropdf/gropdf.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 31a35db4a..800af64c3 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1507,6 +1507,7 @@ sub do_x
my ($pre,$title,$post)=($1,$2,$3);
$title=utf16($title);
 
+   $title="\\134" if $title eq "\\";
my @xwds=split(' ',"<< $pre$title$post >>");
my $out=ParsePDFValue(\@xwds);
$out->{Dest}=UTFName($out->{Dest});

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


[groff] 03/03: Forgot to push last two fixes.

2024-05-14 Thread Deri James
deri pushed a commit to branch master
in repository groff.

commit d998339bef8af990cca00b2b0a9939cc9fc2e7cf
Author: Deri James 
AuthorDate: Tue May 14 15:43:44 2024 +0100

Forgot to push last two fixes.
---
 ChangeLog | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index aa8814703..64ffb4231 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2024-05-14  Deri James  
+
+   [gropdf] \X'pdf: xrev' has issues.
+
+   * src/devices/gropdf/gropdf: Fails if point size not = 10, in
+   a number of ways.
+
+   * src/devices/gropdf/gropdf.1.man: Clarify exact operation of
+   'xrev'.
+
+2024-05-14  Deri James  
+
+   [gropdf] Passing just "\" as a bookmark problem.
+
+   * src/devices/gropdf/gropdf: it ends up as a pdf string "(\)",
+   which is treated as an escaped bracket and the string is not
+   terminated! Solution is to embed the "\" in octal notation,
+   i.e. (\134).
+
 2024-05-13  G. Branden Robinson 
 
* tmac/an.tmac (EE): Define macro with `de1` request, not `de`.

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


[groff] 02/03: [gropdf] \X'pdf: xrev' has issues.

2024-05-14 Thread Deri James
deri pushed a commit to branch master
in repository groff.

commit 4886b57816841de32c51b88ccffc9580b07bb535
Author: Deri James 
AuthorDate: Wed May 8 22:23:28 2024 +0100

[gropdf] \X'pdf: xrev' has issues.

* src/devices/gropdf/gropdf: Fails if point size not = 10, in
a number of ways.

* src/devices/gropdf/gropdf.1.man: Clarify exact operation of
'xrev'.
---
 src/devices/gropdf/gropdf.1.man |  6 ++
 src/devices/gropdf/gropdf.pl| 12 +++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/devices/gropdf/gropdf.1.man b/src/devices/gropdf/gropdf.1.man
index cc1971858..04e5799a5 100644
--- a/src/devices/gropdf/gropdf.1.man
+++ b/src/devices/gropdf/gropdf.1.man
@@ -977,10 +977,8 @@ height.
 .B \[rs]X\[aq]pdf: xrev\[aq]
 Toggle the reversal of glyph direction.
 .
-This feature works \[lq]letter by letter\[rq],
-that is,
-each letter in a word is reversed left-to-right,
-not the entire word.
+This feature works by reversing all following text.
+Each separate letter is also mirrored.
 .
 One application is the reversal of glyphs in the Zapf Dingbats font.
 .
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 800af64c3..74d32a5d7 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -4088,11 +4088,11 @@ sub PutLine
 my $len=0;
 my $rev=0;
 
-if (($lin[0]->[CHR]||0) < 0)
+if ($xrev)
 {
-   $len=($lin[$#lin]->[XPOS]-$lin[0]->[XPOS]+$lin[$#lin]->[HWID])*100;
-   $s.=d3($len).' ';
-$rev=1;
+   
$len=($lin[$#lin]->[XPOS]-$lin[0]->[XPOS]+$lin[$#lin]->[HWID])*1000/$cftsz;
+   $s.=d3($len).' ' if $len;
+   $rev=1;
 }
 
 $stream.="%! wht0sz=".d3($whtsz/$unitwidth).", 
wt=".((defined($wt))?d3($wt/$unitwidth):'--')."\n" if $debug;
@@ -4157,7 +4157,7 @@ sub PutLine
if ($rev)
{
$s.=') ' if !$n;
-   $s.=d3(($c->[CWID]-$c->[HWID])*100).' (';
+   $s.=d3(($c->[CWID]-$c->[HWID])*1000/$cftsz).' (';
$n=0;
}
 
@@ -4331,11 +4331,13 @@ sub PutGlyph
{
MakeMatrix(1);
$inxrev=1;
+   $#lin=-1;
}
elsif ($inxrev and $cn > 0)
{
MakeMatrix(0);
$inxrev=0;
+   $#lin=-1;
}
 
if ($matrixchg or $poschg)

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


[groff] 04/04: [man]: Fix Savannah #65729 (`de1 EE`).

2024-05-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f66cd8444ebd1531f81f69530ac7bc2f0c740a97
Author: G. Branden Robinson 
AuthorDate: Mon May 13 13:02:27 2024 -0500

[man]: Fix Savannah #65729 (`de1 EE`).

* tmac/an.tmac (EE): Define macro with `de1` request, not `de`.

Fixes .  Thanks to Bjarni Ingi
Gislason for the report.  Problem introduced by me in commit 15f8188656,
21 February 2022.

As a comment in the file notes:

Macros that are part of the external interface (TH, SH, P, etc.) or that
are called by traps of any kind must be defined with `de1` because they
might be called from a context where compatibility mode is enabled.  For
other macros, `de` suffices.
---
 ChangeLog| 8 
 tmac/an.tmac | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 0d321594e..aa8814703 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-05-13  G. Branden Robinson 
+
+   * tmac/an.tmac (EE): Define macro with `de1` request, not `de`.
+
+   Fixes .  Thanks to Bjarni
+   Ingi Gislason for the report.  Problem introduced by me in
+   commit 15f8188656, 21 February 2022.
+
 2024-05-11  G. Branden Robinson 
 
[tmac]: Perform actual string comparisons.
diff --git a/tmac/an.tmac b/tmac/an.tmac
index e17ba1758..03ea55524 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -1122,7 +1122,7 @@ contains unsupported escape sequence
 ..
 .
 .\" End example.
-.de EE
+.de1 EE
 .  br
 .  if !\\n[an*is-in-example] \{\
 .an-style-warn ignoring .\\$0 while not in example

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


[groff] 01/04: Start dropping CCSID (code page) 1047 (EBCDIC).

2024-05-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 25b0662e69c1d63b910262deee61915c59f13dc5
Author: G. Branden Robinson 
AuthorDate: Sat May 11 09:40:49 2024 -0500

Start dropping CCSID (code page) 1047 (EBCDIC).

Begin withdrawing support for CCSID (code page) 1047 (EBCDIC).

* tmac/X.tmac:
* tmac/Xps.tmac:
* tmac/dvi.tmac:
* tmac/html.tmac:
* tmac/ps.tmac: Stop loading "latin1.tmac" or "cp1047.tmac" depending on
  the special character `\[char97]` matching "a".

* tmac/troffrc: Simplify logic; map special character `\[char160]` to
  `\~` unconditionally.

Begins fixing .
---
 ChangeLog  | 14 ++
 tmac/X.tmac|  5 -
 tmac/Xps.tmac  |  5 -
 tmac/dvi.tmac  |  5 -
 tmac/html.tmac |  5 -
 tmac/ps.tmac   |  5 -
 tmac/troffrc   |  8 ++--
 7 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index babfd8e00..9f85f3143 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-05-11  G. Branden Robinson 
+
+   Begin withdrawing support for CCSID (code page) 1047 (EBCDIC).
+
+   * tmac/X.tmac:
+   * tmac/Xps.tmac:
+   * tmac/dvi.tmac:
+   * tmac/html.tmac:
+   * tmac/ps.tmac: Stop loading "latin1.tmac" or "cp1047.tmac"
+   depending on the special character `\[char97]` matching "a".
+
+   * tmac/troffrc: Simplify logic; map special character
+   `\[char160` to `\~` unconditionally.
+
 2024-05-09  G. Branden Robinson 
 
* src/roff/troff/node.cpp (class dbreak_node): Add `dump_node`
diff --git a/tmac/X.tmac b/tmac/X.tmac
index c5ef3293a..3a50c0afd 100644
--- a/tmac/X.tmac
+++ b/tmac/X.tmac
@@ -114,11 +114,6 @@
 .  char \[radicalex] \h'-\w'\[sr]'u'\[radicalex]\h'\w'\[sr]'u'
 .fchar \[sqrtex] \[radicalex]
 .
-.ie '\[char97]'a' \
-.  mso latin1.tmac
-.el \
-.  mso cp1047.tmac
-.
 .cp \n[*groff_X_tmac_C]
 .do rr *groff_X_tmac_C
 .
diff --git a/tmac/Xps.tmac b/tmac/Xps.tmac
index aaef0ce29..8502ca707 100644
--- a/tmac/Xps.tmac
+++ b/tmac/Xps.tmac
@@ -50,11 +50,6 @@
 .Xps-char \[lh] \[lA]
 .Xps-char \[rh] \[rA]
 .
-.ie '\[char97]'a' \
-.  mso latin1.tmac
-.el \
-.  mso cp1047.tmac
-.
 .cp \n[*groff_Xps_tmac_C]
 .do rr *groff_Xps_tmac_C
 .
diff --git a/tmac/dvi.tmac b/tmac/dvi.tmac
index 6fbf305ed..22a6c1122 100644
--- a/tmac/dvi.tmac
+++ b/tmac/dvi.tmac
@@ -778,11 +778,6 @@ D\v'-.33m'\s0\v'.33m'
 .defcolor yellow3 rgb #cdcd00
 .defcolor yellow4 rgb #8b8b00
 .
-.ie '\[char97]'a' \
-.  mso latin1.tmac
-.el \
-.  mso cp1047.tmac
-.
 .cp \n[*groff_dvi_tmac_C]
 .do rr *groff_dvi_tmac_C
 .
diff --git a/tmac/html.tmac b/tmac/html.tmac
index c67bd8776..2d3b6db3c 100644
--- a/tmac/html.tmac
+++ b/tmac/html.tmac
@@ -524,11 +524,6 @@
 .
 .mso www.tmac
 .
-.ie '\[char97]'a' \
-.  mso latin1.tmac
-.el \
-.  mso cp1047.tmac
-.
 .cp \n[*groff_html_tmac_C]
 .do rr *groff_html_tmac_C
 .
diff --git a/tmac/ps.tmac b/tmac/ps.tmac
index b67296206..462ec3569 100644
--- a/tmac/ps.tmac
+++ b/tmac/ps.tmac
@@ -658,11 +658,6 @@
 .defcolor yellow3 rgb #cdcd00
 .defcolor yellow4 rgb #8b8b00
 .
-.ie '\[char97]'a' \
-.  mso latin1.tmac
-.el \
-.  mso cp1047.tmac
-.
 .mso europs.tmac
 .
 .cp \n[*groff_ps_tmac_C]
diff --git a/tmac/troffrc b/tmac/troffrc
index a2784d78d..e42e821ce 100644
--- a/tmac/troffrc
+++ b/tmac/troffrc
@@ -47,12 +47,8 @@ troffrc!lj4 \
 troffrc!lbp \
 troffrc!html
 .
-.\" Test whether we work under EBCDIC and map the no-break space
-.\" character accordingly.
-.do ie '\[char97]'a' \
-.  do tr \[char160]\~
-.el \
-.  do tr \[char65]\~
+.\" Map no-break space character to an adjustable non-breaking space.
+.do tr \[char160]\~
 .
 .\" Set the input localization to English.
 .do mso en.tmac

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


[groff] 03/04: [tmac]: Perform actual string comparisons.

2024-05-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 609d962fc02e517744ee4f68160648a78df3a020
Author: G. Branden Robinson 
AuthorDate: Sat May 11 09:54:35 2024 -0500

[tmac]: Perform actual string comparisons.

* tmac/fallbacks.tmac:
* tmac/troffrc-end: Bracket comparands to formatted output comparison
  operator with `\?` escape sequences to perform a more elementary
  string comparison on them (cf. a comparison of _formatted text_).
  This way they continue to perform their function even if the default
  font family has no coverage of Basic Latin (not a bizarre choice when
  considering potential rendering of documents using Devanagari or East
  Asian languages).  Unfortunately this means of comparing strings,
  while long documented in the GNU troff Manual, is neither idiomatic
  for *roff macro programmers nor portable to AT troff.  (The *roff
  language historically _lacks_ a string comparison operator.)  Each
  macro package will have to decide for itself whether it wants to have
  portability at the expense of requiring Basic Latin coverage (possibly
  switching fonts before and after a formatted output comparison for the
  sole purpose of obtaining it).  These two files are unconditionally
  loaded by the stock `troffrc`, and therefore must be dealt with in any
  case.

Fixes .  Thanks to Dave Kemper for
the report, and to him, Peter Schaffter, and Deri James for the
discussion.

Previously:

$ echo | groff -fZD -a
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:14: warning: character 'p' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:14: warning: character 's' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:14: warning: character 'a' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:14: warning: character 'c' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:14: warning: character 'i' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:16: warning: character 'l' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:16: warning: character 't' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:16: warning: character 'n' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:17: warning: character 'u' not 
defined
troff:/.../groff/1.23.0/tmac/fallbacks.tmac:17: warning: character 'f' not 
defined
troff:/.../groff/1.23.0/tmac/troffrc-end:7: warning: character 'h' not 
defined
troff:/.../groff/1.23.0/tmac/troffrc-end:7: warning: character 'm' not 
defined


Now:

$ echo | ./build/test-groff -fZD -a


squash thing
---
 ChangeLog   | 28 
 tmac/fallbacks.tmac |  8 
 tmac/troffrc-end|  2 +-
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9f85f3143..0d321594e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2024-05-11  G. Branden Robinson 
+
+   [tmac]: Perform actual string comparisons.
+
+   * tmac/fallbacks.tmac:
+   * tmac/troffrc-end: Bracket comparands to formatted output
+   comparison operator with `\?` escape sequences to perform a more
+   elementary string comparison on them (cf. a comparison of
+   _formatted text_).  This way they continue to perform their
+   function even if the default font family has no coverage of
+   Basic Latin (not a bizarre choice when considering potential
+   rendering of documents using Devanagari or East Asian
+   languages).  Unfortunately this means of comparing strings,
+   while long documented in the GNU troff Manual, is neither
+   idiomatic for *roff macro programmers nor portable to AT
+   troff.  (The *roff language historically _lacks_ a string
+   comparison operator.)  Each macro package will have to decide
+   for itself whether it wants to have portability at the expense
+   of requiring Basic Latin coverage (possibly switching fonts
+   before and after a formatted output comparison for the sole
+   purpose of obtaining it).  These two files are unconditionally
+   loaded by the stock `troffrc`, and therefore must be dealt with
+   in any case.
+
+   Fixes .  Thanks to Dave
+   Kemper for the report, and to him, Peter Schaffter, and Deri
+   James for the discussion.
+
 2024-05-11  G. Branden Robinson 
 
Begin withdrawing support for CCSID (code page) 1047 (EBCDIC).
diff --git a/tmac/fallbacks.tmac b/tmac/fallbacks.tmac
index 162e57eea..8c9738d78 100644
--- a/tmac/fallbacks.tmac
+++ b/tmac/fallbacks.tmac
@@ -11,10 +11,10 @@
 .\" The early loading observation above also means that the conditional
 .\" expressions 'n' and 't' are not reliable.  Define ersatz substitute.
 .nr fallbacks*troff-mode 1
-.if '\*[.T]'ascii'  .nr 

[groff] 02/04: [docs]: De-document {latin1,cp1047}.tmac loading.

2024-05-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 2d04649dafa60f182765ea87e8e5b08ddeec3dc1
Author: G. Branden Robinson 
AuthorDate: Mon May 13 13:13:30 2024 -0500

[docs]: De-document {latin1,cp1047}.tmac loading.
---
 doc/groff.texi.in| 10 +++---
 man/groff_tmac.5.man | 30 ++
 2 files changed, 13 insertions(+), 27 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 2ea464060..79fe6de14 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -5635,8 +5635,8 @@ other hand, must be in one of two encodings it can 
recognize.
 @cindex IBM code page 1047 input encoding
 @pindex cp1047.tmac
 The code page 1047 input encoding works only on @acronym{EBCDIC}
-platforms (and conversely, the other input encodings don't work with
-@acronym{EBCDIC}); the file @file{cp1047.tmac} is loaded at startup.
+platforms (and conversely, the other input encodings don't work on
+@acronym{EBCDIC} platforms).
 
 @item latin1
 @cindex encoding, input, @w{Latin-1} (ISO @w{8859-1})
@@ -5644,9 +5644,7 @@ platforms (and conversely, the other input encodings 
don't work with
 @cindex ISO @w{8859-1} (@w{Latin-1}), input encoding
 @cindex input encoding, @w{Latin-1} (ISO @w{8859-1})
 @pindex latin1.tmac
-ISO @w{Latin-1}, an encoding for Western European languages, is the
-default input encoding on non-@acronym{EBCDIC} platforms; the file
-@file{latin1.tmac} is loaded at startup.
+ISO @w{Latin-1} is an encoding for Western European languages.
 @end table
 
 @noindent
@@ -5659,8 +5657,6 @@ are interchangeable in their first 128 code 
points.@footnote{The
 with the successive standards, a cause of some frustration among man
 page writers; see @cite{groff_char@r{(7)}}.}
 
-Other encodings are supported by means of macro packages.
-
 @table @code
 @item koi8-r
 @cindex encoding, input, @w{KOI8-R}
diff --git a/man/groff_tmac.5.man b/man/groff_tmac.5.man
index 0e6f8d277..2c87fe825 100644
--- a/man/groff_tmac.5.man
+++ b/man/groff_tmac.5.man
@@ -448,6 +448,10 @@ Chinese.
 .SS "Input encodings"
 .\" 
 .
+A document that requires one of the following encodings can load a
+corresponding macro file.
+.
+.
 .TP 8n \" "latin1" + 2n
 .I latin1
 .TQ
@@ -456,35 +460,21 @@ Chinese.
 .I latin5
 .TQ
 .I latin9
-are various ISO\~8859 input encodings supported by
-.IR groff .
-.
-On systems using ISO character encodings,
-.I groff
-loads
-.I latin1.tmac
-automatically at startup.
-.
-A document that uses Latin-2,
+support the ISO\~8859 Latin-1,
+Latin-2,
 Latin-5,
-or Latin-9
-can specify one of these alternative encodings.
+and
+Latin-9 encodings
 .
 .
 .TP
 .I cp1047
-provides support for EBCDIC-based systems.
-.
-On those platforms,
-.I groff
-loads
-.I cp1047.tmac
-automatically at startup.
+supports EBCDIC-based systems using CCSID\~1047.
 .
 .
 .TP
 .I koi8\-r
-provides support for the KOI8-R encoding.
+supports the KOI8-R encoding.
 .
 KOI8-R code points in the range 0x80\[en]0x9F are not valid input on
 systems using ISO character codings natively;

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