groff
[Top][All Lists]
Advanced

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

Re: [Groff] Suggestions on how to trace this out ...


From: Werner LEMBERG
Subject: Re: [Groff] Suggestions on how to trace this out ...
Date: Mon, 22 Sep 2008 19:24:56 +0200 (CEST)

Sorry for the late reply.

> I'm looking for a suggestion on how to approach this problem.
>
> Consider the file i.mm
>
>       .de xx yy
>       .sp 2
>       .yy
>
> And the command line
>       
>       groff  -mm  i.mm
>
> You would expect, and in fact get, no output.  -Tps  is the default.
>
> BUT consider the command line
>
>       groff -Tascii  -mm  i.mm
>
> You would expect the same but instead get ...
>
>       i.mm:3: warning: `yy' not defined
>
> I've not detected any obvious pattern, and am wondering how to proceed.

In the groff CVS, trace.tmac doesn't trace `.warn', but it is easy to
add it.  Just insert the following snippet:

  .rn warn !!warn
  .
  .!!de1 warn
  .  !!warn \$1
  .  tm1 "\*[!!!sp]*** .warn \$1
  ..

Put the modified trace.tmac into your current directory (where i.mm
resides), then run (using a CVS groff binary)

  groff -M. -mtrace -mm i.mm 2> i.log
  groff -Tascii -M. -mtrace -mm i.mm 2> i.ascii.log

Note that trace.tmac probably doesn't really work yet with -mm -- I
have never tried but I suspect that I have to fix various macros, but
to catch this particular problem it is sufficient.

Saying

  diff -u i.log i.ascii.log

gives the following relevant snippet:

  --- i.log       2008-09-22 16:37:50.000000000 +0200
  +++ i.ascii.log 2008-09-22 16:37:44.000000000 +0200
  @@ -2,6 +2,7 @@
    *** de trace enter: address@hidden "$Revision:" "2.33" "$"
     *** .ds RE 2.33
    *** trace exit: address@hidden "$Revision:" "2.33" "$"
  + *** .warn
    *** .mso devtag.tmac {
     *** .nr _C 0 (-> 0)
     *** .als DEVTAG-SH DEVTAG-NH

So the correponding code must be right after the address@hidden macro, and
indeed, you can find this in m.tmac:

  .if (\n[.warn] == 65543) .warn

BTW, exactly the same line is in s.tmac also.

By default, groff enables the following warnings: 1, 2, 4, 0x10000,
0x20000, which sums up to 0x30007.

However, in tty.tmac, you can find the following code:

  .warn \n[.warn]-(\n[.warn]/131072%2*131072)

which disables flag `131072' (0x20000) so that no warnings about
non-existent fonts are emitted; after loading tty.tmac, the actual
value of \n[.warn] is 0x10007.

The value 65543 is 0x10007 -- so the code in both s.tmac and m.tmac
switches on all warnings if ttf.tmac has been loaded, and this is what
you observe.


    Werner




reply via email to

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