summaryrefslogtreecommitdiff
path: root/share/man/man7/roff.7
AgeCommit message (Collapse)Author
2022-05-31Rudimentary implementation of the \A escape sequence, following groffIngo Schwarze
semantics (test identifier for syntactical validity), not at all following the completely unrelated Heirloom semantics (define hyperlink target position). The main motivation for providing this implementation is to get \A into the parsing class ESCAPE_EXPAND that corresponds to groff parsing behaviour, which is quite similar to the \B escape sequence (test numerical expression for syntactical validity). This is likely to improve parsing of nested escape sequences in the future. Validation isn't perfect yet. In particular, this implementation rejects \A arguments containing some escape sequences that groff allows to slip through. But that is unlikely to cause trouble even in documents using \A for non-trivial purposes. Rejecting the nested escapes in question might even improve robustnest because the rejected names are unlikely to really be usable for practical purposes - no matter that groff dubiously considers them syntactically valid.
2022-05-31Trivial patch to put the roff(7) \g (interpolate format of register)Ingo Schwarze
escape sequence into the correct parsing class, ESCAPE_EXPAND. Expansion of \g is supposed to work exactly like the expansion of the related escape sequence \n (interpolate register value), but since we ignore the .af (assign output format) request, we just interpolate an empty string to replace the \g sequence. Surprising as it may seem, this actually makes a formatting difference for deviate input like ".O\gNx" which used to raise bogus "escaped character not allowed in a name" and "skipping unknown macro" errors and printed nothing, whereas now it correctly prints "OpenBSD".
2022-05-30Dummy implementation of the roff(7) \V (interpolate environment variable)Ingo Schwarze
escape sequence. This is needed to get \V into the correct parsing class, ESCAPE_EXPAND. It is intentional that mandoc(1) output is *not* influenced by environment variables, so interpolate the name of the variable with some decorating punctuation rather than interpolating its value.
2022-05-20Re-classify the roff(7) \r (reverse line feed) escape sequenceIngo Schwarze
from "ignore" to "unsupported" because when an input file uses it, mandoc(1) is likely to significantly misformat the output, usually showing parts of the output in a different order than the author intended.
2022-01-01eascape -> escapeJonathan Gray
2020-10-28Correct an embarrassing spelling mistake:Ingo Schwarze
The last name of the author of groff is "Clark".
2020-04-23 ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;Jason McIntyre
2019-07-15explain escaping of end-of-sentence characters;Ingo Schwarze
missing info reported by Ian <ropers at gmail dot com> on misc@
2019-07-01use the standard spelling of the word "idiosyncrasy";Ingo Schwarze
suggested by Michal Nowak <mnowak at startmail dot com>
2019-04-21Implement the roff .break request (break out of a .while loop).Ingo Schwarze
Jan Stary <hans at stare dot cz> found it in an ancient groffer(1) manual page (version 1.19) on MacOS X Mojave. Having .break not implemented wasn't a particularly bright idea because obviously, it tended to cause infinite loops.
2019-01-01Now that .nf and .fi are implemented in the roff(7) parser and formattersIngo Schwarze
rather than in the man(7) parser and formatters, document them in the roff(7) manual, where they belong, rather than in the man(7) manual. Mention that they imply an output line break, and mention which macros imply these requests.
2018-12-16minor polishing, in parts related to functional improvements in the past,Ingo Schwarze
and also adding some cross references for important escape sequences
2018-12-15Yet another round of improvements to manual font selection.Ingo Schwarze
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.
2018-12-15Several improvements to escape sequence handling.Ingo Schwarze
* 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.
2018-10-04update DESCRIPTION and COMPATIBILITY, mostly correcting statementsIngo Schwarze
from the past that are no longer true
2018-10-04Stop abusing subsections to represent the list of escape sequences;Ingo Schwarze
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.
2018-08-25Rudimentary implementation of the roff(7) .char (output glyphIngo Schwarze
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?
2018-08-24Rudimentary implementation of the roff(7) .while request.Ingo Schwarze
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.
2018-08-23Implement the roff(7) .shift and .return requests,Ingo Schwarze
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.209, moving argument interpolation back into the function roff_res().
2018-08-21Implement the \\$@ escape sequence (insert all macro arguments,Ingo Schwarze
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.
2018-08-19Mostly complete implementation of the 'c' (character available)Ingo Schwarze
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.
2018-08-18support the highly surprising escape sequence \# (line continuationIngo Schwarze
with comment); used for example by gropdf(1)
2018-08-16Document \*(.T.Ingo Schwarze
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.
2018-08-10The groff man-ext macros define fonts CB, CI, and CR,Ingo Schwarze
and some groff manual pages actually use them in .ft requests. It's easy enough to handle these .ft requests in mandoc, too.
2018-08-10Implement the roff(7) .nop (no operation) request.Ingo Schwarze
Examples of manual pages (ab)using it include groff(7), chem(1), groff_mom(7), and groff_hdtbl(7).
2018-04-10Two new low-level roff(7) features:Ingo Schwarze
* .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.
2017-12-15typo; from alexander kuleshovJason McIntyre
2017-07-05nits about trailing punctuation found with mandoc -TlintIngo Schwarze
2017-06-14implement so-called absolute horizontal motion: \h'|...',Ingo Schwarze
used for example by zoem(1)
2017-06-14Naive implementation of the roff(7) .po (page offset) request.Ingo Schwarze
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 :).
2017-06-14simple implementation of the roff(7) .als (macro alias) request,Ingo Schwarze
sufficient for pages using po4a(1)
2017-06-14implement the roff(7) d (macro or string defined) conditionalIngo Schwarze
2017-06-14implement roff(7) .rj (right justify) requestIngo Schwarze
2017-06-14implement the roff(7) \p (break output line) escape sequenceIngo Schwarze
2017-06-10minor markup simplificationsIngo Schwarze
2017-06-07Implement the roff(7) .rn (rename macro or string) request.Ingo Schwarze
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.
2017-06-06Minimal implementation of the roff(7) .ce request (center a numberIngo Schwarze
of input lines without filling). Contrary to groff, high-level macros abort .ce mode for now.
2017-06-04Implement the roff(7) .mc (right margin character) request.Ingo Schwarze
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.
2017-06-04Pure preprocessor implementation of the roff(7) .ec and .eo requestsIngo Schwarze
(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-murderes after them might be a worthwhile part of the punishment, but probably insuffient on its own.
2017-06-02Partial implementation of \h (horizontal line drawing function).Ingo Schwarze
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.
2017-06-01Minimal implementation of the \h (horizontal motion) escape sequence.Ingo Schwarze
Good enough to cope with the average DocBook insanity.
2017-05-08Basic implementation of the roff(7) .ti (temporary indent) request.Ingo Schwarze
Needed by about four dozen ports (thanks to naddy@ for the research).
2017-05-08Convert REQUEST REFERENCE from using .Ss to .Bl -tag, allowing toIngo Schwarze
specify request arguments and supporting tag searching in less(1). Improve some entries and document .ta.
2017-05-05Shorten the description of .sp and move it to roff(7).Ingo Schwarze
If is not a macro but a low-level roff request and not recommended for use in manual pages.
2017-05-05Clean up docs after today's .br and .ft code cleanup; simpler.Ingo Schwarze
2017-02-21fix spelling error;Ingo Schwarze
found by Michael <Stapelberg at debian dot org> with Lintian
2015-09-23typos.Igor Sobrado
2015-08-29Parse and ignore the escape sequences \, and \/ (italic corrections).Ingo Schwarze
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>.
2015-08-29Implement the escape sequence \\$*, expanding to all argumentsIngo Schwarze
of the current user-defined macro. This is another missing feature required for ocserv(8). Problem reported by Kurt Jaeger <pi at FreeBSD>.
2015-05-31Implement the roff(7) `r' (register exists) conditional.Ingo Schwarze
Missing feature found by Markus <Waldeck at gmx dot de> in Debian's bash(1) manual page.