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

Bug#1102748: Xevi.3: Some remarks and a patch with editorial changes for this man page



Package: libxext-dev
Version: 2:1.3.4-1+b3
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man page"

  [Use 

grep -n -e ' $' -e '\\~$' -e ' \\f.$' -e ' \\"' <file>

  to find (most) trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:65: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:165: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.

   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.21-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libxext-dev depends on:
ii  libx11-dev    2:1.8.12-1
ii  libxext6      2:1.3.4-1+b3
ii  x11proto-dev  2024.1-1

libxext-dev recommends no packages.

Versions of packages libxext-dev suggests:
pn  libxext-doc  <none>

-- no debconf information
Input file is Xevi.3

Output from "mandoc -T lint  Xevi.3": (shortened list)

      1 fill mode already enabled, skipping: fi
      1 input text line longer than 80 bytes: XeviQueryExtension, ...
      1 input text line longer than 80 bytes: returns the type of ...

-.-.

Output from
test-nroff -mandoc -t -ww -z Xevi.3: (shortened list)

     11 	Use macro '.B' for one argument or split argument.
     11 .BR is for at least 2 arguments, got 1

-.-.

Use the word (in)valid instead of (il)legal,
if not related to legal matters.

See "www.gnu.org/prep/standards".

Think about translations into other languages!

Xevi.3:157:if passed an illegal visual ID,

-.-.

Remove space in the first column, if not indented.

Use ".in +<number>n" and ".in" to end it;

Or use ".nf" and ".fi" to end
it, for an extra indention.

Xevi.3:37:    int *major_version_return,
Xevi.3:38:    int *minor_version_return);
Xevi.3:42:    int n_visual, ExtendedVisualInfo ** evi_return,
Xevi.3:43:    int * n_info_return);

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

28:XeviQueryExtension, XeviQueryVersion, XeviGetVisualInfo - X Extended Visual Information functions

-.-.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.

Mark a final abbreviation point as such by suffixing it with "\&".

Some sentences (etc.) do not begin on a new line.

Split (sometimes) lines after a punctuation mark; before a conjunction.

  Lines with only one (or two) space(s) between sentences could be split,
so latter sentences begin on a new line.

Use

#!/usr/bin/sh

sed -e '/^\./n' \
-e 's/\([[:alpha:]]\)\.  */\1.\n/g' $1

to split lines after a sentence period.
Check result with the difference between the formatted outputs.
See also the attachment "general.bugs"

82:visual information beyond that supported by the core protocol. This includes
85:of hardware support for multiple colormaps. XeviGetVisualInfo returns
91:screens is returned. Otherwise, it's a pointer to a list of visuals for which
96:returns a pointer to a list of ExtendedVisualInfo. When done, the client
130:returns the type of transparency supported by the visual. XEVI_TRANSPARENCY_NONE if
149:hardware colormap. For example, if a 12-bit hardware colormap is overloaded to

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
Add "\:" to split the string for the output, "\<newline>" in the source.  

Line 28, length 97

XeviQueryExtension, XeviQueryVersion, XeviGetVisualInfo - X Extended Visual Information functions

Line 130, length 83

returns the type of transparency supported by the visual. XEVI_TRANSPARENCY_NONE if

Longest line is number 28 with 97 characters

-.-.

Remove reverse slash (\) in front of a period (.) that is to be printed
as such, and can not come a control character in the first column of a line.
Use "\&" to protect the period to avoid that.
This is a sign, that the man page was transformed from another source
file with a program, whose name is NOT mentioned in a comment.

97:should free the list using XFree\.

-.-.

Split a punctuation mark from a single argument for a two-font macro

52:.BR XeviQueryExtension,

-.-.

Add a zero (0) in front of a decimal fraction that begins with a period
(.)

104:.in +.5i

-.-.

Split a punctuation from a single argument, if a two-font macro is meant.

78:.I minor_version_return.
147:.I colormap_conflicts.

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

Xevi.3:69:the client will get undefined behavior (EVI may or may not work).

-.-.

Only one space character is after a possible end of sentence
(after a punctuation, that can end a sentence).

Xevi.3:82:visual information beyond that supported by the core protocol. This includes
Xevi.3:85:of hardware support for multiple colormaps. XeviGetVisualInfo returns
Xevi.3:91:screens is returned. Otherwise, it's a pointer to a list of visuals for which
Xevi.3:96:returns a pointer to a list of ExtendedVisualInfo. When done, the client
Xevi.3:130:returns the type of transparency supported by the visual. XEVI_TRANSPARENCY_NONE if
Xevi.3:149:hardware colormap. For example, if a 12-bit hardware colormap is overloaded to

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z ":

an.tmac:<stdin>:37: style: 4 leading space(s) on input line
an.tmac:<stdin>:38: style: 4 leading space(s) on input line
an.tmac:<stdin>:42: style: 4 leading space(s) on input line
an.tmac:<stdin>:43: style: 4 leading space(s) on input line
an.tmac:<stdin>:52: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:56: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:61: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:63: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:66: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:71: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:73: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:80: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:86: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:102: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.
an.tmac:<stdin>:154: misuse, warning: .BR is for at least 2 arguments, got 1
	Use macro '.B' for one argument or split argument.

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- Xevi.3	2025-04-12 13:27:29.646864858 +0000
+++ Xevi.3.new	2025-04-12 13:50:20.130162417 +0000
@@ -25,7 +25,8 @@
 .\"
 .TH XEVI 3 "libXext 1.3.4" "X Version 11" "X FUNCTIONS"
 .SH NAME
