[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Some statistics on man page macro usage
From: |
Ingo Schwarze |
Subject: |
Re: [Groff] Some statistics on man page macro usage |
Date: |
Sat, 6 May 2017 17:40:55 +0200 |
User-agent: |
Mutt/1.6.2 (2016-07-01) |
Hi Branden,
for comparison, here are the numbers for the OpenBSD base system
and for the OpenBSD port of X.org (Xenocara). I do not include
data for any third party software installed (my main notebook has
2837 additional man(7) and 105 additional mdoc(7) manuals installed
in /usr/local, but that will look completely different on somebody
else's system).
Debian OpenBSD Xenocara ports
> Dd : ? 2861 9 (105)
> TH : 6598 912 1517 (2837)
> PP : 67814 24487 2040
> IP : 64701 29915 3128
> IX P 60339 43036 1
> TP : 55832 1810 9263
> B : 53372 1726 5242
> SH : 48773 6800 9585
> BR : 43565 247 1084
> I : 30134 491 0
> RS : 27185 2738 802
> RE : 27183 2739 836
> IR : 13349 145 276
> SS : 11633 4739 148
> BI : 9351 57 2084
> PD : 8295 4996 10
> LP : 3847 76 1851
> RB : 3349 196 38
> HP : 2845 5 1095
> P : 2613 60 0
> RI : 2514 1 106
> TS : 1400 35 211
> TE : 1400 35 216
> SM : 686 43 8
> EE G 655 0 225
> EX G 652 0 225
> TQ G 607 0 34
> OP G 350 0 0
> IB : 340 0 5
> UE : 276 0 0
> UR G 264 0 0
> MT G 108 0 0
> ME G 108 0 0
> SY : 82 0 0
> YS : 72 0 0
> SB : 60 0 0
> DT G 26 2 0
> URL: 23 0 0
> UC : 16 0 19
> EQ : 6 2 450
> EN : 6 2 452
> PS : 3 0 0
> PE : 3 0 0
> AT : 0 0 0
> BT G 0 0 0
> ?? : 6722 286 5126
ZN 4926 # \fI\^\\$1\^\fP\\$2 (similar to .IR)
D1 248 1 # mdoc(7)
BP 68 # undefined
IN 49 # similar to .IX
NS 37 # similar to .EX (xterm(1) only)
NE 37 # end .NS
SP 37 # = .sp (cvs(5) only)
other 1 8
> The standout result for me here is the staggering number of
> non-standard macros I found.
As you see above, breaking that down to individual user-defined
macros may be quite easy. It doesn't seem surprising to me at
all, i might even have suspected more .de use in man(7) manuals.
What stands out to me is the rarity of man-ext GNU extensions, even
though you did this on a Debian GNU/Linux systen. The most common
GNU extension appears to be .EX, which is a paragraph macro like
.PP .TP .IP .RS - but less than 0.3% of paragraphs use it. It's
used on average 0.1 times per page on Debian. For comparison, the
similar mdoc(7) .Bd is used on average 2325/2861 = about one time
per page on OpenBSD. Another example: .OP is used on average
350/6598 = .05 times per page on Debian. For comparison, the similar
mdoc(7) .Fl is used on average 12323/2861 = 4.3 times per page on
OpenBSD.
Both examples indicate that man-ext is used in on the order of 1%
of the cases where it could be.
It's also striking that macro frequeny is very different in the
three corpuses. Macros exist that are heavily used on Debian but
rarely on OpenBSD (.BR .I ...) whereas others have up to five times
the relative frequency (.SS .PD ...). Another example: The relative
frequency of .TP in Xenocara is three times as high as in the rest
of OpenBSD, whereas for .IP, it's 15 times lower - so the quotients
of relative frequencies vary up to a factor of 50 even among different
parts of the same operating system!
> man(7)'s "URL" macro is barely used,
This is the first time i even heard of it...
> I submitted a patch to them to un-document .URL so that it can
> be "retired" from the domain of the man macro language.
Sounds good.
> What surprises you about the above list?
The low amount of eqn (.EQ) in your data.
It looks like you have incomplete X11 documentation installed.
Yours,
Ingo