Package: expect
Version: 5.45.4-4
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 ' $' -e '\\~$' <file>" to find obvious 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?


an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")
an.tmac:<stdin>:111: style: 4 leading space(s) on input line
an.tmac:<stdin>:212: style: 4 leading space(s) on input line
an.tmac:<stdin>:827: misuse, warning: .IR 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.12-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 expect depends on:
ii  libc6       2.40-7
ii  libtcl8.6   8.6.16+dfsg-1
ii  tcl-expect  5.45.4-4
ii  tcl8.6      8.6.16+dfsg-1

expect recommends no packages.

Versions of packages expect suggests:
ii  tk8.6  8.6.16-1

-- no debconf information
Input file is expect.1

Output from "mandoc -T lint  expect.1": (shortened list)


Remove trailing space with: sed -e 's/  *$//'
      1 input text line longer than 80 bytes: By default, it repor...
      1 input text line longer than 80 bytes: Run fsck, and in res...
      1 input text line longer than 80 bytes: Use the extended com...
      1 input text line longer than 80 bytes: can be used.  If EXP...
      1 input text line longer than 80 bytes: itself, first call i...
      1 line scope broken: TP breaks I

-.-.

Output from "test-nroff -mandoc -t -ww -z expect.1": (shortened list)


Remove trailing space with: sed -e 's/  *$//'
      1         Use macro '.I' for one argument or split argument.
      1 .IR is for at least 2 arguments, got 1

-.-.

Reduce space between words.

