summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make the generated man(7) code more portable by using .PDIngo Schwarze2012-11-181-5/+19
| | | | | | | instead of .sp -1v, which for example Solaris nroff handles poorly. Problem report and patch by millert@, with the print_word chunk tweaked by me.
* Correct indentation for lists and displays inside lists.Ingo Schwarze2012-11-181-6/+103
| | | | | | | Inspired by a diff from millert@, but implemented rather differently and with slightly better functionality. In particular, this one respects -offset and -width arguments found in the input file.
* Fix four small whitespace issues related to trailing punctuationIngo Schwarze2012-11-183-4/+14
| | | | | | | | | reported by Nicolas Joly <njoly at pasteur dot fr>: - add EOS spacing after trailing punctuation after .Cd, .Fc, and .Lb - suppress spacing before trailing punctuation after .Fd Add the remaining issues from the same report to the TODO file.
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-1714-767/+765
| | | | | | | | 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
* Warn about unknown volume or arch in Dt macro arguments;Ingo Schwarze2012-11-163-1/+3
| | | | patch written by Nicolas Joly <njoly at pasteur dot fr>.
* End of sentence spacing after trailing punctuation after .In and .ApIngo Schwarze2012-11-161-8/+0
| | | | | has just been fixed. Note that my problem description was somewhat misleading, even though Nicolas Joly's problem report was fine.
* Two more macros (.Ap and .In) do trailing delimiter handling.Ingo Schwarze2012-11-161-2/+3
| | | | | | | This fixes the end of sentence spacing in OpenBSD open(2) and in about 150 pages in the NetBSD base system. Reported by Nicolas Joly <njoly a pasteur point fr>, merci!
* Improve formatting of badly nested font blocks.Ingo Schwarze2012-11-163-7/+8
| | | | | | | | | | | | | | | | | The basic idea is to already pop the font at the end marker instead of allowing it to linger until the final end of the block. This requires a few preliminaries: * For each block, save a pointer to the previous font to be used in case the block breaks another and gets extended. * That requires making node information writable during rendering. * Now fonts may get popped in the wrong order; hence, after the stack has already been rewound further by some block that began earlier, ignore popping a font that was put on the stack later. * To be able to exploit all this for font blocks, tie processing to their body, not their block, which is more logical anyway. Triggered by florian@ reporting vaguely similar issues with list blocks.
* Fix a crash triggered by .Bl -tag .It Xo .El .Sh found by florian@.Ingo Schwarze2012-11-162-1/+4
| | | | | | | | | | | | | | | * When allocating a body end marker, copy the pointer to the normalized block information from the body block, avoiding the risk of subsequent null pointer derefence. * When inserting the body end marker into the syntax tree, do not try to copy that pointer from the parent block, because not being a direkt child of the block it belongs to is the whole point of a body end marker. * Even non-callable blocks (like Bd and Bl) can break other blocks; when this happens, postpone closing them out in the usual way. Completed and tested at the OpenBSD impromptu Coimbra hackathon (c2k12). Thanks to Pedro Almeida and the Laborat'orio de Computa,c~ao Avan,cada da Universidade de Coimbra (http://www.uc.pt/lca) for their hospitality!
* crash caused by .Ta outside .BlIngo Schwarze2012-11-041-0/+10
|
* freeciv wants .UR/.UE too; from bentley@Ingo Schwarze2012-10-311-0/+2
|
* minor EOS issue reported by Nicolas JolyIngo Schwarze2012-10-121-0/+8
|
* 1) Remove documentation of the groff-1.15 compatibility quirkIngo Schwarze2012-08-291-10/+4
| | | | | | | | | | | of suppressing spacing before a third .Xr argument because that quirk was removed in mdoc_macro.c rev. 1.113. 2) Mark the "section" argument to .Xr as (syntactically) optional, but still do not encourage omitting it. The missing .Op was reported by espie@. Wording tweaked by and ok jmc@, ok millert@.
* .Sq should use curly right quotes in HTML output to match its curlyIngo Schwarze2012-08-121-3/+3
| | | | | | | | | left quotes. Also, properly reinitialize the styles attribute string buffer for each column in a table so that the attributes don't accumulate. Patch from Matthew@ Dempsky, tweaked by me; OpenBSD rev. 1.66.
* document .PD; related to man_term.c rev. 1.134Ingo Schwarze2012-07-291-1/+32
| | | | OpenBSD man.7 rev. 1.30
* Implement .PD for -Tascii.Ingo Schwarze2012-07-292-13/+36
| | | | | | Reminded about the missing feature by millert@. This reduces mandoc/groff differences in OpenBSD base by 25%. ok millert@
* Drop empty .IP such that is does not cause additional vertical spacing.Ingo Schwarze2012-07-182-21/+21
| | | | | Issue first reported by naddy@ in rsync(1). OpenBSD rev. 1.55.
* Drop .sp and .br right after .SH and .SS.Ingo Schwarze2012-07-182-15/+19
| | | | | | | Fixes vertical spacing after "OPTIONS" in gcc(1). Issue first reported by naddy@ in rsync(1). OpenBSD rev. 1.54.
* Let a trailing .Ns macro take effectIngo Schwarze2012-07-182-10/+8
| | | | | | | | even on an input line containing a partial implicit macro. Fixes horizontal spacing in vi(1), ddb(4), and ppp(8). OpenBSD rev. 1.74.
* Fix handling of paragraph macros inside lists:Ingo Schwarze2012-07-186-12/+45
| | | | | | | * When they are trailing the last item, move them outside the list. * When they are trailing any other none-compact item, drop them. OpenBSD rev. mdoc_validate.c 1.107, mdoc.c 1.91
* The mdoc(7) \*(Ba predefined string actually forces roman font;Ingo Schwarze2012-07-183-14/+2
| | | | | | | | | | | | that's stupid because it may break enclosing font changes, but let's do the same for groff bug compatibility. --> Never use \*(Ba, use just plain "|"! <-- Also, predefined strings are already expanded by the roff(7) parser, so the mdoc(7) parser has to look for the expanded string. OpenBSD rev. mdoc.c 1.90 and predefs.in 1.3
* Always fix the man(7) subsection header (.SS) indent to 3n,Ingo Schwarze2012-07-161-1/+1
| | | | | | | do not let it depend on the default indent provided by -Oindent. By default, this doesn't change anything because 7 / 2 = 3; in -Omdoc mode, it makes man(7) output the same as mdoc(7) output. OpenBSD rev. 1.87
* In flush-left mode of both man(7) and mdoc(7), when an output line is brokenIngo Schwarze2012-07-162-3/+8
| | | | | at the position of a literal tab, the tab indents the following line. Fixes the perl(1) SYNOPSIS; reminded by deraadt@; OpenBSD rev. 1.66.
* For .El .sp, avoid the weird .sp -1v .PP .PP output sequence.Ingo Schwarze2012-07-161-2/+3
| | | | Synching to OpenBSD rev. 1.38.
* Several -mdoc parser improvements related to vertical spacing:Ingo Schwarze2012-07-163-8/+42
| | | | | | | | | | * So far, .Pp and .Lp were removed before paragraph type blocks. * Now also remove .br before paragraph type blocks. * Treat .Lp as a paragraph like .Pp, so remove .Pp, .Lp, .br before it. * Do not treat .sp as a paragraph, don't remove anything before it. * After .Sh, .Ss, .Pp, and .Lp, remove .Pp, .Lp, .sp, .br, and blank lines. * After .sp and .br, remove .br. OpenBSD rev. mdoc.c 1.89 and mdoc_validate.c 1.106
* Translate blank input lines to .sp just like in mdoc(7),Ingo Schwarze2012-07-142-5/+17
| | | | | | and ignore .sp after .PP. This fixes vertical spacing for blank lines after .PP and for .sp after .PP. OpenBSD rev. man.c 1.68 and man_term.c 1.86
* In -Tman .Bl -compact, skip the blank line only before the first itemIngo Schwarze2012-07-141-1/+2
| | | | | of the first list in a section, not before every item of the first list. OpenBSD rev. 1.37
* Adjust -Tman SYNOPSIS .Nm indentation using .HP; requested by millert@.Ingo Schwarze2012-07-131-1/+10
| | | | | There are still lots of ugly line breaks, to be fixed later. OpenBSD rev. 1.36
* If the tag in .Bl -tag .It would leave exactly one blank before theIngo Schwarze2012-07-131-27/+54
| | | | | | | | | body of the item, mdoc(7) breaks the line, whereas the .TP used to translate this to man(7) does not. Thus, insert an explicit roff(7) line break in this place. To be able to correctly count the characters, do not pass font escapes an the like through print_word(). OpenBSD rev. 1.35
* In -man -Tascii, support .sp with negative argument.Ingo Schwarze2012-07-132-72/+100
| | | | | | In -mdoc -Tman, improve the framework to control vertical spacing. Use both to support .Bl -compact (surprisingly hard to get right). OpenBSD rev. 1.85 and 1.34, respectively.
* The post_nm() validation function crashed when the first .Nm child nodeIngo Schwarze2012-07-123-14/+19
| | | | | | | | | | was a non-text node. Fix this by rewriting post_nm() to always set the meta name to UNKNOWN when the name is missing or unusable. While here, make MANDOCERR_NONAME an ERROR, as it usually renders the page content unintelligible. Bug reported by Maxim <Belooussov at gmail dot com>, thanks. OpenBSD rev. 1.105
* Do not crash in -Tman on:Ingo Schwarze2012-07-121-8/+15
| | | | | | | * .Fn with exactly one argument * .Bl -hang without a -width Now all 3776 OpenBSD base manuals build without crashing. OpenBSD rev. 1.33
* Polish -Tman .Rs support.Ingo Schwarze2012-07-111-27/+67
| | | | | All mdoc(7) macros are now supported by -Tman. OpenBSD rev. 1.32
* fix position and formatting of %U;Ingo Schwarze2012-07-112-3/+3
| | | | OpenBSD rev. 1.104 and 1.145, respectively
* basic implementation of -Tman .Bl -column using tbl(7); OpenBSD rev. 1.31Ingo Schwarze2012-07-111-5/+41
|
* basic implementation of -Tman .Bl -tagIngo Schwarze2012-07-101-5/+5
| | | | | while here, do some minor outflags cleanup OpenBSD rev. 1.30
* multiple fixes to -Tascii .HP rendering:Ingo Schwarze2012-07-102-39/+56
| | | | | | | | | | | | | | | | | | * do not add an excessive blank line before the block * in literal mode, start a new line after the tag getting this to work requires some general (print_man_node) fixes: * in literal mode, break the output line at the end of each input line, not just after those input lines ending in text * but don't break it when there was no output on the line * and adjust the margins after the .HP tag these general fixes require an adjustment to -Tascii .TP rendering: * set up NOBREAK mode before the body, not after the head finally, based on all this, implement -Tman .Bl -hang in terms of .HP OpenBSD rev. 1.84 and 1.29, respectively
* Remove a hack that was intended for groff-1.15 bug compatibility:Ingo Schwarze2012-07-101-6/+1
| | | | | | | | When the width of a tag in .Bl -hang was exactly one character shorter than the maximum length that would fit, the following text would have a negative hang of one character (i.e., hang to the left). That bug is no longer present in groff-1.21, so relax mandoc, too. OpenBSD rev. 1.65
* * implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .ItIngo Schwarze2012-07-104-19/+149
| | | | | | | | | | * fix -Tman .Bl -bullet .It * adjust the -Tascii .Bl -bullet -dash -hyphen .It default and minimum width to new groff standards, it changed from 4n (in groff 1.15) to 2n (in groff 1.21) * same for -Tascii -enum, it changed from 5n to 2n * use -hang formatting for -Tascii -enum -width 2n * for -Tascii -enum, the default is -width 3n
* fix -Tascii .Fd line breakingIngo Schwarze2012-07-092-18/+35
| | | | | and implement -Tman .Fd OpenBSD rev. 1.27 and 1.143, respectively
* implement -Tman .Eo and .Ec; OpenBSD rev. 1.26Ingo Schwarze2012-07-091-3/+12
|
* Implement -Tman .Bf.Ingo Schwarze2012-07-091-5/+41
| | | | | | | | To get the spacing right, * avoid man(7) code line breaks at places where no spacing is allowed * allow spacing right after .Sm on * allow spacing after empty .Fl at the end of an input line OpenBSD rev. 1.25
* fix -Tman font handling for:Ingo Schwarze2012-07-091-66/+146
| | | | | | .Ad .Ar .Cd .Cm .Dv .Em .Er .Ev .Fa .Fl .Fn .Fo .Ft .Ic .In .Lk .Li .Ms .Mt .Nm .Pa .Sx .Sy .Tn .Va .Vt OpenBSD rev. 1.24
* implement -Tman .No and .Mt; OpenBSD rev. 1.23Ingo Schwarze2012-07-091-14/+26
|
* fix .Lk for -Tascii and implement it for -TmanIngo Schwarze2012-07-082-17/+45
| | | | OpenBSD rev. 1.22 and 1.142, respectively
* fix vertical spacing for -Tman SYNOPSIS .Fn .Fo .Ft .In .Nm .Va .VtIngo Schwarze2012-07-081-11/+64
| | | | OpenBSD rev. 1.21
* implement -Tman .AnIngo Schwarze2012-07-082-1/+31
| | | | | also reset -[no]split mode at .Sh AUTHORS in -Tascii OpenBSD rev. 1.20 and 1.141, respectively
* Add flags to insert a .sp or .br request before the next output,Ingo Schwarze2012-07-081-49/+29
| | | | | | shortening some frequent idioms and preparing for better vertical spacing in the SYNOPSIS; no functional change intended. OpenBSD rev. 1.19
* Instead of adding one integer variable for each global boolean output flagIngo Schwarze2012-07-081-180/+176
| | | | | | | and passing around a structure containing them into each and every function, just use a single static bitfield. In preparation for adding more output flags to support more features. OpenBSD rev. 1.18
* implement -Tman .VaIngo Schwarze2012-07-081-2/+2
| | | | | and fix -Tman .Vt for the non-SYNOPSIS case OpenBSD rev. 1.17