Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcre2grep.1 - fix warning about undefined macro 0 #673

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

MatthewVernon
Copy link
Contributor

Debian's "lintian" picked this up - line 950 in the man page starts with a ' which is how you start a roff request. You can reproduce the warning thus:

LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
man --warnings -E UTF-8 -l -Tutf8 -Z doc/pcre2grep.1 >/dev/null

The fix is to add a zero-width space (\&) to the start of the relevant line (indeed groff_man(7) suggests exactly this use for \&).

This is obviously not a critical issue, but it'd be nice if it made it into 10.45 please :)

Debian's "lintian" picked this up - line 950 in the man page starts
with a ' which is how you start a roff request. You can reproduce the
warning thus:

```
LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
man --warnings -E UTF-8 -l -Tutf8 -Z doc/pcre2grep.1 >/dev/null
```

The fix is to add a zero-width space (`\&`) to the start of the
relevant line (indeed `groff_man(7)` suggests exactly this use for \&).

Signed-off-by: Matthew Vernon <[email protected]>
\& is a zero-width space, which is occasionally useful.

Signed-off-by: Matthew Vernon <[email protected]>
@NWilson
Copy link
Member

NWilson commented Jan 24, 2025

Arrgh, roff and groff madness. Thank you Matthew.

Unfortunately, we have some Perl scripts which we use to process the man pages (which are the "source of truth") and the Perl scripts are strict at enforcing a known subset of the nroff dialect.

  • I could add support for \& to our scripts.
  • We could just change the line-wrapping so that '0' isn't at the start of a line!
  • I'll also add something to our CI or validation scripts to run man --warnings over our man pages, to verify that this doesn't happen again.

We can definitely get this into 10.45.

@MatthewVernon
Copy link
Contributor Author

I've pushed a commit which causes CheckMan to be happy with \&, which seemed the least-painful approach?

We could change the line-wrapping, but I worry that future-us will come along and change it back again in the future...

@NWilson
Copy link
Member

NWilson commented Jan 24, 2025

Hmm, I expect the do_line function in maint/132html will need updating too. Otherwise, the \& won't be stripped out in the HTML conversion.

I'll do that later this morning.

@MatthewVernon
Copy link
Contributor Author

I think I've done that one too (I ran it locally, and the output looked plausible)

@NWilson
Copy link
Member

NWilson commented Jan 24, 2025

Great, thank you again Matthew!

The check I added will prevent this recurring in future.

@NWilson NWilson merged commit 0d579d3 into PCRE2Project:master Jan 24, 2025
33 checks passed
@MatthewVernon MatthewVernon deleted the groff branch January 24, 2025 11:57
NWilson pushed a commit that referenced this pull request Feb 4, 2025
Debian's "lintian" picked this up - line 950 in the man page starts
with a ' which is how you start a roff request. You can reproduce the
warning thus:

```
LC_ALL=C.UTF-8 MANROFFSEQ='' MANWIDTH=80 \
man --warnings -E UTF-8 -l -Tutf8 -Z doc/pcre2grep.1 >/dev/null
```

The fix is to add a zero-width space (`\&`) to the start of the
relevant line (indeed `groff_man(7)` suggests exactly this use for \&).

---------

Co-authored-by: Matthew Vernon <[email protected]>
@NWilson NWilson mentioned this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants