groff
[Top][All Lists]
Advanced

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

Re: [Groff] mom : unicode in .INCLUDE'd files


From: Steffen Nurpmeso
Subject: Re: [Groff] mom : unicode in .INCLUDE'd files
Date: Sat, 22 Jul 2017 22:23:39 +0200
User-agent: s-nail v14.9.0

"E. Hoffmann" <address@hidden> wrote:
 |Am Fri, 21 Jul 2017 16:28:04 -0400
 |schrieb Peter Schaffter <address@hidden>:
 |
 |[...]
 |>>     $ soelim foo | preconv | groff -Tutf8 | grep .
 |>>     foo: ÄÖÜ SS ÒÓÔÕŎŌ Ç äöü ß òóôõŏō ç
 |>>     bar: ÄÖÜ SS ÒÓÔÕŎŌ Ç äöü ß òóôõŏō ç
 |>>     $
 |>>     $ groff -V -Tutf8 -sk foo
 |>>     preconv foo | soelim | troff -Tutf8 | grotty
 |
 |Thanks a lot.
 |
 |So, the solution's first step is to replace the .INCLUDE macro with the
 |plain .so request, and the second step is the preconv-pipe.
 |
 |Something remains.
 |
 |    $groff -Tutf8 -V -sk example.mom
 |
 |gives:
 |
 |>preconv -eutf8 example.mom | soelim | troff -Tutf8 | grotty

Hmm, so unless i got something wrong Ralph showed this pipeline
uses the false order, because soelim includes external files after
the main body has already been converted, so that the included
files as such will not be covered by preconv.  Correct would be

  soelim | preconv -eutf8 example.mom | troff -Tutf8 | grotty

But this of course requires that soelim knows it has to handle
other inclusions than .so.  I think the best would be if there
would be a file-inclusion command which can be given a file-
specific character set, as in

  .include -charset=latin15 rest-of-line

or that soelim can learn more directives as alternative spellings
to .so, maybe

  .solearn INCLUDE
or
  .sopush INCLUDE

or whatever, but all this is not available.

As a general thought my impression always has been that normal
users should not be bothered with the pipeline as such, because
i can remember having seen .tr documents and being unable to get
it right because (a) i did not know and (b) i did not know about
the document.  My idea was, if i recall that correctly, having not
looked into this for two years (and one more week to come), that
of an introductional description line that roff can look at and
create the necessary pipeline itself. [Looking into that]  Ah ja,
indeed -- oh, i am sorry if i trash your thread with this, btw! --:

   Introduce a new command that can be used to select the preprocessors
   explicitly, e.g., ".preprocessors tbl,eqn" etc.
   If so, how to deal with included files?  Offer "-" mode which turns
   off preprocessors for a specific file?

   I think the best would be some kind of "shebang", for compatibilities
   sake it must be comment-based, as in '.\"!troff eqn tbl enc=latin1'?
   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

   This is good, but pretty much crypto and nothing for normal users.
   But extending this, why not check for <'\" preprocess: tbl eqn"> etc.?
   And as above.
   And this is also documented in groff_tmac.man.  But do not bet on
   this.

No preconv in this pipeline spec, well...

 |Is there something else I can do?

Hard stuff for now.

--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)

reply via email to

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