summaryrefslogtreecommitdiffstats
path: root/roff.7
Commit message (Collapse)AuthorAgeFilesLines
* Rudimentary implementation of the \A escape sequence, following groffIngo Schwarze2022-05-311-2/+17
| | | | | | | | | | | | | | | | | | | | 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.
* Trivial patch to put the roff(7) \g (interpolate format of register)Ingo Schwarze2022-05-311-1/+2
| | | | | | | | | | | | | 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".
* Dummy implementation of the roff(7) \V (interpolate environment variable)Ingo Schwarze2022-05-301-2/+6
| | | | | | | | | 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.
* Re-classify the roff(7) \r (reverse line feed) escape sequenceIngo Schwarze2022-05-201-4/+4
| | | | | | | 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.
* replace "Ar arg Ar arg" with "Ar arg arg"; patch from jmc@Ingo Schwarze2021-09-181-1/+1
|
* Correct an embarrassing spelling mistake:Ingo Schwarze2020-10-281-1/+1
| | | | The last name of the author of groff is "Clark".
* explain escaping of end-of-sentence characters;Ingo Schwarze2019-07-151-0/+6
| | | | missing info reported by Ian <ropers at gmail dot com> on misc@
* use the standard spelling of the word "idiosyncrasy";Ingo Schwarze2019-07-011-1/+1
| | | | suggested by Michal Nowak <mnowak at startmail dot com>
* Implement the roff .break request (break out of a .while loop).Ingo Schwarze2019-04-211-2/+1
| | | | | | | 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.
* Now that .nf and .fi are implemented in the roff(7) parser and formattersIngo Schwarze2019-01-011-11/+34
| | | | | | | 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.
* 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).