]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
13 years agoProperly quote arguments in `Fn' documentation. Also make standalone
Kristaps Dzonsons [Fri, 1 Apr 2011 19:47:33 +0000 (19:47 +0000)]
Properly quote arguments in `Fn' documentation.  Also make standalone
'...' have a properly-escaped initial dot.

13 years agoAllow a NULL mmsg passed to libmandoc.
Kristaps Dzonsons [Thu, 31 Mar 2011 10:54:39 +0000 (10:54 +0000)]
Allow a NULL mmsg passed to libmandoc.

13 years agoMake -Werr be -Wlevel, keeping it in sync with mandoc.1. Noted by
Kristaps Dzonsons [Thu, 31 Mar 2011 10:53:43 +0000 (10:53 +0000)]
Make -Werr be -Wlevel, keeping it in sync with mandoc.1.  Noted by
Alexander Schrijver---thanks!

13 years agonaddy@ reports rsync(1)
Ingo Schwarze [Wed, 30 Mar 2011 00:02:40 +0000 (00:02 +0000)]
naddy@ reports rsync(1)

13 years agoAdd lint target to Makefile.
Kristaps Dzonsons [Tue, 29 Mar 2011 09:37:24 +0000 (09:37 +0000)]
Add lint target to Makefile.

13 years agoGetting ready for next [minor-number] release.
Kristaps Dzonsons [Tue, 29 Mar 2011 09:29:29 +0000 (09:29 +0000)]
Getting ready for next [minor-number] release.

13 years agoCarefully let mandoc_getcontrol() handle libroff's detection of a macro
Kristaps Dzonsons [Tue, 29 Mar 2011 09:00:48 +0000 (09:00 +0000)]
Carefully let mandoc_getcontrol() handle libroff's detection of a macro
line.  Note that we now properly ignore \.", which earlier would have
been pushed through macro detection.  This required attention to all
entries of roff_parse().

This removes a TODO by schwarze@ to the effect that \. can be a control
character, which is now handled in mandoc_getcontrol().

13 years agoMake libman use mandoc_getcontrol() for real this time.
Kristaps Dzonsons [Tue, 29 Mar 2011 08:30:49 +0000 (08:30 +0000)]
Make libman use mandoc_getcontrol() for real this time.

13 years agoHave libman and libmdoc use mandoc_getcontrol() to determine whether a
Kristaps Dzonsons [Mon, 28 Mar 2011 23:52:13 +0000 (23:52 +0000)]
Have libman and libmdoc use mandoc_getcontrol() to determine whether a
macro has been invoked.  libroff is next.

13 years agoPut mandocerrs and mandoclevels arrays into libmandoc with accessors
Kristaps Dzonsons [Mon, 28 Mar 2011 21:49:42 +0000 (21:49 +0000)]
Put mandocerrs and mandoclevels arrays into libmandoc with accessors
mparse_strerror() and mparse_strlevel().

13 years agonew: \. at the beginning of a line
Ingo Schwarze [Wed, 23 Mar 2011 22:16:03 +0000 (22:16 +0000)]
new: \. at the beginning of a line
partially done: date cleanup

13 years agoAs per joerg@'s suggestion, use const arrays when looking up mdoc argvs.
Kristaps Dzonsons [Wed, 23 Mar 2011 15:46:02 +0000 (15:46 +0000)]
As per joerg@'s suggestion, use const arrays when looking up mdoc argvs.

