Re: Inter-paragraph separation modified by HP

2023-04-30 Thread G. Branden Robinson
Hi Alex,

At 2023-04-29T21:32:48+0200, Alejandro Colomar wrote:
> > I'm not seeing a difference in vertical space among the 3 PDF
> > exhibits.
> 
> Indeed; it seems I sent the wrong files.  I'll copy here what I did
> now.
> 
> 
> $ uri.HP.new.pdf
> $ uri.HP.old.pdf
> $  >uri.PP.new.pdf
> $  >uri.PP.old.pdf
> 
> I hope I didn't goof it now.

You didn't.  I am able to reproduce it.

The problem is a one-character thinko from March.

diff --git a/tmac/an.tmac b/tmac/an.tmac
index 9e38ba569..dff0297fe 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -805,7 +805,7 @@ contains unsupported escape sequence
 .\" Set a paragraph with a hanging indentation.
 .\" .HP [indent]
 .de1 HP
-.  if !\\n[mS] \\*[an-deprecation-warn]\c
+.  if !\\n[mS] \\*[an-deprecation-warn]\\
 .  an-break-paragraph
 .  ne (1v + 1u)
 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)

(The reason this causes a problem is that, if no output line is pending,
\c creates one.  Then, `an-break-paragraph` unconditionally puts an
inter-paragraph space on the output.  This creates the appearance of
doubling the inter-paragraph distance.  The page's use of the `nf`
request may be playing a role here, since it guarantees that no output
line will be pending when `HP` is called.  Interestingly, this appears
to affect only troff mode; nroff mode rendering is not harmed.)

This fix will be in my next push to my private branch.

Or maybe I'll take a different approach.  I notice now that one can use
`HP` manually without drawing CHECKSTYLE warnings if one does so within
a `SY`/`YS` region.  I had considered making `HP` a wrapper of a "real"
hanging paragraph macro.  The wrapper would throw the deprecation
warning and the "real" macro, which `SY` would call directly, would do
the work.  That seemed more complex before, but now that I see I goofed
the "interpolate a macro as a string" hack, I'm wondering if the other
approach wasn't the better one after all.

Weirdly, I managed to NOT screw up two other instances of the same
thing in the same commit.

commit aea1dfb11bbe99df52ca3124eb4cfd11c36a1faa
Author: G. Branden Robinson 
Date:   Sun Mar 6 08:53:41 2022 +1100

[man]: Add deprecation warnings to AT, UC, HP.

* tmac/an.tmac (AT, UC, HP): Add deprecation warnings.  For the last,
  only do so if we're not inside a synopsis (SY/YS), since our
  definition of `SY` calls `HP` internally.  (This does seem
  hypocritical.  Perhaps if we knew the correct CSS incantation to speak
  in grohtml, we could un-deprecate `HP`.)
[...]
diff --git a/tmac/an.tmac b/tmac/an.tmac
index f14b3c7fc..f33b5dae5 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -341,6 +341,7 @@
 .\" Designate an AT&T Unix man page.
 .\" .AT [system-id[ release-id]]
 .de1 AT
+\\*[an-deprecation-warn]\\
 .  ds an-extra2 "7th Edition\"
 .  if "\\$1"3" .ds an-extra2 "7th Edition\"
 .  if "\\$1"4" .ds an-extra2 "System III\"
@@ -353,6 +354,7 @@
 .\" Designate a BSD Unix man page.
 .\" .UC [system-id]
 .de1 UC
+\\*[an-deprecation-warn]\\
 .  ds an-extra2 "3rd Berkeley Distribution\"
 .  if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\"
 .  if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\"
@@ -746,6 +748,7 @@
 .\" Set a paragraph with a hanging indentation.
 .\" .HP [indent]
 .de1 HP
+.  if !\\n[mS] \\*[an-deprecation-warn]\c
 .  an-break-paragraph
 .  ne (1v + 1u)
 .  if \\n[.$] .nr an-prevailing-indent (n;\\$1)

Regards,
Branden


signature.asc
Description: PGP signature


Re: Inter-paragraph separation modified by HP

2023-04-29 Thread Alejandro Colomar
Hi Branden,

