Linux Manual Pages development
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	kernel@collabora.com, linux-man@vger.kernel.org
Subject: Re: [PATCH 2/2] ioctl_pagemap_scan: add page for pagemap_scan IOCTL
Date: Mon, 23 Oct 2023 21:48:02 -0500	[thread overview]
Message-ID: <20231024024802.e6hfjvfumzc2rbil@illithid> (raw)
In-Reply-To: <ZTbrIskF1mt0zTM_@debian>

[-- Attachment #1: Type: text/plain, Size: 3907 bytes --]

Hi Alex,

At 2023-10-23T23:52:28+0200, Alejandro Colomar wrote:
> [CC += Branden]
> > +.SH SYNOPSIS
> > +.nf
> > +.BR "#include <linux/fs.h>" "  /* Definition of " struct " " pm_scan_arg ", "
> > +.BR "                          struct page_region "and " PAGE_IS_* "constants " */"
> 
> That space is not necessary after a closing '"' is something I don't
> know why exists.

Right; since filling is off, and the line will be broken after
"pm_scan_arg," (with typeface changes) anyway, this attempts to put a
space at the end of the line.  But that would be invisible, and an
according-to-Hoyle *roff formatter would get rid of such spaces at the
end of the line before sending them to the output device anyway.

$ printf '.TH foo 1 date package\n.B "pm_scan_arg, "\n' \
  | groff -Tutf8 -man -Z | sed -n '/pm_scan_arg/,/package/p'
tpm_scan_arg,
n40 0
f1
V200
H0
tpackage

If one has learned device-independent troff's output language (see
groff_out(5)), one can see that the space after the comma is simply
discarded.

> I changed that slightly.
[...]
> We try to use \~ for a fillable space; it has the nice effect of
> removing the quotes.
> 
> -.IR "sizeof(struct pm_scan_arg)" .
> +.IR sizeof(struct\~pm_scan_arg) .

Yes.  This is portable _almost_ everywhere (certainly anyplace where
_Linux_ man pages are available), and it can prevent a lot of ugliness.

groff_man_style(7):

       \~        Adjustable non‐breaking space.  Use this escape
                 sequence to prevent a break inside a short phrase or
                 between a numerical quantity and its corresponding
                 unit(s).

                        Before starting the motor,
                        set the output speed to\~1.
                        There are 1,024\~bytes in 1\~KiB.
                        CSTR\~#8 documents the B\~language.

                 \~ is a GNU extension also supported by Heirloom
                 Doctools troff 050915 (September 2005), mandoc 1.9.14
                 (2009‐11‐16), neatroff (commit 1c6ab0f6e, 2016‐09‐13),
                 and Plan 9 from User Space troff (commit 93f8143600,
                 2022‐08‐12), but not by Solaris or Documenter’s
                 Workbench troffs.

> > +.TP
> > +.B vec
> > +The address of
> > +.I page_region
> > +array for output.
> > +.PP
> > +.in +8n
> 
> Ahh, this is great, because I needed to explain to groff(1)
> maintainers what is the problem with TP that I was complaining about
> in another thread.
> 
> Branden, here's what I mean.

Good, yes.  I see what you're talking about.  We can now use
ioctl_pagemap_scan(2) as a site for our horrific medical experiments.
3:-)

I think this is an instance of the tricky little constraint problem
Michael Kerrisk and I discussed almost 3 years ago.

https://lore.kernel.org/linux-man/a79fc055-c7ab-1793-04eb-eb4f678e5035@gmail.com/

In all that time, no flash of brilliance has yet illuminated a solution
(that wouldn't involve extending the man(7) language, like recognizing
an additional argument to TP or other paragraphing macros).

> If you're new to man(7), it is rather unintuitive what to do here.

Yes.  groff_man_style(7) attempts to offer advice here, in subsections
"Horizontal and vertical spacing" and as one of the FAQs in "Notes"
(".RS doesn't indent relative to my indented paragraph.").

That's more material than I care to quote to this list, so I will just
advise anyone who doesn't already have groff 1.23.0 installed to check
out pages 261 and 269 of
<https://www.gnu.org/software/groff/manual/groff-man-pages.pdf>.

> Muhammad, in this project, we usually use IP to continuate a TP.

More projects than this one use it for that purpose; when `IP` itself is
given no tag argument, it is idiomatic usage going back to 1979.

Regards,
Branden

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-10-24  2:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 13:12 [PATCH 1/2] ioctl_userfaultfd.2: add UFFD_FEATURE_WP_ASYNC Muhammad Usama Anjum
2023-10-19 13:12 ` [PATCH 2/2] ioctl_pagemap_scan: add page for pagemap_scan IOCTL Muhammad Usama Anjum
2023-10-23 21:52   ` Alejandro Colomar
2023-10-24  2:48     ` G. Branden Robinson [this message]
2023-10-24 10:40       ` Alejandro Colomar
2023-10-28 13:07         ` managing tagged paragraphs (was: [PATCH 2/2] ioctl_pagemap_scan: add page for pagemap_scan IOCTL) G. Branden Robinson
2023-10-28 16:22           ` Alejandro Colomar
2023-10-28 18:07             ` G. Branden Robinson
2023-10-29  0:42               ` Alejandro Colomar
2023-10-24 15:51     ` [PATCH 2/2] ioctl_pagemap_scan: add page for pagemap_scan IOCTL Muhammad Usama Anjum
2023-10-19 13:27 ` [PATCH 1/2] ioctl_userfaultfd.2: add UFFD_FEATURE_WP_ASYNC Alejandro Colomar
2023-10-19 13:29 ` Alejandro Colomar
2023-10-19 13:34   ` Muhammad Usama Anjum
2023-10-19 13:42     ` Alejandro Colomar
  -- strict thread matches above, loose matches on Subject: below --
2023-10-17 15:01 Muhammad Usama Anjum
2023-10-17 15:01 ` [PATCH 2/2] ioctl_pagemap_scan: add page for pagemap_scan IOCTL Muhammad Usama Anjum
2023-10-17 17:12   ` Alejandro Colomar
2023-10-19 12:31     ` Muhammad Usama Anjum
2023-10-19 12:51       ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231024024802.e6hfjvfumzc2rbil@illithid \
    --to=g.branden.robinson@gmail.com \
    --cc=alx@kernel.org \
    --cc=kernel@collabora.com \
    --cc=linux-man@vger.kernel.org \
    --cc=usama.anjum@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox