groff
[Top][All Lists]
Advanced

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

Re: [Groff] Formatting algorithm


From: Keith Marshall
Subject: Re: [Groff] Formatting algorithm
Date: Wed, 23 Apr 2014 21:45:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 22/04/14 20:40, Peter Schaffter wrote:
> On Tue, Apr 22, 2014, Ulrich Lauther wrote:
>> Well of course not.  A paragraph ends, e.g. when an empty line is
>> seen.  Probably there are a whole lot of other conditions.  My
>> understanding is that formatting takes place after macros have
>> been expanded; at the macro level it would be easier.  So could
>> the macros issue some hint (in form of a pseudo comment) when they
>> realize that a paragraph has ended?
> 
> Signalling the end of collected paragraphs can't be done exclusively
> within macros because, unlike SGMLs, paragraph macros in groff
> generally aren't closed.

Doesn't a paragraph logically conclude at any request which introduces a
break?  Or invocation of any macro which itself invokes such a request?
 (In addition to an empty input line, or one with leading white space,
which implies a break?)  All of these exhibit one common feature: the
introduction of the break.

> That means that every macro introducing a new semantic element would
> have to test, at the start of the macro definition, whether paragraph
> collecting is currently taking place, and bring it to an end so the
> paragraph can be formatted. While that would work in a lot of cases,
> I think the better strategy would be to implement two requests, say
> .pb and .pe, usable within macro definitions, but also available
> on-the-fly in cases where the user needs to specify the block of text
> that constitutes a paragraph.

Of course, in the interests of semantic markup, it may be useful to have
a macro which would explicitly mark the end of a paragraph, but would
such a macro not be a semantic element of the particular macro package
which provides it?

-- 
Regards,
Keith.



reply via email to

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