summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwl <wl>2006-06-06 16:49:39 +0000
committerwl <wl>2006-06-06 16:49:39 +0000
commit8c3feae9e730fa662359ab9f870aa01299d291da (patch)
tree5173b3bd4b2e40e8c375ac40bd889dec2129c563
parentdd9643b70bbdadc74a4847195a11e02c56d6461f (diff)
downloadgroff-8c3feae9e730fa662359ab9f870aa01299d291da.tar.gz
* tmac/strip.sed: Strip `\#' also.
* doc/groff.texinfo: Document usage of \? for string comparison.
-rw-r--r--ChangeLog6
-rw-r--r--doc/groff.texinfo43
-rw-r--r--tmac/strip.sed4
3 files changed, 47 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 67487227..e4a32260 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-05 Werner LEMBERG <wl@gnu.org>
+
+ * tmac/strip.sed: Strip `\#' also.
+
+ * doc/groff.texinfo: Document usage of \? for string comparison.
+
2006-06-04 Werner LEMBERG <wl@gnu.org>
* doc/groff.texinfo: Add more index entries for copy-in mode.
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 4a3cb3eb..bfdd8616 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -10586,8 +10586,9 @@ nodes inserted additionally by @code{gtroff}.
@subsection Operators in Conditionals
@cindex @code{if} request, operators to use with
+@cindex @code{ie} request, operators to use with
@cindex @code{while} request, operators to use with
-In @code{if} and @code{while} requests, there are several more
+In @code{if}, @code{ie}, and @code{while} requests, there are several more
operators available:
@table @code
@@ -10608,10 +10609,12 @@ Always false. This condition is for compatibility with other
@code{troff} versions only (identifying a @code{-Tversatec} device).
@item '@var{xxx}'@var{yyy}'
-True if the string @var{xxx} is equal to the string @var{yyy}. Other
-characters can be used in place of the single quotes; the same set of
-delimiters as for the @code{\D} escape is used (@pxref{Escapes}).
-@code{gtroff} formats the strings before being compared:
+True if the output produced by @var{xxx} is equal to the output
+produced by @var{yyy}. Other characters can be used in place of the
+single quotes; the same set of delimiters as for the @code{\D} escape
+is used (@pxref{Escapes}). @code{gtroff} formats @var{xxx} and @var{yyy}
+in separate environments; after the comparison the resulting data is
+discarded.
@Example
.ie "|"\fR|\fP" \
@@ -10632,6 +10635,36 @@ at the same location on the page, so the strings are equal. If
would be ``false'' because (the first) @samp{|} produces an italic
@samp{|} rather than a roman one.
+@cindex string comparison
+@cindex comparison of strings
+To compare strings without processing, surround the data with
+@code{\?}.
+
+@Example
+.ie "\?|\?"\?\fR|\fP\?" \
+true
+.el \
+false
+ @result{} false
+@endExample
+
+@cindex @code{\?}, and copy-in mode
+@cindex copy-in mode, and @code{\?}
+@cindex mode, copy-in, and @code{\?}
+@noindent
+Since data protected with @code{\?} is read in copy-in mode it is even
+possible to use incomplete input without causing an error.
+
+@Example
+.ds a \[
+.ds b \[
+.ie '\?\*a\?'\?\*b\?' \
+true
+.el \
+false
+ @result{} true
+@endExample
+
@item r @var{xxx}
True if there is a number register named @var{xxx}.
diff --git a/tmac/strip.sed b/tmac/strip.sed
index 069c3db1..0bb59f8f 100644
--- a/tmac/strip.sed
+++ b/tmac/strip.sed
@@ -1,8 +1,10 @@
-# strip comments, spaces, etc. after a line containing `%beginstrip%'
+# strip comments, spaces, etc., after a line containing `%beginstrip%'
/%beginstrip%/,$ {
s/^\.[ ]*/./
s/^\.\\".*/./
+ s/^\\#.*/./
s/\\".*/\\"/
+ s/\\#.*/\\/
/\(.[ad]s\)/!s/[ ]*\\"//
/\(.[ad]s\)/s/\([^ ]*\)\\"/\1/
s/\([^/]\)doc-/\1/g