troff:ono.tmac:98: warning: name '.' not defined [-w mac]

#2 · closed · 1 comments

View on GitHub ↗

g-branden-robinson

It's unclear to me what the package is trying to do here. ```console $ nl ono.tmac | sed -n 92,99p 92 .\" 93 .de FONT 94 . FO \\$1 \\$2 95 . . 96 . ig NT 97 . NT 98 .. 99 .de FO \" Called in compatibility-mode ``` Line 95 ends the macro definition. <details><summary>Per the <a href="https://www.gnu.org/software/groff/manual/groff.html.node/Writing-Macros.html">GNU <i>troff</i> manual</a>…</summary> > If the optional second argument [to the `de` request] is not specified, the definition ends with the control line ‘..’ (two dots). Alternatively, _end_ identifies a macro whose call syntax at the start of a control line ends the definition of _name_; _end_ is then called normally. A macro definition must end in the same conditional block (if any) in which it began (recall [] [Conditional Blocks](https://www.gnu.org/software/groff/manual/groff.html.node/Conditional-Blocks.html)). Spaces or tabs are permitted after the control character in the line containing this ending token (either ‘.’ or ‘_end_’), but a tab immediately after the token prevents its recognition as the end of a macro definition.</details> We can see using a new _groff_ 1.24 feature that the foregoing is accurate. ```console $ echo ".pm FONT" | ~/groff-1.24.0/bin/groff -Ez -M . -m ono -z 2>&1 | jq { "name": "FONT", "file name": "./ono.tmac", "starting line number": 94, "length": 12, "contents": ".FO \\$1 \\$2\n", "node list": [] } ``` I don't know if this is an actual defect, but if it's not, then it is not clear to me what lines 96-98 accomplish.

Comments

Alhadis

Whoa boy, this is gonna take a bit of explaining… The short explanation is that `.FONT` was one of the macros I compiled from disparate sources when I first created the file named `mono.tmac` (where "Mono" referred simply to "monospace"; it was a way of fine-tuning how fixed-pitch fonts appeared in terminal output). `.FONT` comes from [the first Groff project I published to GitHub](https://github.com/Alhadis/AddressPrinter), which was in mid-2016 when I still kinda had NFI what I was doing with Roff and even how the Troff pipeline worked as a whole. That part is kinda self-evident when you notice the weird, indirect, multi-level manner in which address labels are written to files named `send.to` with contents like ```roff .\" -*- nroff -*- .so ./addr-label.1 .FONT +12 CLARENDON .vs +2.5 . .FROM: Room 217/2, Reactor 4 Chernobyl Nuclear Power Plant Pripyat, Kyiv Oblast Ukraine . .TO: Vladimir Putin Dvorets Putina, Gelendzhik Krasnodar Krai Russia ``` And for some reason, I wanted the macros to read like a regular shipping label. No idea why. Anyway, I guess I kept the `.FONT` macro around because I'm too used to CSS, and the macros arguments even match the [`font` property shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font): ```css :scope{ font: 1.2em Clarendon; } ```