[comp.text] Troff comments

msb@sq.sq.com (Mark Brader) (11/22/90)

Regarding the troff commenting convention, Larry Wall (lwall@jpl-devvax.
JPL.NASA.GOV) writes:

@  At the point that I developed the ''' habit, I had seen several documents
@  that used it in preference to .\", and I had the hope that it would become
@  an allowed alternative convention.  This has turned out not to be the case,

My colleague Liam R. E. Quin (lee@sq.sq.com) replies:

>  Probably because it is not, in fact, a comment, and troff has much too much
>  momentum to allow it to be one.  In particular, beware of things like
>  	''' \fB
>  where the font change to bold is _not_ commented out.

In fact, the font change does not happen, but for a subtle reason.
Troff sees the ''' as an invocation of a nonexistent macro, which
it ignores.  But macro arguments are read in copy mode, and the \f
escape sequence is not recognized in copy mode.  Thus, no font change.

On the other hand, something like

	''' Note the use of \n+x below

*will* cause an autoincrement of number register x, assuming that an
increment amount has been specified; and as Lee says, things like \}
also cause problems.  Not to mention the mess that would happen if
someone decided that '' was a good name for a temporary macro!

Followups directed to comp.text.
-- 
Mark Brader			    "This is Programming as a True Art Form,
SoftQuad Inc., Toronto		     where style is more important
utzoo!sq!msb, msb@sq.com	     than correctness..."     -- Pontus Hedman

This article is in the public domain.

eggert@twinsun.com (Paul Eggert) (11/27/90)

msb@sq.sq.com (Mark Brader) writes about using ''' to start troff comments:

    Not to mention the mess that would happen if someone decided that '' was a
    good name for a temporary macro!

I often use `` and '' to name strings for open-double-quote and
close-double-quote.  For example,

	\*(``Quite!\*('' he said.

is more readable than -me's

	\*(lqQuite!\*(rq he said.

Unfortunately,

	''' This is a comment.

ruins this, because traditional troff uses the same name space for both macros
and strings, and the above line will interpolate a double close quote.  This is
another reason to stick with the less glamorous

	.\" This is a comment.