summaryrefslogtreecommitdiffstats
path: root/roff.7
Commit message (Collapse)AuthorAgeFilesLines
* minor polishing, in parts related to functional improvements in the past,Ingo Schwarze2018-12-161-20/+28
| | | | and also adding some cross references for important escape sequences
* Yet another round of improvements to manual font selection.Ingo Schwarze2018-12-161-41/+77
| | | | | | | | | Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP. In regress.pl, only strip leading whitespace in math mode.
* Several improvements to escape sequence handling.Ingo Schwarze2018-12-151-0/+43
| | | | | | | | | | | | | | | | | | | | | | | * Add the missing special character \_ (underscore). * Partial implementations of \a (leader character) and \E (uninterpreted escape character). * Parse and ignore \r (reverse line feed). * Add a WARNING message about undefined escape sequences. * Add an UNSUPP message about unsupported escape sequences. * Mark \! and \? (transparent throughput) and \O (suppress output) as unsupported. * Treat the various variants of zero-width spaces as one-byte escape sequences rather than as special characters, to avoid defining bogus forms with square brackets. * For special characters with one-byte names, do not define bogus forms with square brackets, except for \[-], which is valid. * In the form with square brackets, undefined special characters do not fall back to printing the name verbatim, not even for one-byte names. * Starting a special character name with a blank is an error. * Undefined escape sequences never abort formatting of the input string, not even in HTML output mode. * Document the newly handled escapes, and a few that were missing. * Regression tests for most of the above.
* update DESCRIPTION and COMPATIBILITY, mostly correcting statementsIngo Schwarze2018-10-041-18/+17
| | | | from the past that are no longer true
* Stop abusing subsections to represent the list of escape sequences;Ingo Schwarze2018-10-041-95/+101
| | | | | | instead, use .Bl -tag like everywhere else. The same was already done for requests quite some time ago. Also, consistently mark up escape sequences with .Ic, just like requests.
* Rudimentary implementation of the roff(7) .char (output glyphIngo Schwarze2018-08-251-3/+10
| | | | | | | | | definition) request, used for example by groff_hdtbl(7). This simplistic implementation may interact incorrectly with the .tr (input character translation) request. But come on, you are not only using .char *and* .tr, but you do so with respect to the same character in the same manual page?
* Rudimentary implementation of the roff(7) .while request.Ingo Schwarze2018-08-241-7/+7
| | | | | | | | | | | 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.
* Implement the roff(7) .shift and .return requests,Ingo Schwarze2018-08-231-4/+7
| | | | | | | | | | | | | | 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-211-0/+5
| | | | | | | | | | | | 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.
* Mostly complete implementation of the 'c' (character available)Ingo Schwarze2018-08-191-4/+17
| | | | | | | | | | | 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.
* support the highly surprising escape sequence \# (line continuationIngo Schwarze2018-08-181-0/+6
| | | | with comment); used for example by gropdf(1)
* 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.
* The groff man-ext macros define fonts CB, CI, and CR,Ingo Schwarze2018-08-101-3/+3
| | | | | 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-101-4/+7
| | | | | Examples of manual pages (ab)using it include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
* Two new low-level roff(7) features:Ingo Schwarze2018-04-101-3/+17
| | | | | | * .nr optional third argument (auto-increment step size) * \n+ and \n- numerical register auto-increment and -decrement bentley@ reported on Dec 9, 2013 that lang/sbcl(1) uses these.
* typo; from Alexander Kuleshov <kuleshovmail at gmail dot com>Ingo Schwarze2017-12-151-1/+1
|
* nits about trailing punctuation found with mandoc -TlintIngo Schwarze2017-07-051-14/+14
|
* implement so-called absolute horizontal motion: \h'|...',Ingo Schwarze2017-06-141-2/+5
| | | | used for example by zoem(1)
* Naive implementation of the roff(7) .po (page offset) request.Ingo Schwarze2017-06-141-2/+9
| | | | | | This clearly works when .po is called on the top level, but might not be sophisticated enough if people call .po inside indentation-changing contexts, but i haven't seen that in manual pages (yet :).
* simple implementation of the roff(7) .als (macro alias) request,Ingo Schwarze2017-06-141-1/+0
| | | | sufficient for pages using po4a(1)
* implement the roff(7) d (macro or string defined) conditionalIngo Schwarze2017-06-141-2/+9
|
* implement roff(7) .rj (right justify) requestIngo Schwarze2017-06-141-1/+3
|
* implement the roff(7) \p (break output line) escape sequenceIngo Schwarze2017-06-141-0/+2
|
* minor markup simplificationsIngo Schwarze2017-06-101-1/+1
|
* Implement the roff(7) .rn (rename macro or string) request.Ingo Schwarze2017-06-071-2/+11
| | | | | | | | | | 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
|
* Implement the roff(7) .mc (right margin character) request.Ingo Schwarze2017-06-041-1/+3
| | | | | | 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.
* Pure preprocessor implementation of the roff(7) .ec and .eo requestsIngo Schwarze2017-06-041-3/+5
| | | | | | | | | | | | | | | | | (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.
* Partial implementation of \h (horizontal line drawing function).Ingo Schwarze2017-06-021-3/+5
| | | | | | | | | | | 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.
* Minimal implementation of the \h (horizontal motion) escape sequence.Ingo Schwarze2017-06-011-3/+4
| | | | Good enough to cope with the average DocBook insanity.
* Basic implementation of the roff(7) .ti (temporary indent) request.Ingo Schwarze2017-05-081-4/+10
| | | | Needed by about four dozen ports (thanks to naddy@ for the research).
* Convert REQUEST REFERENCE from using .Ss to .Bl -tag, allowing toIngo Schwarze2017-05-081-428/+413
| | | | | specify request arguments and supporting tag searching in less(1). Improve some entries and document .ta.
* Shorten the description of .sp and move it to roff(7).Ingo Schwarze2017-05-051-0/+10
| | | | | If is not a macro but a low-level roff request and not recommended for use in manual pages.
* Clean up docs after today's .br and .ft code cleanup; simpler.Ingo Schwarze2017-05-051-8/+2
|
* fix spelling error;Ingo Schwarze2017-02-211-1/+1
| | | | found by Michael <Stapelberg at debian dot org> with Lintian
* typos; found and fixed by sobrado@Ingo Schwarze2015-09-241-5/+5
|
* Parse and ignore the escape sequences \, and \/ (italic corrections).Ingo Schwarze2015-08-291-1/+7
| | | | | | | | Actually using these is very stupid because they are groff extensions and other roff(7) implementations typically print unintended characters at the places where they are used. Nevertheless, some manuals contain them, for example ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
* Implement the escape sequence \\$*, expanding to all argumentsIngo Schwarze2015-08-291-0/+2
| | | | | | of the current user-defined macro. This is another missing feature required for ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
* Implement the roff(7) `r' (register exists) conditional.Ingo Schwarze2015-05-311-2/+5
| | | | | Missing feature found by Markus <Waldeck at gmx dot de> in Debian's bash(1) manual page.
* Replace the kludge for the \z escape sequence by an actualIngo Schwarze2015-04-291-4/+1
| | | | | | | | implementation. As a side effect, minus ten lines of code. As another side effect, this also fixes the assertion failure that used to be triggered by "\z\o'ab'c" at the beginning of an output line, found by jsg@ with afl (test case 022/Apr27).
* Let .it accept numerical expressions, not just numerical constants.Ingo Schwarze2015-02-171-4/+9
| | | | | | | For .it, ignore scaling units in roff_getnum(). Inside parentheses, skip whitespace after a sign in roff_getnum(). Parse and ignore unary plus in roff_getnum(). As a bonus, get rid of the only call to mandoc_strntoi() in roff.c.
* Radical cleanup of COMPATIBILITY sections:Ingo Schwarze2015-01-291-30/+46
| | | | | | | | Remove lots of lies, dozens of irrelevant implementation details, and all references to groff versions older than 1.17. Move relevant information to the pages where it belongs, and out of mandoc(1) in particular. Add some missing general remarks to roff(7), where it fits the character and purpose of the page much better.
* While ignoring the .ta (set tab stops) and .ti (temp indent) requestsIngo Schwarze2015-01-231-4/+4
| | | | | | is sometimes harmless, it often causes seriously ugly output, so flag these requests as unsupported rather than ignoring them. Discussed with naddy@.
* Wonders of roff(7): Integer numbers in numerical expressions can carryIngo Schwarze2015-01-231-0/+8
| | | | | scaling units, and some manuals (e.g. in devel/grcs) actually use that, so let's support it. Missing feature reported by naddy@.
* improve wording; patch from jmc@Ingo Schwarze2015-01-221-1/+1
|
* Rudimentary implementation of the roff(7) \o escape sequence (overstrike).Ingo Schwarze2015-01-211-4/+5
| | | | | | This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
* typo fixes from jmc@Ingo Schwarze2015-01-201-3/+3
|
* Split the -Werror message level into -Werror (broken manual, probablyIngo Schwarze2015-01-201-53/+723
| | | | | | | | | | | | | using mandoc is better than using groff) and -Wunsupp (manual using unsupported low-level roff(7) feature, probably using groff is better than using mandoc). Once this feature is complete, it is intended to help porting, making the decision whether to USE_GROFF easier. As a first step, distinguish four classes of roff(7) requests: 1. Supported (currently 24 requests) 2. Currently ignored because unimportant (120) -> no message 3. Ignored for good because insecure (14) -> -Werror 4. Currently unsupported (68) -> these trigger the new -Wunsupp messages
* change spelling of centre to center: consistent with other man pagesIngo Schwarze2015-01-201-1/+1
| | | | and the name of the syntax elements being described; from tedu@
* Reduce memory and time consumption on certain malformed input filesIngo Schwarze2014-12-251-2/+4
| | | | | | by limiting the length of expanded input lines during the (usually recursive) expansion of user defined strings. Resource hogging found by jsg@ with afl.