summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* If man(7) next-line scope is open and the line ends with \c,Ingo Schwarze2018-08-253-20/+59
| | | | the scope remains open. Needed for example for groff_man(7).
* Rudimentary implementation of the roff(7) .while request.Ingo Schwarze2018-08-2424-204/+479
| | | | | | | | | | | Needed for example by groff_hdtbl(7). There are two limitations: It does not support nested .while requests yet, and each .while loop must start and end in the same scope. The roff_parseln() return codes are now more flexible and allow OR'ing options.
* The upcoming .while request will have to re-execute roff(7) linesIngo Schwarze2018-08-239-136/+78
| | | | | | | parsed earlier, so they will have to be saved for reuse - but the read.c preparser does not know yet whether a line contains a .while request before passing it to the roff parser. To cope with that, save all parsed lines for now. Even shortens the code by 20 lines.
* Implement the roff(7) .shift and .return requests,Ingo Schwarze2018-08-2321-195/+449
| | | | | | | | | | | | | | for example used by groff_hdtbl(7) and groff_mom(7). Also correctly interpolate arguments during nested macro execution even after .shift and .return, implemented using a stack of argument arrays. Note that only read.c, but not roff.c can detect the end of a macro execution, and the existence of .shift implies that arguments cannot be interpolated up front, so unfortunately, this includes a partial revert of roff.c rev. 1.337, moving argument interpolation back into the function roff_res().
* Implement the \\$@ escape sequence (insert all macro arguments,Ingo Schwarze2018-08-212-4/+23
| | | | | | | | | | | | quoted) in addition to the already supported \\$* (similar, but unquoted). Then use \\$@ to improve the implementation of the .als request (macro alias). Needed by groff_hdtbl(7). Gosh, it feels like the manual pages of the groff package are exercising every bloody roff(7) feature under the sun. In the manual page source code itself, not merely in the implementation of the used macro packages, that is.
* Improve the ASCII rendering of \(Po (Pound Sterling)Ingo Schwarze2018-08-2118-96/+92
| | | | | and of the playing card suits to match groff, using feedback from Ralph Corderoy <ralph at inputplus dot co dot uk>.
* Fix some issues found looking at groff_char(7):Ingo Schwarze2018-08-2110-13/+18
| | | | | | * Add two missing characters, \('Y and \('y. * The Weierstrass p is not capital, see http://unicode.org/notes/tn27/. * Add a groff-compatible ASCII transliteration for U+02DC: "~".
* \f[] means \fP, not \fRIngo Schwarze2018-08-201-4/+7
|
* Expand \n(.$ (the number of macro arguments) right in roff_userdef(),Ingo Schwarze2018-08-201-7/+34
| | | | | | | | before even reparsing the expanded macro. That is the least dirty way to fix the bug that \(.$ remained set after execution of the user-defined macro ended. Any other way to fix it would probably require changes to read.c, which really shouldn't be bothered with such roff(7) internals.
* Disable one test for now that is broken after the addition of \).Ingo Schwarze2018-08-192-4/+3
| | | | | | | | It is not broken because of \), which is correctly implemented, but the addition merely reveals a hidden bug elsewhere, almost certainly in \\ handling. Given that \\ is among the most mysterious escape sequences and using it is very strongly discouraged in manual pages, fixing that is not urgent - and may be hard.
* Add the \) special character, a variant of \& so arcane that iIngo Schwarze2018-08-191-0/+1
| | | | | intentionally leave it undocumented. Abused for example in the groff(7) manual page.
* Do alignment of non-numeric strings in numeric cells the same wayIngo Schwarze2018-08-192-58/+101
| | | | | | as groff, and also honour the explicit alignment indicator "\&". This required an almost complete rewrite of both the measurement function and the formatter function for numeric cells.
* do not print horizontal lines inside vertical spansIngo Schwarze2018-08-191-6/+20
|
* Mostly complete implementation of the 'c' (character available)Ingo Schwarze2018-08-193-14/+60
| | | | | | | | | | | roff conditional, except that the .char request still isn't supported and that behaviour differs from groff in many edge cases. But at least valid character names and numbers are now distinguished from invalid ones. This also fixes the bug that parsing of the 'c' conditional was incomplete, which resulted in leaking the tested character to the input parser at the beginning of the body when the condition was inverted.
* Bugfix: When a line ends with '\ \"', don't strip the trailing spaceIngo Schwarze2018-08-181-1/+2
| | | | because that turned it into a bogus line continuation.
* support the highly surprising escape sequence \# (line continuationIngo Schwarze2018-08-182-1/+14
| | | | with comment); used for example by gropdf(1)
* paragraphs can contain .MT and .UR blocksIngo Schwarze2018-08-181-1/+2
|
* If a tbl(7) column contains both text cells and numeric cells,Ingo Schwarze2018-08-182-4/+10
| | | | horizontally align the numbers in the same way as groff does.
* .RE causes a line break even if .RS is not openIngo Schwarze2018-08-181-0/+6
|
* .SY causes a one-column indentation even without any argumentIngo Schwarze2018-08-181-1/+1
|
* Do not allocate a column for decimal points if all numbers are integers.Ingo Schwarze2018-08-182-12/+8
|
* Unsurprisingly, zero-width non-breaking spaces have... width 0.Ingo Schwarze2018-08-181-2/+1
|
* end of sentence detection after .ME and .UE, useful for some GNU manualsIngo Schwarze2018-08-181-0/+2
|
* The .nf/.fi (fill mode) requests never have text childrenIngo Schwarze2018-08-181-2/+2
| | | | and in particular do not reset font mode.
* Two consecutive .SY blocks only get a blank line in betweenIngo Schwarze2018-08-182-2/+10
| | | | if the first one is explicitly closed with .YS.
* prevent line breaks in the middle of .OPIngo Schwarze2018-08-181-1/+2
|
* Massively reduce the amount of text, cutting it down to what is neededIngo Schwarze2018-08-181-369/+72
| | | | | | | | | | | to understand existing man(7) code and deleting parts that would only be useful for writing new documents, which we strongly discourage: * Delete the MANUAL STRUCTURE section which merely duplicates mdoc(7). * Delete internal cross references only useful for writing new code. * Delete many instances of "included only for compatibility" as the whole language is only provided for compatibility. * Fix a few minor errors and omissions.
* implement the GNU man-ext .SY/.YS (synopsis block) macro in man(7),Ingo Schwarze2018-08-189-6/+115
| | | | used in most manual pages of the groff package
* Remove more pointer arithmetic passing via regions outside the arrayIngo Schwarze2018-08-1716-135/+161
| | | | | that is undefined according to the C standard. Robert Elz <kre at munnari dot oz dot au> pointed out i wasn't quite done yet.
* implement the GNU man-ext .TQ macro in man(7),Ingo Schwarze2018-08-168-17/+27
| | | | used for example by groff_diff(7)
* Do not calculate a pointer to a memory location before the beginning ofIngo Schwarze2018-08-162-6/+4
| | | | | | a static array. Christos Zoulas, Robert Elz, and Andreas Gustafsson point out that is undefined behaviour by the C standard even if we never access the pointer.
* Document \*(.T.Ingo Schwarze2018-08-161-39/+22
| | | | | | | | While here, delete the section about predefined strings. For manual pages, the concept is not important enough to be discussed in such a prominent place, and some aspects of the text were also misleading. Add a shorter version of the relevant parts to the description of the \* escape sequence instead.
* Implement the \*(.T predefined string (interpolate device name)Ingo Schwarze2018-08-1613-10/+144
| | | | | by allowing the preprocessor to pass it through to the formatters. Used for example by the groff_char(7) manual page.
* process UTF-8 input even in ASCII output mode,Ingo Schwarze2018-08-161-2/+2
| | | | and provide a way to specify additional diff(1) options
* fix incomplete variable renaming in previous;Ingo Schwarze2018-08-151-1/+1
| | | | found by Thomas Klausner <wiz at NetBSD> via a compiler warning
* Change comment: NetBSD just fixed their headers; but leave theIngo Schwarze2018-08-151-1/+1
| | | | | workaround in place for now for the benefit of older systems, and other systems might contain similar problems.
* NULL requires <stddef.h>Ingo Schwarze2018-08-151-0/+1
|
* Autodetect whether _GNU_SOURCE or _OPENBSD_SOURCE are needed; theIngo Schwarze2018-08-156-61/+66
| | | | | latter is a NetBSD idiosyncrasy reported by wiz@. Also take into account that NetBSD declares getsubopt(3) in the wrong header.
* support tail arguments on the .ME and .UE macros,Ingo Schwarze2018-08-1410-35/+60
| | | | used for example in the ditroff(7) manual of the groff package
* error message for invalid -S argumentIngo Schwarze2018-08-101-0/+9
|
* handle the non-portable GNU-style \[charNN], \[charNNN] characterIngo Schwarze2018-08-103-10/+31
| | | | escape sequences, used for example in the groff_char(7) manual page
* The groff man-ext macros define fonts CB, CI, and CR,Ingo Schwarze2018-08-104-11/+15
| | | | | and some groff manual pages actually use them in .ft requests. It's easy enough to handle these .ft requests in mandoc, too.
* Implement the roff(7) .nop (no operation) request.Ingo Schwarze2018-08-103-8/+18
| | | | | Examples of manual pages (ab)using it include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
* If somebody asks "man 3 chmod",Ingo Schwarze2018-08-091-2/+8
| | | | | | don't respond with the lie: "No entry for chmod in the manual." Instead, say "No entry for chmod in section 3 of the manual." Came up after a question from kn@; OK kn@.
* some fixes for the "www" and "www-install" maintainer targetsIngo Schwarze2018-08-091-8/+13
|
* release 1.14.4VERSION.1.14.4Ingo Schwarze2018-08-081-5/+7
|
* Even though we strongly discourage escaping hyphens in manual pagesIngo Schwarze2018-08-081-1/+1
| | | | | in general, when introducing the *typographic* term "hyphen", actually display a real hyphen in output modes supporting it.
* Reorder the text in the "Dashes and Hyphens" subsection to keep theIngo Schwarze2018-08-081-24/+24
| | | | | | simplest and most important instructions together and at the beginning. No text change. Suggested by jmc@.
* Clarify the confusing "(text)" annotation in the character lists.Ingo Schwarze2018-08-081-16/+17
| | | | | | | | | | In some cases, it meant "render as an ASCII character in output modes that have a notion of codepoints" (e.g. UTF-8, HTML); in other cases, "render in the text font in output modes that also provide a special font for mathematical symbols" (e.g. PostScript, PDF). Also explicitly annotate the escape sequences that use a special font if available. OK bentley@
* After years of deliberation, finally provide a clear recommendationIngo Schwarze2018-08-081-14/+19
| | | | | | | | for hyphens and minus signs in manual pages. Since there is consensus that a typographically perfect solution is impossible, let's KISS - just write "-", don't bother with "\-", all currently relevant manual page formatters can handle "-" reasonably. OK jmc@ bentley@