Re: Updating eqn

2023-12-08 Thread G. Branden Robinson
At 2023-12-08T14:00:30+1100, Damian McGuckin wrote:
> > (And one of these days I'd like to support cube roots and subscripts
> > and superscripts on the left side of symbols. I'd like to bring
> > eqn's capabilities closer to those of TeX. I hate typing in all
> > those backslashes.)
> 
> You just do a subscript or superscript of nothing immediately preceding
> the primary subject, e.g. to produce a left subscript of 'x':
> 
>   "" sub 3 x

Yes.  The predefined macro "nothing" will do the same thing, in case you
find that more self-descriptive.

I would probably write an eqn macro to handle generalized radicals like
this, to also reduce the size of the superscript and maybe even move it
to "tuck" it above the bend of the radical sign.

Here's something I knocked together in a few minutes to achieve this,
embedded in an ms(7) document.

.LP
.EQ
define radical ! size -3 { up 100 { fwd 100 { $1 } } back 50 nothing } sqrt { 
$2 } !
radical(3, x sup 2)
.EN

Regards,
Branden


signature.asc
Description: PGP signature


Re: Proposed GNU troff behavior change: require end-of-input macros to exit

2023-12-08 Thread G. Branden Robinson
[self-follow-up]

Some clarifications, to our Texinfo manual and to my own remarks...

At 2023-12-08T15:34:28-0600, G. Branden Robinson wrote:
>  The '\c' in the above example needs explanation.  For historical
>  reasons (and for compatibility with AT 'troff'), the end macro
>  exits as soon as it causes a page break and no remaining data is
>  in the partially collected line.

Clearer would be:

"as soon as it causes a page break and no output line is pending."

>  To always force processing the whole end macro independently of
>  this behaviour it is thus advisable to insert something that starts
>  an empty partially filled line ('\c') whenever there is a chance
>  that a page break can happen.

"An empty partially filled line" is somewhat baffling wording.  Clearer
would be:

"to ensure that an output line is pending, even if it has no visible
content, whenever a page break might occur during end-of-input macro
processing."

> I would prefer to just make `em` behave the way people expect, but
> retain the weird old behavior for the benefit of historical documents.

...in AT compatibility mode ("groff -C") only.

Regards,
Branden


signature.asc
Description: PGP signature


Re: Proposed GNU troff behavior change: require end-of-input macros to exit

2023-12-08 Thread Peter Schaffter
On Fri, Dec 08, 2023, G. Branden Robinson wrote:
> I propose that GNU troff stop behaving like AT troff in one aspect of
> end-of-input macro processing, documented in our Texinfo manual.

I'm all for it, for all the reasons given.

-- 
Peter Schaffter
https://www.schaffter.ca



[groff] 07/14: src/roff/troff/node.cpp: Drop "TODO" annotations.

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

commit 7651ed5e9145757d148b24f2c4bc5c787bd3ef84
Author: G. Branden Robinson 
AuthorDate: Thu Dec 7 05:00:01 2023 -0600

src/roff/troff/node.cpp: Drop "TODO" annotations.

