[TUHS] Trying to date "A Supplemental Document For Awk"

Steffen Nurpmeso steffen at sdaoden.eu
Fri Jun 30 05:03:12 AEST 2023


Rich Salz wrote in
 <CAFH29toi4aFfGY7g+SndAPz6ndjk8j+LKZOGfnd2GQGnrNXKhw at mail.gmail.com>:
 |A perl script to inuit likely roff options as definitely a neat Unix hack.

The "problem" is that the "shebang" line used for UNIX man'uals on
at least a few ("newer" <> post Y2K) systems has never been
extended in plain *roff terms, for general macro things.  Ie that

   For example, newer man(1)s read the first line of the manual and
   check for a syntax <^'\" >followed by concat of [egprtv]+ (and in
   fact  *join in* $MANROFFSEQ environment [egprtv]+)
                while getopts 'egprtv' preproc_arg; do
                        case "${preproc_arg}" in
                        e)      pipeline="$pipeline | $EQN" ;;
                        g)      GRAP  ;; # Ignore for compatibility.
                        p)      pipeline="$pipeline | $PIC" ;;
                        r)      pipeline="$pipeline | $REFER" ;;
                        t)      pipeline="$pipeline | $TBL" ;;
                        v)      pipeline="$pipeline | $VGRIND" ;;
                        *)      usage ;;
                        esac

Of course, most roff's do not have that "super process" that groff
actually is, for one, so you have to formulate pipelines anyway.
And then roff is dead for the young.  Generally speaking.

It is only a pity in my opinion because the most widely used
implementation (GNU roff) actually does "magic" already and
anyway, namely in its preconv(1), which does

       preconv tries to find the input encoding with the following algorithm.
       ...
       2.     Otherwise, check whether the input starts with a Byte Order Mark
              (BOM, see below).  If found, use it.

       3.     Otherwise, check whether there is a known coding tag (see below)
              in either the first or second input line.  If found, use it.
       ...
       5.     If everything fails[.]


And 3. is then

  [.]supports the coding tag convention (with some restrictions)
  as used by GNU Emacs and XEmacs[.]
  ...
  .\" -*- mode: troff; coding: latin-2 -*-

But possibly the future brings not only integrative and truthful
western white men, but also a roff which "can".  The former
i doubt, the latter i can still hope for.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the TUHS mailing list