Package: menu
Version: 2.1.50
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 "groff -e ' $' <file>" to find 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?


troff:<stdin>:13: warning: trailing space in the line
an.tmac:<stdin>:27: style: 1 leading space(s) on input line
troff:<stdin>:47: warning: trailing space in the line
an.tmac:<stdin>:55: misuse, warning: .RI is for at least 2 arguments, got 1
        Use macro '.I' 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.6-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 menu depends on:
ii  libc6       2.40-5
ii  libgcc-s1   14.2.0-12
ii  libstdc++6  14.2.0-12

menu recommends no packages.

Versions of packages menu suggests:
pn  gksu | kde-cli-tools | ktsuss  <none>
pn  menu-l10n                      <none>

-- no debconf information
Input file is su-to-root.1

  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>

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

  For a style guide use

  mandoc -T lint

-.-

  So any 'generator' should check its products with the above mentioned
'groff', 'mandoc',  and additionally with 'nroff ...'.

  This is just a simple quality control measure.

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

  Common defects:

  Input text line longer than 80 bytes.

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

  Not beginning each input sentence on a new line.
Lines should thus be shorter.

  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 -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 of 'diff -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)


-.-.

Output from "mandoc -T lint  su-to-root.1": (shortened list)

      2 whitespace at end of input line

-.-.

Output from "test-groff -mandoc -t -ww -z su-to-root.1": (shortened list)

      1         Use macro '.I' for one argument or split argument.
      1 .RI is for at least 2 arguments, got 1
      2 trailing space in the line

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

2

-.-.

Remove space in the first column, if not indented.
Use ".in +<number>n" and ".in" to end it; ".nf" and ".fi" to end
it, for an extra indention.

su-to-root.1:27: \fIsux\fP, \fIsudo-askpass\fP, \fIgksudo\fP and \fIkdesudo\fP.

-.-.

Wrong distance between sentences in the input file.

  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 "\&".

11:Most menu entries simply start an editor or a game or whatever. But
17:The command to execute as a string. This option is mandatory.
45:\fBsu\-to\-root\fP will source these files at startup in this order. This 
lets

-.-.

Put a subordinate sentence (after a comma) on a new line.

13:important settings in the system, that require root privileges. 
19:The name of the user to change to, instead of root.
32:\fIgksu\fP, \fIkdesu\fP, \fIkde4su\fP, \fIktsuss\fP, \fIsux\fP and the 
built-in
33:code, in that order with the exception that under a KDE session, \fIkdesu\fP
40:Supported values are \fIsudo\fP, \fIsux\fP and \fIsu\fP, the later being

-.-.

Remove quotes when there is a printable
but no space character between them
and the quotes are not for emphasis (markup),
for example as an argument to a macro.

20:.IP "\-X"

-.-.

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

troff:<stdin>:13: warning: trailing space in the line
an.tmac:<stdin>:27: style: 1 leading space(s) on input line
troff:<stdin>:47: warning: trailing space in the line
an.tmac:<stdin>:55: misuse, warning: .RI is for at least 2 arguments, got 1
        Use macro '.I' for one argument or split argument.

--- su-to-root.1        2025-01-14 00:14:37.024233097 +0000
+++ su-to-root.1.new    2025-01-14 00:31:07.002007262 +0000
@@ -8,43 +8,53 @@ It can be used in menu entry commands to
 .SH SYNOPSIS
 .B su\-to\-root [\-X] [\-p <user>] \-c <command>
 .SH DESCRIPTION
-Most menu entries simply start an editor or a game or whatever. But
-some menu entries would like to give the user the ability to change
-important settings in the system, that require root privileges. 
+Most menu entries simply start an editor
+or a game or whatever.
+But some menu entries would like to give the user the ability to change
+important settings in the system,
+that require root privileges.
 \fBsu\-to\-root\fP can be used to ask for the root password.
 .SH OPTIONS
 .IP "\-c <command>"
-The command to execute as a string. This option is mandatory.
+The command to execute as a string.
+This option is mandatory.
 .IP "\-p <user>"
-The name of the user to change to, instead of root.
-.IP "\-X"
-The command is a X11 program that does not require a terminal.
-This is to be used with menu entries that declare needs="X11".
+The name of the user to change to,
+instead of root.
+.IP \-X
+The command is a X11 program
+that does not require a terminal.
+This is to be used with menu entries
+that declare needs="X11".
 .SH ENVIRONMENT
 .IP SU_TO_ROOT_X
 Select the su-like program called by \fIsu\-to\-root \-X\fP.
 Supported values are \fIgksu\fP, \fIkdesu\fP, \fIkde4su\fP, \fIktsuss\fP,
- \fIsux\fP, \fIsudo-askpass\fP, \fIgksudo\fP and \fIkdesudo\fP.
+\fIsux\fP, \fIsudo-askpass\fP, \fIgksudo\fP and \fIkdesudo\fP.
 \fIkde4su\fP denotes the KDE4 version of \fBkdesu\fP.
 \fIsudo-askpass\fP require \fBssh-askpass\fP to be installed.
 .IP
-When this variable is not set \fBsu\-to\-root\fP will currently try to use
-\fIgksu\fP, \fIkdesu\fP, \fIkde4su\fP, \fIktsuss\fP, \fIsux\fP and the built-in
-code, in that order with the exception that under a KDE session, \fIkdesu\fP
-and \fIkde4su\fP are preferred over \fIgksu\fP.
+When this variable is not set
+\fBsu\-to\-root\fP will currently try to use
+\fIgksu\fP, \fIkdesu\fP, \fIkde4su\fP, \fIktsuss\fP, \fIsux\fP
+and the built-in code,
+in that order with the exception
+that under a KDE session,
+\fIkdesu\fP and \fIkde4su\fP are preferred over \fIgksu\fP.
 .IP
 The exact set of programs to try and their order is subject to change without
 notice.
 .IP SU_TO_ROOT_SU
 Select the su-like program used in text mode.
-Supported values are \fIsudo\fP, \fIsux\fP and \fIsu\fP, the later being
-the default.
+Supported values are \fIsudo\fP, \fIsux\fP and \fIsu\fP,
+the later being the default.
 .SH FILES
 .IP /etc/su\-to\-rootrc
 .IP ~/.su\-to\-rootrc
-\fBsu\-to\-root\fP will source these files at startup in this order. This lets
-you define and modify the environment variables above without restarting your X
-session.  
+\fBsu\-to\-root\fP will source these files at startup in this order.
+This lets you define
+and modify the environment variables above
+without restarting your X session.
 .SH COPYING
 \fBsu\-to\-root\fP is distributed under the GNU General Public License.
 (GPL 2.0 or greater).
@@ -52,6 +62,6 @@ session.
 Joost Witteveen <[email protected]>
 .P
 X11 support by Morten Brix Pedersen and Bill Allombert
-.RI <[email protected]>
+<[email protected]>
 .SH "SEE ALSO"
 \fBupdate\-menus\fP(1), \fBmenufile\fP(5), \fB/usr/share/doc/menu/html\fP

Reply via email to