13 years agoMerge man_args() into man_macro.c, the only place where it's called, and
Kristaps Dzonsons [Wed, 23 Mar 2011 15:33:57 +0000 (15:33 +0000)]
Merge man_args() into man_macro.c, the only place where it's called, and
make its return value boolean (we don't care about QWORD).  We can move
it into mdoc_macro.c because it's basically just a wrapper around
mandoc_getarg().  Then blow away man_argv.c, which is left empty.

13 years agoFirst, make -man ARGS_EOLN et al. be an enum. Second, remove
Kristaps Dzonsons [Wed, 23 Mar 2011 12:40:04 +0000 (12:40 +0000)]
First, make -man ARGS_EOLN et al. be an enum.  Second, remove
ARGS_ERROR, as it is never returned by man_args().  Then clean up
invocations of man_args() to only check for ARGS_EOLN.

13 years agoAdd MAN_TAIL, which will be used by `UE' (forthcoming) and needs to be
Kristaps Dzonsons [Wed, 23 Mar 2011 12:33:01 +0000 (12:33 +0000)]
Add MAN_TAIL, which will be used by `UE' (forthcoming) and needs to be
used for `RE'.

13 years agoFix "libman" dependence.
Kristaps Dzonsons [Wed, 23 Mar 2011 12:32:39 +0000 (12:32 +0000)]
Fix "libman" dependence.

13 years agoMake (e.g.) `SM' before `B' be only a warning. In reality, this refers
Kristaps Dzonsons [Wed, 23 Mar 2011 09:47:13 +0000 (09:47 +0000)]
Make (e.g.) `SM' before `B' be only a warning.  In reality, this refers
to ELINE macros ("next-line", but not unbreakable like the next-line
paragraph macros) followed by other macros.  This addresses a report by
Christian Weisgerber, posted in the TODO by schwarze@, and aired on
discuss@ (22/03/2011) for whether a fix is warranted.

13 years agoMake empty sections and parts (SH, SS, RS) only produce a warning if it
Kristaps Dzonsons [Tue, 22 Mar 2011 15:30:30 +0000 (15:30 +0000)]
Make empty sections and parts (SH, SS, RS) only produce a warning if it
has no children.  Noted by Brad, added to TODO by schwarze@.

13 years agolibmdoc.h and libman.h were including mdoc.h and man.h, respectively.
Kristaps Dzonsons [Tue, 22 Mar 2011 14:33:05 +0000 (14:33 +0000)]
libmdoc.h and libman.h were including mdoc.h and man.h, respectively.
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.

13 years agomdoc_argn_free is only used local to mdoc_argv.c, so make it static.
Kristaps Dzonsons [Tue, 22 Mar 2011 14:28:48 +0000 (14:28 +0000)]
mdoc_argn_free is only used local to mdoc_argv.c, so make it static.

13 years agoMove mandoc_isdelim() back into libmdoc.h. This fixes an unreported
Kristaps Dzonsons [Tue, 22 Mar 2011 14:05:45 +0000 (14:05 +0000)]
Move mandoc_isdelim() back into libmdoc.h.  This fixes an unreported
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;')
and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its
own line) would also be punctuated.  This introduces a small amount of
complexity of mdoc_{html,term}.c must manage their own spacing with
running print_word() or print_text().  The check for delimiting now
happens in mdoc_macro.c's dword().

13 years agoAdd some documentation and clean up mdoc.h/man.h.
Kristaps Dzonsons [Tue, 22 Mar 2011 13:28:22 +0000 (13:28 +0000)]
Add some documentation and clean up mdoc.h/man.h.

13 years agoHave the default include/lib install path end with "mandoc" to prevent
Kristaps Dzonsons [Tue, 22 Mar 2011 13:28:03 +0000 (13:28 +0000)]
Have the default include/lib install path end with "mandoc" to prevent
clobbering other stuff that may have the same name.

13 years agoNote the TODO file on the website. Also install index.html (oops).
Kristaps Dzonsons [Tue, 22 Mar 2011 13:15:38 +0000 (13:15 +0000)]
Note the TODO file on the website.  Also install index.html (oops).