The ideas would not be straightforward to implement because environments
might have font mounting positions "in use" as current or previous font
selections.  So abandon the notion.
---
 src/roff/troff/node.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 8231f5759..9fabb48cc 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6071,7 +6071,6 @@ static void mount_font_at_position()
 if (n < 0)
   error("font mounting position %1 is negative", n);
 else {
-  // TODO: Make argument optional to clear the mounting position?
   symbol internal_name = get_name(true /* required */);
   if (!internal_name.is_null()) {
symbol external_name = get_long_name();
@@ -6190,7 +6189,6 @@ static void associate_style_with_font_position()
 if (n < 0)
   error("font mounting position %1 is negative", n);
 else {
-  // TODO: Make argument optional to clear the mounting position?
   if (!has_arg())
warning(WARN_MISSING, "abstract style configuration request"
" expects a second argument");

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


[groff] 04/14: [troff]: Tweak diagnostic messages.

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

commit b3ddd51d7acfc3bf882544893e7613cccebb488c
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 15:34:14 2023 -0600

[troff]: Tweak diagnostic messages.

* src/roff/troff/node.cpp (select_underline_font)
  (set_font_specific_special_fonts): Tweak diagnostic messages.
---
 ChangeLog   | 5 +
 src/roff/troff/node.cpp | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 50f40e0b6..b434ea63d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-02  G. Branden Robinson 
+
+   * src/roff/troff/node.cpp (select_underline_font)
+   (set_font_specific_special_fonts): Tweak diagnostic messages.
+
 2023-12-02  G. Branden Robinson 
 
* src/roff/troff/node.cpp (set_special_fonts): Revert part of
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index f97a79595..8231f5759 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6248,8 +6248,8 @@ static int underline_fontno = 2;
 static void select_underline_font()
 {
   if (!has_arg()) {
-warning(WARN_MISSING, "underline font selection request expects"
-   " arguments");
+warning(WARN_MISSING, "underline font selection request expects an"
+   " argument");
 skip_line();
 return;
   }
@@ -6349,7 +6349,7 @@ static void set_font_specific_special_fonts()
 {
   if (!has_arg()) {
 warning(WARN_MISSING, "font-specific special font configuration"
-   " request expects one or more arguments");
+   " request expects at least one argument");
 skip_line();
 return;
   }

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


[groff] 13/14: [troff]: Warn when `if` or `ie` lacks arguments.

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

commit 498a48843c0c0357199f44891e02aed2dbda3be2
Author: G. Branden Robinson 
AuthorDate: Fri Dec 8 14:47:19 2023 -0600

[troff]: Warn when `if` or `ie` lacks arguments.

* src/roff/troff/input.cpp (if_else_request, if_request): Throw warning
  in category `missing` if given no arguments.
---
 ChangeLog|  5 +
 src/roff/troff/input.cpp | 11 +++
 2 files changed, 16 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4638fee8e..fd6f695f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-12-08  G. Branden Robinson 
+
+   * src/roff/troff/input.cpp (if_else_request, if_request): Throw
+   warning in category `missing` if given no arguments.
+
 2023-12-08  G. Branden Robinson 
 
Manage config.h more consistently.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a9abd1905..afdce9885 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6059,11 +6059,21 @@ int do_if_request()
 
 void if_else_request()
 {
+  if (!has_arg()) {
+warning(WARN_MISSING, "if-else request expects arguments");
+skip_line();
+return;
+  }
   if_else_stack.push(do_if_request());
 }
 
 void if_request()
 {
+  if (!has_arg()) {
+warning(WARN_MISSING, "if-then request expects arguments");
+skip_line();
+return;
+  }
   do_if_request();
 }
 
@@ -6086,6 +6096,7 @@ static int while_break_flag = 0;
 
 void while_request()
 {
+  // We can't use `has_arg()` here.  XXX: Figure out why.
   macro mac;
   int escaped = 0;
   int level = 0;

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


[groff] 01/14: ChangeLog: Fix muddled language.

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

commit 66144ac53e38a599ab317aa335e359c5b0188f1e
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 14:43:17 2023 -0600

ChangeLog: Fix muddled language.
---
 ChangeLog | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 249171ed3..bb0f70c59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,8 +12,8 @@
* src/roff/troff/input.cpp (device_request, output_request):
Drop call of `has_arg()` in favor of `input_stack::peek()`.
Manually discard space characters until reaching something else;
-   if that is a newline or EOF, bail out of request processing.
-   Otherwise, proceed with warning diagnostic as before.
+   if that is a newline or EOF, throw warning diagnostic as before.
+   Otherwise, proceed with request processing.
 
 2023-12-01  G. Branden Robinson 
 
@@ -29,7 +29,7 @@
* src/roff/troff/node.cpp (mount_font_at_position)
(associate_style_with_font_position, select_underline_font)
(define_font_specific_character, remove_font_specific_character)
-   (configure_track_kerning, (constantly_space_font): Throw warning
+   (configure_track_kerning, constantly_space_font): Throw warning
in category `missing` if given no arguments.
 
(set_font_specific_special_fonts, set_special_fonts): Demote

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


[groff] 05/14: doc/groff.texi: Fix thinko.

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

commit df31a19604392332edddbaf9f6c7301be6cbe8e5
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 15:34:50 2023 -0600

doc/groff.texi: Fix thinko.

Thanks to Dave Kemper for catching it.

Follows up Savannah #64954.
---
 doc/groff.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index d2bc98acf..be297d248 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -14442,7 +14442,7 @@ As @samp{\D'P @r{@dots{}}'}, but the polygon is filled.
 
 The following macro is like the @samp{\D'l'} example, but shades the
 box.  We draw the box before writing the text because colors in GNU
-@code{troff} have no transparency; in other opposite order, the filled
+@code{troff} have no transparency; in the opposite order, the filled
 polygon would occlude the text.
 
 @Example

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


[groff] 10/14: [troff]: Trivially refactor (rename hyph funcs).

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

commit f71053b973ee630d4549df9943592c55e3dd7012
Author: G. Branden Robinson 
AuthorDate: Thu Dec 7 19:10:43 2023 -0600

[troff]: Trivially refactor (rename hyph funcs).

* src/roff/troff/env.cpp (do_hyphenation_patterns_file): Rename...
  (read_hyphenation_patterns_from_file): ...to this.

  (hyphenation_patterns_file, hyphenation_patterns_file_append): Update
  call sites.

  (hyphenation_patterns_file): Rename...
  (load_hyphenation_patterns_from_file): ...to this.

  (hyphenation_patterns_file_append): ...and this...
  (append_hyphenation_patterns_from_file): ... to this.

  (init_hyphen_requests): Update call sites.
---
 ChangeLog  | 13 +
 src/roff/troff/env.cpp | 14 +++---
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa734e5a3..7396c7345 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2023-12-07  G. Branden Robinson 
+
+   * src/roff/troff/env.cpp (do_hyphenation_patterns_file):
+   Rename...
+   (read_hyphenation_patterns_from_file): ...to this.
+   (hyphenation_patterns_file, hyphenation_patterns_file_append):
+   Update call sites.
+   (hyphenation_patterns_file): Rename...
+   (load_hyphenation_patterns_from_file): ...to this.
+   (hyphenation_patterns_file_append): ...and this...
+   (append_hyphenation_patterns_from_file): ... to this.
+   (init_hyphen_requests): Update call sites.
+
 2023-12-07  G. Branden Robinson 
 
* src/roff/troff/env.cpp (select_hyphenation_language): Demote
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 6930c1045..eb1583475 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -4165,7 +4165,7 @@ void hyphenate(hyphen_list *h, unsigned flags)
   }
 }
 
-static void do_hyphenation_patterns_file(bool append)
+static void read_hyphenation_patterns_from_file(bool append)
 {
   // TODO: Read a file name, not a groff identifier.
   symbol name = get_long_name(true /* required */);
@@ -4180,7 +4180,7 @@ static void do_hyphenation_patterns_file(bool append)
   skip_line();
 }
 
-static void hyphenation_patterns_file()
+static void load_hyphenation_patterns_from_file()
 {
   if (!has_arg()) {
 warning(WARN_MISSING, "hyphenation pattern load request expects"
@@ -4188,10 +4188,10 @@ static void hyphenation_patterns_file()
 skip_line();
 return;
   }
-  do_hyphenation_patterns_file(false /* append */);
+  read_hyphenation_patterns_from_file(false /* append */);
 }
 
-static void hyphenation_patterns_file_append()
+static void append_hyphenation_patterns_from_file()
 {
   if (!has_arg()) {
 warning(WARN_MISSING, "hyphenation pattern appendment request"
@@ -4199,7 +4199,7 @@ static void hyphenation_patterns_file_append()
 skip_line();
 return;
   }
-  do_hyphenation_patterns_file(true /* append */);
+  read_hyphenation_patterns_from_file(true /* append */);
 }
 
 class hyphenation_language_reg : public reg {
@@ -4217,8 +4217,8 @@ void init_hyphen_requests()
   init_request("hw", add_hyphenation_exceptions);
   init_request("phw", print_hyphenation_exceptions);
   init_request("hla", select_hyphenation_language);
-  init_request("hpf", hyphenation_patterns_file);
-  init_request("hpfa", hyphenation_patterns_file_append);
+  init_request("hpf", load_hyphenation_patterns_from_file);
+  init_request("hpfa", append_hyphenation_patterns_from_file);
   register_dictionary.define(".hla", new hyphenation_language_reg);
 }
 

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


[groff] 14/14: [troff]: Reduce symbol visibility.

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

commit e84dbee979805f6248e4efcbd4015f73f98700e1
Author: G. Branden Robinson 
AuthorDate: Fri Dec 8 15:08:44 2023 -0600

[troff]: Reduce symbol visibility.

* src/roff/troff/input.cpp (nop_request, do_if_request, if_else_request)
  (if_request, else_request, while_request, while_break_request)
  (while_continue_request): Define functions as `static`; they require
  no visibility outside this translation unit.
---
 ChangeLog|  8 
 src/roff/troff/input.cpp | 16 
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd6f695f2..7a44d8261 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-12-08  G. Branden Robinson 
+
+   * src/roff/troff/input.cpp (nop_request, do_if_request)
+   (if_else_request, if_request, else_request, while_request)
+   (while_break_request, while_continue_request): Define functions
+   as `static`; they require no visibility outside this translation
+   unit.
+
 2023-12-08  G. Branden Robinson 
 
* src/roff/troff/input.cpp (if_else_request, if_request): Throw
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index afdce9885..d1262f445 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5898,7 +5898,7 @@ static void begin_alternative()
 tok.next();
 }
 
-void nop_request()
+static void nop_request()
 {
   while (tok.is_space())
 tok.next();
@@ -5906,7 +5906,7 @@ void nop_request()
 
 static int_stack if_else_stack;
 
-int do_if_request()
+static int do_if_request()
 {
   int invert = 0;
   while (tok.is_space())
@@ -6057,7 +6057,7 @@ int do_if_request()
   return result;
 }
 
-void if_else_request()
+static void if_else_request()
 {
   if (!has_arg()) {
 warning(WARN_MISSING, "if-else request expects arguments");
@@ -6067,7 +6067,7 @@ void if_else_request()
   if_else_stack.push(do_if_request());
 }
 
-void if_request()
+static void if_request()
 {
   if (!has_arg()) {
 warning(WARN_MISSING, "if-then request expects arguments");
@@ -6077,7 +6077,7 @@ void if_request()
   do_if_request();
 }
 
-void else_request()
+static void else_request()
 {
   if (if_else_stack.is_empty()) {
 warning(WARN_EL, "unbalanced 'el' request");
@@ -6094,7 +6094,7 @@ void else_request()
 static int while_depth = 0;
 static int while_break_flag = 0;
 
-void while_request()
+static void while_request()
 {
   // We can't use `has_arg()` here.  XXX: Figure out why.
   macro mac;
@@ -6155,7 +6155,7 @@ void while_request()
   tok.next();
 }
 
-void while_break_request()
+static void while_break_request()
 {
   if (!while_depth) {
 error("cannot 'break' when not in a 'while' loop");
@@ -6169,7 +6169,7 @@ void while_break_request()
   }
 }
 
-void while_continue_request()
+static void while_continue_request()
 {
   if (!while_depth) {
 error("cannot 'continue' when not in a 'while' loop");

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


[groff] 09/14: [troff]: Improve hyphenation diagnostics.

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

commit 1ecabc49dd2119c2cbf2f5b21812078007d15c86
Author: G. Branden Robinson 
AuthorDate: Thu Dec 7 18:52:33 2023 -0600

[troff]: Improve hyphenation diagnostics.

* src/roff/troff/env.cpp (select_hyphenation_language): Demote missing
  argument diagnostic from error to warning.

  (add_hyphenation_exceptions, hyphenation_patterns_file)
  (hyphenation_patterns_file_append): Throw warning in category
  `missing` if given no arguments.
---
 ChangeLog  |  8 
 src/roff/troff/env.cpp | 22 +-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5093883d7..fa734e5a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-12-07  G. Branden Robinson 
+
+   * src/roff/troff/env.cpp (select_hyphenation_language): Demote
+   missing argument diagnostic from error to warning.
+   (add_hyphenation_exceptions, hyphenation_patterns_file)
+   (hyphenation_patterns_file_append): Throw warning in category
+   `missing` if given no arguments.
+
 2023-12-02  G. Branden Robinson 
 
[libgroff]: Drop unused function parameter.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 5d844ed20..6930c1045 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3599,7 +3599,8 @@ hyphenation_language *current_language = 0;
 static void select_hyphenation_language()
 {
   if (!has_arg()) {
-error("hyphenation language selection request requires argument");
+warning(WARN_MISSING, "hyphenation language selection request"
+   " expects argument");
 skip_line();
 return;
   }
@@ -3619,6 +3620,12 @@ const int WORD_MAX = 256;// we use unsigned char 
for offsets in
 
 static void add_hyphenation_exceptions()
 {
+  if (!has_arg()) {
+warning(WARN_MISSING, "hyphenation exception request expects one or"
+   " more arguments");
+skip_line();
+return;
+  }
   if (!current_language) {
 error("cannot add hyphenation exceptions when no hyphenation"
  " language is set");
@@ -4160,6 +4167,7 @@ void hyphenate(hyphen_list *h, unsigned flags)
 
 static void do_hyphenation_patterns_file(bool append)
 {
+  // TODO: Read a file name, not a groff identifier.
   symbol name = get_long_name(true /* required */);
   if (!name.is_null()) {
 if (!current_language)
@@ -4174,11 +4182,23 @@ static void do_hyphenation_patterns_file(bool append)
 
 static void hyphenation_patterns_file()
 {
+  if (!has_arg()) {
+warning(WARN_MISSING, "hyphenation pattern load request expects"
+   " argument");
+skip_line();
+return;
+  }
   do_hyphenation_patterns_file(false /* append */);
 }
 
 static void hyphenation_patterns_file_append()
 {
+  if (!has_arg()) {
+warning(WARN_MISSING, "hyphenation pattern appendment request"
+   " expects argument");
+skip_line();
+return;
+  }
   do_hyphenation_patterns_file(true /* append */);
 }
 

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


[groff] 08/14: [docs]: Improve `hlm` request summaries.

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

commit 97d28019e5add9158af30c58c6b977180a6e3ea1
Author: G. Branden Robinson 
AuthorDate: Thu Dec 7 13:20:32 2023 -0600

[docs]: Improve `hlm` request summaries.
---
 man/groff.7.man  | 12 ++--
 man/groff_diff.7.man | 14 ++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/man/groff.7.man b/man/groff.7.man
index 2d45ee63f..1e90a6524 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -3313,9 +3313,17 @@ Set the hyphenation language to
 .IR ident .
 .
 .TPx
+.REQ .hlm
+Set the consecutive automatically hyphenated line limit to
+.BR \-1 ,
+meaning \[lq]no limit\[rq].
+.
+.TPx
 .REQ .hlm n
-Set the maximum quantity of consecutive hyphenated lines to
-.IR n .
+Set the consecutive automatically hyphenated line limit to
+.RI to\~ n.
+.
+A negative value means \[lq]no limit\[rq].
 .
 .TPx
 .REQ .hpf pattern-file
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index d42d5be20..707899e78 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -2533,17 +2533,15 @@ The hyphenation language is associated with the 
environment.
 .TP
 .BR .hlm\~ [\c
 .IR n ]
-Set the maximum number of consecutive hyphenated lines
-.RI to\~ n .
+Set the consecutive automatically hyphenated line limit to
+.I n.
 .
-If
-.I n
-is negative,
-there is no maximum.
+A negative value means \[lq]no limit\[rq].
 .
-If omitted,
+Omitting
 .I n
-is\~\-1.
+implies a limit of
+.BR \-1 .
 .
 This value is associated with the environment.
 .

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


[groff] 12/14: Fix code style nits.

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

commit 7d5115b8aa4f438bfe922f831621d3d32bd82cbd
Author: G. Branden Robinson 
AuthorDate: Fri Dec 8 14:34:14 2023 -0600

Fix code style nits.

* src/libs/libbib/map.c: Tweak format of copyright notice to ease
  grepping.

* src/libs/libgroff/ptable.cpp:
* src/libs/libgroff/strtol.c: Kill off trailing whitespace.

* src/libs/libxutil/xmalloc.c: Fix inconsistent indentation; the code we
  copied from X11 uses a different style, so maintain mutual
  consistentcy among its files.  (This also will help with merging
  post-X11R5 changes thereto, which I have a mind to do.)

* src/utils/indxbib/signal.c: Annotate a potential future direction.

* src/include/stringclass.h:
* src/libs/libbib/map.c:
* src/libs/libgroff/assert.cpp:
* src/libs/libgroff/change_lf.cpp:
* src/libs/libgroff/cmap.cpp:
* src/libs/libgroff/cset.cpp:
* src/libs/libgroff/device.cpp:
* src/libs/libgroff/fatal.cpp:
* src/libs/libgroff/fmod.c:
* src/libs/libgroff/geometry.cpp:
* src/libs/libgroff/getcwd.c:
* src/libs/libgroff/getopt.c:
* src/libs/libgroff/getopt1.c:
* src/libs/libgroff/hypot.cpp:
* src/libs/libgroff/localcharset.c:
* src/libs/libgroff/matherr.c:
* src/libs/libgroff/ptable.cpp:
* src/libs/libgroff/putenv.c:
* src/libs/libgroff/quotearg.c:
* src/libs/libgroff/spawnvp.c:
* src/libs/libgroff/strcasecmp.c:
* src/libs/libgroff/strerror.c:
* src/libs/libgroff/strtol.c:
* src/libs/libxutil/xmalloc.c:
* src/preproc/eqn/text.cpp:
* src/preproc/pic/object.cpp:
* src/preproc/pic/pic.h:
* src/utils/indxbib/signal.c: Update editor aid comments; drop old-style
  Emacs file-local variable setting.  Drop comments that had no purpose
  other than to mark the end of the file since the editor aid comments
  also fulfill that role.
---
 src/include/stringclass.h|  6 ++
 src/libs/libbib/map.c|  8 +++-
 src/libs/libgroff/assert.cpp |  6 ++
 src/libs/libgroff/change_lf.cpp  |  6 ++
 src/libs/libgroff/cmap.cpp   |  7 ++-
 src/libs/libgroff/cset.cpp   |  7 ++-
 src/libs/libgroff/device.cpp |  7 ++-
 src/libs/libgroff/fatal.cpp  |  6 ++
 src/libs/libgroff/fmod.c |  6 ++
 src/libs/libgroff/geometry.cpp   |  7 ++-
 src/libs/libgroff/getcwd.c   |  6 ++
 src/libs/libgroff/getopt.c   |  6 ++
 src/libs/libgroff/getopt1.c  |  6 ++
 src/libs/libgroff/hypot.cpp  |  6 ++
 src/libs/libgroff/localcharset.c |  6 ++
 src/libs/libgroff/matherr.c  |  6 ++
 src/libs/libgroff/ptable.cpp | 12 
 src/libs/libgroff/putenv.c   |  6 ++
 src/libs/libgroff/quotearg.c |  6 +-
 src/libs/libgroff/spawnvp.c  |  6 +-
 src/libs/libgroff/strcasecmp.c   |  6 ++
 src/libs/libgroff/strerror.c |  6 ++
 src/libs/libgroff/strtol.c   |  8 +++-
 src/libs/libxutil/xmalloc.c  |  2 +-
 src/preproc/eqn/text.cpp |  6 +-
 src/preproc/pic/object.cpp   |  6 +-
 src/preproc/pic/pic.h|  6 ++
 src/utils/indxbib/signal.c   |  9 -
 28 files changed, 165 insertions(+), 16 deletions(-)

diff --git a/src/include/stringclass.h b/src/include/stringclass.h
index b9245e10d..cc4616009 100644
--- a/src/include/stringclass.h
+++ b/src/include/stringclass.h
@@ -196,3 +196,9 @@ inline string ::operator+=(char c)
 void put_string(const string &, FILE *);
 
 string as_string(int);
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libbib/map.c b/src/libs/libbib/map.c
index 7da0f6e57..06710e199 100644
--- a/src/libs/libbib/map.c
+++ b/src/libs/libbib/map.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989- 2014  Free Software Foundation, Inc.
+/* Copyright (C) 1989-2014  Free Software Foundation, Inc.
  Written by James Clark (j...@jclark.com)
 
 This file is part of groff.
@@ -86,3 +86,9 @@ int unmap(char *p, int len)
 #endif
 
 #endif /* not HAVE_MMAP */
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/assert.cpp b/src/libs/libgroff/assert.cpp
index 9da3d4660..70b6bf8dc 100644
--- a/src/libs/libgroff/assert.cpp
+++ b/src/libs/libgroff/assert.cpp
@@ -36,3 +36,9 @@ void assertion_failed(int lineno, const char *filename,
   fflush(stderr);
   abort();
 }
+
+// Local Variables:
+// fill-column: 72
+// mode: C++
+// End:
+// vim: set cindent noexpandtab shiftwidth=2 textwidth=72:
diff --git a/src/libs/libgroff/change_lf.cpp b/src/libs/libgroff/change_lf.cpp
index 012ac8486..f06b6d545 100644
--- a/src/libs/libgroff/change_lf.cpp
+++ b/src/libs/libgroff/change_lf.cpp
@@ -38,3 +38,9 @@ void change_lineno(int ln)
 {
   current_lineno = ln;
 }
+
+// Local 

[groff] 11/14: Manage config.h more consistently.

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

commit dd6b4aada262b8bb858001905531e8be16e5bcad
Author: G. Branden Robinson 
AuthorDate: Fri Dec 8 14:25:13 2023 -0600

Manage config.h more consistently.

* src/roff/troff/env.cpp: Ensure that we include config.h (if necessary)
  _before_ C standard library header math.h.

* src/devices/xditview/Dvi.c:
* src/devices/xditview/draw.c:
* src/devices/xditview/font.c:
* src/devices/xditview/lex.c:
* src/devices/xditview/page.c:
* src/devices/xditview/parse.c:
* src/libs/libbib/map.c:
* src/libs/libgroff/change_lf.cpp:
* src/libs/libgroff/cmap.cpp:
* src/libs/libgroff/cset.cpp:
* src/libs/libgroff/fmod.c:
* src/libs/libgroff/geometry.cpp:
* src/libs/libgroff/getcwd.c:
* src/libs/libgroff/localcharset.c:
* src/libs/libgroff/prime.cpp:
* src/libs/libgroff/ptable.cpp:
* src/libs/libgroff/quotearg.c:
* src/libs/libgroff/spawnvp.c:
* src/libs/libxutil/DviChar.c:
* src/libs/libxutil/XFontName.c:
* src/libs/libxutil/xmalloc.c:
* src/preproc/eqn/eqn.ypp:
* src/preproc/grn/hdb.cpp:
* src/preproc/grn/hpoint.cpp:
* src/roff/troff/env.cpp:
* src/utils/indxbib/signal.c: Bracket inclusion of config.h with
  preprocessor test of `HAVE_CONFIG_H` where absent.  Use angle bracket
  rather than double-quote notation for the preprocessor file inclusion.
  See .
---
 ChangeLog| 38 ++
 src/devices/xditview/Dvi.c   |  2 ++
 src/devices/xditview/draw.c  |  2 +-
 src/devices/xditview/font.c  |  2 ++
 src/devices/xditview/lex.c   |  2 ++
 src/devices/xditview/page.c  |  2 ++
 src/devices/xditview/parse.c |  2 ++
 src/libs/libbib/map.c|  2 ++
 src/libs/libgroff/change_lf.cpp  |  3 +++
 src/libs/libgroff/cmap.cpp   |  3 +++
 src/libs/libgroff/cset.cpp   |  3 +++
 src/libs/libgroff/fmod.c |  3 +++
 src/libs/libgroff/geometry.cpp   |  2 +-
 src/libs/libgroff/getcwd.c   |  3 +++
 src/libs/libgroff/localcharset.c |  2 ++
 src/libs/libgroff/prime.cpp  |  2 +-
 src/libs/libgroff/ptable.cpp |  2 ++
 src/libs/libgroff/quotearg.c |  2 ++
 src/libs/libgroff/spawnvp.c  |  2 +-
 src/libs/libxutil/DviChar.c  |  2 ++
 src/libs/libxutil/XFontName.c|  2 ++
 src/libs/libxutil/xmalloc.c  |  2 ++
 src/preproc/eqn/eqn.ypp  |  2 +-
 src/preproc/grn/hdb.cpp  |  2 +-
 src/preproc/grn/hpoint.cpp   |  2 +-
 src/roff/troff/env.cpp   |  7 ++-
 src/utils/indxbib/signal.c   |  2 ++
 27 files changed, 92 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7396c7345..4638fee8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2023-12-08  G. Branden Robinson 
+
+   Manage config.h more consistently.
+
+   * src/roff/troff/env.cpp: Ensure that we include config.h (if
+   necessary) _before_ C standard library header math.h.
+
+   * src/devices/xditview/Dvi.c:
+   * src/devices/xditview/draw.c:
+   * src/devices/xditview/font.c:
+   * src/devices/xditview/lex.c:
+   * src/devices/xditview/page.c:
+   * src/devices/xditview/parse.c:
+   * src/libs/libbib/map.c:
+   * src/libs/libgroff/change_lf.cpp:
+   * src/libs/libgroff/cmap.cpp:
+   * src/libs/libgroff/cset.cpp:
+   * src/libs/libgroff/fmod.c:
+   * src/libs/libgroff/geometry.cpp:
+   * src/libs/libgroff/getcwd.c:
+   * src/libs/libgroff/localcharset.c:
+   * src/libs/libgroff/prime.cpp:
+   * src/libs/libgroff/ptable.cpp:
+   * src/libs/libgroff/quotearg.c:
+   * src/libs/libgroff/spawnvp.c:
+   * src/libs/libxutil/DviChar.c:
+   * src/libs/libxutil/XFontName.c:
+   * src/libs/libxutil/xmalloc.c:
+   * src/preproc/eqn/eqn.ypp:
+   * src/preproc/grn/hdb.cpp:
+   * src/preproc/grn/hpoint.cpp:
+   * src/roff/troff/env.cpp:
+   * src/utils/indxbib/signal.c: Bracket inclusion of config.h with
+   preprocessor test of `HAVE_CONFIG_H` where absent.  Use
+   angle bracket rather than double-quote notation for the
+   preprocessor file inclusion.  See
+   .
+
 2023-12-07  G. Branden Robinson 
 
* src/roff/troff/env.cpp (do_hyphenation_patterns_file):
diff --git a/src/devices/xditview/Dvi.c b/src/devices/xditview/Dvi.c
index bc62386cd..26f0ee6bf 100644
--- a/src/devices/xditview/Dvi.c
+++ b/src/devices/xditview/Dvi.c
@@ -1,4 +1,6 @@
+#ifdef HAVE_CONFIG_H
 #include 
+#endif
 
 #ifndef SABER
 #ifndef lint
diff --git a/src/devices/xditview/draw.c b/src/devices/xditview/draw.c
index 288d98abc..d1fb148f7 100644
--- a/src/devices/xditview/draw.c
+++ b/src/devices/xditview/draw.c
@@ -4,7 +4,7 @@
  * accept dvi function calls and translate to X
  */
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include 
 #endif
 
 #include 

[groff] 02/14: [docs]: Note `phw` request in Debugging sections.

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

commit aecafb78bbb1b62ada2a43ff30c9e18ca3fe2b62
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 14:55:46 2023 -0600

[docs]: Note `phw` request in Debugging sections.

* doc/groff.texi:
* man/groff.7.man:
* man/groff_diff.7.man: Do it.

Conntinues commit 0b40885e71, 3 November.
---
 doc/groff.texi   | 4 ++--
 man/groff.7.man  | 2 ++
 man/groff_diff.7.man | 6 --
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 511a57525..d2bc98acf 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -16865,8 +16865,8 @@ or for instrumentation while troubleshooting.  The 
@code{ex} and
 exit codes respectively, to halt further processing when continuing
 would be fruitless.  Examine the state of the formatter with requests
 that write lists of defined names (macros, strings, and diversions),
-environments, registers, and page location traps to the standard error
-stream.
+environments, hyphenation exceptions, registers, and page location traps
+to the standard error stream.
 @c END Keep parallel with section "Debugging" of groff(7).
 
 @Defreq {lf, line [@Var{file}]}
diff --git a/man/groff.7.man b/man/groff.7.man
index ce9cb2733..2d45ee63f 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -8024,6 +8024,8 @@ defined names\[em]macros,
 strings,
 and
 .RB diversions\[em]( .pm );
+hyphenation exceptions
+.RB ( .phw ),
 environments
 .RB ( .pev ),
 registers
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 56acdc2be..d42d5be20 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -5130,10 +5130,12 @@ and
 .
 More aspects of formatter state can be examined with requests that write
 lists of
-defined registers
-.RB ( pnr ),
 environments
 .RB ( pev ),
+hyphenation exceptions
+.RB ( phw ),
+defined registers
+.RB ( pnr ),
 and page location traps
 .RB ( ptr )
 to the standard error stream.

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


[groff] 03/14: [troff]: Fix `special` request without arguments.

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

commit 884e9035bc473f215cfd9b9f865fd29e50b0046d
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 15:29:33 2023 -0600

[troff]: Fix `special` request without arguments.

* src/roff/troff/node.cpp (set_special_fonts): Revert part of commit
  44db6efc01, 3 November.  Stop throwing diagnostic and ignoring request
  if given no arguments; that's how you clear the global list of fonts
  designated as special by request (contrast with those that declare
  themselves as special in their description files).
---
 ChangeLog   | 9 +
 src/roff/troff/node.cpp | 6 --
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bb0f70c59..50f40e0b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-12-02  G. Branden Robinson 
+
+   * src/roff/troff/node.cpp (set_special_fonts): Revert part of
+   commit 44db6efc01, 3 November.  Stop throwing diagnostic and
+   ignoring request if given no arguments; that's how you clear the
+   global list of fonts designated as special by request (contrast
+   with those that declare themselves as special in their
+   description files).
+
 2023-12-01  G. Branden Robinson 
 
[troff]: Fix Savannah #64957 (`device`, `output` broken).
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index f785fc328..f97a79595 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6364,12 +6364,6 @@ static void set_font_specific_special_fonts()
 
 static void set_special_fonts()
 {
-  if (!has_arg()) {
-warning(WARN_MISSING, "global special font configuration request"
-   " expects one or more arguments");
-skip_line();
-return;
-  }
   read_special_fonts(_special_fonts);
   skip_line();
 }

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


[groff] 06/14: [libgroff]: Drop unused function parameter.

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

commit 6bdf6abde348672305c40b93f376ae15e0f4ccfe
Author: G. Branden Robinson 
AuthorDate: Sat Dec 2 15:40:37 2023 -0600

[libgroff]: Drop unused function parameter.

* src/include/lib.h: Drop `want_unlink` parameter from `xtmpfile`
  declaration.
* src/libs/libgroff/tmpfile.cpp (xtmpfile): Drop same from definition,
  along with useless (always true) conditional test.
---
 ChangeLog | 9 +
 src/include/lib.h | 3 +--
 src/libs/libgroff/tmpfile.cpp | 6 ++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b434ea63d..5093883d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-12-02  G. Branden Robinson 
+
+   [libgroff]: Drop unused function parameter.
+
+   * src/include/lib.h: Drop `want_unlink` parameter from
+   `xtmpfile` declaration.
+   * src/libs/libgroff/tmpfile.cpp (xtmpfile): Drop same from
+   definition, along with useless (always true) conditional test.
+
 2023-12-02  G. Branden Robinson 
 
* src/roff/troff/node.cpp (select_underline_font)
diff --git a/src/include/lib.h b/src/include/lib.h
index 7c83c45e5..0f4ed458e 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -87,8 +87,7 @@ int mksdir(char *tmpl);
 #ifdef __cplusplus
   FILE *xtmpfile(char **namep = 0 /* nullptr */,
 const char *postfix_long = 0 /* nullptr */,
-const char *postfix_short = 0 /* nullptr */,
-bool want_unlink = true);
+const char *postfix_short = 0 /* nullptr */);
   char *xtmptemplate(const char *postfix_long,
 const char *postfix_short);
 #endif
diff --git a/src/libs/libgroff/tmpfile.cpp b/src/libs/libgroff/tmpfile.cpp
index 31bc55b8e..fb43cf00f 100644
--- a/src/libs/libgroff/tmpfile.cpp
+++ b/src/libs/libgroff/tmpfile.cpp
@@ -165,8 +165,7 @@ static void add_tmp_file(const char *name)
 // Open a temporary file; any failure is fatal.
 
 FILE *xtmpfile(char **namep,
-  const char *postfix_long, const char *postfix_short,
-  bool want_unlink)
+  const char *postfix_long, const char *postfix_short)
 {
   // `xtmptemplate()` allocates storage for `templ` with `new`.
   char *templ = xtmptemplate(postfix_long, postfix_short);
@@ -179,8 +178,7 @@ FILE *xtmpfile(char **namep,
   FILE *fp = fdopen(fd, FOPEN_RWB);
   if (!fp)
 fatal("cannot open temporary file: %1", strerror(errno));
-  if (want_unlink)
-add_tmp_file(templ);
+  add_tmp_file(templ);
   if (namep != 0 /* nullptr */)
 *namep = templ;
   else

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


Proposed GNU troff behavior change: require end-of-input macros to exit

2023-12-08 Thread G. Branden Robinson
Hi folks,

I have a *roff language reform to suggest.

I propose that GNU troff stop behaving like AT troff in one aspect of
end-of-input macro processing, documented in our Texinfo manual.

 -- Request: .em macro
 Set a trap at the end of input.  MACRO is executed after the last
 line of the input file has been processed.

 For example, if the document had to have a section at the bottom of
 the last page for someone to approve it, the 'em' request could be
 used.

  .de approval
  \c
  .  ne 3v
  .  sp (\\n[.t]u - 3v)
  .  in +4i
  .  lc _
  .  br
  Approved:\t\a
  .  sp
  Date:\t\t\a
  ..
  .
  .em approval

 The '\c' in the above example needs explanation.  For historical
 reasons (and for compatibility with AT 'troff'), the end macro
 exits as soon as it causes a page break and no remaining data is in
 the partially collected line.

 Let us assume that there is no '\c' in the above 'approval' macro,
 and that the page is full and has been ended with, say, a 'br'
 request.  The 'ne' request now causes the start of a new page,
 which in turn makes 'troff' exit immediately for the reasons just
 described.  In most situations this is not intended.

 To always force processing the whole end macro independently of
 this behaviour it is thus advisable to insert something that starts
 an empty partially filled line ('\c') whenever there is a chance
 that a page break can happen.  In the above example, the call of
 the 'ne' request assures that the remaining code stays on the same
 page, so we have to insert '\c' only once.

The AT behavior surprises people over and over again.  It
bit Jörgen Hägg when he implemented GNU mm, for example; see
.  This bug lingered for
over 30 years.

Dave Kemper pointed out that a similar idea, a new `em1` request to
behave this way, was mooted on this list in 2009...but the code never
landed.  See .

I would prefer to just make `em` behave the way people expect, but
retain the weird old behavior for the benefit of historical documents.

Keeping the `\c` in an end-of-input macro, or a macro called by an
end-of-input macro, should not behave any differently.  It _could_
cause a spurious blank page at the end of the document--that's kind of
what it's there for, to keep the formatter from exiting before the
end-of-input macro is "ready", but this would always have been the case.
A person targeting GNU troff alone could leave out the `\c` escape
sequences, and waste no paper.

CSTR #54 in its 1992 revision _did_ warn of this behavior: ", but all
processing ceases at the next page eject." (§7.5).  CSTR #54 1976 and
1981 did _not_ say this.  I conjecture that this was a concession to a
bug that looked too hard to fix.  Whatever the reason, I would document
this as a behavioral difference between GNU and AT troffs.

I'm tracking the development of this feature change in
.

Thoughts?

Regards,
Branden


signature.asc
Description: PGP signature


[bug #64772] [hdtbl] consider deprecating

2023-12-08 Thread G. Branden Robinson
Follow-up Comment #11, bug#64772 (group groff):

Well, [https://lists.gnu.org/archive/html/groff/2023-12/msg7.html
_somebody_ is still using hdtbl]...


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #64910] build failure with clang++ on z/OS (include assert.h _after_ config.h)

2023-12-08 Thread G. Branden Robinson
Follow-up Comment #4, bug#64910 (group groff):

Hi Mike,

Any word on this?


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #64994] math.h fails to compile because it does not include config.h

2023-12-08 Thread G. Branden Robinson
Follow-up Comment #3, bug#64994 (group groff):

Whoops--I failed to read the year associated with bug #61315.  This cannot be
a duplicate of that bug because its fix also shipped with _groff_ 1.23.0.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #64994] math.h fails to compile because it does not include config.h

2023-12-08 Thread G. Branden Robinson
Update of bug#64994 (group groff):

Severity:  3 - Normal => 4 - Important  
  Item Group:None => Build/Installation 
  Status:None => In Progress
 Assigned to:None => gbranden   

___

Follow-up Comment #2:

lib/math.h.in comes from gnulib so it's not a _groff_ file proper.

I assume what's happening is that we're failing to get config.h #included in a
_groff_ .h or .cpp file.

This might already have been fixed in Git; see bug #61315 and bug #64910.  You
might try cherry-picking the commits corresponding to those to see if either
fixes the problem.  We had a similar issue in bug #60035, but shipped the fix
for it in _groff_ 1.23.0.

I see some further inconsistencies, so I have some more improvements pending. 
You can expect them in my next push (later today, I hope).


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #64994] math.h fails to compile because it does not include config.h

2023-12-08 Thread G. Branden Robinson
Follow-up Comment #1, bug#64994 (group groff):

Quoting attachment; it was tagged as "application/octet-stream", so it was a
little hard to work with.


Copyright (C) 1999-2020, 2022 Free Software Foundation, Inc.

Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty provided
the copyright notice and this notice are preserved.

   groff Bug Report
GROFF VERSION:

GNU groff version 1.23.0
Copyright (C) 2022 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU grops (groff) version 1.23.0
GNU troff (groff) version 1.23.0


PLATFORM:
Darwin doinks-MacBook-Air.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Oct
29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64 x86_64


CONFIGURATION REPORT:

--
 installation directory prefix: /usr/local
 C++ compiler and options : g++ -g -O2 
 use libgroff's memory allocator  : no
 C compiler and options   : gcc -g -O2 
 Perl interpreter version : 5.34.0
 X11 support  : disabled
 'groff -l' uses print spooler: lpr
 use URW fonts for PDF output : no
 preconv can use uchardet library : yes
 can build groff.dvi, groff.pdf   : no
--


INPUT FILES:

Only used files part of the standard groff distribution.


COMMAND LINE:

make


DESCRIPTION OF INCORRECT BEHAVIOUR:

math.h fails to compile because it does not include config.h.

In file included from
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:100:
./lib/math.h:58:3: error: "Please include config.h first."
 #error "Please include config.h first."
  ^
./lib/math.h:60:1: error: unknown type name '_GL_INLINE_HEADER_BEGIN'
_GL_INLINE_HEADER_BEGIN
^
./lib/math.h:1673:1: error: expected unqualified-id
_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
^
./lib/stdlib.h:413:5: note: expanded from macro '_GL_CXXALIAS_SYS'
_GL_EXTERN_C int _gl_cxxalias_dummy
^
./lib/stdlib.h:285:30: note: expanded from macro '_GL_EXTERN_C'
# define _GL_EXTERN_C extern "C"
 ^
In file included from src/devices/grodvi/dvi.cpp:19:
In file included from ./lib/assert.h:26:
In file included from
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:44:
In file included from ./lib/stdlib.h:36:
In file included from
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:100:
./lib/math.h:3237:1: error: unknown type name '_GL_INLINE_HEADER_END'
_GL_INLINE_HEADER_END
^
In file included from src/devices/grodvi/dvi.cpp:19:
In file included from ./lib/assert.h:26:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:75:1:
error: expected unqualified-id
__BEGIN_DECLS
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:71:32:
note: expanded from macro '__BEGIN_DECLS'
#define __BEGIN_DECLS   extern "C" {
   ^
src/devices/grodvi/dvi.cpp:304:5: error: use of undeclared identifier
'__assert_rtn'
assert(a == 0);
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:34:
note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__,
#e) : (void)0)
 ^
src/devices/grodvi/dvi.cpp:963:7: error: use of undeclared identifier
'__assert_rtn'
  assert(0);
  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/assert.h:93:34:
note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__,
#e) : (void)0)
 ^
7 errors generated.
make[1]: *** [src/devices/grodvi/dvi.o] Error 1
make: *** [all] Error 2


SUGGESTED FIX:

Have whichever program generates math.h add #include  in the
file.

--- lib/math.h  2023-12-07 13:19:09.0 -0700
+++ lib/mathold.h   2023-12-07 13:36:12.0 -0700
@@ -22,7 +22,6 @@
 #if !(defined __ANDROID__ && defined _LIBCPP_MATH_H && !defined INFINITY)
 
 #ifndef _GL_MATH_H
-#include 
 
 #if __GNUC__ >= 3
 #pragma GCC system_header


# Editor settings
Local Variables:
fill-column: 72
mode: text
End:
vim: set filetype= textwidth=72:




___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: Is there a Groff showcase?

2023-12-08 Thread Thomas Dupond via

Le 2023-12-07 à 22:35, Mike a écrit :

I was thinking of a website or web page which demonstrates the extent
of groff's capabilities.

If there isn't anything like this, currently. Has this been considered?

I have only just learned of groff. The manual is awesome (though tough
reading for me in places). groff does so much more than I first
imagined.

I don't know if this aligns with the goals of the contributors, but
examples of some well-designed, finished documents might attract new
users and potential contributors.


Hello Mike,

I have a small list of documents typeset with groff with source 
available on the "groff examples repository" website.


The website is here : https://froude.eu/groff

You will have to scroll some to find the section labelled "Documents 
edited with groff".  There are only 3 documents right now but they cover 
a lot of ground (math, dropcaps, hyperlinks, bibliography, coloured 
text, etc.)


Any contribution is welcome :)

--
Thomas





Re: Is there a Groff showcase?

2023-12-08 Thread Andreas Eder
On Do 07 Dez 2023 at 21:35, Mike <898...@smartsprout.co.uk> wrote:

> I was thinking of a website or web page which demonstrates the extent
> of groff's capabilities.
>
> If there isn't anything like this, currently. Has this been considered?
>
> I have only just learned of groff. The manual is awesome (though tough
> reading for me in places). groff does so much more than I first
> imagined.
>
> I don't know if this aligns with the goals of the contributors, but
> examples of some well-designed, finished documents might attract new
> users and potential contributors.
>
> Forgive me for being bold, I am just thinking out loud.
>
> Mike

You might have a look at https://www.schaffter.ca/mom/ then.
Iy is for a new macroset called mom from Peter Schaffter and it is very
well documented and has some demostration documents with source.

'Andreas



Re: Is there a Groff showcase?

2023-12-08 Thread hbezemer--- via
You're not bold it's a fair question.
I've worked with LaTeX a lot and also with Word, besides Groff.
Groff outshines the alternatives by far in my humble opinion.
Why?
For me the ability to create pictures, graphs and tables all text based is 
a big advantage.
Almost all my exams (being a science teacher) are created using Groff.
I have a simple but effective macro which enables me to create two versions at 
once:
One version for students with space (and lines) between the questions to fill 
in their answers.
A second version where the empty lines are replaced with the correct answers and
distribution of points.
Having the questions and answers in one source document is very handy.

Secondly you can pull in any other program you want.
For instance I use Lilypond to create small pieces of sheet music, which are
imported in the document.

The reason why groff is not widely used is (imho) that its greatest strenght is 
also 
its weakness: Being deeply rooted in the (l)unix-philosophy of piping data
through different (small) programs makes it hard to attract windows users.
I'm trying to get Groff running on Windows for my collegues, but this isn't
be far a walk in the park.
Having an overleaf.com kind of solution would be a game changer.

Just my two cents.

Regards,

Hans


Mike <898...@smartsprout.co.uk> wrote:

> > It's not much, but I did some kind of a template for different stuff
> > with groff
> > that you can find here : https://t.karchnu.fr/doc/grofftut.pdf
> > 
> > Not sure it's what you're looking for.
> 
> Thank you Philippe.
> 
> That is an interesting resource, thank you for sharing it with me.
> 
> I was thinking of a website or web page which demonstrates the extent
> of groff's capabilities.
> 
> If there isn't anything like this, currently. Has this been considered?
> 
> I have only just learned of groff. The manual is awesome (though tough
> reading for me in places). groff does so much more than I first
> imagined.
> 
> I don't know if this aligns with the goals of the contributors, but
> examples of some well-designed, finished documents might attract new
> users and potential contributors.
> 
> Forgive me for being bold, I am just thinking out loud.
> 
> Mike