expect.1:1095:string is not sent to the current process.)   The
expect.1:1155:Any pattern beginning with a "\-" should be protected this way.   
 (All strings
expect.1:2465:early,  your answer may appear echoed back in the middle of the 
question.

-.-.

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.

expect.1:111:    #!/usr/bin/expect \-f
expect.1:212:    #!/usr/bin/expect \-\-

-.-.

Add a "\&" (or a comma (Oxford comma)) after "e.g." and "i.e.",
or use English words
(man-pages(7)).
Abbreviation points should be marked as such and protected against being
interpreted as an end of sentence, if they are not, and that independent
of the current place on the line.

1040:but it reads characters from /dev/tty (i.e. keystrokes from the user).
1054:but it reads characters from stdin (i.e. keystrokes from the user).
1912:fails (e.g. when

-.-.

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

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"

[List of affected lines removed.]

-.-

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 74, length 91

Run fsck, and in response to its questions, answer "yes", "no" or give control 
back to you,

Line 1023, length 143

By default, it reports on the current spawn id.  An optional spawn id 
specification may be given for information on that spawn id.  For example

Line 1262, length 89

itself, first call interpreter (perhaps by using an escape character), and then 
press ^Z.

Line 2283, length 83

Use the extended command names if you need this compatibility between 
environments.

Line 2450, length 104

can be used.  If EXPECT_PROMPT doesn't exist, the code still has a good chance 
of functioning correctly.


-.-.

Do not use more than two space characters between sentences or (better)
only a new line character.

1095:string is not sent to the current process.)   The
1155:Any pattern beginning with a "\-" should be protected this way.    (All 
strings

-.-.

The name of a man page is typeset in bold and the section in roman
(see man-pages(7)).

46:See libexpect(3).
214:Note that the usual getopt(3) and execve(2) conventions must be observed
266:are Tcl commands (see tcl(3)).
444:takes no other actions beyond what the normal _exit(2) procedure does.
448:typically documented under exit(3).)
1882:initialized so that all settings are "sane" (according to stty(1)).
2191:See signal(3) for more info.

-.-.

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

1687:must be separated.  For example, "set send_slow {10 .001}" would force
1701:transitions.  The third parameter is a measure of variability where .1
1714:    set send_human {.1 .3 1 .05 2}
1721:    set send_human {.4 .4 .2 .5 100}

-.-.

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

843:.I any_spawn_id.

-.-.

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

[List of affected lines removed.]

-.-

Space after an end of sentence.

[List of affected lines removed.]

-.-

Use thousand markers to make large numbers easy to read

2353:timeouts of above 1000000 to be equivalent to 0.

-.-.

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

[List of affected lines removed.]

-.-

Section headings (.SH and .SS) do not need quoting their arguments.

2437:.SH "EXPECT HINTS"
2559:.SH "SEE ALSO"

-.-.

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

an.tmac:<stdin>:1: style: .TH missing fourth argument; consider package/project 
name and version (e.g., "groff 1.23.0")
an.tmac:<stdin>:111: style: 4 leading space(s) on input line
an.tmac:<stdin>:212: style: 4 leading space(s) on input line
an.tmac:<stdin>:827: misuse, warning: .IR is for at least 2 arguments, got 1
        Use macro '.I' for one argument or split argument.

-.-.

Generally:

Split (sometimes) lines after a punctuation mark; before a conjunction.
--- expect.1    2025-03-06 21:37:02.104403298 +0000
+++ expect.1.new        2025-03-07 00:41:31.424749481 +0000
@@ -43,7 +43,8 @@ and
 .BR wish .
 .B Expect
 can also be used directly in C or C++ (that is, without Tcl).
-See libexpect(3).
+See
+.BR libexpect (3).
 .PP
 The name "Expect" comes from the idea of
 .I send/expect
@@ -71,7 +72,10 @@ restart it (again and again) until it do
 then hand over control to you.
 .TP
 \(bu
-Run fsck, and in response to its questions, answer "yes", "no" or give control 
back to you,
+Run fsck,
+and in response to its questions,
+answer "yes", "no"
+or give control back to you,
 based on predetermined criteria.
 .TP
 \(bu
@@ -107,9 +111,11 @@ for a list of commands to execute.
 .B Expect
 may also be invoked implicitly on systems which support the #!\& notation
 by marking the script executable, and making the first line in your script:
+.nf
 
     #!/usr/bin/expect \-f
 
+.fi
 Of course, the path must accurately describe where
 .B Expect
 lives.  /usr/bin is just an example.
@@ -208,10 +214,14 @@ This can usefully be placed in the #!\&
 interpretation by Expect.  For example, the following will leave the
 original arguments (including the script name) in the variable
 .IR argv .
+.nf
 
     #!/usr/bin/expect \-\-
 
-Note that the usual getopt(3) and execve(2) conventions must be observed
+.fi
+Note that the usual
+.BR getopt "(3) and " execve (2)
+conventions must be observed
 when adding arguments to the #!\& line.
 .PP
 The file $exp_library/expect.rc is sourced automatically if present, unless
@@ -263,7 +273,8 @@ Commands used here but not defined (e.g.
 .BR set ,
 .BR if ,
 .BR exec )
-are Tcl commands (see tcl(3)).
+are Tcl commands (see
+.BR tcl (3)).
 .B Expect
 supports additional commands, described below.
 Unless otherwise specified, commands return the empty string.
@@ -291,7 +302,6 @@ program while "expect" with a lower-case
 command within the
 .B Expect
 program.)
-.I
 .TP 6
 .BI close " [\-slave] [\-onexec 0|1] [\-i spawn_id]"
 closes the connection to the current process.
@@ -441,11 +451,14 @@ Upon exiting,
 all connections to spawned processes are closed.  Closure will be detected
 as an EOF by spawned processes.
 .B exit
-takes no other actions beyond what the normal _exit(2) procedure does.
+takes no other actions beyond what the normal
+.BR _exit (2)
+procedure does.
 Thus, spawned processes that do not check for EOF may continue to run.
 (A variety of conditions are important to determining, for example, what
 signals a spawned process will be sent, but these are system-dependent,
-typically documented under exit(3).)
+typically documented under
+.BR exit (3).)
 Spawned processes that continue to run will be inherited by init.
 
 .I status
@@ -824,7 +837,7 @@ password" from the spawn_id named by $pr
 
 .fi
 The value of the global variable
-.IR any_spawn_id
+.I any_spawn_id
 may be used to match patterns to any spawn_ids that are named
 with all other
 .B \-i
@@ -840,7 +853,7 @@ is made available to any other patterns
 in the same
 .B expect
 command associated with
-.I any_spawn_id.
+.IR any_spawn_id .
 
 The
 .B \-i
@@ -1020,7 +1033,11 @@ command was executed (not when its patte
 The \-info flag causes
 .B expect_before
 to return the current specifications of what patterns it will match.
-By default, it reports on the current spawn id.  An optional spawn id 
specification may be given for information on that spawn id.  For example
+By default,
+it reports on the current spawn id.
+An optional spawn id specification may be given for information on that
+spawn id.
+For example
 .nf
 
     expect_before \-info \-i $proc
@@ -1037,7 +1054,7 @@ The output of the \-info flag can be reu
 .BI expect_tty " [expect_args]"
 is like
 .B expect
-but it reads characters from /dev/tty (i.e. keystrokes from the user).
+but it reads characters from /dev/tty (i.e.\& keystrokes from the user).
 By default, reading is performed in cooked mode.
 Thus, lines must end with a return in order for
 .B expect
@@ -1051,7 +1068,7 @@ command below).
 .BI expect_user " [expect_args]"
 is like
 .B expect
-but it reads characters from stdin (i.e. keystrokes from the user).
+but it reads characters from stdin (i.e.\& keystrokes from the user).
 By default, reading is performed in cooked mode.
 Thus, lines must end with a return in order for
 .B expect
@@ -1092,7 +1109,8 @@ and the stdout and stderr of the current
 .IP
 String-body pairs may be specified as arguments, in which case the
 body is executed when the corresponding string is entered.  (By default, the
-string is not sent to the current process.)   The
+string is not sent to the current process.)
+The
 .B interpreter
 command is assumed, if the final body is missing.
 .IP
@@ -1152,8 +1170,8 @@ command uses glob-style patterns by defa
 flag may be used to protect patterns that might otherwise match
 .B interact
 flags from doing so.
-Any pattern beginning with a "\-" should be protected this way.    (All strings
-starting with "\-" are reserved for future options.)
+Any pattern beginning with a "\-" should be protected this way.
+(All strings starting with "\-" are reserved for future options.)
 
 The
 .B \-re
