bug-groff
[Top][All Lists]
Advanced

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

[bug #60479] tmac/e.tmac-u is missing .PF macro documented in doc/meref.


From: Dave
Subject: [bug #60479] tmac/e.tmac-u is missing .PF macro documented in doc/meref.me
Date: Fri, 30 Apr 2021 19:26:03 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #3, bug #60479 (project groff):

It appears a .PF for -me is not even that hard to implement.  As a first
crack, I tried simply:

.als PF PE

(Worth noting: the source code for .IE and .IF are identical, though one is
not defined as an alias of the other, likely because .als is a groff extension
and much -me code predates groff.)

This seems to do basically what I expect.  With that definition, running this
code through "groff -p -me":


.PS
circle
.PE
Hello, world.


produces a horizontally centered circle with "Hello, world" below it, flush
left.  Then changing the .PE to a .PF produces the same circle but with the
"Hello, world" aligned with its top, still flush left.  So pic does the actual
work of figuring out where to leave the cursor upon exit; e.tmac need only
recognize .PF as a valid macro.

I think this alias is a simple but functional solution to the problem.

----

But there is probably more refinement that could be done.  For instance, .GE
and .GF are _not_ identical, and one of the differences between them is that
.GE includes a ".sp .6" that .GF does not.  The existing .PE likewise includes
a ".sp .6", and probably a better .PF would omit this.

(.GF also omits an HTML check that .GE includes, which honestly to me looks
like it creates a bug if someone uses a .GS and .GF pair with HTML output. 
But that is another issue for another day.)

Thus, were I to make .PE and .PF resemble .GE and .GF, sans probable bug, I
would write them as follows:


.de PE                  \" *** end pic picture
.PF
.sp .6
..
.
.de PF                  \" *** end pic picture; stay at top
.if \\n(?n .PS_nm_check resume
.ls
.in
.if \\n(g7 .fi
.do HTML-IMAGE-END
..


These two definitions would replace the current PE definition; functionally,
the old and new are identical.

----

As I've said before, I mostly don't understand the code in tmac/e.tmac-u, so
both the above possible solutions--which both amount to some degree of copying
code I don't understand--could have problems.

However, I think having a potentially problematic .PF is better than having
none at all.  And since either change involves only creating a new macro (one
involves refactoring but not altering an existing one), either solution should
be safe from causing regressions.

(Either proposal above would also need an accompanying change to the -me
manual, documenting .PF in Section 9.)

Any opinions/preferences between these two, or suggestions for further
refinements?  I'm happy to write a patch for either one.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60479>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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