aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.c
Commit message (Collapse)AuthorAgeFilesLines
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-1/+2
| | | | const struct regset pointer. No functionality.
* Initial chunks for variable-width fonts. Pushes all width calculationsKristaps Dzonsons2010-06-251-40/+42
| | | | | | | | in mdoc_term.c and man_term.c down into term.c. This is still not implemented in term.c, although stubs for width calculations are in place. From now on, offset, rmargin, and other layout variables are abstract screen widths. They will resolve to the the familiar values for -Tascii but -Tps will eventually use points instead of chars.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Remove arg_getattrs(), as we only have arg_getattr()-like calls now thatKristaps Dzonsons2010-06-131-45/+15
| | | | -width is cached.
* Switch on cached -width usage in front-ends.Kristaps Dzonsons2010-06-131-10/+11
|
* Allow -width for lists to be cached in mdoc_bl. This requires someKristaps Dzonsons2010-06-131-1/+2
| | | | | | trickery because widths may be on-the-fly recalculated. I don't like how these are split between mdoc_action.c and mdoc_validate.c, but for the time being, it'll do.
* Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaultsKristaps Dzonsons2010-06-121-11/+11
| | | | | to 6n if no value is specified" and added regression tests for `Bl' testing against the empty -offset argument.
* Reverted to mdoc_term.c 1.149 (`It' does not inherit `Bl's cache,Kristaps Dzonsons2010-06-121-8/+11
| | | | | obviously, which was causing fallout) and again remove the loop code. Tested more thoroughly.
* Moved `Bl -compact' into cached data. This allowed the removal ofKristaps Dzonsons2010-06-121-11/+10
| | | | scanning the argv list in print_bvspace(), and thus the parent pointer.
* `Bl' is now using a struct instead of a single enum mdoc_list for itsKristaps Dzonsons2010-06-121-5/+6
| | | | cached values. You can probably guess where this is going.
* Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed inKristaps Dzonsons2010-06-121-19/+16
| | | | | | the "data" union in mdoc_node. Allows me to remove some ugly loops in the front-end and duplicate tests in mdoc_action.c. Add a regression test to make sure we're not doing anything bad (more to come).
* Added enum mdoc_disp (similar to enum mdoc_list). Display types are nowKristaps Dzonsons2010-06-121-42/+7
| | | | | | | | | | | only calculated once in mdoc_validate.c. Noted that `Bd -file xxx' is not supported: it now raises a fatal warning. This is noted in mdoc.7. Empty `Bd' now defaults to LIST_ragged, which is not quite what groff does, but close enough (gross just throws away the `Bd' and gets upset when it encounters an `Ed').
* Fix a regression that crept in in man_term.c 1.73 and mdoc_term.c 1.144.Ingo Schwarze2010-06-101-4/+3
| | | | | | | | | | | | | | | | When the title line uses special characters, mandoc will segfault. Thus, first set up the character tables, then print the header, as we always did. Found in OpenBSD /usr/src/usr.sbin/bind/bin/check/named-checkconf.8. While here, set p->tabwidth in terminal_man() for symmetry with terminal_mdoc(), as suggested by millert@ (and already committed to OpenBSD earlier). Since 5 is the default, this is not strictly required, but it is certainly clearer and more robust. "looks fine" kristaps@
* Have the standard manpage header and footer print on every page of -TpsKristaps Dzonsons2010-06-091-7/+6
| | | | | | | | | | | | | | | output. This is more tricky than you may think: we can't just call the header function out-of-state (i.e., before a flushln has occured) because we'd clobber our current state. Thus, we call at the beginning and dump the output into an auxiliary buffer. For the record, I don't think there's any other clean way to do this. The only other Way That Works is to copy-aside *all* termp state, zero it, and do the necessary headf/footf. This is just as complex, as memory needs to be alloc'd and free'd per margin. Unfortunately, this prohibits page numbering (the margin is only printed once), so I'll probably end up re-writing this down the line.
* First check-in of PostScript output. This does not change any logicKristaps Dzonsons2010-06-071-7/+15
| | | | | | within term.c, but does add a small shim over putchar() that switches on the output engine. Prints, for this initial version, only monospace and without font decorations. It's a start.
* Normalise SYNOPSIS behaviour after I gave up on following groff'sKristaps Dzonsons2010-06-071-77/+91
| | | | | | | | | | | | | | | | | | | | | inconsistent behaviour. In short: Some macros are displayed differently in the SYNOPSIS section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft. All of these macros are output on their own line. If two such dissimilar macros are pair-wise invoked (except for Ft before Fo or Fn), they are separated by a vertical space, unless in the case of Fo, Fn, and Ft, which are always separated by vertical space. Behaviour ok Jason McIntyre, ingo@. Fallout will be treated case-by-case. I had to clear out some regressions that were testing against groff's stranger behaviours: these will now break, as we don't care about such invocations. Also removed the newline for `Cd' invocation in a non-SYNOPSIS context.
* Merge a fix to avoid a regression in OpenBSD:Ingo Schwarze2010-06-061-1/+4
| | | | | | | | | | | Restore the blank line before .In in SYNOPSIS except right after .Sh or right after another .In. Even though Kristaps says SYNOPSIS blank-line handling is still very much work in progress and more is probably needed, this one is useful to keep in sync with OpenBSD. "fine" kristaps@
* Fixed -Tascii and -Thtml rendering of `Ft' and `Fo'.Kristaps Dzonsons2010-06-061-33/+33
|
* Fix following the first: `Ft' is given special treatment if specified beforeKristaps Dzonsons2010-06-041-2/+4
| | | | `Fn'.
* Fixed `Fn' newline behaviour and added some regression tests to thisKristaps Dzonsons2010-06-041-3/+10
| | | | | | | extent. Documented `Fn'. Please note the COMPATIBILITY note regarding historic groff.
* Documented `In' in full.Kristaps Dzonsons2010-06-041-18/+15
| | | | | | Fixed `In' to behave properly: it wasn't properly breaking lines, formatting, or really anything else. Noted COMPATIBILITY with OpenBSD's groff, which pukes all over `In'.
* Fixed `Fd' to format in the right way. Found when confused by what theKristaps Dzonsons2010-06-041-6/+1
| | | | | hell `Fd' is supposed to do anyway (answer: it's a historical macro and we shouldn't be doing anything with it anyway).
* De Morgan's law not being applied properly. Noted by Ulrich Spoerlein.Kristaps Dzonsons2010-06-011-2/+2
|
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-1/+2
| | | | | | | | | | | | | | Add `Ta' macro, which is basically a NULL case everywhere but in mdoc_macro.c, where it closes out an existing `It' body scope and opens a new one, then continues parsing as in phrase() (TODO: merge these two?). Fix where scope-breaking was silently just dying instead of printing an error. Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context. We now support arbitrarily complex `It' contents for `Bl -column'.
* Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. ThisKristaps Dzonsons2010-05-301-17/+25
| | | | | | | | | | will make it easy for re-entrant parsing of `Ta' macros to fit in with standard closure rules. Added some more regressions for `Bl -column'. Note that one should fail, as documented in the TODO file. Recorded change of AST BNF in mdoc.3.
* Moved printing of empty word [back] into mdoc_action.c so that it's notKristaps Dzonsons2010-05-291-3/+1
| | | | mirrored across front-ends.
* Commit of patch floated on discuss@ a few days ago: if an in_line scopeKristaps Dzonsons2010-05-291-1/+3
| | | | | | | | | | has not been opened and closing punctuation is encountered AND the macro is marked as accepting no-content (or `Li'), then open an empty scope. Added regression tests for `Fl' and `Li' testing this behaviour. Also, squeeze hyph0.in tests into the last characters of each line so that groff doesn't hyphenate and break the test.
* Documented `Ud'.Kristaps Dzonsons2010-05-261-1/+5
| | | | | | | | | | | Proper EOS handling for `Rv', `Ex', `Ud', and `Bt'. Both `Bt' and `Ud' now warn about and discard line arguments (reported by Ulrich Spoerlein). Collapsed posts_xr into posts_wtext (harmless: they're the same thing). Added regressions for `Ud' and `Bt'.
* sync to OpenBSD:Ingo Schwarze2010-05-241-9/+7
| | | | | | | save the visual cursor position in term_flushln() and use that to avoid multiple blank lines in nested lists while still putting subsequent empty list tags each on their own line; "go ahead" kristaps@
* Handle literal tab characters both in literal context (.Bd -literal)Ingo Schwarze2010-05-241-1/+6
| | | | | | | | and outside. In literal context, tab stops are at each eigth column; outside, they are at each fifth column. from OpenBSD mdoc_term.c rev. 1.75; "commit" kristaps@
* fix an obvious typo in print_bvspace():Ingo Schwarze2010-05-241-2/+2
| | | | rev. 1.125 broke vertical spacing in .Bl -column
* Fix 1.125: Add missing return in termp_nm_pre.Joerg Sonnenberger2010-05-221-1/+2
|
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-91/+48
| | | | | | | This will eventually be used so that mdoc_macro can known whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-3/+7
| | | | | | | | | | | stringified in main.c. Allow `An' to handle an argument and child (with a warning). Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a warning). Allow inconsistent column syntax to only raise a warning.
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-2/+2
| | | | | | All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc. Useful warning printed if unknown manual section. Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.
* Make the output width an option for ascii_alloc and use that to computeJoerg Sonnenberger2010-05-151-2/+2
| | | | the default margin. Hard-code 80 chars/line for now.
* Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.Kristaps Dzonsons2010-05-131-8/+8
| | | | | Fixed assumption that parse-point == 1 equates to beginning of line (false if whitespace separates macro and control character). Fixed line-break for non-first-macro in several SYNOPSIS macros.
* Tiny EOS patch. Back-end cues front-end through flag. Front-end cues ↵Kristaps Dzonsons2010-05-121-1/+4
| | | | output engine with flag.
* -man also now has unbound margins for literal context.Kristaps Dzonsons2010-05-101-3/+3
|
* Setting maxmargin, too (for completion).Kristaps Dzonsons2010-05-091-9/+13
|
* Allow literal contexts to have unbound line lengths (from Ingo Schwarze's ↵Kristaps Dzonsons2010-05-091-23/+56
| | | | mandoc TODO by way of Jason McIntyre).
* Fixed %T: it now correctly underlines, instead of quoting (noted by Jason ↵Kristaps Dzonsons2010-04-081-22/+2
| | | | McIntyre and posted on Ingo Schwarze' mandoc-todo list).
* Allow `Bd' to accept (warn about then ignore) in-line arguments.Kristaps Dzonsons2010-04-061-3/+3
|
* Let `Bl' accept arguments on the head line with a warning (these are ignored ↵Kristaps Dzonsons2010-04-061-2/+12
| | | | in the front-end device) (noted by Theo de Raadt).
* `Fl' now correctly suppresses the trailing space if followed by macros on ↵Kristaps Dzonsons2010-04-061-3/+3
| | | | the same line.
* Merged patch by Ingo Schwarze allowing `Xr' to pass through with no ↵Kristaps Dzonsons2010-04-031-2/+5
| | | | arguments (emits warning of course).
* Integrate Ingo Schwarze's patch for mdoc_iscdelim() (tri-state for opening ↵Kristaps Dzonsons2010-03-291-2/+2
| | | | | | | | | | | and closing macro punctuation). Modify blk_part_exp() to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_exp(). Modify blk_part_imp() for to correctly handle leading punctuation before HEAD. Significantly clean up and document blk_part_imp(). Integrate Ingo Schwarze's patch for args() (using new mdoc_iscdelim() format). Documented bad `Ec' handling for later work in mdoc_term.c/mdoc_html.c.
* Fixed two very subtle bugs in retaining overstep and maxrmargin widths ↵Kristaps Dzonsons2010-03-231-1/+4
| | | | between parse sequences.
* Fix in handling Vt in SYNOPSIS with trailing punctuation. Spotted by Joerg ↵Kristaps Dzonsons2010-01-301-3/+19
| | | | Sonnenberger.
* Fix of subtle, but significant, resetting of tags when in list mode. ↵VERSION_1_9_15-pre2Kristaps Dzonsons2010-01-011-17/+20
| | | | Pointed out by Ingo Schwarze.