summaryrefslogtreecommitdiff
path: root/doc/groff.texinfo
diff options
context:
space:
mode:
authorwl <wl>2006-10-26 19:39:07 +0000
committerwl <wl>2006-10-26 19:39:07 +0000
commit20499dc80f8da12a02007e70497e498bc74d6ca2 (patch)
treee89de9206d8b0efee708553d28056ad8669ae087 /doc/groff.texinfo
parent38897a978945ce1108ffa422cc3260e22d67d712 (diff)
downloadgroff-20499dc80f8da12a02007e70497e498bc74d6ca2.tar.gz
Add `\%^' escape to handle the parameters to a macro as a string
argument. * src/roff/troff/input.h (DOUBLE_QUOTE): New special character. * src/roff/troff/input.cpp (input_iterator, input_stack, macro_iterator): Add `space_follows_arg' member function. (macro_iterator::add_arg): Add parameter to set the `space_follows' flag. (arg_list): Add member `space_follows'. Update constructor and all callers. (decode_args): Store discarded double quotes. (interpolate_args): Handle DOUBLE_QUOTE. Add `\%^' escape. (get_copy, token::next, composite_glyph_name): Handle DOUBLE_QUOTE. * tmac/trace.tmac: Trace .nr, .ds, .ds1, .as, .as1. * docs/groff.texinfo (Parameters), man/groff.man, man/groff_diff.man, NEWS: Document it.
Diffstat (limited to 'doc/groff.texinfo')
-rw-r--r--doc/groff.texinfo24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 8bbaeb28..5f813616 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -11248,6 +11248,30 @@ spaces. If not in compatibility mode, the input level of double quotes
is preserved (see @ref{Request and Macro Arguments}).
@endDefesc
+@Defesc {\\$^, , , }
+Handle the parameters of a macro as if they were an argument to the
+@code{ds} or similar requests.
+
+@Example
+.de foo
+. tm $1=`\\$1'
+. tm $2=`\\$2'
+. tm $*=`\\$*'
+. tm $@@=`\\$@@'
+. tm $^=`\\$^'
+..
+.foo " This is a "test"
+ @result{} $1=` This is a '
+ @result{} $2=`test"'
+ @result{} $*=` This is a test"'
+ @result{} $@@=`" This is a " "test""'
+ @result{} $^=`" This is a "test"'
+@endExample
+
+This escape is useful mainly for macro packages like @file{trace.tmac} which
+redefines some requests and macros for debugging purposes.
+@endDefesc
+
@Defesc {\\$0, , , }
@cindex macro name register (@code{\$0})
@cindex @code{als} request, and @code{\$0}