summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* improve rounding rules for scaling unitsIngo Schwarze2017-06-1423-47/+66
| | | | in horizontal orientation in the terminal formatter
* harmless, but weird typo; found with afterstep_faq(1)Ingo Schwarze2017-06-141-1/+1
|
* implement the roff(7) d (macro or string defined) conditionalIngo Schwarze2017-06-145-8/+70
|
* implement roff(7) .rj (right justify) requestIngo Schwarze2017-06-147-32/+39
|
* implement the roff(7) \p (break output line) escape sequenceIngo Schwarze2017-06-149-9/+110
|
* Partial support for the \n[an-margin] number register.Ingo Schwarze2017-06-134-2/+56
| | | | | | | | | | | | | | | 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.
* If the layout is empty except for requesting a left vertical frame,Ingo Schwarze2017-06-131-0/+2
| | | | | | | 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.
* Delete the arbitrary range restriction for -Owidth.Ingo Schwarze2017-06-132-3/+2
| | | | | | | 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.
* fix the interaction of the allbox option with spanned cells in the layoutIngo Schwarze2017-06-133-16/+49
|
* Explicitly ignore .br, .ce, and .sp inside tbl(7) text blocks.Ingo Schwarze2017-06-131-2/+3
| | | | | | 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.
* test the new allbox and wrapping featuresIngo Schwarze2017-06-125-1/+95
|
* Two minor fixes for the "allbox" modifier:Ingo Schwarze2017-06-121-2/+5
| | | | | | 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.
* If a tbl(7) layout contains a 'w' (minimum width) modifier for aIngo Schwarze2017-06-121-2/+3
| | | | | | | 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.
* implement the tbl(7) "allbox" option;Ingo Schwarze2017-06-121-1/+7
| | | | used for example by curs_getch(3) and GLwDrawingArea(3)
* fix column width calculation for text block cellsIngo Schwarze2017-06-124-14/+21
|
* Implement automatic line breakingIngo Schwarze2017-06-1212-88/+343
| | | | | inside individual table cells that contain text blocks. This cures overlong lines in various Xenocara manuals.
* ooops, fix a glitch in the previous commit...Ingo Schwarze2017-06-111-1/+1
|
* Style message about legacy man(7) date format in mdoc(7) documentsIngo Schwarze2017-06-1159-0/+59
| | | | | and operating system dependent messages about missing or unexpected Mdocdate; inspired by mdoclint(1).
* Style message about legacy man(7) date format in mdoc(7) documentsIngo Schwarze2017-06-11101-15/+142
| | | | | and operating system dependent messages about missing or unexpected Mdocdate; inspired by mdoclint(1).
* style message about missing .Fn markup; inspired by mdoclintIngo Schwarze2017-06-114-7/+35
|
* Do not issue the message "no blank before trailing delimiter" for .No.Ingo Schwarze2017-06-112-4/+3
| | | | | | | 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@.
* add forgotten fileIngo Schwarze2017-06-111-0/+0
|
* fix order of messagesIngo Schwarze2017-06-111-1/+1
|
* Reduce false positives for the "no blank before trailing delimiter" message.Ingo Schwarze2017-06-101-2/+75
| | | | This brings us down to one false positive for about every 18 pages.
* minor markup simplificationsIngo Schwarze2017-06-102-2/+2
|
* style message about missing blank before trailing delimiter;Ingo Schwarze2017-06-10155-238/+483
| | | | inspired by mdoclint(1), and jmc@ considers it useful
* do not break the line between Bsx/Bx/Fx/Nx/Ox/Dx and its argumentsIngo Schwarze2017-06-101-9/+18
|
* Properly reinitialize roffce_node between parses,Ingo Schwarze2017-06-081-0/+4
| | | | | or this may crash with use-after-free in makewhatis(8); reported by jmc@, thanks!
* Implement w layout specifier (minimum column width).Ingo Schwarze2017-06-0812-31/+140
| | | | | Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
* make the internal a2roffsu() interface more powerful by returningIngo Schwarze2017-06-0811-46/+44
| | | | | a pointer to the end of the parsed data, making it easier to parse subsequent bytes
* warning about unknown .Lb arguments; inspired by mdoclint(1)Ingo Schwarze2017-06-085-0/+13
|
* style checks related to .Er; inspired by mdoclint(1)Ingo Schwarze2017-06-075-2/+77
|
* Also catch "new sentence, new line" if there are three blanksIngo Schwarze2017-06-071-6/+12
| | | | | between the sentences. Thomas Klausner says he has seen some of these, and i don't see any false positives.
* Make "new sentence, new line" detection stricter:Ingo Schwarze2017-06-071-1/+1
| | | | | | | | | 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...
* Prepare the terminal driver for filling multiple columns in parallel,Ingo Schwarze2017-06-072-25/+42
| | | | | | | | | | 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.
* Prepare the terminal driver for filling multiple columns in parallel,Ingo Schwarze2017-06-078-236/+253
| | | | | | 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.
* The \h escape sequence provides another method for moving backwards,Ingo Schwarze2017-06-072-15/+29
| | | | | | 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...
* Implement the roff(7) .rn (rename macro or string) request.Ingo Schwarze2017-06-073-7/+109
| | | | | | | | | | 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.
* document the new .ce implementationIngo Schwarze2017-06-061-1/+4
|
* Minimal implementation of the roff(7) .ce request (center a numberIngo Schwarze2017-06-069-11/+132
| | | | | of input lines without filling). Contrary to groff, high-level macros abort .ce mode for now.
* Implement the roff(7) .mc (right margin character) request.Ingo Schwarze2017-06-0412-101/+119
| | | | | | 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.
* Make term_flushln() simpler and more robust:Ingo Schwarze2017-06-044-105/+38
| | | | | | Eliminate the "overstep" state variable. The information is already contained in "viscol". Minus 60 lines of code, no functional change intended.
* Pure preprocessor implementation of the roff(7) .ec and .eo requestsIngo Schwarze2017-06-043-85/+107
| | | | | | | | | | | | | | | | | (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.
* ignore blank lines in man(7) next line scope;Ingo Schwarze2017-06-0319-7/+63
| | | | strange groff edge case behaviour found in multimedia/mjpegtools
* enable -Wstyle by default in -Tlint; OK jmc@Ingo Schwarze2017-06-032-3/+3
|
* Partial implementation of \h (horizontal line drawing function).Ingo Schwarze2017-06-024-6/+75
| | | | | | | | | | | 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.
* add about 15 missing character escape sequences found in groff_char(7);Ingo Schwarze2017-06-0215-33/+112
| | | | triggered by multimedia/mkvtoolnix mkvmerge(1) using \(S2
* Minimal implementation of the \h (horizontal motion) escape sequence.Ingo Schwarze2017-06-016-7/+32
| | | | Good enough to cope with the average DocBook insanity.
* STYLE message about full stop at the end of .Nd; inspired by mdoclint(1)Ingo Schwarze2017-06-014-0/+13
|
* STYLE message about missing use of Ox/Nx/Fx/Dx; OK jmc@ wiz@Ingo Schwarze2017-05-314-0/+44
|