| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.
|
|
|
|
|
|
|
|
|
| |
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.
|
|
|
|
|
|
| |
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
replacing the last instances by more specific warnings.
Improved functionality, minus 50 lines of code.
|
|
|
|
|
| |
parser. Simplify the code by moving it into the roff(7) parser, also
making it work for mdoc(7).
|
|
|
|
|
|
| |
when .Os has no argument, so do the same for man(7) when .TH has less
than four arguments; there is no reason to treat both differently.
Issue found following a question from Thomas Klausner <wiz at NetBSD>.
|
|
|
|
| |
and some cleanup; no functional change, minus 70 lines.
|
|
|
|
|
|
| |
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.
|
|
|
|
|
|
|
|
|
|
|
|
| |
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED. Warn about it.
* Missing section in .Dt does not default to 1. But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings. Warn about it.
|
|
|
|
|
|
|
|
|
| |
Drop pre-handlers, they were almost unused.
Drop the needless complexity of allowing more than one post-handler.
This saves one internal interface function, one static function, one
private struct definition, sixteen static arrays, and 45 lines of code.
No functional change.
|
| |
|
| |
|
|
|
|
|
|
| |
Detect the condition earlier, report in the error message
which block is broken, and delete the broken block.
Consequently, empty section headers can no longer happen.
|
|
|
|
| |
Hierarchical naming and mention macro names in messages.
|
|
|
|
|
| |
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.
|
|
|
|
|
|
|
|
| |
* Fix .Sm with invalid arg: move arg out and toggle mode.
* Promote "unknown standard" from WARNING to ERROR, it loses information.
* Delete MANDOCERR_BADWIDTH, it would only indicate a mandoc(1) bug.
* Do not report MANDOCERR_BL_LATETYPE when there is no type at all.
* Mention macro names, arguments and fallbacks.
|
|
|
|
|
|
| |
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.
|
|
|
|
|
|
|
| |
* Hierarchical naming of enum mandocerr items.
* Improve the wording to make it comprehensible.
* Mention the offending macro.
* Garbage collect one chunk of ancient, long unreachable code.
|
|
|
|
| |
showing which macro was skipped and before or after what.
|
|
|
|
|
|
|
|
|
| |
* Hierarchical naming of the related enum mandocerr items.
* Mention the offending macro, section title, or string.
While here, improve some wordings:
* Descriptive instead of imperative style.
* Uniform style for "missing" and "skipping".
* Where applicable, mention the fallback used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when they are meaningful, to avoid confusing stuff like this:
$ mandoc /dev/null
mandoc: /dev/null:0:1: FATAL: not a manual
Instead, just say:
mandoc: /dev/null: FATAL: not a manual
Another example this applies to is documents having a prologue,
but lacking a body. Do not throw a FATAL error for these; instead,
issue a WARNING and show the empty document, in the man(7) case with
the same amount of blank lines as groff does. Also downgrade mdoc(7)
documents having content before the first .Sh from FATAL to WARNING.
|
|
|
|
|
|
|
|
|
|
|
| |
So far, this covers all WARNINGs related to the prologue.
1) hierarchical naming of MANDOCERR_* constants
2) mention the macro name in messages where that adds clarity
3) add one missing MANDOCERR_DATE_MISSING msg
4) fix the wording of one message related to the man(7) prologue
Started on the plane back from Ottawa.
|
|
|
|
|
| |
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change
|
|
|
|
|
| |
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.
|
|
|
|
|
|
|
| |
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.
|
|
|
|
|
|
|
| |
In -Q mode, refrain form validating and normalizing the format
of the date given in .Dd or .TH, as it won't be used anyway.
For /usr/share/man, mandocdb -Q now takes 45% of the time of makewhatis(8).
|
|
|
|
|
| |
and remove pointless local variables;
found in a clang output from Ulrich Spoerlein <uqs at FreeBSD>
|
|
|
|
|
|
|
|
| |
man-ext macros by Eric S. Raymond, enabled by default in groff_man(7).
Usual disclaimer: You don't write new man(7) code, so you are not going
to use these, either.
Improves e.g. the bzr(1) and etherape(1) manuals.
Thanks to naddy@ for bringing these to my attention.
|
|
|
|
|
|
|
|
| |
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.
ok kristaps@ some time ago
|
|
|
|
|
|
| |
Reminded about the missing feature by millert@.
This reduces mandoc/groff differences in OpenBSD base by 25%.
ok millert@
|
|
|
|
|
| |
Issue first reported by naddy@ in rsync(1).
OpenBSD rev. 1.55.
|
|
|
|
|
|
|
| |
Fixes vertical spacing after "OPTIONS" in gcc(1).
Issue first reported by naddy@ in rsync(1).
OpenBSD rev. 1.54.
|
|
|
|
|
| |
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.
|
|
|
|
| |
some man(7) changes to accomodate for the an-ext compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
| |
volume name for the respective manual section, just like in mdoc(7).
This gives us nicer page headers for cvs(1), lynx(1), tic(1),
mkhybrid(8), and many curses(3) manuals.
ok kristaps@
To not break compatibility, i wrote a corresponding patch for GNU troff
which Werner Lemberg accepted upstream at rev. 1.65 of:
http://cvs.savannah.gnu.org/viewvc/groff/tmac/an-old.tmac?root=groff
|
|
|
|
|
|
|
|
| |
do not abort with a FATAL error, but report a report a WARNING,
remove the broken .TP from the syntax tree, and prod on.
Reported repeatedly by ports people, at least by brad@ and jeremy@.
Also fixes rendition(4) in Xenocara.
ok kristaps@
|
|
|
|
|
|
| |
do not use the current date. This removes a gratuitous output difference
with respect to groff.
ok kristaps@
|
|
|
|
|
|
|
| |
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.
|
| |
|
| |
|
|
|
|
|
| |
backend (the front-end already accomodated for this). Found indirectly
from a question by Brad Smith.
|
|
|
|
|
| |
through looking for user-defined escapes. This clears up a nice bit of
validation code.
|
|
|
|
|
|
|
|
|
|
|
|
| |
That is to say, with mingw32. This amounts to the following:
(1) break compat.c into compat_strlcpy.c and compat_strlcat.c
(2) add compat_getsubopt.c (from OpenBSD) and test-getsubopt.c
(3) add test-strptime.c for HAVE_STRPTIME
(4) add ifdef bits here and there, where necessary
(5) remove some harmless unportable stuff (u_char, localtime_r)
I've added the appropriate mdocml.zip target to the Makefile, too.
|
|
|
|
|
|
| |
-man. This actually seems to be what groff does. Sort-of. Anyway,
it's required to get perlpod pages rendered nicely, so until perlpod
stops producing shit, do it. Ok schwarze@.
|
|
|
|
|
|
|
|
|
|
|
| |
prompted by a TODO by schwarze@, originally from Gleydson Soares, that
an empty `SS' was raising an error (it hasn't for some time). It makes
sense these shouldn't warn, as omitting their contents doesn't change
anything in the structure of the document (groff and mandoc specifically
account for the whitespace between empty sections).
This doesn't change any manuals, which only refer to the line arguments
(or possibly next-line, in the case of man(7) syntax).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a public (mandoc.h) function mandoc_escape(), which merges the
functionality of both prior functions.
Reason: code duplication. The a2roffdeco() and mandoc_special()
functions were pretty much the same thing and both quite complex. This
allows one function to receive improvements in (e.g.) subexpression
handling and performance, instead of having to replicate functionality.
As such, the mandoc_escape() function already handles a superset of the
escapes handled in previous versions and has improvements in performance
(using strcspn(), for example) and reliable handling of subexpressions.
This code Works For Me, but may need work to catch any regressions.
Since the benefits are great (leaner code, simpler API), I'd rather have
it in-tree than floating as a patch.
|
|
|
|
| |
has no children. Noted by Brad, added to TODO by schwarze@.
|