[Top][All Lists]

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

[bug #63812] Discussion of conditional expressions in docs should mentio

From: G. Branden Robinson
Subject: [bug #63812] Discussion of conditional expressions in docs should mention `.if h`
Date: Sun, 5 Mar 2023 07:26:01 -0500 (EST)

Follow-up Comment #8, bug #63812 (project groff):

[comment #7 comment #7:]
> [comment #6 comment #6:]
> > Long stories short, I want a `for` request that will iterate over
> Interesting. Does it resemble this

Not closely.

What I had in mind was this.

.for s string-expr \{\
.  whatever
.  you
.  want
.\"  break
.\"  continue

This would be a simple iterator.  The string named "s" takes on the value of
each item in string-expr from left to right.
> > and new conditional operators to test for "nodes"
> YES. PLEASE. The whole "nodes versus strings" semantic is what led me down
the aforementioned rabbit hole. The fact I even got it working (without GNU
extensions, no less) is a testament to my neurotic stubbornness.

Yes.  People keep doing complicated, wacky things to work around this.  Keith
Marshall has his "sanitize.tmac".  I have two different instances of loony
shit in an.tmac and doc.tmac to abbreviate overlong material for placement in

It's incredibly tedious and bug-prone.
> > and for glyphs that are actually defined in the current font
> I've probably spent too many hours coding in PostScript, but wouldn't an
escape sequence that expands to the name of the font containing the requested
glyph be more useful?

Maybe.  But the question I've found myself needing to answer recently was "is
this REALLY a glyph the font will provide, or some contrivance in the *roff
language?".  I forget now where this came up but it's in a Savannah ticket. 
Dave might remember.

> At least that way you'll be able to compare the output against the name of
the current font.

Not saying this isn't worth doing, but it's not one of the two big changes
mentioned above, and which I would like to do soon.
> (This corresponds to PostScript's `where` operator, which locates the entry
on the dictionary stack which defines an entry with the given key. I'll shut
up now)

By the time a request can process something in *roff, there aren't many stacks
of interest to look at.  Just a node list.

*roff was written for small systems. There's no Document Object Model.  The
formatter has no view of the whole document at any time.  It keeps track of as
little as possible; enough to spit out the next output line and a few other
bits of state demanded by features required to typeset conventional works.


Reply to this item at:


Message sent via Savannah

reply via email to

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