commit d1167d13274e30b034bbdd6847c1e3b2ab6f2c29
parent 92e9aaef41e7daf146fab9794e37d5f2b1520b12
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 26 Jan 2026 06:52:28 +0800
vim-patch:e914ada: runtime(doc): Fix erroneous *roff syntax examples
Problem dates back at least to commit 071d4279d6, Vim 7.0001 (2004).
The examples shown were of special character interpolation syntax, not
("number") register interpolation syntax.
Sources:
* https://www.gnu.org/software/groff/manual/groff.html.node/Built_002din-Registers.html
* https://github.com/mamccollum/troff-resources/blob/main/cstr-54.pdf
closes: vim/vim#19243
https://github.com/vim/vim/commit/e914ada32334af67604c9791aa4149a74ab0d1eb
Co-authored-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
@@ -2222,10 +2222,10 @@ package, arrange for files to be recognized as groff input (see
GNU troff differs from older AT&T n/troff programs (that you may still find in
Solaris or Plan 9) by extending the "*roff" language syntax. For example, in
AT&T troff, you access the count of years since 1900 with the escape sequence
-\(yr. In groff you can do the same, which it recognizes for compatibility, or
-use groff's extended syntax, \[yr]. AT&T troff documented the yr register as
-storing the "last two digits of current year", but had a Y2K problem; in
-groff, you can access the Gregorian year correctly: \[year]. In groff, font,
+\n(yr. In groff you can do the same, which it recognizes for compatibility,
+or use groff's extended syntax, \n[yr]. AT&T troff documented the yr register
+as storing the "last two digits of current year", but had a Y2K problem; in
+groff, you can access the Gregorian year correctly: \n[year]. In groff, font,
register, macro, string, and request names can exceed two characters; for
example, with groff's mm package, the control lines ".VERBON" and ".VERBOFF"
call macros of those names to bracket displays of "verbatim" content.