Bug#893318: grep.1: Some fixes in the manual

2018-03-29 Thread Bjarni Ingi Gislason
On Tue, Mar 27, 2018 at 03:55:58PM +0200, Santiago R.R. wrote:
> Hi Bjarni,
> 
> El 17/03/18 a las 23:15, Bjarni Ingi Gislason escribió:
> > Package: grep
> > Version: 3.1-2
> > Severity: minor
> > Tags: patch
> > 
> > Dear Maintainer,
> > 
> > Input file is grep.in.1
> > 
> > Test nr. 2:
> > 
> > Enable and fix warnings from 'test-groff'.
> > 
> ???
> 
> Thanks for you bug report.
> 
> could you provide details about how to reproduce those tests (and
> confirm the patch solves the warnings)?
> 

  First:

  A patch for the groff (see bug #53043 on the "bug-groff" list,
savannah.gnu.org/bugs/?53043)

 tmac/an-old.tmac | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 9ae3b9f9..dd8ca295 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -511,7 +511,15 @@
 .
 .ds an-empty \" this is referenced to avoid looping on, e.g., .RB ( \\ )
 .
+.de1 an-inputcheck
+.  if \\$2<2 \{\
+.tm \\n(.F:\\n(.c (macro \\$1): only \\$2 argument, but more are expected
+.  \}
+..
+.
 .de1 RI
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .ds an-result \&\f[R]\\$1\"
 .shift
@@ -526,6 +534,8 @@
 ..
 .
 .de1 IR
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .ds an-result \&\f[I]\,\\$1\f[R]\"
 .shift
@@ -540,6 +550,8 @@
 ..
 .
 .de1 IB
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .ds an-result \&\f[I]\,\\$1\"
 .shift
@@ -554,6 +566,8 @@
 ..
 .
 .de1 BI
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .ds an-result \&\f[B]\\$1\"
 .shift
@@ -568,6 +582,8 @@
 ..
 .
 .de1 RB
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  ds an-result \&\"
 .  while (\\n[.$] >= 2) \{\
 .as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
@@ -579,6 +595,8 @@
 ..
 .
 .de1 BR
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  ds an-result \&\"
 .  while (\\n[.$] >= 2) \{\
 .as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
-- 
2.15.1




  Second: a grep search; search for only one argument to macros for two
alternating fonts:

grep -n -e '^[.] *[BIR][BIRR]  *[^ ]*$' \
  -e '^[.] *[BIR][BIR]  *"[^"]*["]*$'

-- 
Bjarni I. Gislason



Bug#893318: grep.1: Some fixes in the manual

2018-03-27 Thread Santiago R.R.
Hi Bjarni,

El 17/03/18 a las 23:15, Bjarni Ingi Gislason escribió:
> Package: grep
> Version: 3.1-2
> Severity: minor
> Tags: patch
> 
> Dear Maintainer,
> 
> Input file is grep.in.1
> 
> Test nr. 2:
> 
> Enable and fix warnings from 'test-groff'.
> 
…

Thanks for you bug report.

could you provide details about how to reproduce those tests (and
confirm the patch solves the warnings)?

Cheers,

S


signature.asc
Description: PGP signature


Bug#893318: grep.1: Some fixes in the manual

2018-03-17 Thread Bjarni Ingi Gislason
Package: grep
Version: 3.1-2
Severity: minor
Tags: patch

Dear Maintainer,

Input file is grep.in.1

Test nr. 2:

Enable and fix warnings from 'test-groff'.

Input file is /tmp/grep.in.1

:550 (macro BR): only 1 argument, but more are expected
:576 (macro BR): only 1 argument, but more are expected
:583 (macro BR): only 1 argument, but more are expected
:588 (macro BR): only 1 argument, but more are expected
:698 (macro BR): only 1 argument, but more are expected
:816 (macro BR): only 1 argument, but more are expected

chk_manuals: Output is from: test-groff -Tutf8 -b -e -mandoc -rF0 -t -w w -z 



Test nr. 15:

Change the name of a macro for two fonts (e.g., BR and IR) to one letter,
if there is only one argument.
Add the second argument if needed.  It is sometimes part of the first one.

550:.BR \-I
576:.BR \-\^\-line\-buffered
583:.BR grep
588:.BR grep
698:.BR [:xdigit:].
816:.BR )

#

Test nr. 20:

Use a macro to change to the italic font, instead of \fI [1], if
possible.
The macros have the italic corrections, but "\c" removes them.
[1] man-pages(7)

1130:also disables \fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP,
1133:\fB_\fP\fIN\fP\fB_GNU_nonoption_argv_flags_\fP

#

Test nr. 24:


Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of a
name for an option.

289:.BR "gzip -cd foo.gz | grep --label=foo -H something" .
612:.B sort -z
884:.B -v
887:.B -v

#

Test nr. 29:

Check if "\c" is correctly used.  It removes italic correcions, if they
are applied in the macro at the end of last last argument.

801:.BI \e n\c

#

Test nr. 30:

Surround a block of comments with the macros ".ig" and "..".
The .\" at the beginning of each line is then not needed.
Makes it easier to add and remove text and adjust lenght of lines.

NO PATCH

6:.\" Update the above date whenever a change to either this file or
7:.\" grep.c's 'usage' function results in a nontrivial change to the man page.
8:.\" In Emacs, you can update the date by running 'M-x time-stamp'
9:.\" after you make a change that you decide is nontrivial.
10:.\" It is no big deal to forget to update the date.

#

Test nr. 37:

Have a space after a comma in a argumnet to alternating fonts macro

302:.BR \-H , \-n ,

#

  The patch is in the attachment.

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

Kernel: Linux 4.9.80-2 (SMP w/2 CPU cores)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE=is_IS.iso88591 (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages grep depends on:
ii  dpkg  1.19.0.5
ii  install-info  6.5.0.dfsg.1-2
ii  libc6 2.27-2
ii  libpcre3  2:8.39-9

grep recommends no packages.

Versions of packages grep suggests:
ii  libpcre3  2:8.39-9

-- no debconf information

-- 
Bjarni I. Gislason
--- grep.in.1   2018-03-17 02:20:07.0 +
+++ grep.in.1.new   2018-03-17 02:32:53.0 +
@@ -286,7 +286,7 @@ Display input actually coming from stand
 This is especially useful when implementing tools like
 .BR zgrep ,
 e.g.,
-.BR "gzip -cd foo.gz | grep --label=foo -H something" .
+.BR "gzip \-cd foo.gz | grep \-\^\-label=foo \-H something" .
 See also the
 .B \-H
 option.
@@ -299,7 +299,7 @@ within its input file.
 Make sure that the first character of actual line content lies on a
 tab stop, so that the alignment of tabs looks normal.
 This is useful with options that prefix their output to the actual content:
-.BR \-H , \-n ,
+.BR \-H ", " \-n ,
 and
 .BR \-b .
 In order to improve the probability that lines
@@ -547,7 +547,7 @@ whose base name matches
 Ignore any redundant trailing slashes in
 .IR GLOB .
 .TP
-.BR \-I
+.B \-I
 Process a binary file as if it did not contain matching data; this is
 equivalent to the
 .B \-\^\-binary\-files=without-match
@@ -573,19 +573,19 @@ Follow all symbolic links, unlike
 .BR \-r .
 .SS "Other Options"
 .TP
-.BR \-\^\-line\-buffered
+.B \-\^\-line\-buffered
 Use line buffering on output.
 This can cause a performance penalty.
 .TP
 .BR \-U ", " \-\^\-binary
 Treat the file(s) as binary.
 By default, under MS-DOS and MS-Windows,
-.BR grep
+.B grep
 guesses whether a file is text or binary as described for the
 .B \-\^\-binary\-files
 option.
 If
-.BR grep
+.B grep
 decides the file is a text file, it strips the CR characters from the
 original file contents (to make regular expressions with
 .B ^
@@ -609,7 +609,7 @@ Like the
 or
 .B \-\^\-null
 option, this option can be used with commands like
-.B sort -z
+.B sort \-z
 to process arbitrary file names.
 .
 .SH "REGULAR EXPRESSIONS"
@@ -695,7 +695,7 @@ Their names are self explanatory, and th
 .BR [:space:] ,
 .BR [:upper:] ,
 and
-.BR [:xdigit:].
+.BR [:xdigit:] .
 For example,
 .B [[:alnum:]]
 means the character class of numbers and