]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
7 years agomore renaming from mdocml to mandoc
Ingo Schwarze [Thu, 20 Jul 2017 16:24:53 +0000 (16:24 +0000)]
more renaming from mdocml to mandoc

7 years agomention -Tlint to stdout
Ingo Schwarze [Thu, 20 Jul 2017 16:23:56 +0000 (16:23 +0000)]
mention -Tlint to stdout

7 years agoMAP_PRIVATE is pointless without PROT_WRITE
Ingo Schwarze [Thu, 20 Jul 2017 15:41:26 +0000 (15:41 +0000)]
MAP_PRIVATE is pointless without PROT_WRITE

7 years agoFor -Tlint, put parser messages on stdout instead of stderr.
Ingo Schwarze [Thu, 20 Jul 2017 15:26:41 +0000 (15:26 +0000)]
For -Tlint, put parser messages on stdout instead of stderr.

Originally, naddy@ requested this in 2011 (or maybe even earlier).
It was discussed with joerg@, kristaps@, naddy@, and espie@ in 2011,
and everybody agreed in principle, but it was postponed because
kristaps@ wanted to do some cleanup of the message system first.
Meanwhile, message infrastructure was improved about a dozen times...

This makes long, tedious commands like "mandoc -Tlint *.1 2>&1 | less"
unnecessary and allows simple ones like "man -l -Tlint *.1".

7 years agoDo not call err(3) from the parser. Call mandoc_vmsg() and
Ingo Schwarze [Thu, 20 Jul 2017 14:36:36 +0000 (14:36 +0000)]
Do not call err(3) from the parser.  Call mandoc_vmsg() and
return failure such that we can continue with the next file.

7 years agocorrectly handle letters in .Nx arguments; improves for example
Ingo Schwarze [Thu, 20 Jul 2017 12:54:02 +0000 (12:54 +0000)]
correctly handle letters in .Nx arguments; improves for example
getpgid(2), ac(8), ldconfig(8), mount_ffs(8), sa(8), ttyflags(8), ...

7 years agothree ideas found in a different TODO file
Ingo Schwarze [Thu, 20 Jul 2017 11:58:31 +0000 (11:58 +0000)]
three ideas found in a different TODO file

7 years ago* clean catman.o which was missing
Ingo Schwarze [Thu, 20 Jul 2017 11:41:54 +0000 (11:41 +0000)]
* clean catman.o which was missing
* delete WWW_OBJS which i don't use
* do not complain about *.out_markdown
* bump VERSION to 1.14.2 (not released yet)

7 years agosync
Ingo Schwarze [Thu, 20 Jul 2017 11:24:19 +0000 (11:24 +0000)]
sync

7 years agoFix incorrectly swapped labels of left/right arrows; from bentley@.
Ingo Schwarze [Thu, 20 Jul 2017 11:07:27 +0000 (11:07 +0000)]
Fix incorrectly swapped labels of left/right arrows; from bentley@.

7 years agodelete some entries that have been taken care of
Ingo Schwarze [Wed, 19 Jul 2017 21:48:37 +0000 (21:48 +0000)]
delete some entries that have been taken care of

7 years agomore bits for 1.14.2
Ingo Schwarze [Wed, 19 Jul 2017 21:01:59 +0000 (21:01 +0000)]
more bits for 1.14.2

7 years agoPrefer arch-dependent over arch-independent pages if the name priority,
Ingo Schwarze [Wed, 19 Jul 2017 14:05:13 +0000 (14:05 +0000)]
Prefer arch-dependent over arch-independent pages if the name priority,
the section number, and all names match.  Changes little on installed
systems except the ordering of apropos(1) results, because we install
base and Xenocara manuals in different trees, but fixes lookup of pages
like apm(4) vs. apm(4/amd64) in man.cgi(8).
Issue discovered by martian67 on freenode and reported via tj@.

7 years agoRun the regression tests iteratively rather than recursively.
Ingo Schwarze [Tue, 18 Jul 2017 18:47:06 +0000 (18:47 +0000)]
Run the regression tests iteratively rather than recursively.
Simpler user interface, better summary output, simpler code,
and slightly faster.
Inspired by espie@'s request to avoid needless recursive make(1)
in the OpenBSD regression testing tree.