13 years agoAdd a FATAL error for when no manual type was assigned (you can repeat
Kristaps Dzonsons [Tue, 22 Mar 2011 10:35:26 +0000 (10:35 +0000)]
Add a FATAL error for when no manual type was assigned (you can repeat
this for yourself by having a file consisting only of comments).

13 years agoBe a bit more specific on where we compile. Are there any ANSI-C
Kristaps Dzonsons [Tue, 22 Mar 2011 10:30:07 +0000 (10:30 +0000)]
Be a bit more specific on where we compile.  Are there any ANSI-C
compilers where we don't compile?  I'm pretty sure that mmap() is
non-standard (we'll fail, e.g., on mingw32).

13 years agoAs mentioned: ChangeLog isn't being built any more.
Kristaps Dzonsons [Tue, 22 Mar 2011 10:20:56 +0000 (10:20 +0000)]
As mentioned: ChangeLog isn't being built any more.

13 years agoStep 5: re-write Makefile and relax. This restructures the Makefile to
Kristaps Dzonsons [Tue, 22 Mar 2011 10:20:33 +0000 (10:20 +0000)]
Step 5: re-write Makefile and relax.  This restructures the Makefile to
do actual dependency checking for headers and to build everything nicer
(www properly depends on mandoc, etc.).

Note that the ChangeLog isn't being built any more: if people are
interested, they can visit the source-changes mailing list archive.

13 years agoStep 4: merge chars.h into out.h. The functions in this file are
Kristaps Dzonsons [Tue, 22 Mar 2011 10:13:01 +0000 (10:13 +0000)]
Step 4: merge chars.h into out.h.  The functions in this file are
necessary to all [real] front-ends, so stop pretending it's special.
While here, add some documentation to the variable types.

13 years agoStep 3: consolidate manuals. The parse functions in mdoc.h, roff.h, and
Kristaps Dzonsons [Tue, 22 Mar 2011 10:02:50 +0000 (10:02 +0000)]
Step 3: consolidate manuals.  The parse functions in mdoc.h, roff.h, and
man.h are now part of libmandoc.h, so remove these from their respective
manuals (they're no longer public-facing and we don't need a libmandoc.3
(yet?)).  Before that, move the juicy data (parse tree syntax) into
new-born mandoc.3.  Peck around in Makefile and index.sgml to reflect
reality.

13 years agoStep 2: blow away roff.h, as all of its functions have been moved into
Kristaps Dzonsons [Tue, 22 Mar 2011 09:50:11 +0000 (09:50 +0000)]
Step 2: blow away roff.h, as all of its functions have been moved into
libmandoc.h and there's nothing left.

13 years agoStep 1 of restructuring: libmandoc.h. Move all compiler-set-specific
Kristaps Dzonsons [Tue, 22 Mar 2011 09:48:13 +0000 (09:48 +0000)]
Step 1 of restructuring: libmandoc.h.  Move all compiler-set-specific
stuff into libmandoc.h, including old mdoc.h/man.h/roff.h functions now
used by read.c.  The motivation behind this is to tighten the
relationship between the underlying compilers while keeping parse data
hidden from general callers (e.g., main.c).

While here, also move register values from mandoc.h into libmandoc.h as
noted by schwarze@.  See above for explanation.

13 years agomain.c doesn't need roff.h anymore.
Kristaps Dzonsons [Mon, 21 Mar 2011 12:04:26 +0000 (12:04 +0000)]
main.c doesn't need roff.h anymore.

13 years agoLet read.c worry about the currently-open file instead of having this
Kristaps Dzonsons [Sun, 20 Mar 2011 16:05:21 +0000 (16:05 +0000)]
Let read.c worry about the currently-open file instead of having this
information duplicated in main.c.  For the time being, remove evt_close
and evt_open, as the only known mparse interface (main.c) doesn't need
them.

13 years agoConsolidate messages. Have all parse-time messages (in libmdoc,
Kristaps Dzonsons [Sun, 20 Mar 2011 16:02:05 +0000 (16:02 +0000)]
Consolidate messages.  Have all parse-time messages (in libmdoc,
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h.  This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.

13 years agoChange around include ordering for compilation on OpenBSD.
Kristaps Dzonsons [Sun, 20 Mar 2011 11:43:06 +0000 (11:43 +0000)]
Change around include ordering for compilation on OpenBSD.

13 years agoSplit the document parsing sequence out of main.c and into read.c,
Kristaps Dzonsons [Sun, 20 Mar 2011 11:41:24 +0000 (11:41 +0000)]
Split the document parsing sequence out of main.c and into read.c,
putting the interface into mandoc.h.  This effectively makes the
function of main.c be command-line handling, invoking the parser, and
sending its output to the output handler.  The sequence of parsing
(pfile(), pdesc(), etc.) has changed very little but for clean-up of
some state variables (curp->fd, etc.).

13 years agoBumped internal version. There will be no formal release with this: it
Kristaps Dzonsons [Sun, 20 Mar 2011 11:07:05 +0000 (11:07 +0000)]
Bumped internal version.  There will be no formal release with this: it
precedes some major structural changes for easier roll-back in the case
of errors or whatnot.

13 years ago.RS w/o line args is not serious VERSION_1_10_10
Ingo Schwarze [Sat, 19 Mar 2011 23:36:08 +0000 (23:36 +0000)]
.RS w/o line args is not serious

13 years agoNote the development status of eqn.7 and tbl.7.
Kristaps Dzonsons [Thu, 17 Mar 2011 15:12:42 +0000 (15:12 +0000)]
Note the development status of eqn.7 and tbl.7.

13 years ago"Reserved Characters" isn't correct since `\.' and `\*(Ba' aren't
Kristaps Dzonsons [Thu, 17 Mar 2011 14:50:14 +0000 (14:50 +0000)]
"Reserved Characters" isn't correct since `\.' and `\*(Ba' aren't
characters.  Use "Reserved Terms" instead.

13 years agoNote that mdoc_valids[] is static.
Kristaps Dzonsons [Thu, 17 Mar 2011 12:14:19 +0000 (12:14 +0000)]
Note that mdoc_valids[] is static.

13 years agomandocmsg finally has no return value.
Kristaps Dzonsons [Thu, 17 Mar 2011 12:08:01 +0000 (12:08 +0000)]
mandocmsg finally has no return value.

13 years agoClean-up in libman: make all calls to man_*msg not check return value.
Kristaps Dzonsons [Thu, 17 Mar 2011 11:56:17 +0000 (11:56 +0000)]
Clean-up in libman: make all calls to man_*msg not check return value.
Also convert man_vmsg to return void.

13 years agoClean-up in libmdoc: fix last checks for mdoc_*msg return value, then
Kristaps Dzonsons [Thu, 17 Mar 2011 11:30:23 +0000 (11:30 +0000)]
Clean-up in libmdoc: fix last checks for mdoc_*msg return value, then
make mdoc_vmsg not return an int.  libmdoc is now completely clean of
return-value checks from the message subsystem.

13 years agoClean-up in mdoc_argv.c args_checkpunct().
Kristaps Dzonsons [Thu, 17 Mar 2011 11:09:36 +0000 (11:09 +0000)]
Clean-up in mdoc_argv.c args_checkpunct().

13 years agoClean-up in mdoc_argv.c: make CPP-defines into an enum, document, make
Kristaps Dzonsons [Thu, 17 Mar 2011 10:59:27 +0000 (10:59 +0000)]
Clean-up in mdoc_argv.c: make CPP-defines into an enum, document, make
static arrays const, properly abort() for bogus switch cases, and be
obsessive about spacing and (void)-casting.

13 years agoClean up mdoc_pmsg invocations to make them not check the return value.
Kristaps Dzonsons [Thu, 17 Mar 2011 10:41:18 +0000 (10:41 +0000)]
Clean up mdoc_pmsg invocations to make them not check the return value.

13 years agoKill off some unused function prototypes.
Kristaps Dzonsons [Thu, 17 Mar 2011 09:28:00 +0000 (09:28 +0000)]
Kill off some unused function prototypes.

13 years agoKill off mdoc_strings.c, which is now empty. Byeeeeeeeee!
Kristaps Dzonsons [Thu, 17 Mar 2011 09:25:54 +0000 (09:25 +0000)]
Kill off mdoc_strings.c, which is now empty.  Byeeeeeeeee!

13 years agoMove mdoc_macro2len() into mdoc_validate.c as macro2len(), as that's the
Kristaps Dzonsons [Thu, 17 Mar 2011 09:24:51 +0000 (09:24 +0000)]
Move mdoc_macro2len() into mdoc_validate.c as macro2len(), as that's the
only place that it's being used.

13 years agoMove mdoc_str2sec() into mdoc_validate.c as a2sec(), as that's the only
Kristaps Dzonsons [Thu, 17 Mar 2011 09:22:39 +0000 (09:22 +0000)]
Move mdoc_str2sec() into mdoc_validate.c as a2sec(), as that's the only
place that it's being used.

13 years agoTiny optimisation in mandoc_isdelim() check.
Kristaps Dzonsons [Thu, 17 Mar 2011 09:18:12 +0000 (09:18 +0000)]
Tiny optimisation in mandoc_isdelim() check.

13 years agoMove mdoc_isdelim() into mandoc.h as mandoc_isdelim(). This allows the
Kristaps Dzonsons [Thu, 17 Mar 2011 09:16:38 +0000 (09:16 +0000)]
Move mdoc_isdelim() into mandoc.h as mandoc_isdelim().  This allows the
removal of manual delimiter checks in html.c and term.c.  Finally, add
the escaped period as a closing delimiter, removing a TODO to this
effect.

13 years agoMove mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.h
Kristaps Dzonsons [Thu, 17 Mar 2011 08:49:34 +0000 (08:49 +0000)]
Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.h
so that everybody can use them.  This follows the convention of
libXXXX.h being internal to a library and XXXX.h being the external
interface.  Not only does this allow the removal of lots of redundant
NULL-checking code, it also sets the tone for adding new mandoc-global
routines.

13 years agoMake args_checkpunct() use mdoc_isdelim() instead of mdoc_iscdelim(),
Kristaps Dzonsons [Thu, 17 Mar 2011 01:23:28 +0000 (01:23 +0000)]
Make args_checkpunct() use mdoc_isdelim() instead of mdoc_iscdelim(),
which is wrong.  Then remove mdoc_iscdelim() alltogether.

13 years agoMove check for closing punctuation into its own function. This will
Kristaps Dzonsons [Thu, 17 Mar 2011 00:58:14 +0000 (00:58 +0000)]
Move check for closing punctuation into its own function.  This will
later be modified to remove the need for iscdelim(), which will be used
to unify delimiter checks, which will then allow for the simple removal
of a TODO regarding escaped periods.

13 years agoo diaeresis is 246 (U+00F6)
Ingo Schwarze [Wed, 16 Mar 2011 22:49:55 +0000 (22:49 +0000)]
o diaeresis is 246 (U+00F6)
from Christian Weisgerber <naddy at openbsd dot org>

13 years agoInstead of a series of hard-coded strcmps, make argv_a2arg() iterate
Kristaps Dzonsons [Wed, 16 Mar 2011 17:55:39 +0000 (17:55 +0000)]
Instead of a series of hard-coded strcmps, make argv_a2arg() iterate
over an array of possible argument types, hooking in to mdoc_argnames[].
This knocks off bytes for the duplicated strings and cleans up code
readability.

13 years agoPush exit_status into struct curparse alongside file_status.
Kristaps Dzonsons [Wed, 16 Mar 2011 15:28:35 +0000 (15:28 +0000)]
Push exit_status into struct curparse alongside file_status.

13 years agoMake lint shut up a little bit.
Kristaps Dzonsons [Tue, 15 Mar 2011 16:23:51 +0000 (16:23 +0000)]
Make lint shut up a little bit.

13 years agoRemove duplicate UNCONST definition.
Kristaps Dzonsons [Tue, 15 Mar 2011 16:15:37 +0000 (16:15 +0000)]
Remove duplicate UNCONST definition.

13 years agoClean-up: make file_status global be local to curparse. "I agree with
Kristaps Dzonsons [Tue, 15 Mar 2011 13:24:42 +0000 (13:24 +0000)]
Clean-up: make file_status global be local to curparse.  "I agree with
the direction of this particular patch", schwarze@.

13 years agoPlug memory leak of normalised-date field.
Kristaps Dzonsons [Tue, 15 Mar 2011 13:23:33 +0000 (13:23 +0000)]
Plug memory leak of normalised-date field.

13 years agomy $buf = "string"; return $string; is cool in Perl, but not in C;
Ingo Schwarze [Tue, 15 Mar 2011 03:03:54 +0000 (03:03 +0000)]
my $buf = "string"; return $string;  is cool in Perl, but not in C;
found by Ulrich Spoerlein <uqs at freebsd> using the clang static analyzer;
"ok, but please document the numbers" kristaps@

13 years agoDo not leak information about the software used
Ingo Schwarze [Mon, 7 Mar 2011 01:58:24 +0000 (01:58 +0000)]
Do not leak information about the software used
into PostScript and PDF documents behind the user's back.
Joerg Sonnenberger pointed out that almost all software
creating PostScript and PDF documents does so, even on OpenBSD,
but that doesn't make the leakage much better in my book.
According to all standards i could find, this information is optional.
Issue originally reported by deraadt@; "commit!" kristaps@.

13 years agoClean up date handling,
Ingo Schwarze [Mon, 7 Mar 2011 01:35:51 +0000 (01:35 +0000)]
Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

13 years agodate handling needs cleanup
Ingo Schwarze [Sun, 27 Feb 2011 14:17:28 +0000 (14:17 +0000)]
date handling needs cleanup

13 years agoAllow compilation with pcc, which has interesting/broken handling of -W
Kristaps Dzonsons [Thu, 24 Feb 2011 14:30:15 +0000 (14:30 +0000)]
Allow compilation with pcc, which has interesting/broken handling of -W
with missing function prototypes.  Ok joerg@.

13 years agoClean up the COMPATIBILITY section;
Ingo Schwarze [Wed, 9 Feb 2011 22:53:20 +0000 (22:53 +0000)]
Clean up the COMPATIBILITY section;
heavily based on a patch from kristaps@ with some tweaks by me.
- Also talk about -Tps and -Tpdf.
- Use the same list style as in the other mandoc manuals.
- Replace a few macros by ones better suited.
- Some improvements of wording.
ok jmc@ kristaps@

13 years agoAdd stub for eqn.7 manual and flip it on. Also note COMPATIBILITY issue
Kristaps Dzonsons [Wed, 9 Feb 2011 10:03:02 +0000 (10:03 +0000)]
Add stub for eqn.7 manual and flip it on.  Also note COMPATIBILITY issue
of how we considered .TS (etc.) macros and how the preprocessors do.

13 years agoEQN blocks are now printed in all modes. This is simply a printing of
Kristaps Dzonsons [Wed, 9 Feb 2011 09:52:47 +0000 (09:52 +0000)]
EQN blocks are now printed in all modes.  This is simply a printing of
the concatenated string (in -T[x]html, it gets a SPAN, too).

13 years agoConsolidate "rc" value in main.c around addspan, addeqn, and parseln.
Kristaps Dzonsons [Wed, 9 Feb 2011 09:33:43 +0000 (09:33 +0000)]
Consolidate "rc" value in main.c around addspan, addeqn, and parseln.

13 years agoAllow -man to process EQN as well. Also fix a segfault in missing case
Kristaps Dzonsons [Wed, 9 Feb 2011 09:18:15 +0000 (09:18 +0000)]
Allow -man to process EQN as well.  Also fix a segfault in missing case
statements in the post-handler for EQN in -mdoc and -man.

13 years agoAllow EQN data to be pushed down into libmdoc via mdoc_addeqn(). Only
Kristaps Dzonsons [Wed, 9 Feb 2011 09:05:52 +0000 (09:05 +0000)]
Allow EQN data to be pushed down into libmdoc via mdoc_addeqn().  Only
the adding itself is implemented; equation data is not yet shown.

13 years agoPut tbl_alloc function right into the addspan() one, as this is the only
Kristaps Dzonsons [Tue, 8 Feb 2011 07:40:23 +0000 (07:40 +0000)]
Put tbl_alloc function right into the addspan() one, as this is the only
place that it's called.

13 years agoThe macro .Ns has no effect at the beginning of an input line;
Ingo Schwarze [Mon, 7 Feb 2011 00:05:40 +0000 (00:05 +0000)]
The macro .Ns has no effect at the beginning of an input line;
ok kristaps@ jmc@.

13 years agoFix a regression caused by mdoc_term.c 1.214 / mdoc_html.c 1.148:
Ingo Schwarze [Sun, 6 Feb 2011 23:02:31 +0000 (23:02 +0000)]
Fix a regression caused by mdoc_term.c 1.214 / mdoc_html.c 1.148:
Inside .Bk or inside the SYNOPSIS, Unix variant macros cleared
the keep flag.

13 years agoSome pre-handlers produce output, so reorder the code to set up
Ingo Schwarze [Sun, 6 Feb 2011 22:33:38 +0000 (22:33 +0000)]
Some pre-handlers produce output, so reorder the code to set up
keep flags before they are called.
Without this bugfix, .Bk was ineffective in some cases.
"looks reasonable" kristaps@

13 years agoUse tbl_span line number for warnings/errors.
Kristaps Dzonsons [Sun, 6 Feb 2011 22:05:20 +0000 (22:05 +0000)]
Use tbl_span line number for warnings/errors.

13 years agoLet the line-number of a tbl_span be remembered.
Kristaps Dzonsons [Sun, 6 Feb 2011 22:02:58 +0000 (22:02 +0000)]
Let the line-number of a tbl_span be remembered.

13 years agoAdd initial libmdoc and libman top-most machinery for accepting TBL
Kristaps Dzonsons [Sun, 6 Feb 2011 21:44:36 +0000 (21:44 +0000)]
Add initial libmdoc and libman top-most machinery for accepting TBL
directives.  For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).

13 years agoAdd initial EQN support to mandoc. This parses, then throws away, data
Kristaps Dzonsons [Sun, 6 Feb 2011 20:36:36 +0000 (20:36 +0000)]
Add initial EQN support to mandoc.  This parses, then throws away, data
between EQ and EN roff blocks.  EQN is different from TBL in that data
after .EQ is unilaterally considered an equation until an .EN.  Thus,
there's no need to jump through hoops in having table spans and so on.
This is ONLY the parse code framework in libroff.  EQN is not yet passed
into the backends.

13 years agoTODO note on that `.TS', `.TE' etc. aren't real roff macros and troff
Kristaps Dzonsons [Thu, 3 Feb 2011 10:24:21 +0000 (10:24 +0000)]
TODO note on that `.TS', `.TE' etc. aren't real roff macros and troff
won't recognise them when invoked as e.g. `.   TS' (we, however, do).

13 years agoIf `Ns' is specified on its own line, it should be ignored. This is
Kristaps Dzonsons [Wed, 2 Feb 2011 21:40:45 +0000 (21:40 +0000)]
If `Ns' is specified on its own line, it should be ignored.  This is
shitty groff behaviour.  Do the same, but raise a warning to this
effect.  This from a TODO noted by schwarze@.

13 years agoNote an error found in the wild.
Kristaps Dzonsons [Mon, 31 Jan 2011 12:52:43 +0000 (12:52 +0000)]
Note an error found in the wild.

13 years agoImplement the \N'number' (numbered character) roff escape sequence.
Ingo Schwarze [Sun, 30 Jan 2011 16:05:37 +0000 (16:05 +0000)]
Implement the \N'number' (numbered character) roff escape sequence.
Don't use it in new manuals, it is inherently non-portable, but we
need it for backward-compatibility with existing manuals, for example
in Xenocara driver pages.
ok kristaps@ jmc@ and tested by Matthieu Herrb (matthieu at openbsd dot org)

13 years agoWhen in a <PRE>, don't print out the <BR> before lines that have leading
Kristaps Dzonsons [Sat, 29 Jan 2011 14:49:44 +0000 (14:49 +0000)]
When in a <PRE>, don't print out the <BR> before lines that have leading
whitespace.

13 years agoRemove unnecessary conditional...
Kristaps Dzonsons [Tue, 25 Jan 2011 17:32:04 +0000 (17:32 +0000)]
Remove unnecessary conditional...

13 years agoArguments to `Bsx' and friends are separated by a non-breaking space.
Kristaps Dzonsons [Tue, 25 Jan 2011 16:20:24 +0000 (16:20 +0000)]
Arguments to `Bsx' and friends are separated by a non-breaking space.
This removes a TODO raised by schwarze@.

13 years agoPush capitalisation of `Bx' second argument into validator, where it belongs.
Kristaps Dzonsons [Tue, 25 Jan 2011 15:46:05 +0000 (15:46 +0000)]
Push capitalisation of `Bx' second argument into validator, where it belongs.

13 years agoProperly uppercase the first-letter of the `Bx' second argument.
Kristaps Dzonsons [Tue, 25 Jan 2011 15:28:56 +0000 (15:28 +0000)]
Properly uppercase the first-letter of the `Bx' second argument.

13 years agoHave `Bx' accept two arguments, not just one, and join these arguments
Kristaps Dzonsons [Tue, 25 Jan 2011 15:17:18 +0000 (15:17 +0000)]
Have `Bx' accept two arguments, not just one, and join these arguments
with "xxBSD-yy"

13 years agoAvoid double blank line before a table preceded by .PP.
Ingo Schwarze [Tue, 25 Jan 2011 12:35:09 +0000 (12:35 +0000)]
Avoid double blank line before a table preceded by .PP.
ok kristaps@

13 years agoSince tbl_data() can now produce multiple spans, let parsebuf()
Ingo Schwarze [Tue, 25 Jan 2011 12:24:27 +0000 (12:24 +0000)]
Since tbl_data() can now produce multiple spans, let parsebuf()
generate man(7) or mdoc(7) nodes for all these spans,
not only for the last one.
Restores the horizontal lines in the cpu(4/hppa) tables.
ok kristaps@

13 years agoDo not skip data after horizontal lines in the layout.
Ingo Schwarze [Tue, 25 Jan 2011 12:16:22 +0000 (12:16 +0000)]
Do not skip data after horizontal lines in the layout.
Instead, let one line of input data add two new spans
to the tbl tree during one single call of tbl_data().
Note that this causes the horizontal line to get parsed
into the tbl tree, but not yet used in the output,
which will be fixed next.
Avoids data loss in cpu(4/hppa).
ok kristaps@

13 years agocorrect horizontal spacing of data cells
Ingo Schwarze [Tue, 25 Jan 2011 12:07:30 +0000 (12:07 +0000)]
correct horizontal spacing of data cells
correct alignment of centered cells
adjust horizontal rule width to the new spacing
ok kristaps@

13 years agoIf %B is specified, quote %T. Noted by schwarze@ in the TODO.
Kristaps Dzonsons [Tue, 25 Jan 2011 10:37:49 +0000 (10:37 +0000)]
If %B is specified, quote %T.  Noted by schwarze@ in the TODO.

13 years agoIgnore .ns (no-space mode), .ps (change point size), .ta (tab control)
Ingo Schwarze [Tue, 25 Jan 2011 01:12:02 +0000 (01:12 +0000)]
Ignore .ns (no-space mode), .ps (change point size), .ta (tab control)
for now.  All of these just cause a bit too much or too little
whitespace, but no serious formatting problems.
Triggered by reports from brad@.

13 years agoAs noticed by deraadt@, it goes without saying that text files
Ingo Schwarze [Tue, 25 Jan 2011 00:40:14 +0000 (00:40 +0000)]
As noticed by deraadt@, it goes without saying that text files
on a UNIX system use UNIX conventions, and UNIX tools working
on them expect that.
ok jmc@