On 4/29/23 21:18, G. Branden Robinson wrote:
> At 2023-04-29T21:05:36+0200, Alejandro Colomar wrote:
>> BTW, I didn't ask explicitly, but I also would like to know why I
>> don't notice any effects of HP (apart from the reported regression)
>> Is it safe if I replace it with PP, or is there some special
>> formatting that my eyes aren't seeing?
> 
> If your paragraph is only one output line long, it is impossible to tell
> whether `HP` has been used.  I presume that is one of the reasons the
> second paragraph below, something similar to which goes back many years,
> is in groff_man(7).
> 
> .HP [indentation]
> Set up a paragraph with a hanging left indentation.  The
> indentation argument, if present, is handled as with .TP.
> 
> Use of this presentation‐oriented macro is deprecated.  A
> hanging indentation cannot be expressed naturally under HTML,
> and non‐roff‐based man page interpreters may treat .HP as an
> ordinary paragraph.  Thus, information or distinctions you mean
> to express with indentation may be lost.

Ahh, I was expecting that the first line would be the one with negative
indentation, instead of the rest being indented.  Now it makes sense.
Especially after having seen the effects in groff-1.22.4.

Cheers,
Alex

> 
> Regards,
> Branden

-- 

GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


OpenPGP_signature
Description: OpenPGP digital signature


Re: Inter-paragraph separation modified by HP

2023-04-29 Thread G. Branden Robinson
At 2023-04-29T21:05:36+0200, Alejandro Colomar wrote:
> BTW, I didn't ask explicitly, but I also would like to know why I
> don't notice any effects of HP (apart from the reported regression)
> Is it safe if I replace it with PP, or is there some special
> formatting that my eyes aren't seeing?

If your paragraph is only one output line long, it is impossible to tell
whether `HP` has been used.  I presume that is one of the reasons the
second paragraph below, something similar to which goes back many years,
is in groff_man(7).

.HP [indentation]
Set up a paragraph with a hanging left indentation.  The
indentation argument, if present, is handled as with .TP.

Use of this presentation‐oriented macro is deprecated.  A
hanging indentation cannot be expressed naturally under HTML,
and non‐roff‐based man page interpreters may treat .HP as an
ordinary paragraph.  Thus, information or distinctions you mean
to express with indentation may be lost.

Regards,
Branden


signature.asc
Description: PGP signature


Re: Inter-paragraph separation modified by HP

2023-04-29 Thread G. Branden Robinson
Hi Alex,

At 2023-04-29T21:02:52+0200, Alejandro Colomar wrote:
> I was checking some warning about using HP.  It happens in uri.7.
> 
> I'm not sure I understand the macro.  From visual inspection, it's
> creating inter-paragraph spacing, but from the documentation I'd
> say it should only affect horizontal space, right?

The purpose of the macro is to create a hanging indent.  To illustrate,
 I'll format this very paragraph with a hanging indentation.  You
 can see that lines after the first are indented, but the first is
 not.  But it is still a paragraph, so inter-paragraph space
 precedes it.

> It's being called as '.HP 0.2i'.  I replaced those .HP calls by .PP
> to see the difference, and I don't see anything noticeable in
> horizontal spacing, but see a considerable difference in the
> vertical spacing.

I'm not seeing a difference in vertical space among the 3 PDF exhibits.

Each BNF declaration gets a paragraph.  The break for "scheme" happens
way too early, but that too is consistent among the 3 PDF exhibits.

> It's used in the synopsis; it should be easy to distinguish.
> 
> Is that some 1.23.0 regression maybe?
> 
> In fact, after formatting with /usr/bin/groff (the old 1.22.4), I
> don't see the effects of 1.23.0, so it's a regression.  Is it known?

Could you maybe take a screenshot and mark up the thing I'm supposed to
be seeing with a big red arrow or something?

> Attached you can see some PDFs of the page:
> 
> uri.7.pdf
>   Original uri.7, formatted with groff-1.23.0
> 
> uri_PP.7.pdf
>   I edited the original uri.7 to use PP instead of HP,
>   and formatted with groff-1.23.0.
> 
> uri_old.pdf
>   Original uri.7, formatted with groff-1.22.4.

None of them look erroneous to me.

Regards,
Branden


signature.asc
Description: PGP signature


Re: Inter-paragraph separation modified by HP

2023-04-29 Thread Alejandro Colomar
BTW, I didn't ask explicitly, but I also would like to know why I
don't notice any effects of HP (apart from the reported regression)
Is it safe if I replace it with PP, or is there some special
formatting that my eyes aren't seeing?

Cheers,
Alex

-- 

GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


OpenPGP_signature
Description: OpenPGP digital signature