]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
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

7 years agoimplement so-called absolute horizontal motion: \h'|...',
Ingo Schwarze [Wed, 14 Jun 2017 23:24:17 +0000 (23:24 +0000)]
implement so-called absolute horizontal motion: \h'|...',
used for example by zoem(1)

7 years agoNaive implementation of the roff(7) .po (page offset) request.
Ingo Schwarze [Wed, 14 Jun 2017 22:51:25 +0000 (22:51 +0000)]
Naive implementation of the roff(7) .po (page offset) request.

This clearly works when .po is called on the top level, but might
not be sophisticated enough if people call .po inside indentation-changing
contexts, but i haven't seen that in manual pages (yet :).

7 years agoadd the \(ru (0.5m baseline ruler) character escape sequence,
Ingo Schwarze [Wed, 14 Jun 2017 20:57:07 +0000 (20:57 +0000)]
add the \(ru (0.5m baseline ruler) character escape sequence,
abused by mail/nmh; groff_char(7) confirms that this really exists

7 years agosimple implementation of the roff(7) .als (macro alias) request,
Ingo Schwarze [Wed, 14 Jun 2017 19:39:18 +0000 (19:39 +0000)]
simple implementation of the roff(7) .als (macro alias) request,
sufficient for pages using po4a(1)

7 years agolet \l use the right fill character
Ingo Schwarze [Wed, 14 Jun 2017 18:23:37 +0000 (18:23 +0000)]
let \l use the right fill character

7 years agoimprove rounding rules for scaling units
Ingo Schwarze [Wed, 14 Jun 2017 17:51:15 +0000 (17:51 +0000)]
improve rounding rules for scaling units
in horizontal orientation in the terminal formatter

7 years agoharmless, but weird typo; found with afterstep_faq(1)
Ingo Schwarze [Wed, 14 Jun 2017 14:24:20 +0000 (14:24 +0000)]
harmless, but weird typo; found with afterstep_faq(1)

7 years agoimplement the roff(7) d (macro or string defined) conditional
Ingo Schwarze [Wed, 14 Jun 2017 14:02:39 +0000 (14:02 +0000)]
implement the roff(7) d (macro or string defined) conditional

7 years agoimplement roff(7) .rj (right justify) request
Ingo Schwarze [Wed, 14 Jun 2017 13:00:31 +0000 (13:00 +0000)]
implement roff(7) .rj (right justify) request

7 years agoimplement the roff(7) \p (break output line) escape sequence
Ingo Schwarze [Wed, 14 Jun 2017 01:31:26 +0000 (01:31 +0000)]
implement the roff(7) \p (break output line) escape sequence

7 years agoPartial support for the \n[an-margin] number register.
Ingo Schwarze [Tue, 13 Jun 2017 19:34:40 +0000 (19:34 +0000)]
Partial support for the \n[an-margin] number register.

Manuals autogenerated from reStructuredText are reckless enough
to peek at this non-portable, implementation-dependent, highly
groff-specific internal register - for no good reason, because the
man(7) language natively provides in a much simpler way what they
are trying to emulate here with much fragility.

A full implementation would be very hard because it would require
access to output-device-specific formatting data at the roff(7)
preprocessor stage, which mandoc doesn't support at all.
So hardcode a few magic numbers as reStructuredText expects them
for terminal output.  For other output modes (like HTML), code using
this register is utterly broken anyway.

7 years agoIf the layout is empty except for requesting a left vertical frame,
Ingo Schwarze [Tue, 13 Jun 2017 16:12:01 +0000 (16:12 +0000)]
If the layout is empty except for requesting a left vertical frame,
record that detail in struct tbl_opts, such that term_tbl() can do
correct column calculations and doesn't prematurely break lines.
Fixes the tbl/layout/empty regression test that got broken when
line breaking in text block cells was implemented.

7 years agoDelete the arbitrary range restriction for -Owidth.
Ingo Schwarze [Tue, 13 Jun 2017 15:06:56 +0000 (15:06 +0000)]
Delete the arbitrary range restriction for -Owidth.
We provide users with tools.  We don't attempt to prevent them from
using them in stupid ways: depending on the context, not every
stupid-looking use is necessarily actually stupid, and not every
stupidity can be automatically detected anyway, so don't even try.

7 years agofix the interaction of the allbox option with spanned cells in the layout
Ingo Schwarze [Tue, 13 Jun 2017 14:39:13 +0000 (14:39 +0000)]
fix the interaction of the allbox option with spanned cells in the layout

7 years agoExplicitly ignore .br, .ce, and .sp inside tbl(7) text blocks.
Ingo Schwarze [Tue, 13 Jun 2017 13:51:11 +0000 (13:51 +0000)]
Explicitly ignore .br, .ce, and .sp inside tbl(7) text blocks.
With the current code structure, they would appear at the wrong
place in the syntax tree, so it is better to not insert them
into the tree at all and issue an UNSUPP message instead.

7 years agotest the new allbox and wrapping features
Ingo Schwarze [Mon, 12 Jun 2017 22:50:38 +0000 (22:50 +0000)]
test the new allbox and wrapping features

7 years agoTwo minor fixes for the "allbox" modifier:
Ingo Schwarze [Mon, 12 Jun 2017 22:49:16 +0000 (22:49 +0000)]
Two minor fixes for the "allbox" modifier:
1. It does not reduce explicit "||" in the layout to "|".
2. It does not cause three horizontal lines at the end of a table,
even if the table ends with an explicit "_" data line.

7 years agoIf a tbl(7) layout contains a 'w' (minimum width) modifier for a
Ingo Schwarze [Mon, 12 Jun 2017 22:05:57 +0000 (22:05 +0000)]
If a tbl(7) layout contains a 'w' (minimum width) modifier for a
given column, that column contains no literal or numeric cell of
larger width, and all text block cells in that column can be line
wrapped to fit into that minimum width, groff does not increase
that column width beyond the specified minimum: so do the same.

7 years agoimplement the tbl(7) "allbox" option;
Ingo Schwarze [Mon, 12 Jun 2017 20:45:18 +0000 (20:45 +0000)]
implement the tbl(7) "allbox" option;
used for example by curs_getch(3) and GLwDrawingArea(3)

7 years agofix column width calculation for text block cells
Ingo Schwarze [Mon, 12 Jun 2017 20:14:18 +0000 (20:14 +0000)]
fix column width calculation for text block cells

7 years agoImplement automatic line breaking
Ingo Schwarze [Mon, 12 Jun 2017 19:05:47 +0000 (19:05 +0000)]
Implement automatic line breaking
inside individual table cells that contain text blocks.
This cures overlong lines in various Xenocara manuals.

7 years agoooops, fix a glitch in the previous commit...
Ingo Schwarze [Sun, 11 Jun 2017 20:03:02 +0000 (20:03 +0000)]
ooops, fix a glitch in the previous commit...

7 years agoStyle message about legacy man(7) date format in mdoc(7) documents
Ingo Schwarze [Sun, 11 Jun 2017 19:45:05 +0000 (19:45 +0000)]
Style message about legacy man(7) date format in mdoc(7) documents
and operating system dependent messages about missing or unexpected
Mdocdate; inspired by mdoclint(1).

7 years agoStyle message about legacy man(7) date format in mdoc(7) documents
Ingo Schwarze [Sun, 11 Jun 2017 19:37:00 +0000 (19:37 +0000)]
Style message about legacy man(7) date format in mdoc(7) documents
and operating system dependent messages about missing or unexpected
Mdocdate; inspired by mdoclint(1).

7 years agostyle message about missing .Fn markup; inspired by mdoclint
Ingo Schwarze [Sun, 11 Jun 2017 17:16:51 +0000 (17:16 +0000)]
style message about missing .Fn markup; inspired by mdoclint

7 years agoDo not issue the message "no blank before trailing delimiter" for .No.
Ingo Schwarze [Sun, 11 Jun 2017 14:24:55 +0000 (14:24 +0000)]
Do not issue the message "no blank before trailing delimiter" for .No.
In practice, that message only matters inside .Bf, and even there, it
can occasionally be a false positive.  In all other cases, it usually
is a false positive, so it is better to drop it outright.
Suggested by jmc@.

7 years agoadd forgotten file
Ingo Schwarze [Sun, 11 Jun 2017 14:23:53 +0000 (14:23 +0000)]
add forgotten file

7 years agofix order of messages
Ingo Schwarze [Sun, 11 Jun 2017 14:20:27 +0000 (14:20 +0000)]
fix order of messages

7 years agoReduce false positives for the "no blank before trailing delimiter" message.
Ingo Schwarze [Sat, 10 Jun 2017 16:54:16 +0000 (16:54 +0000)]
Reduce false positives for the "no blank before trailing delimiter" message.
This brings us down to one false positive for about every 18 pages.

7 years agominor markup simplifications
Ingo Schwarze [Sat, 10 Jun 2017 16:32:27 +0000 (16:32 +0000)]
minor markup simplifications

7 years agostyle message about missing blank before trailing delimiter;
Ingo Schwarze [Sat, 10 Jun 2017 01:48:53 +0000 (01:48 +0000)]
style message about missing blank before trailing delimiter;
inspired by mdoclint(1), and jmc@ considers it useful

7 years agodo not break the line between Bsx/Bx/Fx/Nx/Ox/Dx and its arguments
Ingo Schwarze [Sat, 10 Jun 2017 01:28:33 +0000 (01:28 +0000)]
do not break the line between Bsx/Bx/Fx/Nx/Ox/Dx and its arguments

7 years agoProperly reinitialize roffce_node between parses,
Ingo Schwarze [Thu, 8 Jun 2017 19:35:51 +0000 (19:35 +0000)]
Properly reinitialize roffce_node between parses,
or this may crash with use-after-free in makewhatis(8);
reported by jmc@, thanks!

7 years agoImplement w layout specifier (minimum column width).
Ingo Schwarze [Thu, 8 Jun 2017 18:11:22 +0000 (18:11 +0000)]
Implement w layout specifier (minimum column width).
Improve width calculation of text blocks.
Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.

7 years agomake the internal a2roffsu() interface more powerful by returning
Ingo Schwarze [Thu, 8 Jun 2017 12:54:58 +0000 (12:54 +0000)]
make the internal a2roffsu() interface more powerful by returning
a pointer to the end of the parsed data, making it easier to
parse subsequent bytes

7 years agowarning about unknown .Lb arguments; inspired by mdoclint(1)
Ingo Schwarze [Thu, 8 Jun 2017 00:23:30 +0000 (00:23 +0000)]
warning about unknown .Lb arguments; inspired by mdoclint(1)

7 years agostyle checks related to .Er; inspired by mdoclint(1)
Ingo Schwarze [Wed, 7 Jun 2017 23:29:48 +0000 (23:29 +0000)]
style checks related to .Er; inspired by mdoclint(1)

7 years agoAlso catch "new sentence, new line" if there are three blanks
Ingo Schwarze [Wed, 7 Jun 2017 20:58:49 +0000 (20:58 +0000)]
Also catch "new sentence, new line" if there are three blanks
between the sentences.  Thomas Klausner says he has seen some
of these, and i don't see any false positives.

7 years agoMake "new sentence, new line" detection stricter:
Ingo Schwarze [Wed, 7 Jun 2017 20:30:40 +0000 (20:30 +0000)]
Make "new sentence, new line" detection stricter:
Also catch cases where the new sentence starts with a one-letter word
and the input line is broken right after that word.
Suggested by Thomas Klausner <wiz @ NetBSD>.

It's merely a three-bit diff, changing one byte from 0x34 to 0x33,
so what can possibly go wrong...

7 years agoPrepare the terminal driver for filling multiple columns in parallel,
Ingo Schwarze [Wed, 7 Jun 2017 20:01:19 +0000 (20:01 +0000)]
Prepare the terminal driver for filling multiple columns in parallel,
second step: make the per-column byte pointer persistent across
term_flushln() calls, such that a subsequent call can continue at
the point where the previous call left.  If more than one column
is in use, return from term_flushln() when the column is full,
rather than breaking the output line.

No functional change, because nothing sets up multiple columns yet.

7 years agoPrepare the terminal driver for filling multiple columns in parallel,
Ingo Schwarze [Wed, 7 Jun 2017 17:38:26 +0000 (17:38 +0000)]
Prepare the terminal driver for filling multiple columns in parallel,
first step: split column data out of the terminal state struct into
a new column state struct and use an array of such column state
structs.  No functional change.

7 years agoThe \h escape sequence provides another method for moving backwards,
Ingo Schwarze [Wed, 7 Jun 2017 02:14:09 +0000 (02:14 +0000)]
The \h escape sequence provides another method for moving backwards,
and after that, previously written output gets overwritten, but
overwriting with blanks does *not* erase previously written content.
Yes, manual pages exist that are crazy enough to rely on that...

7 years agoImplement the roff(7) .rn (rename macro or string) request.
Ingo Schwarze [Wed, 7 Jun 2017 00:50:34 +0000 (00:50 +0000)]
Implement the roff(7) .rn (rename macro or string) request.
Renaming a user-defined macro is very simple: just copy
the definition to the new name and delete the old name.
Renaming high-level macros is a bit tricky: use a dedicated
key-value-table, with non-standard names as keys and standard
names as values.  When a macro is found that is not user-defined,
look it up in the "renamed" table and translate it back to the
standard name before passing it on to the high-level parsers.

7 years agodocument the new .ce implementation
Ingo Schwarze [Tue, 6 Jun 2017 15:03:35 +0000 (15:03 +0000)]
document the new .ce implementation

7 years agoMinimal implementation of the roff(7) .ce request (center a number
Ingo Schwarze [Tue, 6 Jun 2017 15:01:04 +0000 (15:01 +0000)]
Minimal implementation of the roff(7) .ce request (center a number
of input lines without filling).
Contrary to groff, high-level macros abort .ce mode for now.

7 years agoImplement the roff(7) .mc (right margin character) request.
Ingo Schwarze [Sun, 4 Jun 2017 22:44:15 +0000 (22:44 +0000)]
Implement the roff(7) .mc (right margin character) request.
The Tcl/Tk manual pages use this extensively.
Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf;
instead, implement a proper TERMP_BRNEVER flag.

7 years agoMake term_flushln() simpler and more robust:
Ingo Schwarze [Sun, 4 Jun 2017 18:50:35 +0000 (18:50 +0000)]
Make term_flushln() simpler and more robust:
Eliminate the "overstep" state variable.
The information is already contained in "viscol".
Minus 60 lines of code, no functional change intended.

7 years agoPure preprocessor implementation of the roff(7) .ec and .eo requests
Ingo Schwarze [Sun, 4 Jun 2017 00:13:15 +0000 (00:13 +0000)]
Pure preprocessor implementation of the roff(7) .ec and .eo requests
(escape character control), touching nothing after the preprocessing
stage and keeping even the state variable local to the preprocessor.
Since the escape character is also used for line continuation, this
requires pulling the implementation of line continuation from the
input reader to the preprocessor, which also considerably shortens
the code required for that.

When the escape character is changed, simply let the preprocessor
replace bare by escaped backslashes and instances of the non-standard
escape character with bare backslashes - that's all we need.

Oh, and if anybody dares to use these requests in OpenBSD manuals,
sending a medium-sized pack of axe-murderers after them might be a
worthwhile part of the punishment, but probably insuffient on its own.

7 years agoignore blank lines in man(7) next line scope;
Ingo Schwarze [Sat, 3 Jun 2017 15:55:24 +0000 (15:55 +0000)]
ignore blank lines in man(7) next line scope;
strange groff edge case behaviour found in multimedia/mjpegtools

7 years agoenable -Wstyle by default in -Tlint; OK jmc@
Ingo Schwarze [Sat, 3 Jun 2017 12:17:25 +0000 (12:17 +0000)]
enable -Wstyle by default in -Tlint; OK jmc@

7 years agoPartial implementation of \h (horizontal line drawing function).
Ingo Schwarze [Fri, 2 Jun 2017 19:21:23 +0000 (19:21 +0000)]
Partial implementation of \h (horizontal line drawing function).
A full implementation would require access to output device properties
and state variables (both only available after the main parser has
finalized the parse tree) before numerical expansions in the roff
preprocessor (i.e., before the main parser is even started).

Not trying to pull that stunt right now because the static-width
implementation committed here is sufficient for tcl-style manual pages
and already more complicated than i would have suspected.

7 years agoadd about 15 missing character escape sequences found in groff_char(7);
Ingo Schwarze [Fri, 2 Jun 2017 12:43:52 +0000 (12:43 +0000)]
add about 15 missing character escape sequences found in groff_char(7);
triggered by multimedia/mkvtoolnix mkvmerge(1) using \(S2

7 years agoMinimal implementation of the \h (horizontal motion) escape sequence.
Ingo Schwarze [Thu, 1 Jun 2017 19:05:37 +0000 (19:05 +0000)]
Minimal implementation of the \h (horizontal motion) escape sequence.
Good enough to cope with the average DocBook insanity.

7 years agoSTYLE message about full stop at the end of .Nd; inspired by mdoclint(1)
Ingo Schwarze [Thu, 1 Jun 2017 15:25:39 +0000 (15:25 +0000)]
STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)

7 years agoSTYLE message about missing use of Ox/Nx/Fx/Dx; OK jmc@ wiz@
Ingo Schwarze [Wed, 31 May 2017 15:31:00 +0000 (15:31 +0000)]
STYLE message about missing use of Ox/Nx/Fx/Dx; OK jmc@ wiz@

7 years agotweak previous; from jmc@
Ingo Schwarze [Tue, 30 May 2017 20:25:32 +0000 (20:25 +0000)]
tweak previous; from jmc@

7 years agoSTYLE message about useless macros we don't want (Bt Tn Ud);
Ingo Schwarze [Tue, 30 May 2017 19:30:38 +0000 (19:30 +0000)]
STYLE message about useless macros we don't want (Bt Tn Ud);
not a WARNING because they don't endanger portability

7 years agofix formatting of intermediate punctuation in .Lk
Ingo Schwarze [Tue, 30 May 2017 16:31:29 +0000 (16:31 +0000)]
fix formatting of intermediate punctuation in .Lk

7 years agoMacro argument quoting does not prevent recognition of punctuation
Ingo Schwarze [Tue, 30 May 2017 16:22:03 +0000 (16:22 +0000)]
Macro argument quoting does not prevent recognition of punctuation
and of called macros.

This bug affects almost all macros, and fixing it simplifies the
code.  It is amazing that the bogus ARGS_QWORD feature got implemented
in the first place, and then carrier along for more than eight years
without anybody ever noticing that it was pointless.

Reported by Leah Neukirchen <leah at vuxu dot org>, found on Void Linux.

7 years agoUse [ rather than [[ for portability,
Ingo Schwarze [Thu, 18 May 2017 14:45:34 +0000 (14:45 +0000)]
Use [ rather than [[ for portability,
in particular since it makes no difference in the case at hand.
Reported by Leah Neukirchen <leah at vuxu dot org> (Void Linux).

7 years agoDelete the -T xhtml command line option.
Ingo Schwarze [Wed, 17 May 2017 23:39:31 +0000 (23:39 +0000)]
Delete the -T xhtml command line option.
It has been obsolete for more than two years.
Use -T html.

7 years agoFix documentation bug:
Ingo Schwarze [Wed, 17 May 2017 23:23:00 +0000 (23:23 +0000)]
Fix documentation bug:
man(1) does not ignore manpath directories lacking mandoc.db(5) files;
instead, it uses filename lookup to find manuals in such directories.

7 years agoModernize an example showing antiquated syntax,
Ingo Schwarze [Wed, 17 May 2017 23:20:32 +0000 (23:20 +0000)]
Modernize an example showing antiquated syntax,
and delete an example showing the arcane -W stop option.

7 years agomissing space between macro arg and punctuation; from jmc@
Ingo Schwarze [Wed, 17 May 2017 22:43:56 +0000 (22:43 +0000)]
missing space between macro arg and punctuation; from jmc@

7 years agoNever create empty databases.
Ingo Schwarze [Wed, 17 May 2017 22:27:12 +0000 (22:27 +0000)]
Never create empty databases.

When pkg_add(1)ing packages installing manual pages into some directory,
the database in that directory automatically gets created or updated,
no change so far.  This patch causes the database file to be
automatically unlinked when pkg_delete(1)ing the last package having
manual pages in that directory, to leave less cruft behind.

Suggested by ajacoutot@.

7 years agoDo not warn if a database file does not exist
Ingo Schwarze [Wed, 17 May 2017 21:19:32 +0000 (21:19 +0000)]
Do not warn if a database file does not exist
because that is simply equivalent to an empty database.
Suggested by ajacoutot@

7 years agoDelete pointless width calculation for SYNOPSIS .Nm block heads.
Ingo Schwarze [Wed, 17 May 2017 17:54:45 +0000 (17:54 +0000)]
Delete pointless width calculation for SYNOPSIS .Nm block heads.
Just let HTML <table> do its work of selecting the needed width.
<Anton dot Lindqvist at gmail dot com> reported that the manually
calculated width was insufficient in some manual pages.

7 years agoIntroduce a new mandoc(1) message level, -W style, below -W warning.
Ingo Schwarze [Tue, 16 May 2017 19:06:30 +0000 (19:06 +0000)]
Introduce a new mandoc(1) message level, -W style, below -W warning.
Switch -W all from meaning -W warning to meaning -W style.
The meaning of -T lint does *not* change, it still implies -W warning.
No messages on the new level yet, but they will come.

Usually, i do not lightly make the user interface larger.
But this has been planned for years, and EXIT STATUS 1
was reserved for it all the time.  The message system
is now stable enough to finally implement it.

jmc@ regarding the concept: "really good idea"

7 years agowarn about punctuation between .Xr and .Rs in SEE ALSO;
Ingo Schwarze [Sun, 14 May 2017 14:00:58 +0000 (14:00 +0000)]
warn about punctuation between .Xr and .Rs in SEE ALSO;
inspired by mdoclint

7 years agoTweak previous: tb@ noticed that some browser/font combinations
Ingo Schwarze [Sun, 14 May 2017 12:27:28 +0000 (12:27 +0000)]
Tweak previous: tb@ noticed that some browser/font combinations
have so amazingly wide bold fonts (for the same nominal font size)
that adding 15% to the column width still isn't sufficient to make
text reliably fit, so go for 20%.

7 years agoMake the tag column in .Bl -tag lists wider:
Ingo Schwarze [Fri, 12 May 2017 17:58:21 +0000 (17:58 +0000)]
Make the tag column in .Bl -tag lists wider:
1. I forgot about the 2n padding between tag and body.
2. The factor 1.1 was too small for bold fold, make it *1.15 + 1n.
Ugliness spotted by tb@.

7 years agoTrailing \c suppresses the output line break even if
Ingo Schwarze [Tue, 9 May 2017 14:10:01 +0000 (14:10 +0000)]
Trailing \c suppresses the output line break even if
the next line is a text line starting with whitespace.
Quirk found in the sysutils/rancid port.

7 years agoLine-breaking roff(7) requests also break man(7) next-line scope.
Ingo Schwarze [Mon, 8 May 2017 20:33:53 +0000 (20:33 +0000)]
Line-breaking roff(7) requests also break man(7) next-line scope.
Considering that real roff implements next-line scope using input
line traps, that isn't all that surprising.
Issue found in the games/xbattle port.

7 years agoBasic implementation of the roff(7) .ti (temporary indent) request.
Ingo Schwarze [Mon, 8 May 2017 15:34:54 +0000 (15:34 +0000)]
Basic implementation of the roff(7) .ti (temporary indent) request.
Needed by about four dozen ports (thanks to naddy@ for the research).

7 years agoConvert REQUEST REFERENCE from using .Ss to .Bl -tag, allowing to
Ingo Schwarze [Mon, 8 May 2017 03:55:25 +0000 (03:55 +0000)]
Convert REQUEST REFERENCE from using .Ss to .Bl -tag, allowing to
specify request arguments and supporting tag searching in less(1).
Improve some entries and document .ta.

7 years agoimplement .DT in terms of .ta; needed for print/ghostview, for example
Ingo Schwarze [Sun, 7 May 2017 21:44:49 +0000 (21:44 +0000)]
implement .DT in terms of .ta; needed for print/ghostview, for example

7 years agoBasic implementation of the roff(7) .ta (define tab stops) request.
Ingo Schwarze [Sun, 7 May 2017 17:31:45 +0000 (17:31 +0000)]
Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

7 years agoShorten the description of .sp and move it to roff(7).
Ingo Schwarze [Fri, 5 May 2017 15:54:59 +0000 (15:54 +0000)]
Shorten the description of .sp and move it to roff(7).
If is not a macro but a low-level roff request
and not recommended for use in manual pages.

7 years agoMove .sp to the roff modules. Enough infrastructure is in place
Ingo Schwarze [Fri, 5 May 2017 15:17:32 +0000 (15:17 +0000)]
Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

7 years agomove .ll to the roff modules
Ingo Schwarze [Fri, 5 May 2017 13:17:54 +0000 (13:17 +0000)]
move .ll to the roff modules

7 years agoClean up docs after today's .br and .ft code cleanup; simpler.
Ingo Schwarze [Fri, 5 May 2017 02:31:35 +0000 (02:31 +0000)]
Clean up docs after today's .br and .ft code cleanup; simpler.

7 years agoMove handling of the roff(7) .ft request from the man(7)
Ingo Schwarze [Fri, 5 May 2017 02:06:19 +0000 (02:06 +0000)]
Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

7 years agoStart roff formatter modules for HTML and termininal output,
Ingo Schwarze [Thu, 4 May 2017 22:16:09 +0000 (22:16 +0000)]
Start roff formatter modules for HTML and termininal output,
used by both the mdoc and man formatters, with the ultimate
goal of reducing code duplication between the two macro formatters.
Made possible by the parser unification.
Add the first formatting function (for the .br request).

7 years agoParser reorg:
Ingo Schwarze [Thu, 4 May 2017 17:48:28 +0000 (17:48 +0000)]
Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

7 years agoA few days ago, a patch from <G dot Branden dot Robinson at gmail dot com>
Ingo Schwarze [Mon, 1 May 2017 23:27:39 +0000 (23:27 +0000)]
A few days ago, a patch from <G dot Branden dot Robinson at gmail dot com>
got committed to groff which changed .TP from using .it to using .itc,
such that groff now supports more than one man(7) macro line in the .TP
head if all but the last line in the head end with \c.

Of course, relying on that behaviour is utterly non-portable, but if
authors are reckless enough to use that idiom, let's do what they want.

7 years agoWhen trying to expand some columns in a table where the sum of the
Ingo Schwarze [Mon, 1 May 2017 20:54:59 +0000 (20:54 +0000)]
When trying to expand some columns in a table where the sum of the
widths of the remaining columns is already wider than the line
length, underflowing size_t and dying from ENOMEM is the wrong plan.
Instead, simply refrain from expanding anything in such a situation,
avoiding a crash that tb@ found with afl.

7 years agoParser unification: use nice ohashes for all three request and macro tables;
Ingo Schwarze [Sat, 29 Apr 2017 12:45:41 +0000 (12:45 +0000)]
Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.

7 years agoDelete .Pp right before the first .Sh and right before any .Ss,
Ingo Schwarze [Fri, 28 Apr 2017 16:25:11 +0000 (16:25 +0000)]
Delete .Pp right before the first .Sh and right before any .Ss,
and warn about it; mdoclint(1) does so, and it makes sense.

7 years agoASCII characters that are special to roff
Ingo Schwarze [Thu, 27 Apr 2017 17:08:04 +0000 (17:08 +0000)]
ASCII characters that are special to roff

7 years agoDelete the manpage(1) utility.
Ingo Schwarze [Mon, 24 Apr 2017 23:32:00 +0000 (23:32 +0000)]
Delete the manpage(1) utility.
It was never enabled in any release, nor was a manual ever written.

In general, we want to simplify the user interface rather than
succumb to featurism.  Consequently, integrating manpage(1)
into the main binary would seem like a dubious direction.

7 years agoContinue parser unification:
Ingo Schwarze [Mon, 24 Apr 2017 23:06:17 +0000 (23:06 +0000)]
Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

7 years agoMore thoroughly reject direct access to unintended files, such that
Ingo Schwarze [Wed, 19 Apr 2017 01:00:03 +0000 (01:00 +0000)]
More thoroughly reject direct access to unintended files, such that
URIs like http://man.openbsd.org/OpenBSD-current/mandoc.db and
http://man.openbsd.org/OpenBSD-current/man1/ do not cause display
of garbage.