@@ -1259,7 +1277,10 @@ If you really want to send a SIGSTOP to
 consider spawning csh first and then running your program.
 On the other hand, if you want to send a SIGSTOP to
 .B Expect
-itself, first call interpreter (perhaps by using an escape character), and 
then press ^Z.
+itself,
+first call interpreter
+(perhaps by using an escape character),
+and then press ^Z.
 .IP
 String-body pairs can be used as a shorthand for avoiding having
 to enter the interpreter and execute commands interactively.  The previous
@@ -1684,7 +1705,7 @@ controlled by the value of the variable
 element list.  The first element is an integer that describes the
 number of bytes to send atomically.  The second element is a real
 number that describes the number of seconds by which the atomic sends
-must be separated.  For example, "set send_slow {10 .001}" would force
+must be separated.  For example, "set send_slow {10 0.001}" would force
 "send \-s" to send strings with 1 millisecond in between each 10
 characters sent.
 
@@ -1698,7 +1719,7 @@ the variable "send_human" which takes a
 two elements are average interarrival time of characters in seconds.
 The first is used by default.  The second is used at word endings, to
 simulate the subtle pauses that occasionally occur at such
-transitions.  The third parameter is a measure of variability where .1
+transitions.  The third parameter is a measure of variability where 0.1
 is quite variable, 1 is reasonably variable, and 10 is quite
 invariable.  The extremes are 0 to infinity.  The last two parameters
 are, respectively, a minimum and maximum interarrival time.
@@ -1711,14 +1732,14 @@ example, the following command emulates
 consistent typist:
 .nf
 
-    set send_human {.1 .3 1 .05 2}
+    set send_human {0.1 0.3 1 0.05 2}
     send \-h "I'm hungry.  Let's do lunch."
 
 .fi
 while the following might be more suitable after a hangover:
 .nf
 
-    set send_human {.4 .4 .2 .5 100}
+    set send_human {0.4 0.4 0.2 0.5 100}
     send \-h "Goodd party lash night!"
 
 .fi
@@ -1879,7 +1900,8 @@ This is not supported on all systems.
 Internally,
 .B spawn
 uses a pty, initialized the same way as the user's tty.  This is further
-initialized so that all settings are "sane" (according to stty(1)).
+initialized so that all settings are "sane" (according to
+.BR stty (1)).
 If the variable
 .I stty_init
 is defined, it is interpreted in the style of stty arguments
@@ -1909,7 +1931,7 @@ If
 .I program
 cannot be spawned successfully because
 .BR exec (2)
-fails (e.g. when
+fails (e.g.\& when
 .I program
 doesn't exist), an error message will be returned by the next
 .B interact
@@ -2188,7 +2210,9 @@ to
 The disconnect command sets SIGALRM to SIG_IGN (ignore).  You can reenable
 this as long as you disable it during subsequent spawn commands.
 
-See signal(3) for more info.
+See
+.BR signal (3)
+for more info.
 .TP
 .BI wait " [args]"
 delays until a spawned process (or
@@ -2280,7 +2304,8 @@ For this reason, most of the
 commands are also available as "exp_XXXX".
 Commands and variables beginning with "exp", "inter", "spawn",
 and "timeout" do not have aliases.
-Use the extended command names if you need this compatibility between 
environments.
+Use the extended command names
+if you need this compatibility between environments.
 
 .B Expect
 takes a rather liberal view of scoping.
@@ -2350,7 +2375,7 @@ doesn't know about.  Please find out wha
 back to me.
 
 Ultrix 4.1 (at least the latest versions around here) considers
-timeouts of above 1000000 to be equivalent to 0.
+timeouts of above 1,000,000 to be equivalent to 0.
 
 Digital UNIX 4.0A (and probably other versions) refuses to allocate
 ptys if you define a SIGCHLD handler.  See grantpt page for more info.
@@ -2434,7 +2459,7 @@ the command (i.e., sleep).
 The expect_background command ignores \-timeout arguments and has no
 concept of timeouts in general.
 
-.SH "EXPECT HINTS"
+.SH EXPECT HINTS
 There are a couple of things about
 .B Expect
 that may be non-intuitive.
@@ -2447,7 +2472,9 @@ shells, portably automating rlogin can b
 the prompt.  A reasonable convention is to have users store a regular
 expression describing their prompt (in particular, the end of it) in
 the environment variable EXPECT_PROMPT.  Code like the following
-can be used.  If EXPECT_PROMPT doesn't exist, the code still has a good chance 
of functioning correctly.
+can be used.
+If EXPECT_PROMPT doesn't exist,
+the code still has a good chance of functioning correctly.
 .nf
 
     set prompt "(%|#|\e\e$) $"          ;# default prompt
@@ -2556,7 +2583,7 @@ The result is a script which may be exec
 When invoked, it runs the
 .B Expect
 script.
-.SH "SEE ALSO"
+.SH SEE ALSO
 .BR Tcl (3),
 .BR libexpect (3)
 .br
  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

-.-

  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 via email to