7 years agoThe only elements using floats are dt.It-tag,
Ingo Schwarze [Sun, 16 Jul 2017 18:45:00 +0000 (18:45 +0000)]
The only elements using floats are dt.It-tag,
so the only elements allowed to the right of them are dd.It-tag.
Fixes overlapping rendering after long tag lists without bodies,
for example in the Xenocara apm(4) manual.  Issue reported by tj@.

7 years agotest -diag -width and -inset -width
Ingo Schwarze [Sun, 16 Jul 2017 17:59:43 +0000 (17:59 +0000)]
test -diag -width and -inset -width

7 years agoIn .Bl -tag and -hang, do not print a margin-left style attribute
Ingo Schwarze [Sat, 15 Jul 2017 17:57:51 +0000 (17:57 +0000)]
In .Bl -tag and -hang, do not print a margin-left style attribute
for each individual item if the -width argument matches the default
of 6n.  Suggested by Steffen Nurpmeso <steffen at sdaoden dot eu>
on <groff at GNU dot org> in April 2017.

7 years agouse the same width increase logic for .Bl -hang as for .Bl -tag
Ingo Schwarze [Sat, 15 Jul 2017 17:29:31 +0000 (17:29 +0000)]
use the same width increase logic for .Bl -hang as for .Bl -tag

7 years agoIf -column, -diag, -inset, -item, or -ohang lists have a -width,
Ingo Schwarze [Sat, 15 Jul 2017 16:40:29 +0000 (16:40 +0000)]
If -column, -diag, -inset, -item, or -ohang lists have a -width,
don't just talk about ignoring it, actually do ignore it.
No change for terminal output, improves HTML output.

7 years agocorrect left margins for different classes of definition lists
Ingo Schwarze [Sat, 15 Jul 2017 16:35:52 +0000 (16:35 +0000)]
correct left margins for different classes of definition lists

7 years agoprint the right character for mathematical overbar; from bentley@
Ingo Schwarze [Sat, 15 Jul 2017 16:26:17 +0000 (16:26 +0000)]
print the right character for mathematical overbar; from bentley@

7 years agoImprove rev. 1.250 further:
Ingo Schwarze [Sat, 15 Jul 2017 13:17:49 +0000 (13:17 +0000)]
Improve rev. 1.250 further:
If a database is empty, we already don't write a database file and
delete an existing one.  If none exists, that only means the database
was empty and remains so, which is not an error.  So don't nag about
it, in particular because that would be a weekly(8) annoyance.
Issue reported by jmc@.

7 years agofirst draft of the 1.14.2 release notes
Ingo Schwarze [Sat, 15 Jul 2017 01:11:19 +0000 (01:11 +0000)]
first draft of the 1.14.2 release notes

7 years agoalways give commas their own <mo> element,
Ingo Schwarze [Fri, 14 Jul 2017 18:18:26 +0000 (18:18 +0000)]
always give commas their own <mo> element,
suggested by bentley@, improves e.g. glMultMatrix(3)

7 years agoThe .Dd and .TH macros must interrupt .ce, too;
Ingo Schwarze [Fri, 14 Jul 2017 17:16:16 +0000 (17:16 +0000)]
The .Dd and .TH macros must interrupt .ce, too;
fixing tree corruption and assertion failure found by jsg@ with afl(1)

7 years agoExplicitly initialize a variable where the compiler is (understandably)
Ingo Schwarze [Fri, 14 Jul 2017 16:49:39 +0000 (16:49 +0000)]
Explicitly initialize a variable where the compiler is (understandably)
unable to figure out that it is never used uninitialized.
While here, tweak the content of the variable to make its usage
easier to understand.  No functional change.

7 years agoFix an assertion failure triggered by print_otag("sw+-l", NULL).
Ingo Schwarze [Fri, 14 Jul 2017 16:28:38 +0000 (16:28 +0000)]
Fix an assertion failure triggered by print_otag("sw+-l", NULL).
Even though we skip the style when the argument is NULL,
we must still consume the options.
Not found with afl(1), but during manual testing of the previous patch...

7 years agoHandle .Bl -compact via CSS rather than writing individual style
Ingo Schwarze [Fri, 14 Jul 2017 16:06:44 +0000 (16:06 +0000)]
Handle .Bl -compact via CSS rather than writing individual style
attributes into .It blocks; suggested by Steffen Nurpmeso <steffen
at sdaoden dot eu> on <groff at GNU dot org> in April 2017.

Delete margin-bottom and margin-top style names and the 'v' argument
letter from print_otag() because they are no longer used.

7 years agoprint HTML character references as 4+ digits hexadecimal, like Unicode;
Ingo Schwarze [Fri, 14 Jul 2017 15:56:37 +0000 (15:56 +0000)]
print HTML character references as 4+ digits hexadecimal, like Unicode;
from bentley@, tweaked by me

7 years agodo not print <math class="eqn"><mrow></mrow></math> for empty .EQ;
Ingo Schwarze [Fri, 14 Jul 2017 13:32:35 +0000 (13:32 +0000)]
do not print <math class="eqn"><mrow></mrow></math> for empty .EQ;
issue reported by bentley@

7 years agoeqn(7) nits from bentley@
Ingo Schwarze [Fri, 14 Jul 2017 12:48:37 +0000 (12:48 +0000)]
eqn(7) nits from bentley@

7 years agoeqn(7) .EQ has to break man(7) next-line scope, or tree corruption
Ingo Schwarze [Thu, 13 Jul 2017 15:13:18 +0000 (15:13 +0000)]
eqn(7) .EQ has to break man(7) next-line scope, or tree corruption
and use after free many ensue; again found by jsg@ with afl(1)

7 years agoSimplify by creating struct roff_node syntax tree nodes for tbl(7)
Ingo Schwarze [Sat, 8 Jul 2017 17:52:49 +0000 (17:52 +0000)]
Simplify by creating struct roff_node syntax tree nodes for tbl(7)
right from roff_parseln() rather than delegating to read.c,
similar to what i just did for eqn(7).

The interface function roff_span() becomes obsolete and is deleted,
the former interface function roff_addtbl() becomes static,
the interface functions tbl_read() and tbl_cdata() become void,
and minus twelve linus of code.

No functional change.

7 years agofix an assertion failure triggered by .ce in next-line scope;
Ingo Schwarze [Sat, 8 Jul 2017 15:28:09 +0000 (15:28 +0000)]
fix an assertion failure triggered by .ce in next-line scope;
found by jsg@ with afl(1)

7 years ago1. Eliminate struct eqn, instead use the existing members
Ingo Schwarze [Sat, 8 Jul 2017 14:51:04 +0000 (14:51 +0000)]
1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

7 years agoCorrectly handle horizontal spans at the beginning of rows,
Ingo Schwarze [Sat, 8 Jul 2017 13:43:15 +0000 (13:43 +0000)]
Correctly handle horizontal spans at the beginning of rows,
fixing an assertion failure found by jsg@ with afl(1).

While here, also drop printing of whitespace in tbl_data()
which makes no difference because column positioning code
in term_tbl() already takes care of that.

7 years agogarbage collect unused enum member EQN_ROOT
Ingo Schwarze [Fri, 7 Jul 2017 19:39:30 +0000 (19:39 +0000)]
garbage collect unused enum member EQN_ROOT

7 years agoadd parentheses to the output where required for disambiguation
Ingo Schwarze [Fri, 7 Jul 2017 19:06:31 +0000 (19:06 +0000)]
add parentheses to the output where required for disambiguation

7 years agosimplify the eqn_box_makebinary() function by removing the trivial pos
Ingo Schwarze [Fri, 7 Jul 2017 17:16:17 +0000 (17:16 +0000)]
simplify the eqn_box_makebinary() function by removing the trivial pos
parameter; also minus two lines of code; no functional change

7 years agoRadically simplify the definitions what the message levels ERROR
Ingo Schwarze [Fri, 7 Jul 2017 16:20:30 +0000 (16:20 +0000)]
Radically simplify the definitions what the message levels ERROR
and WARNING mean: minus 20 lines of mdoc source.  OK jmc@.

7 years agoNow that we have the -Wstyle message level, downgrade six warnings
Ingo Schwarze [Thu, 6 Jul 2017 22:59:48 +0000 (22:59 +0000)]
Now that we have the -Wstyle message level, downgrade six warnings
that are not syntax mistakes and that do not cause wrong formatting
or content to style suggestions.
Also upgrade two warnings that may cause information loss to errors.

7 years agoFix operator precedence according to Brian W. Kernighan and Lorinda
Ingo Schwarze [Thu, 6 Jul 2017 00:19:54 +0000 (00:19 +0000)]
Fix operator precedence according to Brian W. Kernighan and Lorinda
L. Cherry, "Typesetting Mathematics - User's Guide (Second Edition)",
August 15, 1978, paragraph 23; swarm of bugs pointed out by bentley@.

7 years agoThe EQN_LISTONE box type is pointless.
Ingo Schwarze [Wed, 5 Jul 2017 15:03:27 +0000 (15:03 +0000)]
The EQN_LISTONE box type is pointless.
Simplify by just using EQN_LIST with expectargs = 1.
Noticed while investigating a bug report from bentley@.
No functional change.

7 years agonits about trailing punctuation found with mandoc -Tlint
Ingo Schwarze [Wed, 5 Jul 2017 12:25:17 +0000 (12:25 +0000)]
nits about trailing punctuation found with mandoc -Tlint

7 years agovarious nits found with mandoc -Tlint
Ingo Schwarze [Tue, 4 Jul 2017 23:40:01 +0000 (23:40 +0000)]
various nits found with mandoc -Tlint

7 years agoFix handling of \} on roff request lines.
Ingo Schwarze [Tue, 4 Jul 2017 22:52:00 +0000 (22:52 +0000)]
Fix handling of \} on roff request lines.
Cures bogus error messages in pages generated with pod2man(1).

7 years agoIt turns out association of tbl spans with layout rows is simpler than
Ingo Schwarze [Tue, 4 Jul 2017 21:08:29 +0000 (21:08 +0000)]
It turns out association of tbl spans with layout rows is simpler than
i thought.  Fixing a bug in curs_addch(3) and minus 25 lines of code.

7 years agoadjust to today's change of the OpenBSD groff port
Ingo Schwarze [Tue, 4 Jul 2017 21:01:17 +0000 (21:01 +0000)]
adjust to today's change of the OpenBSD groff port

7 years agoMessages of the -Wbase level now print STYLE:. Since this
Ingo Schwarze [Tue, 4 Jul 2017 15:24:36 +0000 (15:24 +0000)]
Messages of the -Wbase level now print STYLE:.  Since this
causes horrible churn anyway, profit of the opportunity to stop
excessive testing, such that this is hopefully the last instance
of such churn.  Consistently use OpenBSD RCS tags, blank .Os,
blank fourth .TH argument, and Mdocdate like everywhere else.
Use -Ios=OpenBSD for platform-independent predictable output.

7 years agoPrinting "BASE:" in messages about violations of base system conventions
Ingo Schwarze [Tue, 4 Jul 2017 14:40:38 +0000 (14:40 +0000)]
Printing "BASE:" in messages about violations of base system conventions
is confusing, simply print "STYLE:", which is intuitive and does not
sound excessively alarming; suggested by jmc@, OK tedu@ jmc@.

7 years agoreport trailing delimiters after macros where they are usually a mistake;
Ingo Schwarze [Mon, 3 Jul 2017 17:33:05 +0000 (17:33 +0000)]
report trailing delimiters after macros where they are usually a mistake;
the idea came up in a discussion with Thomas Klausner <wiz at NetBSD>

7 years agowarn about time machines; suggested by Thomas Klausner <wiz @ NetBSD>
Ingo Schwarze [Mon, 3 Jul 2017 13:40:18 +0000 (13:40 +0000)]
warn about time machines; suggested by Thomas Klausner <wiz @ NetBSD>

7 years agoIf a single page references the same non-existent manual more than
Ingo Schwarze [Sun, 2 Jul 2017 21:18:29 +0000 (21:18 +0000)]
If a single page references the same non-existent manual more than
once, print "(N times)" after the message "referenced manual not
found", to lessen the risk that people fix the first instance and
miss the others; jmc@ confirmed that this is useful.

7 years agoadd warning "cross reference to self"; inspired by mdoclint
Ingo Schwarze [Sun, 2 Jul 2017 15:31:59 +0000 (15:31 +0000)]
add warning "cross reference to self"; inspired by mdoclint

7 years agoWhen checking cross references with -Tlint, ultimately fall back to
Ingo Schwarze [Sat, 1 Jul 2017 12:54:07 +0000 (12:54 +0000)]
When checking cross references with -Tlint, ultimately fall back to
looking in the current working directory.  Not a security issue
because the files are never open(2)ed, only access(2)ed.
Requested by jmc@ and inspired by mdoclint(1).

This cannot be perfect because it only works for files having the
exact filename ./pagename.sec - mandoc has no way to figure out
which files might contain a manual for multiple names, or that files
in autohell might be called ./pagename.man.in instead, or which
subdirectories might contain additional source files.  Also, it may
hide messages if you have bogus stuff lying around in the directory
where you run mandoc -Tlint.  But jmc@ considers it important, and
good enough for everyday use.

Also avoid leaking the memory for the file name while here.

7 years agoWhen checking the validity of cross references with -Tlint,
Ingo Schwarze [Sat, 1 Jul 2017 12:02:31 +0000 (12:02 +0000)]
When checking the validity of cross references with -Tlint,
fall back from database search to file system search
just like man(1) does when looking up manuals.

This is not too expensive because on a system having up-to-date
mandoc.db(5) files, it only prolongs the time needed to check
*invalid* references - and you are not supposed to have many of
those, right?  And on a system with missing or invalid mandoc.db(5)
files, spending a bit of time and warning loudly about the real
problem is also better than quickly issuing bogus warnings about
cross references that are actually valid.

7 years agoBasic reporting of .Xrs to manual pages that don't exist
Ingo Schwarze [Sat, 1 Jul 2017 09:47:30 +0000 (09:47 +0000)]
Basic reporting of .Xrs to manual pages that don't exist
in the base system, inspired by mdoclint(1).

We are able to do this because (1) the -mdoc parser, the -Tlint validator,
and the man(1) manual page lookup code are all in the same program
and (2) the mandoc.db(5) database format allows fast lookup.

Feedback from, previous versions tested by, and OK jmc@.

A few features will be added to this in the tree, step by step.

7 years agoSkip whitespace at the beginning of eqn(7) nodes,
Ingo Schwarze [Thu, 29 Jun 2017 16:31:15 +0000 (16:31 +0000)]
Skip whitespace at the beginning of eqn(7) nodes,
in particular ~ and ^ that misrendered;
found by bentley@ in glCopyTexSubImage1D(3); also affected
glAccum(3), glClipPlane(3), glDrawPixels(3), glEvalMesh(3), and others.

7 years agowarn about some non-portable idioms in .Bl -column;
Ingo Schwarze [Thu, 29 Jun 2017 15:22:17 +0000 (15:22 +0000)]
warn about some non-portable idioms in .Bl -column;
triggered by a question from Yuri Pankov (illumos)

7 years agoClarify that .Ta as a line macro is a portability problem,
Ingo Schwarze [Thu, 29 Jun 2017 13:17:00 +0000 (13:17 +0000)]
Clarify that .Ta as a line macro is a portability problem,
even though mandoc(1) handles it;
triggered by a question from Yuri Pankov (illumos).

7 years agofix incomplete handling of roff(7) nodes in man(7) block next-line scope;
Ingo Schwarze [Wed, 28 Jun 2017 12:52:45 +0000 (12:52 +0000)]
fix incomplete handling of roff(7) nodes in man(7) block next-line scope;
assertion failure in tclsh(1) reported by deraadt@ via bentley@

7 years agoRewrite half of this, i was completely unaware how bad it was.
Ingo Schwarze [Wed, 28 Jun 2017 00:59:57 +0000 (00:59 +0000)]
Rewrite half of this, i was completely unaware how bad it was.
Remove several lies, lots of duplicate information,
and a lengthy discussion of features we don't support.
Clarify the wording in some places and make it more concise in others.
Delete examples from where they don't belong
and write a new EXAMPLES section from scratch.

7 years agotest inter-column spacing
Ingo Schwarze [Tue, 27 Jun 2017 19:51:48 +0000 (19:51 +0000)]
test inter-column spacing

7 years agoImplement spacing of columns as defined in the table layout;
Ingo Schwarze [Tue, 27 Jun 2017 18:25:02 +0000 (18:25 +0000)]
Implement spacing of columns as defined in the table layout;
this is for example used by lftp(1)
and, ironically, misused by our very own tbl(7) manual...

7 years agowarn about .Ns macros that have no effect because they are followed
Ingo Schwarze [Tue, 27 Jun 2017 12:18:00 +0000 (12:18 +0000)]
warn about .Ns macros that have no effect because they are followed
by an isolated closing delimiter; inspired by mdoclint

7 years agocatch up with the recent eqn(7) improvements
Ingo Schwarze [Mon, 26 Jun 2017 20:11:45 +0000 (20:11 +0000)]
catch up with the recent eqn(7) improvements

7 years agoComplete rewrite of the lexer in a single function with four operation
Ingo Schwarze [Mon, 26 Jun 2017 20:09:04 +0000 (20:09 +0000)]
Complete rewrite of the lexer in a single function with four operation
modes instead of four functions, resulting in considerable
simplification, fifty lines less of code, fifteen fewer automatic
variables, and several bug fixes, for example:

1. The delim control statement consumes exactly two bytes of input,
requires no whitespace after these two bytes, and does not treat
quotes in any special way.
2. If the argument of left, right, gfont, gsize, or size is defined
as an alias, only the first word of the value is used as the
delimiter, font name, or font size.
3. If a back, fwd, down, or up keyword is followed by another keyword
instead of the required number, GNU eqn does nothing useful, but
typically errors out.  So no need to have special handling (with
an ugly goto!) for it in mandoc.

Also getting rid of one pointless static buffer and twelve redundant
calls to strlcpy(3).

7 years agowhen splitting a composite word,
Ingo Schwarze [Mon, 26 Jun 2017 11:04:47 +0000 (11:04 +0000)]
when splitting a composite word,
do not forget to close the inserted list box

7 years agoCatch typos in .Sh names; suggested by jmc@.
Ingo Schwarze [Sun, 25 Jun 2017 17:43:45 +0000 (17:43 +0000)]
Catch typos in .Sh names; suggested by jmc@.

I'm using a very simple, linear time / zero space fuzzy string
matching heuristic rather than a full Levenshtein metric, to keep
the code both simple and fast.

7 years agotest new MT macro
Ingo Schwarze [Sun, 25 Jun 2017 14:09:44 +0000 (14:09 +0000)]
test new MT macro

7 years agocope with changes in BASE messages
Ingo Schwarze [Sun, 25 Jun 2017 12:51:47 +0000 (12:51 +0000)]
cope with changes in BASE messages

7 years agoadd support for the MT and ME mailto macros, used for example in wg(8);
Ingo Schwarze [Sun, 25 Jun 2017 11:42:02 +0000 (11:42 +0000)]
add support for the MT and ME mailto macros, used for example in wg(8);
patch from bentley@

7 years agodelete useless .Ns macro that jmc@ found with mdoclint(1)
Ingo Schwarze [Sat, 24 Jun 2017 21:08:44 +0000 (21:08 +0000)]
delete useless .Ns macro that jmc@ found with mdoclint(1)

7 years agodocument message "unknown architecture"
Ingo Schwarze [Sat, 24 Jun 2017 19:06:51 +0000 (19:06 +0000)]
document message "unknown architecture"

7 years agooperating system dependent message about unknown architecture;
Ingo Schwarze [Sat, 24 Jun 2017 18:58:33 +0000 (18:58 +0000)]
operating system dependent message about unknown architecture;
inspired by mdoclint

7 years agodelete old, undocumented, obsolete section names that nobody uses
Ingo Schwarze [Sat, 24 Jun 2017 17:37:06 +0000 (17:37 +0000)]
delete old, undocumented, obsolete section names that nobody uses

7 years agoin the base system, suggest leaving .Os blank; inspired by mdoclint
Ingo Schwarze [Sat, 24 Jun 2017 15:59:50 +0000 (15:59 +0000)]
in the base system, suggest leaving .Os blank; inspired by mdoclint

7 years agoSplit -Wstyle into -Wstyle and the even lower -Wbase, and add
Ingo Schwarze [Sat, 24 Jun 2017 14:38:32 +0000 (14:38 +0000)]
Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

7 years agoDelete .St -p1003.1-2013.
Ingo Schwarze [Sat, 24 Jun 2017 13:49:29 +0000 (13:49 +0000)]
Delete .St -p1003.1-2013.
It is an OpenBSD addition that did not get used a single time in
three years, and groff did not pick it up either, so removing it
does not affect any existing manuals anywhere.
Cleanup suggested by jmc@, OK bentley@.

7 years agoConsistently treat character escape sequences as operators,
Ingo Schwarze [Fri, 23 Jun 2017 23:00:01 +0000 (23:00 +0000)]
Consistently treat character escape sequences as operators,
not as letters, even if their names contain letters.

This is certainly not perfect, but code to recognize that \(*a is
not an operator but a letter would need a huge table, or Unicode
character property support, which won't happen at this time.

7 years agoeqn(1) output operator translation
Ingo Schwarze [Fri, 23 Jun 2017 22:20:17 +0000 (22:20 +0000)]
eqn(1) output operator translation

7 years agosplitting a text box sometimes requires wrapping it in a list
Ingo Schwarze [Fri, 23 Jun 2017 21:04:57 +0000 (21:04 +0000)]
splitting a text box sometimes requires wrapping it in a list

7 years agoStop using "mdocml" as an official name.
Ingo Schwarze [Fri, 23 Jun 2017 15:58:14 +0000 (15:58 +0000)]
Stop using "mdocml" as an official name.
Prefer mandoc.bsd.lv to mdocml.bsd.lv.

7 years agoWrite text boxes as <mi>, <mn>, or <mo> as appropriate,
Ingo Schwarze [Fri, 23 Jun 2017 02:32:12 +0000 (02:32 +0000)]
Write text boxes as <mi>, <mn>, or <mo> as appropriate,
and write fontstyle or fontweight attributes where required.
Missing features reported by bentley@.

7 years agoSimplify font handling:
Ingo Schwarze [Fri, 23 Jun 2017 00:30:38 +0000 (00:30 +0000)]
Simplify font handling:
1. Inherit the font attribute from the parent box, such that iteration
is no longer required to find the current font.
2. For well-known function name tokens, do not insert an EQN_LISTONE
box into the AST; simply set the font attribute of the text box
itself that contains the name.

Also improve word splitting of unquoted strings in default font mode:
3. Split between numbers and punctuation because both will soon get
different HTML markup.
4. Do not split between letters.  With the newly ubiquitious font
attributes, all formatters will be able to figure out what to do
without putting each letter into a separate box.

7 years agoFix font selection for text boxes in the terminal formatter.
Ingo Schwarze [Thu, 22 Jun 2017 00:30:20 +0000 (00:30 +0000)]
Fix font selection for text boxes in the terminal formatter.
Issue reported by bentley@.

The AST data structure is powerful enough that all required
information can easily be provided in the parser, and no change
of the formatting code is needed.

7 years agoOutside explicit font context, give every letter its own box.
Ingo Schwarze [Wed, 21 Jun 2017 20:50:50 +0000 (20:50 +0000)]
Outside explicit font context, give every letter its own box.
The formatters need this to correctly select fonts.
Missing feature reported by bentley@.

7 years agoquoted words are not parsed for defined keys
Ingo Schwarze [Wed, 21 Jun 2017 18:38:26 +0000 (18:38 +0000)]
quoted words are not parsed for defined keys

7 years agoRecognize well-known functions names (the same that Heirloom recognizes,
Ingo Schwarze [Wed, 21 Jun 2017 18:04:34 +0000 (18:04 +0000)]
Recognize well-known functions names (the same that Heirloom recognizes,
which includes those recognized by groff) and wrap them in a roman box
unless they already are in roman context.
Missing feature reported by bentley@.

7 years agoKNF: remove parentheses from switch case labels; no binary change
Ingo Schwarze [Tue, 20 Jun 2017 17:24:35 +0000 (17:24 +0000)]
KNF: remove parentheses from switch case labels; no binary change

7 years agoFix a regression in the previous revision:
Ingo Schwarze [Mon, 19 Jun 2017 12:57:08 +0000 (12:57 +0000)]
Fix a regression in the previous revision:
When there is no link description, reuse the URI.
Reported by tj@ and bentley@.

7 years agoImplement appending to standard man(7) and mdoc(7) macros with .am.
Ingo Schwarze [Sun, 18 Jun 2017 17:36:03 +0000 (17:36 +0000)]
Implement appending to standard man(7) and mdoc(7) macros with .am.

With roff_getstrn(), provide finer control which definitions
can be used for what:
* All definitions can be used for .if d tests and .am appending.
* User-defined for \* expansion, .dei expansion, and macro calling.
* Predefined for \* expansion.
* Standard macros, original or renamed, for macro calling.

Several related improvements while here:
* Do not return string table entries that have explicitly been removed.
* Do not create a rentab entry when trying to rename a non-existent macro.
* Clear an existing rentab entry when the external interface
roff_setstr() is called with its name.
* Avoid trailing blanks in macro lines generated from renamed
and from aliased macros.
* Delete the duplicate __m*_reserved[] tables, just use roff_name[].

7 years agostyle message about duplicate RCS ids; inspired by mdoclint
Ingo Schwarze [Sat, 17 Jun 2017 23:07:00 +0000 (23:07 +0000)]
style message about duplicate RCS ids; inspired by mdoclint

7 years agostyle message about missing RCS ids; inspired by mdoclint
Ingo Schwarze [Sat, 17 Jun 2017 22:43:14 +0000 (22:43 +0000)]
style message about missing RCS ids; inspired by mdoclint

7 years agoif .in is used inside the .TP head, it's always relative
Ingo Schwarze [Sat, 17 Jun 2017 16:47:48 +0000 (16:47 +0000)]
if .in is used inside the .TP head, it's always relative

7 years agotables leak tab settings to subsequent text
Ingo Schwarze [Sat, 17 Jun 2017 14:55:30 +0000 (14:55 +0000)]
tables leak tab settings to subsequent text

7 years agocorrect handling of blank lines after \c
Ingo Schwarze [Sat, 17 Jun 2017 13:06:16 +0000 (13:06 +0000)]
correct handling of blank lines after \c

7 years agoproperly set the default indentation
Ingo Schwarze [Sat, 17 Jun 2017 01:27:05 +0000 (01:27 +0000)]
properly set the default indentation
such that even pages without any .SH macros get it

7 years agoMultiple tbl(7) improvements:
Ingo Schwarze [Fri, 16 Jun 2017 20:01:06 +0000 (20:01 +0000)]
Multiple tbl(7) improvements:
* Do not discard data that lacks a matching layout cell but remains
within the number of columns of the table as a whole.
* Do not insert dummy data rows for any layout row starting with a
horizontal line, but only for layout rows that would discard all
the data on a matching non-empty data row.
* Print horizontal lines specified in the layout even if there is
no matching data cell.
* Improve the logic for extending vertical lines to adjacent rows,
for choosing cross marks versus line segments, and some related details.

7 years agoround default width of tbl(7) text blocks in the same way as groff
Ingo Schwarze [Thu, 15 Jun 2017 00:27:52 +0000 (00:27 +0000)]
round default width of tbl(7) text blocks in the same way as groff