-XeviQueryExtension, XeviQueryVersion, XeviGetVisualInfo - X Extended Visual Information functions
+XeviQueryExtension, XeviQueryVersion, XeviGetVisualInfo \- X Extended
+Visual Information functions
 .SH SYNOPSIS
 \&#include <X11/extensions/XEVI.h>
 
@@ -34,11 +35,14 @@ XeviQueryExtension (Display *dpy);
 .LP
 Bool
 XeviQueryVersion (Display *dpy,
+.nf
     int *major_version_return,
     int *minor_version_return);
+.fi
 .LP
 int
 XeviGetVisualInfo (Display *dpy, VisualID *visual,
+.nf
     int n_visual, ExtendedVisualInfo ** evi_return,
     int * n_info_return);
 .fi
@@ -49,59 +53,64 @@ information about core X visuals beyond
 
 The EVI application programming library contains the interfaces described below.
 With the exception of
-.BR XeviQueryExtension,
+.BR XeviQueryExtension ,
 if any of these routines are
 called with a display that does not support the extension, the
 ExtensionErrorHandler (which can be set with
-.BR XSetExtensionErrorHandler
+.B XSetExtensionErrorHandler
 and functions the same way as
 .BR XSetErrorHandler )
 will be called and the function will then return.
 .PP
-.BR XeviQueryExtension
+.B XeviQueryExtension
 returns
-.BR True
+.B True
 if the Extended Visual Information extension is available on the given display.
 A client must call
-.BR XeviQueryExtension
+.B XeviQueryExtension
 before calling any other EVI
 function in order to negotiate a compatible protocol version; otherwise
-the client will get undefined behavior (EVI may or may not work).
+the client will get undefined behavior
+(EVI may or may not work).
 .PP
-.BR XeviQueryVersion
+.B XeviQueryVersion
 returns
-.BR True
+.B True
 if the request succeeded; the values of the major and minor protocol
 version supported by the server are returned in
 .I major_version_return
 and
-.I minor_version_return.
+.IR minor_version_return .
 .PP
-.BR XeviGetVisualInfo
+.B XeviGetVisualInfo
 returns a list of ExtendedVisualInfo structures that describe
-visual information beyond that supported by the core protocol. This includes
+visual information beyond that supported by the core protocol.
+This includes
 layer information relevant for systems supporting overlays and/or underlay
 planes, and information that allows applications better to determine the level
-of hardware support for multiple colormaps. XeviGetVisualInfo returns
-.BR Success
+of hardware support for multiple colormaps.
+XeviGetVisualInfo returns
+.B Success
 if successful, or an X error otherwise.
 If the argument
 .I visual
 is NULL, then information for all visuals of all
-screens is returned. Otherwise, it's a pointer to a list of visuals for which
+screens is returned.
+Otherwise, it's a pointer to a list of visuals for which
 extended visual information is desired.
 .I n_visual
 is the number of elements in the array visual.
 .I evi_return
-returns a pointer to a list of ExtendedVisualInfo. When done, the client
-should free the list using XFree\.
+returns a pointer to a list of ExtendedVisualInfo.
+When done, the client
+should free the list using XFree.
 .I n_info_return
 returns the number of elements in the array evi_return.
 .LP
 The
-.BR ExtendedVisualInfo
+.B ExtendedVisualInfo
 structure has the following fields:
-.in +.5i
+.in +0.5i
 .nf
 .ta 1.6i
 VisualID	\fIcore_visual_id\fR
@@ -127,7 +136,8 @@ overlays, < 0 for underlays.
 .LP
 .I
 transparency_type
-returns the type of transparency supported by the visual. XEVI_TRANSPARENCY_NONE if
+returns the type of transparency supported by the visual.
+XEVI_TRANSPARENCY_NONE if
 there are no transparent pixels, XEVI_TRANSPARENCY_PIXEL if the visual supports
 a transparent pixel, XEVI_TRANSPARENCY_MASK if the visual supports transparent
 plane(s).
@@ -144,17 +154,18 @@ visual.
 .LP
 .I num_colormap_conflicts
 returns the number of elements in
-.I colormap_conflicts.
+.IR colormap_conflicts .
 This array returns a list of visuals that may cause conflicts in the use of the
-hardware colormap. For example, if a 12-bit hardware colormap is overloaded to
+hardware colormap.
+For example, if a 12-bit hardware colormap is overloaded to
 support 8-bit colormaps, the corresponding 8-bit visuals would conflict with the
 12-bit visuals.
 
 .SH ERRORS
-.BR XeviGetVisualInfo
+.B XeviGetVisualInfo
 will return
 .I BadValue
-if passed an illegal visual ID,
+if passed an invalid visual ID,
 .I BadAccess
 if the X server does not respond,
 .I BadAlloc
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  To find trailing space use

grep -n -e ' $' -e ' \\f.$' -e ' \\"' <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  "git" has a "tool" to point out whitespace,
see for example "git-apply(1)" and git-config(1)")

  Not beginning each input sentence on a new line.
Line length and patch size should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option "-warnings=w"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT="-ww -b -z"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

Reply to: