groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/07: [grog]: Stop emitting ill-conceived diagnostic.


From: G. Branden Robinson
Subject: [groff] 03/07: [grog]: Stop emitting ill-conceived diagnostic.
Date: Tue, 29 Jun 2021 00:19:22 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 4ecbc388998770f8dc2c7a6ab367a7fe65c0e872
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Jun 28 21:13:45 2021 +1000

    [grog]: Stop emitting ill-conceived diagnostic.
    
    * src/utils/grog/grog.pl (do_first_line): Stop emitting
      pseudo-diagnostic (to standard output!) if we see a "groff options
      line" [it's not] of incorrect form.  The preprocessor encoding hint
      convention of concern here is particular to man pages, disregarded by
      at least one major implementation thereof (man-db man), and not used
      by other types of roff documents; at this point, we don't yet know if
      the document we're processing is a man page.
---
 ChangeLog              |  7 +++++++
 src/utils/grog/grog.pl | 17 ++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cec7a28..6434a4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,13 @@
        * src/utils/grog/grog.pl (process_arguments, construct_command):
        Tweak warning diagnostics to use a style where an empty argument
        will be easy to spot.
+       (do_first_line): Stop emitting pseudo-diagnostic (to standard
+       output!) if we see a "groff options line" [it's not] of
+       incorrect form.  The preprocessor encoding hint convention of
+       concern here is particular to man pages, disregarded by at least
+       one major implementation thereof (man-db man), and not used by
+       other types of roff documents; at this point, we don't yet know
+       if the document we're processing is a man page.
 
 2021-06-28  G. Branden Robinson <g.branden.robinson@gmail.com>
 
diff --git a/src/utils/grog/grog.pl b/src/utils/grog/grog.pl
index 964a05e..2c4f7c8 100644
--- a/src/utils/grog/grog.pl
+++ b/src/utils/grog/grog.pl
@@ -341,20 +341,17 @@ sub process_input {
 # The letter for 'refer' is 'r', not 'R', and there is also the
 # historical legacy of vgrind ('v') to consider.  In any case, why
 # should that comment line override what we can infer from actual macro
-# calls within the document?  Contemplate getting rid of this subroutine
+# calls within the document?  Furthermore this hint encoding convention
+# is particular to man pages, disregarded by at least one major
+# implementation thereof (man-db man), and not used by other types of
+# roff documents; at this point, we don't yet know if the document we're
+# processing is a man page.  Contemplate getting rid of this subroutine
 # and %preprocs_tmacs altogether.  --GBR
 sub do_first_line {
   my ( $line, $file ) = @_;
 
-  # For a leading groff options line use only [egGjJpRst]
+  # For a leading groff options line [sic], use only [egGjJpRst].
   if  ( $line =~ /^[.']\\"[\segGjJpRst]+&/ ) {
-    # this is a groff options leading line
-    if ( $line =~ /^\./ ) {
-      # line is a groff options line with . instead of '
-      print "First line in $file must start with an apostrophe \ " .
-       "instead of a period . for groff options line!";
-    }
-
     if ( $line =~ /j/ ) {
       $Groff{'chem'}++;
     }
@@ -451,6 +448,8 @@ sub do_line {
 
 
   ######################################################################
+  # XXX: Dubious.  See <https://savannah.gnu.org/bugs/?60421>.  --GBR
+
   # soelim
   if ( $line =~ /^\.(do)?\s*(so|mso|PS\s*<|SO_START).*$/ ) {
     # '.so', '.mso', '.PS<...', '.SO_START'



reply via email to

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