groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 05/10: Increase respect for compatibility mode.


From: G. Branden Robinson
Subject: [groff] 05/10: Increase respect for compatibility mode.
Date: Fri, 16 Oct 2020 10:59:43 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit c416a142db2c46cfe8d370d2cf2604b8e370ce67
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 16 23:51:34 2020 +1100

    Increase respect for compatibility mode.
    
    * src/preproc/eqn/main.cpp (main):
    * src/preproc/pic/main.cpp (main):
    * src/preproc/tbl/main.cpp (main):
    * tmac/eqnrc:
    * tmac/troffrc: Perform checks of register and macro definitions with a
      .do request, since we might be in compatibilty mode.
---
 ChangeLog                | 9 +++++++++
 src/preproc/eqn/main.cpp | 4 ++--
 src/preproc/pic/main.cpp | 4 ++--
 src/preproc/tbl/main.cpp | 4 ++--
 tmac/eqnrc               | 4 ++--
 tmac/troffrc             | 6 ++++--
 6 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f909dfc..d5a8752 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2020-10-16  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/preproc/eqn/main.cpp (main):
+       * src/preproc/pic/main.cpp (main):
+       * src/preproc/tbl/main.cpp (main):
+       * tmac/eqnrc:
+       * tmac/troffrc: Perform checks of register and macro definitions
+       with a .do request, since we might be in compatibilty mode.
+
+2020-10-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/roff/troff/input.cpp (do_if_request): Emit warning of type
        "syntax" if a groff conditional expression extension is used
        when compatibility mode is active.
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 3bbb00a..ede7317 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -376,8 +376,8 @@ int main(int argc, char **argv)
     }
   init_table(device);
   init_char_table();
-  printf(".if !dEQ .ds EQ\n"
-        ".if !dEN .ds EN\n");
+  printf(".do if !dEQ .ds EQ\n"
+        ".do if !dEN .ds EN\n");
   if (output_format == troff) {
     printf(".if !'\\*(.T'%s' "
           ".if !'\\*(.T'html' "        // the html device uses '-Tps' to render
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index fabed31..597a339 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -620,8 +620,8 @@ int main(int argc, char **argv)
 #endif
   {
     out = make_troff_output();
-    printf(".if !dPS .ds PS\n"
-          ".if !dPE .ds PE\n");
+    printf(".do if !dPS .ds PS\n"
+          ".do if !dPE .ds PE\n");
   }
 #ifdef FIG_SUPPORT
   if (whole_file_flag) {
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index f057089..bba288a 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -1596,9 +1596,9 @@ int main(int argc, char **argv)
     default:
       assert(0);
     }
-        ".if !dTS .ds TS\n"
-        ".if !dTE .ds TE\n");
   printf(".if !\\n(.g .ab GNU tbl requires groff extensions; aborting\n"
+        ".do if !dTS .ds TS\n"
+        ".do if !dTE .ds TE\n");
   if (argc > optind) {
     for (int i = optind; i < argc; i++) 
       if (argv[i][0] == '-' && argv[i][1] == '\0') {
diff --git a/tmac/eqnrc b/tmac/eqnrc
index 6feeb60..84f8cf9 100644
--- a/tmac/eqnrc
+++ b/tmac/eqnrc
@@ -1,8 +1,8 @@
 .\" -*- nroff -*-
 .\"
 .\" Startup file for eqn.
-.if !d EQ .ds EQ
-.if !d EN .ds EN
+.do if !d EQ .ds EQ
+.do if !d EN .ds EN
 .EQ
 sdefine << %{ < back 20 < }%
 sdefine >> %{ > back 20 > }%
diff --git a/tmac/troffrc b/tmac/troffrc
index 99c9e00..2b2975d 100644
--- a/tmac/troffrc
+++ b/tmac/troffrc
@@ -11,8 +11,10 @@
 .
 .\" Use .do here, so that it works with -C.
 .\" The groff command defines the .X string if the -X option was given.
-.ie r.X .do ds troffrc!ps Xps.tmac
-.el .do ds troffrc!ps ps.tmac
+.do ie r.X \
+.      do ds troffrc!ps Xps.tmac
+.el \
+.      do ds troffrc!ps ps.tmac
 .do ds troffrc!pdf pdf.tmac
 .do ds troffrc!dvi dvi.tmac
 .do ds troffrc!X75 X.tmac



reply via email to

[Prev in Thread] Current Thread [Next in Thread]