Xft support under OpenMotif 2.3.3 - I've been using this for quite a while on
[nedit.git] / doc / faq-txt.awk
blob44230aa796d22e59ae47d0f22d55e65cd9ea39d5
1 # $Id: faq-txt.awk,v 1.3 2002/09/26 12:37:37 ajhood Exp $
3 function wrap(line, prefix)
6 wrapMargin = 75;
8 if (length(line) < wrapMargin) {
9 print prefix line;
10 } else {
12 count = split(line, words);
14 indent = match(line, /[^ ]/)
16 indentStr = substr( \
17 " ", \
18 1, indent - 1);
20 result = "";
21 for (w = 1; w <= count; w++) {
22 if (length(result) + length(words[w]) > wrapMargin - indent) {
23 # print a new line
24 print prefix indentStr result;
25 result = words[w];
26 } else {
27 if (w == 1)
28 result = words[w]
29 else
30 result = result " " words[w];
33 print prefix indentStr result;
40 BEGIN { prefixed = 0; pre = 0 }
41 /^PREFIXED$/ {prefixed = 1; next }
42 /^NOT_PREFIXED$/ {prefixed = 0; next }
43 /^PRE$/ {pre = 1; next }
44 /^NOT_PRE$/ {pre = 0; next }
46 if (pre) {
47 if (prefixed) print "> " $0;
48 else print $0;
49 } else {
50 if (prefixed) wrap($0, "> ");
51 else wrap($0, "")