groff
[Top][All Lists]
Advanced

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

Adjusting long lines in man pages and how to temporarily disable a warni


From: Tim Landscheidt
Subject: Adjusting long lines in man pages and how to temporarily disable a warning?
Date: Sun, 28 Feb 2021 01:08:37 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

the man page for rpm(8) has a section that causes a warning
on display (added ".TH" here for a reproducible example):

| .TH "RPM" "8" "09 June 2002" "Red Hat, Inc."
| .TP
| \fB--macros \fIFILELIST\fB\fR
| Replace the list of macro files to be loaded. Each of the files in the colon 
separated
| \fIFILELIST\fR
| is read sequentially by \fBrpm\fR for macro definitions.
| Only the first file in the list must exist, and tildes will be
| expanded to the value of \fB$HOME\fR.
| The default \fIFILELIST\fR is
| 
\fI/usr/\:lib/\:rpm/\:macros\fR:\:\fI/usr/\:lib/\:rpm/\:macros.d/\:macros.*\fR:\:\fI/usr/\:lib/\:rpm/\:platform/\:%{_target}/\:macros\fR:\:\fI/usr/\:lib/\:rpm/\:fileattrs/\:*.attr\fR:\:\fI/usr/\:lib/\:rpm/\:redhat/\:macros\fR:\:\fI/etc/\:rpm/\:macros.*\fR:\:\fI/etc/\:rpm/\:macros\fR:\:\fI/etc/\:rpm/\:%{_target}/\:macros\fR:\:\fI~/.rpmmacros

When run through "groff -mandoc -rLL=162n -rLT=162n -Tutf8 <
rpm.8 | sed -e 's/\x1b\[[0-9;]*m//g;'", this displays:

| <standard input>:10: warning [p 1, 1.2i]: cannot adjust line
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| RPM(8)                                                                System 
Manager's Manual                                                               
RPM(8)



|        --macros FILELIST
|               Replace  the  list of macro files to be loaded. Each of the 
files in the colon separated FILELIST is read sequentially by rpm for macro 
definitions.
|               Only the first file in the list must exist, and tildes will be 
expanded to the value of $HOME.  The default  FILELIST  is  
/usr/lib/rpm/macros:/usr/
|               
lib/rpm/macros.d/macros.*:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/fileattrs/*.attr:/usr/lib/rpm/redhat/macros:/etc/rpm/macros.*:/etc/
|               rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros



| Red Hat, Inc.                                                              09 
June 2002                                                                     
RPM(8)

At first, I thought "cannot adjust line" means that groff
cannot find a place to wrap a line, which was at odds with
the plenty of zero-width break points, but I believe I now
understand correctly that "cannot adjust line" means that
groff finds no/not enough spaces between words to spread the
words "from left to right"?  Supposing that, is there a way
to achieve a warning-free/"beautiful" look for such para-
graphs with "words" longer than a line?

Second, the warning can confuse the user.  Therefore (if
there is no way to set this long line "beautifully"), I'd
like to disable it temporarily for this line.  I found that
I can achieve that by wrapping:

| .\" If warnings for breaks (4) are set, disable them.
| .nr saved-warn-level \n[.warn]
| .if ((\n[.warn] - ((\n[.warn] / 8) * 8)) > 3) .warn (\n[.warn] - 4)

and:

| .warn \n[saved-warn-level]

around it (and now I see that tmac/doc.tmac-u even has a si-
milar piece of code).

Is that the groffy way to to do that?  Or is there some al-
ready existing macro that says "my argument can be long,
don't complain about it"?

Any other advice is highly appreciated.

TIA,
Tim




reply via email to

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