File: tf-help

package info (click to toggle)
tf5 5.0beta8-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,800 kB
  • sloc: ansic: 25,492; perl: 103; makefile: 82; sh: 79
file content (10788 lines) | stat: -rw-r--r-- 482,218 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
&/addworld
&addworld()

addworld()

  Function usage: 

  ADDWORLD(<name>, <type>, [<host>, <port> [, <char>, <pass> [, <file> [, 
  <flags> [, <srchost>]]]]])

  Command usage: 

  /ADDWORLD [-pxe] [-T<type>] [-s<srchost>] <name> [<char> <pass>] <host> 
  <port> [<file>]
  /ADDWORLD [-T<type>] [-s<srchost>] <name>
  /ADDWORLD [-T<type>] DEFAULT [<char> <pass> [<file>]]
  ____________________________________________________________________________

  Defines a new world or redefines an existing world with the name <name>.  
  <Name> may not contain spaces; addtionally, when defining a new world, 
  <name> may not begin with "(".  

  <Host> is a server's internet hostname, IPv4 address, or (if your platform 
  supports it) IPv6 address.  <Port> is the number or name of a TCP port on 
  the host.  If <host> and <port> are blank, then "connecting" to the world 
  will only create a tf window for the world, it will not open an actual 
  network connection; this is called a "connectionless" socket.  

  There may be a special world named "default" which does not have a <host> or 
  <port>.  If a normal world is defined without a <character>, <pass>, <type>, 
  or <mfile>, then that world will use the corresponding field of the 
  "default" world if there is one.  If the "default" world is redefined, 
  worlds with omitted fields will use the new default values.  

  In function form, <flags> is a string of 0 or more letters that modify the 
  behavior of the function.  For compatability with older versions of TF, an 
  "f" or "0" in <flags> has the same effect as "p", and an "n" or "1" in 
  <flags> has no effect.  

  Options: 
  command: -p 
  function: <flags> contains "p" 
          %{proxy_host} will be ignored, and all connections to the world will 
          be direct.  By default, worlds use %{proxy_host} if it is set.  
  command: -x 
  function: <flags> contains "x" 
          TF will use the SSL protocol to make connections to this world.  
  command: -e 
  function: <flags> contains "e" 
          all text sent to the world will be echoed right back as if it were 
          received from the world (in addition to being sent to the server).  
          This is most useful with connectionless sockets.  
  command: -s<srchost> 
  function: <srchost> 
          defines the host name or IP address to use for the local (tf) side 
          of the connection.  This is useful if the host has multiple network 
          interfaces and you need to override the default choice of the OS.  
  command: -T<type> 
  function: <type> 
          The optional <type> is used in hooks and triggers, and for automatic 
          login and flag setting.  (See below.) 

  The library pre-defines WORLD and LOGIN hooks for types that match these 
  glob patterns: 

  (none)  TinyMud login format ("connect <char> <pass>"), the value of lp is 
          not changed.  

  tiny, tiny.* 
          TinyMud login format ("connect <char> <pass>"), lp=off.  

  lp, lp.* 
  diku, diku.* 
  aber, aber.* 
          LP/Diku login format (sends <char> and <pass> on separate lines), 
          lp=on.  For servers that send unterminated prompts.  

  lpp, lpp.* 
          LP/Diku login format, lp=off.  For muds that use GOAHEAD or EOR 
          prompt protocol.  

  telnet, telnet.* 
          Telnet login format (sends <char> and <pass> when "login:" and 
          "password:" prompts are received), lp=on, /localecho on.  For any 
          line-by-line telnet service.  

  You can define your own world types for use in other triggers or hooks.  If 
  you use names that match the glob patterns above, the standard library hooks 
  will still work.  For example, if you did: 

    /test addworld("Cave", "tiny.muck.",     "cave.tcp.com", 2283, <char>, <pass>)
    /test addworld("Foo",  "tiny.muck.msp.", "foo.com",      9999, <char>, <pass>)
    /test addworld("Cow",  "tiny.moo.",      "cow.com",      8267, <char>, <pass>)
    /test addworld("Buzz", "tiny.moo.msp.",  "buzz.org",     8267, <char>, <pass>)

  then tiny-style autologin would still work (using the library hooks), and 
  you could also define your own triggers and hooks specific to TinyMUCKs or 
  TinyMOOs (e.g., "/def -Ttiny.muck.*") or to worlds that support MSP 
  regardless of their server type (e.g., "/def -T*.msp.*"), etc.  Note the 
  trailing period on the world type defintions, which make it easier to write 
  matching triggers.  

  Any <type> is valid, but is only useful if it is matched by a "-T<type>" 
  option of a hook or trigger.  

  If addworld() with a password is executed from a file that has permissions 
  making it readable by others, it will produce a warning.  You should change 
  the file permissions to prevent other people from reading your password.  

  See: worlds, /connect, /fg, /unworld, /edworld, /telnet 

&/addtiny
&/addlp
&/addlpp
&/adddiku
&/addtelnet

/add<worldtype>

  The comamnds /addtiny, /addlp, /addlpp, /adddiku, and /addtelnet take the 
  same arguments as /addworld, and also give that world a type.  A world's 
  type determines the format for automatic login and flag settings.  

  See: /addworld 

&/alias
&/unalias

/alias

  Usage: 

  /REQUIRE alias.tf

  /ALIAS [<name> [<command>]]
  /UNALIAS <name>
  /PURGEALIAS
  ____________________________________________________________________________

  With no arguments, /alias lists all aliases.  With a <name> argument, /alias 
  lists the alias with names that match the glob pattern <name>.  Otherwise, 
  /alias defines <name> as an alias for <command>.  

  /Unalias undefines an alias for <name> that was defined with /alias.  

  /Purgealias undefines all aliases defined with /alias.  Note that 
  /purgealias does not take a pattern argument.  

  To use an alias, just type its name followed by any optional arguments.  
  Unlike macros defined with /def, you do not type '/' before <name> to 
  execute an alias.  Argument substitution in aliases works the same as in 
  macros.  

  As of 3.5 alpha 11, aliases can be called from other aliases or macros.  To 
  send a line of text to the server without alias calls, use send().  If an 
  old alias that used to work now results in "Too many recursions", you need 
  to rewrite the alias to use send().  

  Using /def instead of /alias is recommended.  

  See: /def, macros, substitution, tfrc 

&/at

/at

  Usage: 

  /AT [-v] [<date>] <time> <commands>
  ____________________________________________________________________________

  <Commands> will be executed at <date> and <time>.  <Date> must be of the 
  form "<year>-<month>-<day>" or "<month>-<day>", where <year> may be 2 or 4 
  digits.  <Time> must be of the form "<hours>:<minutes>" or 
  "<hours>:<minutes>:<seconds>", where <hours> is between 0 and 23, and 
  <seconds> may be specified to the nearest microsecond.  If any part of the 
  date is omitted, it defaults to the nearest value for which <date> and 
  <time> are in the future.  For example, if the current time is 16:00, then 
  an argument of "15:00" means 15:00 tomorrow, and "17:00" means 17:00 today.  

  Options: 
  -v      verbose: prints full date and time 

  Examples: 
  /at 04-01 00:00:00 /echo Happy April Fools Day!
  /def lunch_reminder = /at 12:00 /echo Lunchtime!%%; /lunch_reminder

  See: processes, /repeat, /quote 

&/bamf

/bamf

  Usage: 

  /BAMF [OFF|ON|OLD]
  ____________________________________________________________________________

  Sets the flag %{bamf}.  This flag controls whether TF will cooperate with 
  portals.  A portal allows a mud character to move from one server to another 
  transparently, by simply going through a seemingly normal mud exit.  

  How it works: A "portal" is text sent by a server of the form: 


    #### Please reconnect to <name>@<addr> (<host>) port <port> #### 

  For example: 


    #### Please reconnect to Islandia@128.100.102.51 (hawkwind.utcs.toronto.edu) port 2323 #### 

  If %{bamf} is off, lines in this format have no effect.  If %{bamf} is on, 
  Fugue will attempt to use the portal as an UnterMUD portal: it will 
  disconnect from the current world, and attempt to connect to the new world; 
  if the %{login} flag is also on, TF will try to log in to the new world 
  using the name and password from the current world.  If bamf is "old", Fugue 
  will connect to the new world without disconnecting from the current world.  
  If %{login} is also on, and the new world has been defined with a name and 
  password in an /addworld command, Fugue will attempt to log in 
  automatically.  

  Note that on many servers, arbitrary users can spoof the portal text, 
  redirecting your tf against your will if you have bamfing enabled.  

  The flag %{bamf} defaults to 0 (off).  

  See: worlds, sockets, %bamf, %login 

&/beep

/beep

  Usage: 

  /BEEP [<number>|ON|OFF]
  ____________________________________________________________________________

  /beep causes Fugue to emit <number> beeps (ASCII 7).  /beep with no 
  arguments will emit three beeps.  /beep OFF causes Fugue to ignore further 
  calls to /beep until a /beep ON is performed.  

  Note that on many terminals, multiple immediate beeps are indistinguishable. 
  You can use /repeat to put a delay between beeps: 

    /repeat -0.2 5 /beep

&/bind

/bind

  Usage: 

  /BIND <sequence> = <command>
  ____________________________________________________________________________

  Creates a macro that will be executed when <sequence> is typed at the 
  keyboard.  The <sequence> may use ^<key> notation for a control key, and 
  \<number> for an ascii character code in octal, hexadecimal, or decimal.  
  For example, the escape character can be given by any of these forms: ^[, 
  \033, \0x1B, or \27.  

  When the key sequence <sequence> is typed at the keyboard, <command> is 
  executed.  The command is actually a macro body, so all the substitutions 
  described under "evaluation" will be performed.  The most common command 
  used with a key binding is /dokey.  

  At startup, TF defines bindings for /dokey BSPC, BWORD, DLINE, REFRESH, 
  LNEXT, UP, DOWN, RIGHT, and LEFT based on your terminal settings.  Also, the 
  standard macro library defines a set of (invisible) default bindings, one 
  for each of the /dokey functions.  

  If /bind fails for any reason, it returns 0.  Otherwise, it returns the 
  number of the new macro (useful in /undefn and /edit).  

  As of version 3.5, the NUL character (^@) is allowed in keybindings.  

  The command
  /bind <sequence> = <command>
  is equivalent to
  /def -b"<sequence>" = <command>. 

  Examples: 

    /bind ^Xtw = :jumps to the left%;:steps to the right!
    /bind ^[q = /set more off
    /bind ~ky = /input Kyosuke

  See: keys, /dokey, /unbind, /input, interface 

&/break

/break

  Usage: 

  /BREAK [<n>]
  ____________________________________________________________________________

  During macro evaluation, /BREAK unconditionally terminates the nearest 
  enclosing /WHILE loop.  If <n> is specified, it will break out of <n> 
  enclosing /WHILE loops.  If used outside a /WHILE loop, the macro evaluation 
  is terminated.  

  See: /while, /return, /exit, evaluation 

&/cat

/cat

  Usage: 

  /CAT [%]
  ____________________________________________________________________________

  Concatenates (puts together) all subsequent lines until a line containing a 
  single "." is typed.  If the argument "%" is given, a "%;" sequence is 
  appended to each intermediate line.  The concatenated result is then 
  executed as a single line.  

  The concatenated result is stored in the input history as a single line, so 
  intermediate lines can not be recalled separately.  

  Example: 

    /cat %
    :foo
    :bar
    :baz
    . 

  This produces: 

    :foo%;:bar%;:baz

  If the %{sub} flag is set on, this will expand to three lines ":foo", ":bar" 
  and ":baz" and be sent to the socket.  

  See: /paste, /sub, general, history 

&/changes

/changes

  Usage: 

  /CHANGES [<version>]
  ____________________________________________________________________________

  List the changes in a <version> of TinyFugue; if omitted, <version> defaults 
  to the current version.  <Version> can be a full version name (e.g., "5.0 
  beta 7") or just the major and minor numbers (e.g., "5.0").  The information 
  is kept in the file %TFLIBDIR/CHANGES.  

  A list of changes in the latest version of tf can be found at 
  http://tinyfugue.sourceforge.net/CHANGES.  

  See: /version 

&completion
&/complete

/complete

  Usage: 

  /COMPLETE [<type>]
  ____________________________________________________________________________

  When a part of a word is typed, and then /complete is called (from a 
  keybinding), it will attempt to fill in the rest of the word.  The possible 
  words it chooses from depend on <type>.  If no <type> is given, it completes 
  from context: it will choose the type of completion based on earlier parts 
  of the line being typed, plus previous input history.  For example, if the 
  line begins with "/connect", it will use worldname completion; if the word 
  begins with "%" or "%{", it will use variable name completion; etc.  

  The following table lists the meanings and the default keybindings for each 
  type.  

      Keys                Type            Meaning
      ----                ----            -------
      ^[^I (ESC TAB)                      complete word depending on context
      ^[^W                worldname       complete tf world name
      ^[$                 macroname       complete tf macro name
      ^[%                 variable        complete tf variable name
      ^[/                 filename        complete file name (unix only)
      ^[;                 user_defined    complete from %{completion_list}
      ^[i                 input_history   complete from previously typed words
                          sockname        complete name of open tf socket

  The "ESC TAB" and "ESC ;" bindings will use the %{completion_list} variable, 
  in which you can store a list of any words you want to be able to complete.  

  You can also define your own types of completion.  See the 
  %{TFLIBDIR}/complete.tf file for more information.  

  See: keybindings, interface 

&/connect

/connect

  Usage: 

  /CONNECT [-lqxbf] [<world>]
  /CONNECT <host> <port>
  ____________________________________________________________________________

  In the first form, /connect attempts to open a socket connected to <world>.  
  <World> must be defined by the /addworld command and not already open.  If 
  <world> is omitted, the first defined world will be used.  If <world> does 
  not have a host and port, /connect will create a "connectionless" socket.  
  In the form "/connect <host> <port>", it will define a temporary world named 
  "(unnamed<N>)" with the given address, and try to connect to it.  <Host> may 
  be an internet hostname, an IPv4 address, or (if your platform supports it) 
  an IPv6 address.  A temporary world will be undefined when it is no longer 
  in use.  

  Options: 
  -l      No automatic login (i.e., don't call the LOGIN hook).  
  -q      Quiet login (overrides %{quiet} flag).  
  -x      Connect using SSL (not necessary if world was defined with the "x" 
          flag).  
  -f      Connect in the foreground 
  -b      Connect in the background 

  The first thing /connect does is create a new socket.  If the -f option was 
  given, or /connect was called from the foreground (e.g., from the command 
  line), the new socket is immediately brought into the foreground.  If the -b 
  option was given, or /connect was called from the background (e.g., from a 
  DISCONNECT hook in a background world), the connection proceeds in the 
  background.  

  If a hostname was given, TF must look it up to find one or more IPv4 or (if 
  your platform supports it) IPv6 addresses.  If %{gethostbyname} is 
  "nonblocking" (the default), and this process takes more than a fraction of 
  a second, TF will print "Hostname resolution for <world> in progress" (the 
  PENDING hook), and TF will continue running normally while the lookup 
  proceeds.  But if %{gethostbyname} is "blocking", TF will freeze until the 
  lookup is finished.  Either way, if the lookup succeeds, TF will try to 
  connect; if it fails, you will be notified.  

  Next, TF tries to open a network connection to the IP address, and prints 
  "Trying to connect to <world>: <address> <port>" (the PENDING hook).  On 
  most platforms, if %{connect} is "nonblocking" (the default), TF continues 
  running normally while the network connection proceeds.  But if %{connect} 
  is "blocking", TF will freeze until the network connection is finished.  If 
  the connection succeeds, a message is printed, but (unlike previous versions 
  of TF) the socket is not automatically brought to the foreground.  However, 
  if you had run /connect in the foreground (e.g.  from the command line), the 
  socket would already be in the foreground, unless it was nonblocking and had 
  taken a long time and you foregrounded another socket while you were 
  waiting, in which case you probably wouldn't want to automatically 
  foreground the new socket.  If you prefer automatic foregrounding upon 
  successful connection, you can define a CONNECT hook that calls "/fg %{1}".  

  Even if %{gethostbyname} and/or %{connect} are "blocking", they can be 
  interrupted with the SIGINT signal (^C).  

  If the connection fails, TF normally prints "Connection to <world> failed: 
  <address> <port>: <reason>" (the CONFAIL hook).  But, if the failure was in 
  the specific address, and there is more than one address associated with the 
  world's hostname, the message will instead say "Intermediate connection to 
  <world> failed: ..." (the ICONFAIL hook), and TF will try to connect to the 
  next address.  So, a failed /connect will always result in a series of zero 
  or more ICONFAIL hooks followed by exactly one CONFAIL hook.  But an 
  ICONFAIL may also be followed by a successful connection to an alternate 
  address.  

  If the network connection is successful, or the socket is "connectionless", 
  these events occur: 

    * If the world was defined with an <mfile>, that file will be loaded 
      (and the LOAD hook will be called); 
    * The CONNECT hook is called (unless the socket is connectionless or 
      the connection is via a proxy).  
    * If %{login} is on, and a character and password is defined for the 
      world, the LOGIN hook is called (unless the socket is connectionless or 
      the connection is via a proxy).  The default LOGIN hooks sends the 
      character name and password in a format corresponding to the world type. 
      To automatically login to a world that expects a different login format, 
      define your own LOGIN hook.  

  If you have trouble connecting (especially if you use SOCKS), try "/set 
  connect=blocking".  

  If your host has multiple network interfaces, the OS will choose one of them 
  for the client end of the connection according to its own rules.  To 
  override the system's choice, set the tfhost variable or define the world 
  with a <srchost> parameter to addworld.  

  /connect returns 0 on error or failure, 1 for immediate success, or 2 if the 
  name lookup or network connection is pending.  

  See: worlds, sockets, proxy, /world, /addworld, /fg, /retry, %login, 
  %gethostbyname, %connect, hooks procotols 

&disconnect
&close
&/dc

/dc

  Usage: 

  /DC [<world>|-ALL]
  ____________________________________________________________________________

  Disconnects from the named world, or the current world if no world is given, 
  or all worlds if "-all" is given.  If the flag %{quitdone} is on, and /dc 
  disconnects the last socket, TF will exit.  

  Disconnecting with /dc does not invoke the DISCONNECT hook.  

  See: sockets, %quitdone, /quit 

&/def

/def

  Usage: 

  /DEF [<options>] [<name>] [= <body>]
  ____________________________________________________________________________

  Defines a macro with an optional keybinding, trigger and/or hook associated 
  with it.  The options and their meanings are: 

#-msimple
#-mglob
#-mregexp
#/def -m
#-m
  -m<matching> 
          Determines which matching style should be used for -t, -h, or -T 
          options.  Valid values are "simple", "glob", and "regexp" (see also: 
          patterns).  If omitted, the value of %{matching} ("glob" by default) 
          is used, unless -P is also given, in which case "regexp" is used.  

#/def -n
#-n
  -n<shots> 
          The macro is a multi-shot, that is, it will be deleted after it is 
          triggered or hooked <shots> times.  A value of 0 makes the macro 
          permanent.  Default: 0.  

#/def -E
#-E
  -E<expression> 
          Before this macro is tested for a trigger (-t) or hook (-h) match, 
          <expression> is evaluated; if its value is 0, the macro will not be 
          considered a match, so no attributes (-a) will be applied, and this 
          macro will not prevent matches of lower priority (-p), and its body 
          will not be executed.  If the value of <expression> is non-zero, the 
          comparison proceedes as usual.  Note: 
          * positional parameters (%n) and subexpression matches (%Pn) are not 
          available in <expression>.  
          * Remember that for every macro with a trigger and an -E expression, 
          its <expression> must be evaluated for every line received.  So, you 
          should keep it simple (e.g., "enable_foo" or "${world_name} =~ 
          fg_world()").  More complex expressions should be put in the body of 
          the macro.  
          * The body of a high priority macro is not necessarily executed 
          before the -E expression of a lower priority macro is tested, so 
          <expression> should not rely on values that may be changed by other 
          macros that match the same trigger or hook.  
          Default: no expression (i.e., always match if the trigger or hook 
          matches).  See: expressions.  

#/def -t
#-t
  -t<pattern> 
          Defines a trigger pattern which will cause the macro to be called 
          when it is matched by a line of text from a socket.  <Pattern> may 
          be enclosed in quotes (", ', or `); if so, all occurances of quotes 
          and '\' within the pattern must be preceded with a '\'.  The pattern 
          matching style is determined by the -m option, or defaults to the 
          value of %{matching}.  Default: no trigger.  See: triggers.  

#/def -h
#-h
  -h"<event>[ <pattern>]" 
          Specifies that the macro will be called automatically whenever 
          <event> occurs and its arguments match <pattern>.  <Event> may be a 
          single event name or a list separated by '|'.  If <pattern> is 
          omitted, it will match any arguments, and the quotes may also be 
          omitted.  If quotes are used, then all occurances of quotes and '\' 
          within the option argument must be preceded with a '\'.  The pattern 
          matching style is determined by the -m option, or defaults to the 
          value of %{matching}.  Default: no hook.  See: hooks.  

#/def -b
#-b
  -b<bind> 
          The macro will be called when the string <bind> is typed at the 
          keyboard.  Default: no binding.  The <bind> string may contain the 
          special codes described under "bind".  See: keys.  

#/def -B
#-B
  -B<keyname> 
          Deprecated.  The macro will be called when the key named <keyname> 
          (according to the termcap database) is typed at the keyboard.  
          Default: none.  See "keys".  

#/def -p
#-p
  -p<pri> 
          Sets the priority of the macro's trigger or hook to <pri>.  As in 
          all numeric options, the argument to -p may be an expression that 
          has a numeric value.  E.g.  "/def -pmaxpri ..." will set the macro's 
          priority to the value of the variable maxpri.  The expression is 
          evaluated only once, when the macro is defined.  Default: 1.  See 
          also: fall-thru.  See: priority, /def -F.  

#/def -c
#-c
  -c<chance> 
          Sets the percent probability of executing the body of a matched 
          trigger or hook.  (The macro still counts as a match for attributes 
          and priority even if it does not execute.) Default: 100%.  

#/def -w
#-w
  -w<world> 
          If the macro has a trigger or hook, it can be matched only by text 
          or events from <world>.  Default: any world.  

#/def -T
#-T
  -T<type> 
          If the macro has a trigger or hook, it can be matched only by text 
          or events from worlds of type <type>.  (See: /addworld).  The 
          pattern matching style is determined by the -m option, or defaults 
          to the value of %{matching}.  Default: any type.  

#/def -F
#-F
  -F      Fall-thru: on a trigger or hook, allows additional matches of lower 
          priority to be run.  Default: not fall-thru.  See: priority 

#/def -a
#-a
  -a[ngGLAurBbhC] 
          Set attribute(s) (normal, gag, nohistory, nolog, noactivity, 
          underline, reverse, bold, bell, hilite, Color) used to display text 
          matched by the trigger or to display the default message of a hook.  
          Default: normal.  See: attributes.  

#/def -P
#-P
  -P[<part>]<attr>[;[<part>]<attr>]...  
          Define a "partial hilite".  The argument consists of a list of pairs 
          of parts (<part>) and attributes (<attr>), separated by ';'.  When a 
          line matches the regexp trigger of this macro, each <attr> is 
          applied to the corresponding <part> of the line.  <Attr> can contain 
          any of the attribute codes "nxurBhC".  (normal, exclusive, 
          underline, reverse, bold, hilite, Color).  The value of <part> 
          determines which part of the text is affected: 
          L       text to the left of the regexp match 
          R       text to the right of the regexp match 
          0       text matched by the entire regexp 
          <number>
                  text matched by the the <number>th parenthesized 
                  subexpression of the regexp.  
          If <part> is omitted it defaults to 0.  If <part> is a number and 
          there are multiple matches in the text, the <attr> will be applied 
          to all of the matches.  Implies -mregexp.  Only one -P option is 
          allowed.  See: attributes.  

#/def -f
#-f
  -f      Same as -a, for backward compatibility.  

#/def -I
#-I
#/def -i
#-i
  -i 
  -I      Makes the macro "invisible".  Invisible macros are not processed by 
          /list, /save, or /purge unless forced.  Default: not invisible.  

#/def -q
#-q
  -q      Makes the macro "quiet".  If called as a trigger, the macro will not 
          count toward the BACKGROUND hook or the return value of /trigger.  
          If called as a SEND hook, the macro will not prevent the sending of 
          the original input.  If called as a PROMPT hook, the macro will not 
          remove the text from the data stream.  

#-1
  -1      Defines a one-shot.  Equivalent to "-n1".  

#
  <name>  The name of the macro.  Default: no name.  Names should begin with a 
          letter, and contain letters, numbers, or '_' characters.  This is 
          not enforced, but other characters (especially '$', '/', and '%') 
          may cause unwanted interpretations during expansion.  

  = <body> 
          Text to be executed when macro is called.  Default: no body.  

  If /def could not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful with /undefn and /edit).  
  ____________________________________________________________________________

##follow
  Example: 

    /def follow = \
        /def -T^tiny -mregexp -p2 -t"^%{1} goes ([a-z]*)\\\\.$$" do_follow = \
            go %%P1

  This will create a macro named "follow".  When it is called like "/follow 
  Joe", it will execute the command 

    /def -T^tiny -mregexp -p2 -t"^Joe goes ([a-z]*)\\.$" do_follow = go %P1

  Note the substitutions that occurred: "%{1}" was replaced with the first 
  (and only) argument; each "\\" was replaced with "\"; "$$" was replaced with 
  "$"; and "%%" was replaced with "%".  

  That command, in turn, defines another macro called "do_follow", with a 
  regexp trigger 

    ^Joe goes ([a-z]*)\.$

  which will only match on worlds whose type matches the regexp pattern 
  "^tiny".  

  Thereafter, when a line like "Joe goes north." is received, it will match 
  the trigger, and cause this command to be executed: 

    go north

  Note how "%P1" was substituted with the text matched by the first set of 
  parentheses (in this case, "north").  

  When writing nested macros like this, it is usually easiest to think 
  backwards.  In this example, you would first figure out how /do_follow 
  should be defined, and then figure out how to define /follow in such a way 
  that it will define /do_follow.  
#
  ____________________________________________________________________________

  /def is sufficient to perform all the functions of the /trig, /trigp, 
  /trigc, /trigpc, /gag, /hilite, /partial, /hook, and /bind commands.  

  See: macros, triggers, patterns, hooks, priority, evaluation, attributes, 
  /undef, /undefn, /purge, /list, /save, /load 

&/dokey

/dokey

  Usage: 

  /DOKEY <name>
  ____________________________________________________________________________

  Performs an action that is intended to be invoked from a keybinding created 
  with /bind or /def -b.  Most of the actions not meaningful or useful when 
  the /dokey command is executed from the command line.  


    Name          Default binding   Action
    ----          ---------------   --------
#bs
#backspace
#bspc
    BSPC          (stty), ^H, ^?    Backspace
#bword
    BWORD         (stty), ^W        Delete previous word
#dline
    DLINE         (stty), ^U        Delete entire line
#refresh
    REFRESH       (stty), ^R        Refresh line
#lnext
    LNEXT         (stty), ^V        Ignore any binding next key might have
#

#up
    UP            (none)            Cursor up
#down
    DOWN          (none)            Cursor down
#right
    RIGHT         key_right         Cursor right
#left
    LEFT          key_left          Cursor left
#

#newline
    NEWLINE       ^J, ^M            Execute current line
#recallb
    RECALLB       ^P                Recall previous input line
#recallf
    RECALLF       ^N                Recall next input line
#recallbeg
    RECALLBEG     ^[<               Recall first input line
#recallend
    RECALLEND     ^[>               Recall last input line
#searchb
    SEARCHB       ^[p               Search backward in input history
#searchf
    SEARCHF       ^[n               Search forward in input history
#socketb
    SOCKETB       ^[b               Switch to previous socket
#socketf
    SOCKETF       ^[f               Switch to next socket
#dword
    DWORD         ^[d               Delete word
#del
#delete
#dch
    DCH           ^D                Delete character under cursor
#redraw
    REDRAW        ^L                Redraw screen
#clear
    CLEAR         ^[^L              Clear screen
#home
    HOME          ^A                Go to beginning of line
#end
    END           ^E                Go to end of line
#wleft
    WLEFT         ^B                Go left, to beginning of word
#wright
    WRIGHT        ^F                Go right, to end of word
#deol
    DEOL          ^K                Delete from cursor to end of line
#pause
    PAUSE         ^S                Pause screen
#page
    PAGE          key_tab           Scroll 1 page forward ("more")
#pageback
    PAGEBACK      (none)            Scroll 1 page backward ("more")
#hpage
    HPAGE         ^X]               Scroll half page forward ("more")
#hpageback
    HPAGEBACK     ^X[               Scroll half page backward ("more")
#pgup
    PGDN          key_pgdn          /dokey_hpage
#pgup
    PGUP          key_pgup          /dokey_hpageback
#line
    LINE          ^[^N              Scroll forward 1 line ("more")
#lineback
    LINEBACK      ^[^P              Scroll backward 1 line ("more")
#flush
    FLUSH         ^[j               Jump to end of scroll buffer
#selflush
    SELFLUSH      ^[J               Show lines with attributes,
                                        and jump to end of buffer

#

  A default of "(stty)" means the key sequence is that used by your terminal 
  driver.  A default of the form "key_<name>" means the key named <name> (see 
  keybindings).  

  The return value of /dokey depends on the action.  The movement and deletion 
  actions return the new position of the cursor; the scrolling actions return 
  the number of lines scrolled.  The return values of other actions aren't 
  very useful.  

  See "keybindings" for a complete list of keybindings.  

  Example: 

    /bind ^B = /dokey RECALLB
    /bind ^F = /dokey RECALLF

  Then, ^B and ^F could be used to recall input backwards and forwards.  

  See: keybindings, /bind, sockets, history, /more 

&/echo
&/_echo
&echo()

echo()

  Function usage: 

  ECHO(<text> [, <attrs> [, <inline> [, <dest>]]])

  Command usage: 

  /ECHO [-peA] [-a<attrs>] [-w[<world>]] <text>
  /_ECHO <text>
  ____________________________________________________________________________

  Displays <text> on the tfout stream (i.e., the screen, usually), unless 
  otherwise redirected by options.  

  Options and arguments: 
  command: -a<attrs> 
  function: <attrs> 
          Echo <text> with the attributes given by <attrs>.  
  command: -p 
  function: <inline> = "on" or 1 
          Interpet "@{<attr>}" strings as commands to set attributes inline.  
          "@@" strings are interpreted as "@".  "@{n}" or "@{x}" will turn 
          attributes off.  See also: decode_attr().  
  command: -w<world> 
  function: <dest> = "w<world>" 
          Echo <text> to the <world> stream instead of the default tfout 
          stream (see tfio).  If <world> is blank, the current world is 
          assumed.  
  command: -e 
  function: <dest> = "e" 
          Echo <text> to the tferr stream, instead of the default tfout stream 
          (see tfio).  
  function: <dest> = "o" 
          Echo <text> to the tfout stream (the default).  
  command: -A 
  function: <dest> = "a" 
          Echo <text> to the alert stream, instead of the default tfout stream 
          (see tfio).  

  The command form is usually more convenient, but the function form is the 
  only way to echo text with leading or trailing spaces.  Remember that "-" by 
  itself can be used to mark the end of command options, in case <text> begins 
  with "-".  

  /_echo is more efficient than /echo, so it is better for use in heavily used 
  macros that don't need all the options of /echo.  

  When echoing to the tferr stream, if no <attrs> are specified, text will be 
  echoed with the "E" attribute.  

  Example: Both of these commands 

    /test echo("@{u}Hello@{n}, world!", "BCred", 1)
    /echo -aBCred -p @{u}Hello@{n}, world!

  echo the following line, with "Hello" underlined, and the whole line bold 
  red: 

    Hello, world!

  Echoed text is not matched against triggers.  To do that, use /trigger.  

  See: attributes, worlds, fwrite(), pad(), tfio 

&/edit

/edit

  Usage: 

  /EDIT [<options>] [<name>] [= <body>]
  ____________________________________________________________________________

  Edits a currently existing macro or the trigger associated with a macro.  
  Options are described under "def".  The name of the macro must be specified 
  and cannot be changed, with the following two exceptions: 

  1.  The macro name can be specified as "#<num>" where <num> is the number of 
  the macro instead of the name.  A macro number can be determined by listing 
  the macro with /list, or from the return value of /def or /edit.  

  2.  The macro name can be specified as "$<pattern>" where <pattern> is the 
  trigger pattern.  You may still change the pattern if this is used to locate 
  the macro.  

  In either case, the name cannot be changed.  It is possible to create a 
  macro which changes the name of a macro, if it does not have any options 
  other than a name and a body: 

  /def rename = /def %2 = $%1%; /undef %1 

  How this works is discussed in the help section "expansion".  

  Also, the /edmac command will allow you to edit an existing macro definition 
  on the command line.  

  The -i flag will be cleared automatically from the macro if it is not 
  explicitly given to /edit.  The body may be cleared by specifiying "=" with 
  nothing after it; if "=" is not present at all, the macro's body will be 
  unchanged.  It is not possible to clear the -F option.  The -w, -T -t, and 
  -h options also can not be cleared, but their arguments can be changed.  The 
  -T, -t, and -h options will use the pattern matching style specified by the 
  -m option to the /edit command; they will not inherit -m from the original 
  definition.  Any other options that are not specified with /edit will remain 
  unchanged from the original definition.  

  As of version 5.0, /edit does not renumber the macro being edited.  

  Example: 

  /def -p2 -t"* has arrived." -ah greet = :greets %1
  /edit -c0 greet 

  The second command will change the probability of /greet's trigger from 100% 
  to 0%, effectively disabling it without actually undefining it (however, 
  because it is not fall-through, it will still block other triggers of lower 
  priority).  

  See: macros, triggers, patterns, evaluation, attributes, /def, /list, /edmac 

&/escape

/escape

  Function usage: 

  ESCAPE(<metacharacters>, <string>)

  Command usage: 

  /ESCAPE <metacharacters> <string>
  ____________________________________________________________________________

  Echoes (in command form) or returns (in function form) <string>, with any 
  <metacharacters> or '\' characters contained in <string> preceded by a '\' 
  character.  

  Example: 

  /def blue = /def -aCblue -t"$(/escape " %*)"
  /blue * pages, "*" 

  When the second command executes, it will expand to: 

  /def -aCblue -t"* pages, \"*\"" 

  See: evaluation 

&/not
&/eval
&eval
&eval()

eval()

  Function usage: 

  eval(<text> [, <level>])

  Command usage: 

  /EVAL [-s<level>] <text>
  /NOT [-s<level>] <text>
  ____________________________________________________________________________

  <Text> is evaluated as a macro body: it goes through substitution, and is 
  executed in a new scope.  The return value of eval() and /eval is that of 
  the last command in <text>; the return value of /not is the logical negation 
  of return value of the last command in <text>.  

  Positional parameters (%1, etc) are inherited from the caller.  

  Options and arguments: 
  command: -s<level> 
  function: <level> 
          Expands the <text> as if %{sub} were set to <level>.  By default, 
          eval expands the <text> as if %{sub} were "full", and echoes it if 
          %{mecho} is not "off".  

  Note: calling /eval with arguments from a trigger could be dangerous.  If 
  not written carefully, such a trigger could allow anyone with access to the 
  server to gain access to your tf or shell account (if they have not been 
  /restricted).  

  Example:
  command: /def showvar = /eval /echo %{1} is %%{%{1}}. 
  command: /showvar borg
  output: borg is on. 

  "/Eval -s0" can be useful when the argument is generated by an expansion.  
  For example, if you defined "/def do = %{*}, and then called "/do /echo 
  test", it would send "/echo test" to the server instead of executing it as a 
  tf command.  But if you defined "/def do = /eval -s0 %{*}", then "/do /echo 
  test" would execute "/echo test" as a tf command.  

  Note: Instead of /not, you should normally use the "/!<command>" syntax to 
  execute "/<command>" and negate its result.  /not evaluates its arguments, 
  which may be undesirable.  

  See: evaluation 

&/exit

/exit

  Usage: 

  /EXIT [<n>]
  ____________________________________________________________________________

  When called directly or indirectly during a /load, /exit aborts execution of 
  all enclosing macro bodies, and aborts <n> (default 1) enclosing /load's.  

  When called outside of a /load, /exit has no effect.  

  Example: one way to prevent a file from being loaded more than once is to 
  put commands like these at the beginning of the file: 

    /if (<variable>) /exit%; /endif
    /set <variable>=1

  ...where <variable> is the name of the file or some other unique name.  

  See: /load, /return, /break, /loaded 

&/export

/export

  Usage: 

  /EXPORT <variable>
  ____________________________________________________________________________

  If <variable> is a global variable, it becomes an environment variable.  
  This makes <variable> available to the environment for "/sh" and "/quote !". 

  Local variables may not be exported.  

  See: environment, variables, /setenv 

&/expr

/expr

  Usage: 

  /EXPR <expression>
  ____________________________________________________________________________

  Evaluates <expression> and prints its value.  This almost the same as "/eval 
  /echo -- $$[<expression>]", except that {#} and positional parameters ({1}, 
  etc) are not defined.  If you neet to print a value of an expression that 
  uses positional parameters, use /result or echo().  

  Example: 

  command: /set x=4
  command: /expr x * 2
  output: 8

  See: expressions 

&/features

/features

  Usage: 

  /FEATURES [<name>]
  ____________________________________________________________________________

  With no arguments, /features prints a list of optional TF features, each 
  prefixed with "+" or "-" to indicate that it is enabled or disabled, 
  respectively.  

  With a <name> argument, /features returns 0 or 1 if the feature <name> is 
  disabled or enabled, respectively, in this instance of tf.  Case is 
  insignificant in <name>.  

    Feature           Meaning
    -------           -------
    256colors         256 color support
    core              If tf crashes, it can dump a core file
    float             Floating point arithmetic and functions
    ftime             ftime() accepts % formatting
    history           /recall and /quote #
    IPv6              Internet Protocol version 6
    locale            allow alternate character sets and date formats
                      (see: locale)
    MCCPv1            Mud Client Compression Protocol version 1 (see: mccp)
    MCCPv2            Mud Client Compression Protocol version 2 (see: mccp)
    process           /repeat and /quote
    SOCKS             SOCKS proxy
    ssl               Secure Sockets Layer
    subsecond         time is measured with subsecond accuracy
    TZ                honors the TZ variable

  Example: 

    /if (!features("ssl")) /echo -e warning: socket is not secure%; /endif
    

&/bg
&/fg

/fg

  Usage: 

  /FG [-nsq<>l] [-c<N>] [<world>]
  /BG
  ____________________________________________________________________________

  Bring the socket associated with <world> into the foreground.  The <world> 
  must already be connected with the /connect command.  Any lines that arrived 
  while the socket was in the background will be displayed or counted in the 
  more prompt, unless the -q option is given.  

  /fg Options: 
  -n      no socket: put all sockets in the background.  
  -s      suppress error messages.  
  -<      previous socket in cycle.  
  ->      next socket in cycle.  
  -c<N>   Repeat the -< or -> option <N> times.  
  -l      ignored.  
  -q      quiet: jump to the last screenful of text, instead of starting at 
          the same location you were at the last time the socket was in the 
          foreground.  

  If successful, /fg returns nonzero and invokes the WORLD hook; otherwise, it 
  returns 0.  

  By default, /fg draws a dividing line between old and new text.  If you 
  would prefer no dividing line, or clearing old text, this can be configured 
  with %textdiv.  

  /bg puts all sockets in the background, and is equivalent to /fg -n.  By 
  default, /bg is bound to the ^] key (not ESC, which is ^[) 

  See: /connect, worlds, sockets, %textdiv, %textdiv_str.  

&finger.tf
&/finger

/finger

  Usage: 

  /REQUIRE finger.tf

  /FINGER [<user>][@<host>]
  ____________________________________________________________________________

  Like unix finger, /finger reports information about <user> (default: all 
  users) on <host> (default: localhost), assuming that <host> is running a 
  standard finger daemon.  

  See: /require, worlds, sockets 

&/for

/for

  Usage: 

  /FOR <variable> <start> <end> <commands>
  ____________________________________________________________________________

  The <variable> will take on all numeric values between <start> and <end>, 
  inclusive.  The <commands> will be executed once for each of the values.  If 
  <end> is less then <start>, <commands> will not be executed.  

  <Commands> are executed in a new evaluation scope.  This means, for example, 
  that a /for called from a macro must use "%%{...}" and "%%;" instead of 
  "%{...}" and "%;" to have the substitutions performed when the /for is 
  expanded instead of when the calling macro is expanded.  

  Example: 

  Given the definition 

    /def countdown = /for i 0 %{1} say $$[%{1} - i]
    

  then the command "/countdown 10" would cause you to execute the commands 
  "say 10", "say 9", ...  "say 0".  Note that the "%{1}" is substituted when 
  /countdown is expanded, and the "$$" is replaced with "$".  The resulting 
  "$[10 - i]" is substituted when /for is expanded.  If /countdown used 
  "$[...]" instead of "$$[...]" in the <commands>, it would be substituted 
  when /countdown is expanded, and you would repeat "10" 11 times.  If 
  /countdown used "%%{1}" or "{1}" instead of "%{1}" inside the expression, it 
  would not be substituted until /for was expanded, so it would have the value 
  of /for's first argument (the string "i", which has numeric value 0), and 
  you would end up counting down from 0 to -10.  

  See: /while 

&ftime
&ftime()

ftime()

  Function usage: 

  ftime([<format> [, <time>]])
  ____________________________________________________________________________

  Returns a string formatted from an absolute system time <time> (obtained 
  from time() or mktime()) according to <format>.  If <time> is omitted, it 
  defaults to the current time.  If <time> is out of range, ftime() returns an 
  empty string and prints an error message.  If <format> is omitted, it 
  defaults to %time_format.  If <format> is "@", a raw system time (e.g., 
  seconds since 1970-01-01 00:00:00 UTC) will be displayed.  Otherwise, each 
  "%" in <format> describes a conversion: 
  %@      raw system time, in seconds, to the nearest microsecond 
          (nonstandard) 
  %.      microseconds since last whole second (nonstandard) 
  %a      abbreviated weekday name 
  %A      full weekday name 
  %b      abbreviated month name 
  %B      full month name 
  %c      local time and date representation 
  %d      day of month (01-31) 
  %F      ISO 8601 date format (equivalent to "%Y-%m-%d") 
  %H      hour on 24-hour clock (00-23) 
  %I      hour on 12-hour clock (01-12) 
  %j      day of year (001-366) 
  %m      month (01-12) 
  %M      minute (00-59) 
  %p      local equivalent of "AM" or "PM" 
  %s      raw system time, rounded down to the nearest whole second 
          (nonstandard) 
  %S      second (00-61) 
  %T      ISO 8601 time format (equivalent to "%H:%M:%S") 
  %U      week number of year, Sunday is first day of week (00-53) 
  %w      weekeday (0-6, Sunday is 0) 
  %W      week number of year, Monday is first day of week (00-53) 
  %x      local date representation 
  %X      local time representation 
  %y      year without century (00-99) 
  %Y      year with century 
  %Z      time zone name, if any 
  %%      "%" 
  Names and conversions labeled "local" may be affected by the setting of the 
  LC_TIME locale category.  Additional "%" conversions may be supported by 
  your system, including 3-character conversions starting with "%E" and "%O"; 
  see your system's strftime() documentation for details.  All other 
  characters in <format> are copied unmodified to the result.  

  The formats "%@" and "%s.%." do not give the same results if <time> is 
  negative.  

  Example:
  command: /expr ftime("Today is %a %b %d", time())
  output: Today is Thu Jul 02

  See: functions, time(), locale, %TZ, %time_format, %clock_format.  

&/gag

/gag

  Usage: 

  /GAG [<pattern> [=<response>]]
  ____________________________________________________________________________

  Creates a macro which will trigger on text matching <pattern> and prevent it 
  from being displayed, optionally executing <response>.  

  With no arguments, /gag sets the flag %{gag} to 1 (on).  This flag enables 
  the gag attribute on triggers.  It is on by default.  

  The matching style of the gag pattern is determined by %{matching}.  The 
  priority of the gag is determined by %{gpri}.  These variables are examined 
  when the gag is defined, not when it is executed.  

  Gagged lines from background worlds will not set the activity indicator on 
  the status line or call the activity hook.  

  If /gag does not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful in /undefn and /edit).  

  /gag <pattern> [= <response>]
  is equivalent to
  /def -ag -t"<pattern>" [= <response>]. 

  See: triggers, patterns, evaluation, %gag, /def, /nogag 

&download
&/getfile_MUCK
&/getfile_LP
&/getfile_UNIX
&/getfile

/getfile

  Usage: 

  /REQUIRE filexfer.tf

  /GETFILE_MUCK <file> [<remote-file>]
  /GETFILE_LP <file> [<remote-file>]
  /GETFILE_UNIX <file> [<remote-file>]
  ____________________________________________________________________________

  Downloads text <remote-file> from a MUCK, LP, or remote UNIX shell to <file> 
  on the local host.  If <remote-file> is omitted, <file> is used as the name 
  on both ends.  Do not use "wildcard" globbing characters in the file names.  

  When using /getfile_UNIX, an extra line of garbage may appear at the 
  beginning of the downloaded file unless you first disable remote echo with 
  "stty -echo".  

  Bug: if there is a log open for the current world, it will be closed by 
  /getfile.  

  See: /putfile, /log 

&/grab

/grab

  Usage: 

  /GRAB <text>
  ____________________________________________________________________________

  This command puts <text> into the input buffer.  It is not really useful 
  from the normal command line, but is quite useful when called from a macro 
  to redefine macros, or perhaps when bound to a key to speed up part of a 
  line (macros allow you to largely do what this would allow, however).  Any 
  text already in the input buffer is discarded.  

  Example: 

    /def reedit = /grab /edit %1 = $%1

  If you had previously done "/def flail = :flails at his keyboard", the 
  command "/reedit flail" would place "/edit flail = :flails at his keyboard" 
  in the input buffer and allow you to edit it using the editing keys.  See 
  "evaluation" for details on how macros like this work.  

  See: /input, general 

&oldgrep
&grep.tf

/grep

  Usage: 

  /REQUIRE grep.tf

  /FGREP <pattern> <command>
  /GREP <pattern> <command>
  /EGREP <pattern> <command>
  ____________________________________________________________________________

  Executes <command> and prints only the output that matches <pattern> (which 
  must not contain spaces).  /fgrep prints lines that contain the string 
  <pattern>; /grep prints lines that match the glob <pattern>; /egrep prints 
  lines that match the regexp <pattern>.  

  Remember to use "*" at each end of <pattern> to make /grep match lines that 
  contain a piece that matches the glob <pattern>; without the "*"s, the 
  entire line must match.  

  Example: "/fgrep T'tiny.muck' /listworlds" lists all the worlds defined with 
  the -T'tiny.muck' option.  

  See: textutil.tf, /require, patterns, expressions, functions 

&/man
&/help

/help

  Usage: 

  /HELP [<topic>]
  ____________________________________________________________________________

  Displays help on the topic specified, or displays a quick summary of 
  available topics if no topic is given.  

  In the documentation, words or phrases in this format are references to 
  other topics.  That is, a hyperlink in HTML, or something that can be used 
  as an argument to /help in tf.  

  Commands are described with the format "/COMMAND arguments".  Words in all 
  caps must be spelled exactly as shown (but do not need to be capitalized).  
  Arguments in <this format> (underlined angle brackets in /help, or italics 
  in HTML) can be given any value.  Arguments in [square brackets] may be 
  omitted.  The character | means "or".  For example, "[OFF|ON]" means you may 
  type "off", "on", or nothing.  

  Some help topics have punctuation in their names: variables begin with "%", 
  commands begin with "/", and functions end with "()".  A name with omitted 
  punctuation will usually match the same topic (e.g., "/def" and "def" both 
  match the /def command topic), but sometime will match a different topic 
  (e.g., "%MAIL" matches the MAIL variable topic, but "MAIL" matches the MAIL 
  hook topic).  There are also (sub)topics for various tf syntax constructions 
  such as "%{}" and "$()".  

  For /help to work, the variable %TFHELP must contain the name of the 
  helpfile.  It is set when TF is installed, and should not normally be 
  changed.  If the helpfile or the help index is not found, /help will not 
  function.  The help file is in ASCII with embedded ANSI display codes, so 
  can be read or printed by any program that can handle ANSI codes.  

#html
  The help documents are also available on the web at 
  http://tinyfugue.sourceforge.net/help/.  
#

  See: index, intro, options 

&/highlight
&/hilite

/hilite

  Usage: 

  /HILITE [<pattern> [= <response>]]
  ____________________________________________________________________________

  Creates a macro which will trigger on text matching <pattern> and display it 
  with the hilite attribute, optionally executing <response>.  

  With no arguments, /hilite sets the flag %{hilite} to 1 (on).  This flag 
  enables hilite and other attributes on triggers.  It is on by default.  

  The attribute(s) for hilited text are determined by the %{hiliteattr} 
  variable.  The default is bold (hiliteattr=B).  Colors are also available 
  (e.g., hiliteattr=Cgreen); see "attributes" and "color" for more 
  information.  

  The matching style of the hilite pattern is determined by %{matching}.  The 
  priority of the hilite is determined by %{hpri}.  These variables are 
  examined when the hilite is defined, not when it is executed.  

  If /hilite does not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful in /undefn and /edit).  

  The standard library also defines /hilite_page and /hilite_whisper which 
  hilite several different commonly used page and whisper formats.  

  /hilite <pattern> [=<response>]
  is equivalent to
  /def -ah -t"<pattern>" [=<response>]. 

  Example: 

    /hilite {*} tried to kill you!

  With the default settings, any line matching that pattern will appear bold.  

  To hilite messages generated by tf, see hooks.  

  See: triggers, patterns, attributes, /def, /nohilite, /partial 

&/histsize

/histsize

  Usage: 

  /HISTSIZE [-lig] [-w[<world>]] [<size>]
  ____________________________________________________________________________

  Options: 
  -l      local history 
  -i      input history 
  -g      global history (default) 
  -w<world> 
          world history 

  If <size> is not given, /histsize reports the maximum number of lines that 
  can be stored in the specified history.  

  If <size> is given, /histsize changes the maximum size of the specified 
  history to <size>.  If the new size is less than the old size, the oldest 
  lines will be lost immediately.  If the new size is greater than the old 
  size, no more old lines will be lost until enough new lines are added to 
  reach the new size.  

  /histsize returns 0 for failure, and the size of the history otherwise.  

  The %{histsize} variable can be used to set the default size of world 
  histories before they are created.  

  See: history, %histsize 

&/hook

/hook

  Usage: 

  /HOOK <event>[ <pattern>] [= <body>]
  /HOOK [OFF|ON]
  ____________________________________________________________________________

  Creates a macro which will execute <body> when <event> occurs and the 
  event's arguments match the optional <pattern>.  The <event> may be a single 
  event or a list of events separated by '|'.  If omitted, <pattern> will 
  default to "*".  

  /hook with no arguments displays the state of the %{hook} flag.  /hook with 
  an argument of ON or OFF sets the %{hook} flag, which determines if hooks 
  will execute their associated macros.  

  The matching style of the hook pattern is determined by %{matching}.  This 
  variable is examined when the hook is defined, not when it is executed.  

  Defining a hook will not replace an existing hook on the same event, but 
  rather creates an additional hook macro on the event.  The macro or macros 
  to be executed are chosen by the normal priority rules.  

  See the section "hooks" for details on hook operation, a list of event 
  names, and examples.  

  If /hook does not create a new macro, it returns 0.  Otherwise, it returns 
  the number of the new macro (useful in /undefn and /edit).  

  /hook <event>[ <pattern>] [=<response>]
  is equivalent to
  /def -h"<event>[ <pattern>]" [=<response>]. 

  Example: 

    /hook MAIL = /sh mutt

  will automatically invoke "mutt" to read mail when it arrives.  

  See: hooks, macros, evaluation, patterns, /def, /unhook 

&/if
&/then
&/elseif
&/else
&/endif
&/if

/if

  Usage: 

  /IF (expr) list [ /ELSEIF (expr) list ]...  [ /ELSE list ] /ENDIF
  /IF list /THEN list [ /ELSEIF list /THEN list ]...  [ /ELSE list ] /ENDIF
  ____________________________________________________________________________

  <List> is any list of commands.  The return value of a <list> is the return 
  value of the last command executed in the <list>.  Note that each <list> 
  must be terminated by "%;".  

  <expr> is any expression, and must be surrounded by parentheses.  

  The <list> or <expr> following the /IF is executed or evaluated.  If the 
  result is non-zero, the next <list> is executed.  Otherwise, this is 
  repeated for each /ELSEIF.  If none of the /IF or /ELSEIF <list>s or <expr>s 
  return non-zero, the /ELSE <list> is executed if there is one.  

  The return value of the /IF.../ENDIF statement is undefined.  

  /IF (expr) body%; /ENDIF 
  is equivalent to
  /IF /TEST expr%; /THEN body%; /ENDIF 
  except that in the former, <expr> does not undergo macro body substitution.  

  When /IF is used on the command line, "%;" command separation is done even 
  if %sub=off.  Of course, full substitution will be done if %sub=full.  

  If <list> is a server (mud) command, the condition being tested is whether 
  the command is sent successfully; that is, whether there is a current 
  socket.  TF has no way of knowing how the server deals with the command or 
  what is considered "success" for a server command, and tf does not wait for 
  a server response which will be delayed by network latency.  So, doing 
  something like "/if rob corpse%; /then ..." will not have the effect you 
  probably want.  To achieve that effect, you should define a trigger on each 
  of the possible server responses, before you send your command.  

  Example: 

    /if (TERM !~ "dumb") /visual on%; /endif

  will do "/visual on" if your %{TERM} is not "dumb".  

  See: evaluation, expressions, /test, /def -E, 

&builtins
&commands
&index

index

  Commands marked with '+' are new in the current version.  Commands marked 
  with '*' have changed significantly in the current version.  

  *ADDWORLD      *FG             LISTVAR        REPLACE        TOGGLE        
  *AT             FINGER         LISTWORLDS    *RESTRICT       TR            
   BAMF           FOR            LOAD           RETURN         TRIG          
   BEEP           GAG            LOCALECHO     +RUNTIME       *TRIGGER       
  *BIND           GETFILE        LOG            SAVE           UNBIND        
   BREAK          GRAB           mapping        SAVEWORLD      UNDEF         
   CAT            HELP          *MORE          *SEND           UNDEFN        
   CHANGES        HILITE         NOHILITE       SET            UNDEFT        
  *CONNECT        HISTSIZE       PARTIAL        SETENV         UNHOOK        
   DC             HOOK          *PASTE          SH             UNSET         
  *DEF            IF            *PS             SHIFT          UNTRIG        
  *DOKEY          INPUT          PURGE          spelling       UNWORLD       
  *ECHO           KILL           PURGEWORLD     SUB            VERSION       
  *EDIT           LCD            PUTFILE        SUBSTITUTE     WATCHDOG      
   ESCAPE         LET           *QUIT           SUSPEND        WATCHNAME     
  *EVAL/NOT      +LIMIT         *QUOTE          TELNET         WHILE         
   EXIT           list commands  quoter.tf      TEST           WORLD         
   EXPORT         LIST          *RECALL        *textutil.tf                  
   EXPR          *LISTSOCKETS    RECORDLINE     TICK                         
  +FEATURES       LISTSTREAMS   *REPEAT         TIME                         

  See also: intro, topics 

&/input

/input

  Usage: 

  /INPUT <text>
  ____________________________________________________________________________

  Enters <text> into the input buffer as if it had been typed at the keyboard, 
  without deleting the current contents of the input buffer.  

  /Input is perhaps most useful in combination with /bind, to create short key 
  sequences that expand to longer text.  For example, if you have this 
  binding: 

  /bind ^[oj = /input OliverJones 

  and then type "page ^[oj = snausages!" at the keyboard, it will appear in 
  the input window as "page OliverJones = snausages!".  

  See: /bind, /grab 

&/ismacro

/ismacro

  Usage: 

  /ISMACRO <macro-options>
  ____________________________________________________________________________

  If <macro-options> matches one or more existing macros, /ismacro returns the 
  number of the last matching macro; otherwise, /ismacro returns 0.  
  <Macro-options> may include any of the options accepted by /list.  If -m is 
  not specified, %{matching} is used.  

  Example: 

    /if /!ismacro -b"^X*"%; /then /bind ^X = /foobar%; /endif

  See: /list, macros 

&/isvar

/isvar

  Usage: 

  /ISVAR <name>
  ____________________________________________________________________________

  Returns 1 if variable <name> is set, 0 otherwise.  

  Example: 

    /if (!isvar('LANG')) /set LANG=en_US%; /endif

  See: /listvar, variables 

&/kill

/kill

  Usage: 

  /KILL <pid>... 
  ____________________________________________________________________________

  For each <pid> given, /kill terminates the corresponding process (/quote or 
  /repeat command).  The pid of a process can be determined from the return 
  value of the /quote or /repeat, the /ps command, or a PROCESS hook.  

  Bug: /kill on a pending /quote ! will block until the shell process exits.  
  The block can be broken with an interrupt.  

  See: processes, /quote, /repeat, /ps 

&/cd
&/pwd
&/lcd

/lcd

  Usage: 

  /LCD [<dir>]
  /CD [<dir>]
  /PWD
  ____________________________________________________________________________

  /lcd and /cd change to a new working directory.  If <dir> is omitted with 
  /lcd, the current directory is displayed (if supported on your system).  If 
  <dir> is omitted with /cd, %{HOME} is assumed.  

  The <dir> name is expanded as described under "filenames".  

  /pwd displays the current working directory (if supported on your system).  

&/let

/let

  Usage: 

  /LET <name>=<value>
  /LET <name> <value>
  ____________________________________________________________________________

  Assigns <value> to variable <name> in the current local scope.  Can only be 
  used during macro expansion.  The variable will be destroyed when the scope. 
  in which it was created exits.  

  Note to lisp users: this is nothing like lisp's let.  

  See: /set, variables 

&/limit
&/relimit
&/unlimit

/limit

  Usage: 

  /LIMIT [-v] [-a] [-m<style>] [<pattern>]
  /RELIMIT
  /UNLIMIT
  ____________________________________________________________________________

  /Limit redraws the window, showing only lines that match <pattern>.  It is 
  then possible to scroll forward and backward within the "limited" window.  
  The limit affects only the current screen, and stays in effect until 
  /unlimit is called.  

  /Limit options: 
  -v      show only lines that don't match <pattern> 
  -a      show only lines that have attributes 
  -m<style> 
          use matching style (simple, glob, or regexp), instead of the default 
          %{matching}.  

  If <pattern> is given, only lines in the given range that match <pattern> 
  will be recalled.  The matching style is determined by the -m option if 
  given, %{matching} otherwise.  By default, the @more status field does not 
  count lines that are omitted by /limit.  

  With no options or arguments, /limit returns 1 if a limit is in effect, 0 if 
  not.  

  /unlimit disables the /limit so all lines are displayed.  

  During /limit, scrolling to any point, including the bottom, results in a 
  More prompt that shows the number of lines (possibly 0) below the status 
  line.  In this state, /unlimit will leave the bottom visible line where it 
  is, and redraw the unlimited lines above it.  Thus, you can use /limit to 
  find a line you are interested in, use the scrolling keys to position that 
  line at the bottom of the window, then /unlimit to see the context of that 
  line.  But if you attempt to scroll past the bottom during /limit, the More 
  prompt changes to "LIMIT ON"; in this state, /unlimit will redraw with the 
  previously invisible last line at the bottom of the screen.  

  /relimit repeats the last /limit.  

  The default keybinding ^[L toggles the last limit off and on.  

  See: /recall 

&/listbind
&/listdef
&/listgag
&/listhilite
&/listhook
&/listtrig
&/list

/list

  Usage: 

  /LIST [-s] [<macro-options>] [<name>] [= <body>]
  ____________________________________________________________________________

  Lists macros having all the specified options.  Except for "-s", each option 
  is compared against a macro's option, and the macro selected only if the 
  options match.  Omitted options are "don't care", and will not be used in 
  the comparison.  Thus, with no arguments, /list will list all non-invisible 
  macros.  

#list options
  Options: 
  -s      List macros in short format.  
  -S      Sort macros by name.  
  -m<matching> 
          Determines matching style used for comparison of string fields 
          (trigger, keybinding, keyname, hook, worldtype, name, and body).  
          This is not compared against the -m options of macros.  If omitted, 
          the style is determined by %{matching}.  
  -t<pattern> 
  -b<pattern> 
  -B<pattern> 
  -E<pattern> 
  -T<pattern> 
          Matches macros with a corresponding /def option whose 
          option-argument matches <pattern>.  <pattern>.  An option with no 
          pattern matches all macros that have that option, regardless of the 
          value of the option-argument.  A "{}" glob pattern or "^$" regexp 
          can be used to match macros that don't have that option, 
  -h["<event>[ <pattern>]"] 
          Matches macros with hooks matching <event> and <pattern>.  "-h" by 
          itself matches all non-empty hooks; "-h0" matches only macros 
          without hooks.  
  -a<attrs> 
          Matches macros having one or more of the display attributes in 
          <attrs>.  
  -P<part><attrs> 
          Matches macros having a -P<part> with one or more of the display 
          attributes in <attrs>.  
  -i      Matches invisible macros as well as normal macros.  
  -I      Matches only invisible macros.  
  <name>  A pattern that macro names must match.  The glob pattern "{}" or 
          regexp "^$" will match only macros without names.  If <name> starts 
          with "#", it is compared against macro numbers, instead of as a 
          pattern against macro names.  
  = <body> 
          <body> is a pattern that macro bodies must match.  The glob pattern 
          "{}", or the regexp "^$" or the simple pattern "" will match 
          bodyless macros only.  
#

  Other options allowed by /def may be used with /list, and are compared 
  directly to macros.  

  The return value of /list is the number of the last macro listed, or 0 if no 
  macros were listed (because of error or none matched the specified options). 

  The standard library also defines the macros /listbind, /listdef, /listgag, 
  /listhilite, /listfullhilite, /listpartial, /listhook, and /listtrig, which 
  list macros of the appropriate type.  

  Example: 

      /list -mregexp -n0 -t -aurh ^foo =

  will list all macros whose names begin with "foo"; have a trigger; are not 
  multi-shots; have any of the underline, reverse, or hilite attributes; and 
  have an empty body.  

  To list functions for named keys, try "/list -i key_*".  

  See: macros, triggers, patterns, attributes, library, /def 

&/car
&/cdr
&/cadr
&/cddr
&/caddr
&/cdddr
&/length
&/reverse
&/mapcar
&/maplist
&/remove
&/unique
&lisp
&lisp.tf
&list
&list commands

list commands

  Usage: 

  /REQUIRE lisp.tf
  ____________________________________________________________________________

  These commands operate on lists of words, and are similar to those in lisp.  
  They all give their results with /echo, and are intended to be used in 
  $(...) command substitution to capture the result.  

  /car <list> 
          Echo first word.  (Same as /first).  
  /cdr <list> 
          Echo all words after first.  (Same as /rest).  
  /cadr <list> 
          Echo second word.  
  /cddr <list> 
          Echo all words after second.  
  /caddr <list> 
          Echo third word.  
  /cdddr <list> 
          Echo all words after third.  

  /length <list> 
          Echo number of words in <list>.  

  /reverse <list> 
          Reverse the order of the words in <list>.  

  /mapcar <cmd> <list> 
          Execute "<cmd> <word>" for each word in <list>.  
  /maplist <cmd> <list> 
          Execute "<cmd> <list>" repeatedly, removing the first word from 
          <list> each time, until <list> is empty.  

  /remove <word> <list> 
          Echo <list> with all occurrences of <word> removed.  

  /unique <list> 
          Remove all duplicate words from <list>.  Note: /unique is very slow 
          on long lists.  

  See: /nth 

&/listsockets

/listsockets

  Usage: 

  /LISTSOCKETS [-sn] [-m<style>] [-S<field>] [-T<type>] [<name>]
  ____________________________________________________________________________

  Lists the sockets to which TinyFugue is connected.  

  Options and arguments: 
  -s      short form, list only world names 
  -n      print host and port in numeric form 
  -m<style> 
          Use <style> for pattern matching in other options (default: 
          %{matching}).  
  -S<field> 
          Sort sockets by <field>.  <Field> may be "name", "type", 
          "character", "host", "port", "lines", "idle", or "-" (don't sort; 
          this is the default).  Only the first character is necessary.  
  -T<type> 
          list only worlds with a type matching the pattern <type>.  
  <name>  list only worlds with a name matching the pattern <name>.  

  The output will look something like this (unless the -s option is given): 

       LINES IDLE TYPE      NAME            HOST                       PORT
     10+  48  13h tiny.muck Cave            tcp.com                    2283
  *  foregnd   1m tiny.mush DeepSeas        muds.okstate.edu           6250
           0   7s telnet    whitehouse.gov, whitehouse.gov             smtp
   ?       0  15s tiny      SlowMUD         slow.machine.com           4201

  The columns and their meanings are: 
  unlabeled first column 
          "*" marks the current socket.  
  unlabeled second column 
          the state of the socket is one of: 
          !       dead 
          ?       hostname lookup or network connection is incomplete 
          C/c     an established normal connection 
          S/s     an established connection currently in telnet subnegotiation 
          X/x     an established SSL connection 
          O       an open connectionless socket 
          A lowercase state character indicates the connection is using MCCP.  
  unlabeled third column 
          "P" if the connection is proxied 
  LINES   for a background socket, the number of old (seen) and new (unseen) 
          lines past the bottom of the socket's window (ignoring any limit 
          that may be in effect on that window); or, "foregnd" for a 
          foreground socket.  
  IDLE    how long since the last text was received on the socket.  
  TYPE    the type of the world (set with /addworld -T).  
  NAME    the name of the world associated with the socket.  
  HOST    the host to which the socket is connected.  
  PORT    the port to which the socket is connected.  

  The return value of /listsockets is the number of sockets listed.  

  See: sockets, %background, /connect, /fg, nactive(), idle() 

&/liststreams

/liststreams

  Usage: 

  /LISTSTREAMS
  ____________________________________________________________________________

  Lists tfio streams opened by tfopen().  The tfin, tfout, and tferr streams 
  are not included.  

  The columns and their meanings are: 
  HANDLE  The handle returned by tfopen().  
  MODE    The mode argument given to tfopen().  
  FLUSH   Whether automatic flushing is enabled.  See tfflush().  
  NAME    The name argument, if any, given to tfopen().  Files of mode "q" do 
          not need a name, but you may wish to give them one anyway so it 
          appears here.  

  The return value of /liststreams is the number of open streams listed.  

  See: tfio 

&/listvar

/listvar

  Usage: 

  /LISTVAR [-m<matching>] [-gxsv] [<name> [<value>]]
  ____________________________________________________________________________

  Options: 
  -m<matching> 
          Determines matching style used for comparison of <name> and <value>. 
          If omitted, the style is determined by %{matching}.  
  -g      List only global (unexported) variables.  
  -x      List only variables that are exported to the environment.  
  -s      Short format: list variable names only.  
  -v      List values only.  

  /Listvar lists values of variables whose name and value match <name> and 
  <value> according to <matching>, sorted by name.  If neither -g nor -x is 
  given, global and environment variables are listed.  

  The return value of /listvar is the number of variables listed.  

  See: variables, /set, /setenv, /export, /let, /unset 

&/listworlds

/listworlds

  Usage: 

  /LISTWORLDS [-cus] [-m<style>] [-S<field>] [-T<type>] [<name>]
  ____________________________________________________________________________

  Lists world definitions.  

  Options and arguments: 
  -m<style> 
          Use <style> for pattern matching of <type> and <name> patterns.  
          (default: %{matching}).  
  -s      Display short format (world names only).  
  -c      Display command format (including passwords).  
  -S<field> 
          Sort worlds by <field>.  <Field> may be "name" (the default), 
          "type", "character", "host", "port", or "-" (don't sort).  Only the 
          first character is necessary.  
  -u      Include unnamed temporary worlds in the listing.  
  -T<type> 
          List only worlds with a type matching the pattern <type>.  
  <name>  List only worlds with a name matching the pattern <name>.  

  If neither -s nor -c are given, a table format is used, and passwords are 
  not shown.  The return value of /listworlds is the number of worlds listed.  

  See: worlds, patterns 

&/loadbind
&/loaddef
&/loadgag
&/loadhilite
&/loadtrig
&/loadhook
&/loadworld
&/require
&/loaded
&/load

/load

  Usage: 

  /LOAD [-q] <file>
  /REQUIRE [-q] <file>

  /LOADED <token>
  ____________________________________________________________________________

  /Load and /require both read and execute commands from <file>.  They are 
  identical, except that if <file> calls /loaded and has already been read 
  once, /require will not read it again (but the LOAD message/hook will still 
  be displayed/called).  

  "/Loaded <token>" should be the first command in a file that is designed to 
  be loaded only once with /require.  <Token> should be a string that does not 
  contain space or glob metacharacters, and is different than the token used 
  by any other /loaded call.  The file's full name is usually a good choice 
  for <token>.  

  Options: 
  -q      Do not echo the "% Loading commands from <file>" message in this 
          /load call or any /load calls in <file>.  (but the LOAD hook will 
          still be called).  

  The file may contain any legal TinyFugue commands.  Blank lines and lines 
  beginning with ';' or '#' are ignored.  Any leading whitespace on a line is 
  stripped.  Any line ending in '\' will have the following line joined to it 
  (after leading spaces are stripped).  A '%' preceding a '\' eliminates its 
  special meaning.  

  The <file> name is expanded as described under "filenames".  

  If the COMPRESS_SUFFIX and COMPRESS_READ macros are defined, the file will 
  be automatically uncompressed if needed.  

  If the expanded filename is not an absolute path name, TF will search first 
  in the current directory (which can be changed with /lcd), and then in the 
  list of directories named by %{TFPATH}.  If %{TFPATH} is blank or unset, the 
  single directory named by %{TFLIBDIR} is used.  

  A /load may be aborted early with the /exit command in the file.  

  Loaded files may be given any name, but names ending in ".tf" are 
  recommended.  

  /Load and /require return 1 if successful (for /require, this includes not 
  needing to read the file), or 0 if not successful.  /Loaded does not return 
  if the file that calls it has already been loaded.  

  The standard macro library also defines the commands /loaddef, /loadbind, 
  /loadhilite, /loadgag, /loadtrig, /loadhook, and /loadworld.  These macros 
  will load from a default file if no file is specified.  

  See: macros, library, /exit, /def, /save, /lcd, filenames, compression 

&%always_echo
&always_echo
&/localecho

/localecho

  Usage: 

  /LOCALECHO [ON|OFF]
  ____________________________________________________________________________

  /Localecho with no arguments returns 1 if local echoing is enabled for the 
  current socket, 0 otherwise.  TF echoes its input by default, unless the 
  server has negotiated otherwise.  

  /Localecho with an argument attempts to enable or disable echoing for the 
  current socket.  If the server is not known to support TELNET protocol, 
  "/localecho [ON|OFF]" does nothing, and returns 0.  ON tells the server DONT 
  ECHO; if the server acknowledges (as it must according to TELNET protocol), 
  tf will echo its own input.  OFF tells the server to DO ECHO; if the server 
  acknowledges, tf will not echo its own input, expecting the server to do it. 
  The actual change of state takes place after the server agrees, which may be 
  delayed by network latency ("netlag").  

  Note that tf does not transmit input until a newline is pressed, and the 
  server can not echo it until it is received; so, with /localecho off, your 
  typing will not be visible until you hit return, at which time the server 
  may echo back the entire line.  

  Some mud servers use the ECHO option to disable local echo during password 
  entry.  Telnet servers, however, try to disable local echo for the entire 
  session, which would interfere with many useful tf features.  Hooks defined 
  in the standard library use /localecho to override the telnet server 
  automatically.  

  /Localecho is intended to be called by library macros, and should not need 
  to be called by the user.  /Localecho obsoletes %{always_echo}.  

  The TELNET ECHO option is defined in RFC 857.  

  See: prompts, %telopt, /telnet 

&/log

/log

  Usage: 

  /LOG [-ligw[<world>]] [OFF|ON|<file>]
  ____________________________________________________________________________

  Enables or disables logging, or lists currently open log files.  An [-ligw] 
  option specifies which history is used (only one can be used).  The 
  [OFF|ON|<file>] argument specifies what action is taken on that history.  

  Options: 
  -w<world> 
          Output from <world> only.  
  -w      Output from the current world.  
  -l      Local output (i.e., output generated by TF).  
  -i      Keyboard input.  
  -g      Global output (all worlds and local TF output).  

  Arguments: 
  OFF     Disable specified log, or all logs if unspecified.  
  ON      Log to ${LOGFILE}; -g is assumed if -ligw not given.  
  <file>  Log to <file>; -g is assumed if -ligw not given.  
  (none)  With no option, lists all open logs.  
  (none)  With an -ligw option, same as "ON".  

  When logging is enabled for a history, lines that are normally recorded in 
  that history are also appended to the log file (unless the line has the "L" 
  nolog attribute).  The previously existing contents of the file, if any, are 
  not affected.  

  It is possible to have multiple log files open simultaneously.  It is also 
  possible to have several types of output go to the same log file, by using 
  several /log commands.  For example, 

    /log -i tt.log
    /log -wTT tt.log
    /log -g on

  will send input from the keyboard and output from the world TT to the file 
  "tt.log", and also send all (global) output to the file named by the LOGFILE 
  macro.  

  This example logs the current world's output to a file whose name contains 
  the world's name and today's date: 

    /eval /log -w ${world_name}.$[ftime("%F")]
    

  The functions of the /logme command in older versions of TF can be performed 
  with /log -i.  

  Wrapping will be done in the log file only if the %{wraplog} variable is 
  "on".  

  Logging is disabled by default.  The default value of ${LOGFILE} is 
  "tiny.log".  

  Note: the natural logarithm function was renamed from log() to ln() in 
  version 5.0, to avoid confusion with /log.  

  See: %wraplog, history, nlog() fwrite() 

&/logme

/logme

  Obsolete.  See "log".  

&/map
&/mark
&/path
&/revert
&/savepath
&/unpath
&/unmark
&/dopath
&mapping

mapping

  Usage: 

  /REQUIRE map.tf

  /MARK <dir>
  /UNMARK
  /PATH
  /RETURN
  /MAP
  /UNPATH
  /SAVEPATH <name>
  /DOPATH <path>
  ____________________________________________________________________________

  These commands, similar to those in tintin, help keep track of sequences of 
  directions between two locations on a mud.  When mapping is enabled with 
  /mark, all mud movement commands (n, s, e, w, ne, sw, nw, se, u, d) that you 
  type are recorded in the "current path".  

  /mark clears the current path and starts recording your movement.  

  /unmark disables map recording (but does not clear the current path).  

  /path prints the current recorded path.  

  /revert "undoes" the last movement by deleting it from the path and 
  executing the opposite movement command.  (This was called "/return" prior 
  to version 4.0).  

  /map adds <dir> to the current path as if you had actually gone in that 
  direction.  

  /unpath deletes the last movement from the path (but does not move you to 
  your previous position) 

  /savepath defines a macro named <name> that will execute the movements in 
  the currently defined path.  (To save this macro to a file, use "/save [-a] 
  <file> <name>").  

  /dopath executes a <path>.  <Path> must be a space-separated list of 
  movement commands with optional repeat counts.  For example, "/dopath 10 n e 
  d 2 w" will execute "n" 10 times, "e" once, "d" once, and "w" twice.  

  See: /require, speedwalk 

&scroll
&pager
&--more--
&--More--
&/more

/more

  Usage: 

  /MORE [OFF|ON]
  ____________________________________________________________________________

  Sets the value of the %{more} flag.  If the %{more} flag is ON when the 
  screen or output window fills up, output will stop, and a "More" prompt will 
  be displayed.  With the default keybindings, TAB will scroll one screenful, 
  PgDn and PgUp will scroll a half screen forward or backward, ^[^N and ^[^P 
  will scroll one line forward or backward, and ^[j will Jump to the last 
  screenful.  

  Regardless of the setting of the %more flag, you can use "/dokey pause" (^S) 
  at any time to pause the screen immediately, or use any of the scrolling 
  commands to scroll backward and forward.  After doing so, the "more" prompt 
  will remain until you reach the bottom line again; after that point, newly 
  displayed lines will obey the %more flag normally.  

  In visual mode, with the default status bar settings, the More prompt 
  displays the number of old lines (i.e., how far you have scrolled backwards) 
  and the number of new lines you haven't had a chance to see yet (i.e.  lines 
  that arrived since the More prompt first appeared).  If you have not 
  scrolled backwards, only the count of new lines is shown, so the More prompt 
  looks the same as it would have in version 4.0.  If either count would not 
  fit in the space allotted to it in the More prompt, they may be displayed in 
  units of thousands (e.g., "17523" would be shown as "17k").  

  Each socket and open world world has its own window with its own "more" 
  state.  

  If your terminal can't scroll in visual mode, TF will start over at the top 
  of the output window instead.  

  See: /dokey, visual, %more, morescroll(), moresize(), status_fields 

&/nogag

/nogag

  Usage: 

  /NOGAG [<pattern>]
  ____________________________________________________________________________

  Eliminates a macro that is triggered by <pattern> and has the gag attribute. 
  /nogag with no arguments turns off the flag %{gag}, disabling all gag 
  attributes.  <Pattern> is matched against existing patterns using simple 
  comparison.  

  The flag %{gag} defaults to 1 (on).  

  See: triggers, /gag, %gag 

&/nohilite

/nohilite

  Usage: 

  /NOHILITE [<pattern>]
  ____________________________________________________________________________

  With a <pattern> argument, /nohilite undefines a macro that is triggered by 
  <pattern> and has the hilite attribute.  <Pattern> is matched against 
  existing patterns using simple comparison.  

  With no argument, /nohilite turns off the flag %{hilite}, disabling all 
  display attributes.  

  The flag %{hilite} defaults to 1 (on).  

  See: triggers, /hilite, %hilite 

&/first
&/last
&/nth

/nth

  Usage: 

  /FIRST <text>
  /LAST <text>
  /NTH <n> <text>
  ____________________________________________________________________________

  Echoes the first, last, or <n>th word from text.  `/first <text>' is 
  equivalent to `/nth 1 <text>'.  

  These commands can be useful in command substitutions.  For example, to make 
  "ctrl-O 1" input the first word of the most recent mud output, you could do 
  this: 

  /bind ^O1 = /input $(/first $(/recall 1)) 

  See: parameters, command substitution 

&/partial

/partial

  Usage: 

  /PARTIAL <regexp>
  ____________________________________________________________________________

  Creates a macro which will hilite the part of a line containing text matched 
  by the regular expression <regexp>.  Remember that regular expressions are 
  case sensitive.  The new macro is a fall-thru, so multiple /partials (and 
  other triggers) can match the same text.  

  The attribute(s) for hilited text are determined by the %{hiliteattr} 
  variable.  The default is bold (hiliteattr=B).  Colors are also available.  

  For example, "/partial [Hh]awkeye" will hilite any occurrence of "Hawkeye" 
  or "hawkeye".  

  Unlike version 3.2, a partial hilite will be applied to every match on a 
  line, not just the first match.  

  /partial <regexp>
  is equivalent to
  /def -Ph -F -t<regexp>

  See: attributes, patterns, /hilite, /def 

&paste_prefix
&%paste_prefix
&/endpaste
&/paste

/paste

  Usage: 

  /PASTE [-pnx] [<prefix>]
  /ENDPASTE
  ____________________________________________________________________________

  After executing /paste, every line of input (including lines that begin with 
  "/") will have <prefix> prepended to it and then get sent to the current 
  socket.  If <prefix> is omitted and -n is not specified, the prefix defaults 
  to the value of %paste_prefix; if %paste_prefix is empty or unset, it 
  defaults to ":|".  Typing "/endpaste" or "." on a line by itself ends the 
  pasting; "/abort" on a line by itself aborts the pasting.  /Paste can be 
  very useful when using the cut-and-paste mechanism of many windowing 
  systems.  

  Options: 
  -p      "paragraph mode": adjacent non-blank lines are joined, and leading 
          spaces are stripped (this is particularly useful when pasting text 
          cut from a web browser or a window of different width).  
  -n      Don't prepend any prefix.  
  -x      After prepending the prefix (if any), execute the resulting line as 
          a command (without substitution) instead of sending it.  
  -w<world> 
          Send the text to <world>.  
  -e<end> 
          End when the user types <end> (default: "/endpaste").  With or 
          without this option, "." will always work.  
  -a<abort> 
          Abort when the user types <abort> (default: "/abort").  With or 
          without this option, interrupt (^C) will always work.  
  -q      quiet: do not print "Entering paste mode" message.  
  -s      strip trailing spaces from each pasted line 
  -h      invoke matching SEND hooks for each line sent by /paste.  

  Note that /endpaste is not actually a command, but a "magic cookie" 
  recognized by /paste.  "/Endpaste", ".", and SIGINT (^C) are the only ways 
  to end /paste.  

  Lines sent by /paste will invoke matching SEND hooks.  

  Examples: 
  Prepare to paste text from a web page to a mud: 
          /paste -p 
  Prepare to paste a bunch of lines to be recorded in your input history: 
          /paste -x /recordline -i - 

  See: /quote 

&/prompt

/prompt

  Function usage: 

  PROMPT(<text>)

  Command usage: 

  /PROMPT [-a<attrs>] [-p] <text>
  ____________________________________________________________________________

  Sets the prompt for the current socket to <text>, replacing any existing 
  prompt.  

  Command options: 
  -a<attrs> 
          Apply the attributes given by <attrs> to <text>.  
  -p      Interpet "@{<attr>}" strings within <text> as commands to set 
          attributes inline.  See decode_attr().  

  /prompt is most useful when called from a PROMPT hook, like this: 

      /def -h"PROMPT *> " catch_prompt = /test prompt({*})

  Then, any text that ends in ">" without a newline will be made the prompt.  

  For a more sophisticated example, see "status line".  

  See: prompts, hooks (PROMPT) 

&/ps

/ps

  Usage: 

  /PS [-srq] [-w<world>] [<pid>]
  ____________________________________________________________________________

  Options: 
  -s      short form, lists only PIDs.  
  -r      list /repeats only.  
  -q      list /quotes only.  
  -w[<world>] 
          list only processes for <world>.  

  Lists information about process <pid>, or all currently running /quote and 
  /repeat processes: 

  PID     unique process identification number.  
  NEXT    time remaining until next execution of process, or "pending" if 
          process is waiting for output from a shell command.  
  T       the type of the command: "q" for 
          quote or "r" for repeat.  
  D       disposition of /quote lines: "e" for echo, "s" for send, or "x" for 
          exec.  
  WORLD   world to which output is sent, if not the current world.  
  PTIME   delay between executions.  
  COUNT   number of /repeat executions remaining.  
  COMMAND 
          the command to be executed.  

  See: processes 

&/purgebind
&/purgedef
&/purgedeft
&/purgegag
&/purgehilite
&/purgehook
&/purgetrig
&/purge

/purge

  Usage: 

  /PURGE [<macro-options>] [<name>] [= <body>]
  ____________________________________________________________________________

  Removes all macros matching the specified restrictions.  The <macro-options> 
  are the same as those in the /list command; see "/list" for details.  
  Invisible macros will not be purged unless "-i" is specified.  Remember that 
  "macros" includes keybindings, hilites, gags, triggers, and hooks.  

  The standard macro library also defines the commands /purgedef, /purgebind, 
  /purgehilite, /purgegag, /purgetrig, /purgedeft, and /purgehook, which purge 
  macros of the appropriate type.  These always use glob matching.  

  See: macros, triggers, patterns, attributes, library, /def, /list, 
  /purgeworld 

&/purgeworld

/purgeworld

  Usage: 

  /PURGEWORLD [-m<style>] [-T<type>] [<name>]
  ____________________________________________________________________________

  Removes world definitions.  

  Options and arguments: 
  -m<style> 
          Use <style> for pattern matching of <type> and <name> patterns.  
          (default: %{matching}).  
  -T<type> 
          Remove only worlds with a type matching the pattern <type>.  
  <name>  Remove only worlds with a name matching the pattern <name>.  

  The return value of /purgeworld is the number of world definitions that were 
  removed.  

  See: worlds, /listworlds, patterns 

&upload
&/putfile_MUCK
&/putfile_UNIX
&/putfile_LP
&/putfile

/putfile

  Usage: 

  /REQUIRE filexfer.tf

  /PUTFILE_MUCK <file> [<remote-file>]
  /PUTFILE_LP <file> [<remote-file>]
  /PUTFILE_UNIX <file> [<remote-file>]
  ____________________________________________________________________________

  Uploads text <file> from the local system to <remote-file> on a MUCK, LP, or 
  UNIX server, using an editor on the remote system.  If <remote-file> is 
  omitted, <file> is used as the name of the remote file.  

  /Putfile_LP assumes the LPmud has an "ed" editor similar to that in UNIX.  

  For backward compatibility, /putfile is the same as /putfile_MUCK.  

  See: /getfile, /quote 

&/quit

/quit

  Usage: 

  /QUIT [-y]
  ____________________________________________________________________________

  Exits TF.  If TF is interactive, and there are any worlds with unseen text, 
  /quit first asks you to confirm the exit; if you type anything other than 
  "Y" or "y", TF does not exit.  

  Options: 
  -y      exit unconditionally, without prompting.  
  When TF exits, all socket connections will be disconnected; all logfiles 
  will be closed; all /quotes and /repeats will be killed; and all history, 
  unsaved macros, and variables will be lost.  

  If you prefer to never be prompted by /quit, you can redefine it like this: 

    /def quit = /@quit -y

  See also: /dc, %quitdone 

&/quote

/quote

  Usage: 

  /QUOTE [<options>] [<pre>] '"<file>"[<suf>]
  /QUOTE [<options>] [<pre>] #"<recall_args>"[<suf>]
  /QUOTE [<options>] [<pre>] !"<shell_cmd>"[<suf>]
  /QUOTE [<options>] [<pre>] `"<TF_cmd>"[<suf>]
  ____________________________________________________________________________

  /Quote generates lines of text, one for each line quoted from a file, shell 
  command, history, or TF command.  Each generated line is then echoed, sent 
  to a socket, or executed as a command.  Lines will be generated at a rate 
  described in the section "processes".  

  Options and arguments: 
  -d<disp> 
          disposition of generated text.  <Disp> is one of: "echo" (echo to 
          the screen), "send" (send directly to the socket), or "exec" 
          (execute text as a tf command).  The default <disp> is "send" if 
          there is no <pre>, and "exec" if there is a <pre>.  
  -w<world> 
          Generated commands will be executed with <world> as the current 
          world.  If <world> is blank, it uses the world that was current when 
          the /quote started.  If -w is omitted, each command's current world 
          will be whatever happens to be in the foreground when each command 
          occurs.  (See "sockets").  
  -<time> 
          The delay between each generated line.  It can have the format 
          "<hours>:<minutes>:<seconds>", "<hours>:<minutes>", or "<seconds>", 
          and <seconds> may be specified to the nearest microsecond.  If 
          -<time> is omitted, the variable %{ptime} is used.  If <time> is 
          given as the letter "S", the quote will run synchronously, with no 
          delay.  If a slow shell command is used with /quote -S !, tf will 
          hang until the command produces some output or exits.  A synchronous 
          /quote may be used inside another /quote.  If <time> is given as the 
          letter "P", the quote will run whenever a prompt is received.  See 
          "processes" for more information on process timing.  
  -s<sub> 
          Expand <TF_cmd> as if %{sub} were set to <sub>.  By default, /quote 
          expands <TF_cmd> as if %{sub} were "full".  
  <pre>   <pre> is prefixed to each generated line.  If <pre> contains any of 
          the command characters ('!`#), they must be preceded with '\' to 
          remove their special meaning.  
  '<file> 
          Get text from <file>.  The <file> name is expanded as described 
          under /help filenames.  
  !<shell_cmd> 
          Get text from the standard output and standard error of executing 
          <shell_cmd> in the shell.  
  `<TF_cmd> 
          Get text from the output of executing <TF_cmd> in tf.  
  #<recall_args> 
          Get text from executing /recall <recall_args>.  (See "recall" for 
          the exact syntax).  
  <suf>   Append <suf> to each generated line.  If omitted, the double quotes 
          around the <file> or <command> may also be omitted.  

  An asynchronous (background) /quote (i.e., a /quote without -S) returns the 
  pid of the new process, or 0 if an error occurred.  A synchronous (-S) shell 
  (!) or command (`) quote returns the return value of the command.  A 
  synchronous file (') quote returns 0 on error, nonzero otherwise.  

  The library file quoter.tf defines some useful quoter commands that are 
  shortcuts for some common uses of quote.  

  The following is a list of some nearly equivalent pairs of commands: 
  /quote -S -dexec '<file> 
          /load <file> 
  /quote -S /echo -aG - #<args> 
          /recall <args> 
  /quote <opts> `/recall <args> 
          /quote <opts> #<args> 

  ____________________________________________________________________________

  Examples: 


    /quote -1 :reads about '"/usr/dict/words" in the dictionary.

  This sends off lines like:

    :reads about aardvark in the dictionary.
    :reads about aardvore in the dictionary.

  with one-second delays between lines.  


    /quote -S /echo !ps -gux

  This displays the output of the system command "ps -gux" by echoing it 
  locally, immediately.  


    /quote -0 :heard: #-wCave /2 *pages*

  This sends off quickly: 

  :heard: [the last 2 lines from Cave that contain "pages"] 


    /quote :is using `/version

  will tell everybody in the room what version of TF you're running.  


    /quote -wlpmud -dsend 'prog.c

  will send the file "prog.c" to the world "lpmud", without any interpretation 
  of leading spaces or slashes (in lines like "/* comment */"), etc.) 

  ____________________________________________________________________________

  See: processes, %ptime, %lpquote, quoter.tf, history, command subs, /load, 
  /recall, /sh, /sys, /paste 

&/qdef
&/qmac
&/qworld
&/qtf
&/qsh
&/qmud
&quoter
&quoter.tf

Quoter Commands

  /REQUIRE quoter.tf
  ____________________________________________________________________________

  After doing "/REQUIRE quoter.tf", the quoting commands can be used to take 
  the output of various sources and execute them as commands, typically 
  quoting them to a mud server.  These are all just shortcuts for things you 
  can already do with /quote -S.  The default <prefix> is ":|", which will 
  perform a pose on Tiny-style muds.  The default prefix can be changed by 
  setting the appropriate variable: qdef_prefix, qmac_prefix, qworld_prefix, 
  qtf_prefix, qsh_prefix, or qmud_prefix.  An alternate <prefix> can be given 
  on the command line for /qdef, /qmac, /qworld, and /qfile.  Also, before any 
  output is generated, the command used to generate the output is quoted.  

  /QDEF [<prefix>] <name> 
          Prepends <prefix> to each line generated by "/list <name>", and 
          executes each resulting line as a command.  

  /QMAC [<prefix>] <name> 
          Searches for the definition of macro <name> in a group of tf files, 
          prepends <prefix> to each line found, "/quote <name>", and executes 
          each resulting line as a command.  

  /QWORLD [<prefix>] <name> 
          Prepends <prefix> to each line generated by "/listworlds <name>", 
          and executes each resulting line as a command.  

  /QFILE [<prefix>] <name> 
          Prepends <prefix> to each line of file <name>, and executes each 
          resulting line as a command.  

  /QTF <cmd> 
          Prepends <prefix> to each line generated by executing <cmd> in tf, 
          and executes each resulting line as a command.  

  /QSH <cmd> 
          Prepends <prefix> to each line generated by executing <cmd> in the 
          shell, and executes each resulting line as a command.  

  /QMUD [-w<world>] <cmd> 
          Prepends <prefix> to each line generated by executing <cmd> on world 
          <world> (default: the current world), and executes each resulting 
          line as a command.  /Qmud requires that the mud supports the 
          OUTPUTPREFIX and OUTPUTSUFFIX commands.  

  Examples: 

  The command 

    /qsh finger

  would generate a series of commands something like this: 

    :! finger
    :| Login       Name              TTY Idle    When    Site Info
    :| hawkeye  Ken Keys              p3       Fri 19:32 
    :| hawkeye  Ken Keys              p4       Sat 17:37 

  And, on a Tiny-style mud named "Cave", the command 

    /qmud score

  would generate a series of commands something like this: 

    :| Cave> score
    :| You have 8704 pennies.

  ____________________________________________________________________________

  See: /quote, processes, /paste 

&/recall

/recall

  Usage: 

  /RECALL [-w<world>] [-ligv] [-t[<format>]] [-a<attrs>] [-m<style>] [-A<n>] 
  [-B<n>] [-C<n>] [#]<range> [<pattern>]
  ____________________________________________________________________________

  Recalls lines from a history buffer.  Only one of the [-ligw] options can be 
  used, to specify the history from which to recall.  

  Options: 
  -w      recall from current world's history (default) 
  -w<world> 
          recall from <world>'s history 
  -l      recall from local history (i.e., TF output) 
  -g      recall from global history (all worlds, and local) 
  -i      recall from input history 
  -t[<format>] 
          display timestamps on each line, using <format>.  If <format> is 
          omitted, "[%{time_format}]" will be used.  The format is described 
          in ftime().  
  -v      recall lines that don't match the pattern 
  -q      quiet: suppress the header and footer lines 
  -a<attr> 
          suppress specified attributes (e.g., -ag shows gagged lines) 
  -m<style> 
          matching style (simple, glob, or regexp).  
  -A<n>   Print <n> lines of context after each matching line.  
  -B<n>   Print <n> lines of context before each matching line.  
  -C<n>   Equivalent to -A<n> -B<n>.  
  #       display line numbers (must be last option, before <range>) 

  <range> can have one of the formats below.  If <x> and <y> are plain 
  integers, they are interpreted as line numbers or counts.  If they have the 
  form "<hours>:<minutes>" or "<hours>:<minutes>:<seconds>", they are 
  interpreted as time values (either a period of time, or a clock time within 
  the last 24 hours).  If they are real numbers (with up to 6 decimal places), 
  they are interpreted as absolute system times.  
  /x      Recall the last <x> matching lines.  
  x       Recall from the last <x> lines, or lines within the last time period 
          <x>.  
  x-y     Recall lines starting with <x> and ending with <y>.  
  -y      If <y> is a line number, recall the <y>th previous line; if <y> is a 
          time, recall lines earlier than <y>.  Remember to use "-" before 
          "-y" so it isn't interpreted as an option.  
  x-      Recall lines after <x>.  

  If <range> is prefixed with "#", line numbers will be displayed.  

  If <pattern> is given, only lines in the given range that match <pattern> 
  will be recalled.  The matching style is determined by the -m option if 
  given, %{matching} otherwise.  

  If the output of /recall is being sent to the screen, it will be preceded by 
  "================ Recall start ================" and follwed by 
  "================= Recall end =================" unless -q is used.  These 
  lines will not be produced if the output is redirected, for example with 
  $(...) command substitution or "/quote `/recall".  When -A, -B, or -C is 
  used, groups of lines that are not adjacent in history will be separated by 
  "--".  

  If lines are received while tf is suspended (by ^Z or /suspend) or in a 
  subshell (by /sh), the timestamps on the lines will correspond to the time 
  tf resumed control, not the time they actually arrived.  

  The return value of /recall is the number of lines that were actually 
  recalled.  

  Because the output of /recall may clutter the current window, you may wish 
  to use /limit instead.  

  Examples These examples assume that matching=glob (the default).  
  Recall every line beginning with "Kite whispers" that arrived in the last 
  hour:   /recall 1:00 Kite whispers* 
  Recall every line that arrived between 11 am and 1 pm: 
          /recall 11:00-13:00 
  Recall the last 5 lines containing "spam": 
          /recall /5 *spam* 
  Recall the last 4th most recent line: 
          /recall - -4 

  See: history, attributes, /limit, /quote, %time_format 

&/recordline

/recordline

  Usage: 

  /RECORDLINE [-lig] [-w[<world>]] [-t<time>] <text>
  ____________________________________________________________________________

  Records <text> into a history buffer.  

  Options: 
  -w      record to current world's history 
  -w<world> 
          record to <world>'s history 
  -l      record to local history 
  -g      record to global history (default) 
  -i      record to input history 
  -t<time> 
          record the line with the system time <time> (as displayed by /recall 
          -t@) instead of the current time 
  -a<attrs> 
          Record <text> with the attributes given by <attrs>.  
  -p      Interpet "@{<attr>}" strings as commands to set attributes inline.  
          "@@" strings are interpreted as "@".  "@{n}" or "@{x}" will turn 
          attributes off.  See also: decode_attr().  

  The <text> will not be echoed to the screen or saved in any log.  

  /Recordline can be combined with /quote to read a log file back into 
  history.  For example, if you had created a log with "/log -i input.log" in 
  an earlier tf session, you could start a new tf session and use 

  /quote -S -dexec /recordline -i - 'input.log 

  to restore that input history.  That way, you could use the RECALLB, 
  RECALLF, RECALLBEG, RECALLEND, SEARCHB, and SEARCHF (^P, ^N, ^[<, ^[>, ^[P, 
  and ^[N) keys to recall lines you typed in the earlier session.  

  Note that /recordline always appends to the end of a history.  /Recordline 
  -t<time> makes it possible to insert lines that are not in chronological 
  order, which may produce strange results with /recall.  

  See: /recall, /quote, history 

&delay
&/repeat

/repeat

  Usage: 

  /REPEAT [-w[<world>]] [-n] {[-<time>]|-S|-P} <count> <command>
  ____________________________________________________________________________

  Repeats <command>, <count> times.  <Command> may be any legal macro body.  
  If <count> is "i", the <command> repeats indefinitely.  This works through a 
  process, which runs concurrently with normal operations.  

  Options: 
  -w[<world>] 
          <Command> will execute with <world> as the current world.  If 
          <world> is omitted, it is assumed to be the world that was current 
          for /repeat.  If this option is omitted entirely, the <command>'s 
          current world will be whatever world happens to be in the foreground 
          when it's time for <command> to run.  
  -<time> 
          <Time> is the delay between each execution of <command>.  <Time> may 
          be specified in the format "<hours>:<minutes>:<seconds>", 
          "<hours>:<minutes>", or "<seconds>" (<seconds> may be specified to 
          the nearest microsecond).  
  -S      The repeat will run synchronously.  
  -P      The repeat will run whenever a prompt is received.  
  -n      When combined with the -<time> option, this makes the first 
          execution of <command> happen with no delay.  
  At most one of the -S, -P, and -<time> options should be specified.  If none 
  are specified, the delay between each execution of <command> is determined 
  by the variable %{ptime}.  See "processes" for more information on process 
  timing.  

  The <command> undergoes macro body substitution when it is executed.  

  An asynchronous /repeat (without -S) returns the pid of the new process, or 
  0 if an error occurred.  A synchronous /repeat returns the return value of 
  the last command.  

  Since the first run is not done until after the first interval (for /repeat 
  without -S or -n), a useful trick is to use "/repeat -<time> 1 <command>" to 
  delay the execution of a single command.  

  Example: /repeat -0:30 1 /echo -ab Dinner's ready 
#sleep

  There is no good way to directly "sleep" within a macro body.  Any attempt 
  to write your own /sleep macro will, at best, "freeze" tf for the duration 
  of the sleep, or even worse hog the machine's CPU time in a busy wait.  The 
  best way to achieve the effect a sleep in a /while loop is probably to use a 
  /repeat where each execution of the /repeat body corresponds to an iteration 
  of the desired /while loop.  That is, if you want to write 

      /def foo = \
          /before_stuff%; \
          /while (condition) \
              /do_stuff%; \
              /sleep 5%; \
          /done%; \
          /after_stuff

  you must instead write: 

      /def foo = \
          /before_stuff%; \
          /foo_loop

      /def foo_loop = \
          /if (condition) \
              /do_stuff%; \
              /repeat -5 1 /foo_loop%; \
          /else
              /after_stuff%; \
          /endif

  Of course, local variables will not survive between calls of /do_stuff in 
  the second version as they would in the first (if it were possible), so any 
  variables you need to share between iterations must be global.  

  But, if the reason you want to sleep is to wait for a response from a 
  server, then you really don't want to sleep at all: you want a trigger.  
  First, set up triggers on the possible responses, then send the command.  If 
  one of the possible responses is no response at all, then a /repeat can be 
  useful to wait for some maximum timeout and then handle the no-reponse case 
  and delete the response triggers.  This is in general the best way to write 
  macros that interact with a server.  
#

  See: processes, %ptime, /at, kbnum 

&/replace

/replace

  Function usage: 

  REPLACE(<old>, <new>, <string>)

  Command usage: 

  /REPLACE <old> <new> <string>
  ____________________________________________________________________________

  Echoes (in command form) or returns (in function form) <string>, with any 
  occurrences of <old> in <string> replaced by <new>.  

#replace-ex
  Example: 

  This example replaces "TF" with "TinyFugue" in every line sent by the 
  server.  

    /def -mregexp -t"TF" replace_tf = \
        /test substitute(replace("TF", "TinyFugue", {P0}))

  See: evaluation, /tr 

&security
&/restrict

/restrict

  Usage: 

  /RESTRICT [SHELL|FILE|WORLD]
  ____________________________________________________________________________

  With no arguments, /restrict reports the current restriction level.  

  With an argument, /restrict sets the restriction level.  Once restriction 
  has been set to a particular level, it can not be lowered.  
  level 0: NONE 
          No restrictions.  
  level 1: SHELL 
          Prevents all access to shell or external commands.  Disables TF 
          builtins "/sh" and "/quote !", and uncompression during /load and 
          /help.  
  level 2: FILE 
          Prevents reading and writing of files.  Disables TF builtins 
          "/load", "/save", "/saveworld", "/lcd", "/log", and "/quote '", 
          "tfopen()", the "sockmload feature.  Implies /restrict shell.  
  level 3: WORLD 
          Disallows all new user-defined connections.  The TF builtins 
          /addworld and the "/connect <host> <port>" semantics are disabled.  
          Implies /restrict file.  

  /Restrict is typically placed in %{TFLIBDIR}/local.tf by an administrator of 
  a public copy of TF who wishes to restrict users' access.  

  Note that while I believe these options to be secure, I provide no warranty 
  to that effect.  

  See: warranty 

&/result
&/return

/return and /result

  Usage: 

  /RETURN [<expression>]
  /RESULT [<expression>]
  ____________________________________________________________________________

  /return stops execution of the macro body that called it, and causes the 
  macro to return the string value of <expression>.  If the <expression> is 
  omitted, the return value of the macro is the empty string.  

  When a macro that calls /result was called as a function, /result is 
  identical to /return.  When a macro that calls /result was called as a 
  command, /result has the additional effect of echoing the value of 
  <expression> to the tfout stream.  /Result thus allows the same macro to be 
  called usefully as either a command or a function.  

  Note that /return and /result take the string value of <expression>.  This 
  is not a problem for integer- or float-valued expressions, since they 
  convert freely to strings and back without loss of information.  But if the 
  expression is an enumerated special variable (e.g., borg), the value 
  returned will be its string value (e.g., "on"), not its integer value (e.g., 
  1).  To force it to use the integer value, you can use the unary plus 
  operator (e.g., +borg).  

  The return value of the last command (builtin or macro) is stored in %{?}.  
  The return value of a function (builtin or macro) is just the value of the 
  function.  

  These examples define several macros intended to be called as a functions: 

    /def square = /return pow({1}, 2)

    /def hypot = /return sqrt(square({1}) + square({2}))

    /def strrev = \
        /let len=$[strlen({*})]%; \
        /return (len <= 1) ? {*} : \
            strcat(strrev(substr({*},len/2)), strrev(substr({*},0,len/2)))

  If those examples had used /result instead of /return, they could also be 
  used as commands when echoing is more convenient.  For example, 

      /eval say My name backwards is $(/strrev ${world_character}).

  See: /if, /while, /test, /break, /exit, expressions, evaluation, variables 

&/runtime

/runtime

  Usage: 

  /runtime <command>
  ____________________________________________________________________________

  Executes <command>, and prints the real time and cpu time used.  <Command> 
  is not put through any additional substitution before being executed.  The 
  return value of /runtime is that of <command>.  

  See: cputime(), debugging.  

&mudwho
&rwho.tf
&/rwho

/rwho

  Usage: 

  /REQUIRE rwho.tf

  /RWHO
  /RWHO name=<player>
  /RWHO mud=<mud>
  ____________________________________________________________________________

  Gets a remote WHO list from a mudwho server.  The first form gives a 
  complete list, the other forms give partial lists.  Due to the short timeout 
  of the mudwho server, sometimes the complete list is sent even if the second 
  or third format is used (send complaints to the author or maintainer of the 
  mudwho server, not to me).  

  Make sure you /load rwho.tf _after_ you define your worlds, or rwho will be 
  the default world.  

&/savebind
&/savedef
&/savegag
&/savehilite
&/savehook
&/savetrig
&/save

/save

  Usage: 

  /SAVE [-a] <file> [<list-options>]
  ____________________________________________________________________________

  Saves specified macros to <file>.  The <list-options> are the same as those 
  in the /list command; see "/list" for details.  Invisible macros will not be 
  saved unless "-i" is specified.  

  If "-a" is specified, macros will be appended to <file>.  Otherwise, the 
  macros will overwrite any existing contents of <file>.  

  The return value of /save is the number of the last macro listed, or 0 if no 
  macros were listed (because of error or none matched the specified options). 

  The standard macro library also defines commands that save macros of a 
  particular type: 
  /savedef 
          macros with names, but no triggers, hooks, or keybindings 
  /savebind 
          macros with keybindings 
  /savehilite 
          macros with triggers and attributes other than -ag 
  /savegag 
          macros with triggers and the -ag attribute 
  /savetrig 
          macros with triggers and no attributes 
  /savehook 
          macros with hooks 
  These commands take a filename argument; if it is omitted, a default file 
  name will be used.  No -a (append) option is allowed.  

  The /save* commands are useful if your macros are few and simple, but if you 
  have many and/or complex macros, you will probably find it easier to write 
  them with an editor and then /load them in tf, instead of writing them in tf 
  and /save'ing them to a file.  Avoiding /save allows you to keep the file(s) 
  nicely formatted, use comments, and organize them better.  Use whatever 
  works best for you.  

  Note that when tf starts, it does not automatically read files created with 
  any of the /save commands.  To make it do so, add the corresponding /load 
  command to your .tfrc file.  

  Except for its return value,
  /save [-a] <file> [<list-options>]
  is equivalent to
  /eval /list [<list-options>] %| /writefile [-a] <file> 

  See: macros, patterns, attributes, library, /def, /list, /load, /saveworld 

&/saveworld

/saveworld

  Usage: 

  /SAVEWORLD [-a] [<file>]
  ____________________________________________________________________________

  Saves world definitions to <file> if specified, otherwise from the file 
  named in the body of the WORLDFILE macro.  

  If "-a" is given, world definitions will be appended to <file>; otherwise, 
  the world definitions will replace any original contents of <file>.  

  Note that when tf starts, it does not automatically read files created with 
  /saveworld.  To make it do so, add the /loadworld command to your .tfrc 
  file.  

  See: worlds, library, /addworld, /load 

&send()
&/send

/send

  Function usage: 

  SEND(<text>[, <world>[, <flags>]])

  Command Usage: 

  /SEND [-W] [-T<type>] [-w[<world>]] [-n] <text>
  ____________________________________________________________________________

  Sends <text> to a world.  If no world is specified, the current world is 
  used.  By default, send does not execute SEND hooks.  

  In the function form, the optional <flags> is a string containing letters 
  that modify the function's behavior: 
  "h"     test for and invoke matching SEND hooks.  
  "u"     send <text> unterminaed (i.e., without a CR LF end-of-line marker).  
  For backwards compatibility, the flags "o", "n", and "1" are ignored, and 
  the flags "0" and "f" are equivalent to "u".  

  Command options: 
  -w<world> 
          sends <text> to <world>.  
  -T<type> 
          sends <text> to all connected worlds with a type that matches the 
          pattern <type>.  
  -W      sends <text> to all connected worlds.  
  -n      send <text> without an end-of-line marker (CR LF).  
  -h      test for and invoke matching SEND hooks.  

  The return value of send is 0 if the text is not successfully sent, nonzero 
  if it is.  

  See: functions.  

&/set

/set

  Usage: 

  /SET <name>=<value>
  /SET [<name> [<value>]]
  ____________________________________________________________________________

  In the first form, or with two arguments, /set will set the value of 
  variable <name> to <value>.  With one argument, /set will display the value 
  of variable <name>.  With no arguments, /set will display the value of all 
  internal variables.  If the first form is used, there should be no spaces on 
  either side of the '='.  

  Variable <name> will be an internal variable unless it has already been 
  defined as an environment variable.  

  Note: The variables 'L' and 'R' are reserved.  You should not assign values 
  to them.  

  When setting a variable, /set returns 1 if successful, 0 if not.  When 
  listing variables, /set returns the number of variables listed.  

  See: variables, /listvar, /setenv, /export, /let, /unset, /edvar 

&/setenv

/setenv

  Usage: 

  /SETENV [<name> [<value>]]
  /SETENV <name>=<value>

  With two arguments, /setenv will set the value of <name> to <value> in the 
  environment.  With one argument, /setenv will display the value of <name>.  
  With no arguments, /setenv will display the value of all environment 
  variables.  If the second form is used, spaces around the '=' will not be 
  stripped.  

  If <name> was already defined as an internal variable, it will become an 
  environment variable.  

  When setting a variable, /setenv returns 1 if successful, 0 if not.  When 
  listing variables, /setenv returns the number of variables listed.  

  See: variables, /listvar, /set, /export 

&/sh

/sh

  Usage: 

  /SH [-q] [<command>]
  /PSH [<command>]
  ____________________________________________________________________________

  If no command is given, /sh and /psh execute an interactive shell named by 
  %{SHELL}.  With a <command>, /sh will execute <command> in the default shell 
  (/bin/sh on unix), and /psh will execute <command> in the shell named by 
  %{SHELL}.  <Command> is executed interactively, so it may accept input and 
  may produce any output.  

  In visual mode, /sh and /psh will fix the screen first, and restore it after 
  executing the shell.  /Sys does not.  

  If the -q option is given, /sh will be quiet: the SHELL hook will not be 
  called, and the "Executing" line will not be printed.  

  If the %{shpause} and %{interactive} flags are on, TF will wait for a 
  keypress before returning.  

  Note: calling /sh or /psh with arguments from a trigger is very dangerous.  
  If not written carefully, such a trigger could allow anyone connected to the 
  server to gain access to your shell account.  

  The return value of /sh and /psh is the exit status of the shell if it 
  exited normally, -1 otherwise.  Note that UNIX shell commands usually return 
  0 for success and nonzero for failure.  

  See: /quote, /sys, utilities (/psh) 

&/shift

/shift

  Usage: 

  /SHIFT [n]
  ____________________________________________________________________________

  Shifts the positional parameters left by <n>.  That is, the positional 
  parameters %(n+1) ...  %# are renamed to %1 ...  %(#-n).  If <n> is omitted, 
  1 is assumed.  

  /shift is useful only during macro expansion.  

  Example: 

    /def worlds = /while ({#}) /world %1%; /shift%; /done

  Then, the command "/worlds foo bar baz" would execute the commands "/world 
  foo", "/world bar", and "/world baz".  

  See: variables, evaluation, list commands 

&/signal

/signal

  Usage: 

  /SIGNAL [<sig>]
  ____________________________________________________________________________

  Sends signal <sig> to the tf process, or with no arguments, /signal lists 
  all valid signal names.  Valid signals usually include: HUP, INT, QUIT, 
  KILL, SEGV, TERM, USR1, USR2, and TSTP.  The complete list varies from 
  system to system.  

  See: signals, /suspend, getpid(), hooks (SIGHUP, SIGTERM, SIGUSR1, SIGUSR2) 

&spell
&spelling
&/spell_line

spelling checker

  Usage: 

  /REQUIRE spell.tf

  /SPELL_LINE
  Keybinding: ^[s
  ____________________________________________________________________________

  After executing "/require spell.tf", typing "^[s" will call /spell_line to 
  report any misspellings in the current input line.  /Spell_line can of 
  course be bound to other keys with "/def -b".  

  /Spell_line assumes your system has a program called "spell" that reports 
  misspellings in its standard input.  

  See: interface, keys 

&/split

/split

  Usage: 

  /split <args>
  ____________________________________________________________________________

  Sets %{P1} to the substring of <args> before the first '=', and sets %{P2} 
  to the substring of <args> after the first '='.  If there is no '=' in 
  <args>, %{P1} will contain the entire string and %{P2} will be empty.  %{P0} 
  will contain the entire string.  

  Spaces surrounding the '=' are stripped.  

  See: getopts() 

&/sub

/sub

  Usage: 

  /SUB [OFF|ON|FULL]
  ____________________________________________________________________________

  Sets the flag %{sub}.  

  If the flag %{sub} is OFF (0), all lines except for history substitutions 
  (line beginning with '^') and commands (/) are sent as-is to the socket.  

  If the flag %{sub} is ON (1), the sequences "%;" and "%\" are substituted 
  with newlines, and the sequence "%%" is substituted with "%", and the 
  sequence "\<n>" is substituted with the character with decimal ASCII code 
  <n>.  

  If the flag %{sub} is FULL, text is processed just as if it were the body of 
  a macro (see "evaluation") called without any arguments.  This allows you to 
  have in-line macros in regular input.  

  The flag %{sub} defaults to 0 (off).  

  See: general, evaluation 

&/substitute
&substitute()

/substitute

  Function usage: 

  SUBSTITUTE(<text> [, <attrs> [, <inline>]])

  Command usage: 

  /SUBSTITUTE [-a<attrs>] [-p] <text>
  ____________________________________________________________________________

  When called from a trigger (directly or indirectly), the entire triggering 
  line is replaced with <text>.  After a /substitute, it will appear as if 
  <text> is what caused the trigger; the original line is lost.  In 
  particular, this means when /substitute is called from a fall-thru trigger, 
  triggers of lower priority will be compared against <text> instead of the 
  original line.  

  Options and arguments: 
  command: -a<attrs> 
  function: <attrs> 
          Give <text> the attributes described by <attrs>.  These are added to 
          the original line's attributes unless <attrs> include the "x" 
          attribute.  
  command: -p 
  function: <inline> = "on" or 1 
          Interpet @{<attr>} strings as commands to set attributes inline, as 
          in /echo.  (See /echo).  

  Example: 

  On a mud that uses MUFpage, you could set your #prepend string to "##page>", 
  and define a trigger like: 

    /def -ah -t"##page> *" hilite_mufpage = /substitute %-1

  This will match no matter what page format the sender uses, and strip off 
  the "##page>" so you never see it.  

  For another example, see /replace.  

  See: triggers 

&/suspend

/suspend

  Usage: 

  /SUSPEND
  ____________________________________________________________________________

  Suspends the TF process, if your system and shell support job control.  This 
  has the same effect as typing ^Z on most UNIX-like systems.  When TF is 
  resumed, it redraws the screen and processes all /repeat and /quote commands 
  that were scheduled to run while TF was suspended and processes all text 
  that was received while TF was suspended.  

  See: signals, /signal.  

&/sys

/sys

  Usage: 

  /SYS <shell-command>
  ____________________________________________________________________________

  Executes <shell-command>.  The command is executed without a tty, so it 
  should have no input, and its output, if any, should be plain text.  The 
  command's stdout and stderr are echoed to tf's output window.  /sys differs 
  from /sh in that /sys can not do an interactive shell command, but does not 
  redraw the screen or produce any extra messages.  

  Note: calling /sys with arguments from a trigger is dangerous.  If not 
  written carefully, such a trigger could allow anyone with access to the 
  server to gain access to your shell account.  

  The return value of /sys is the exit status of the shell if it exited 
  normally, -1 otherwise.  Note that UNIX shell commands usually return 0 for 
  success and nonzero for failure, which is the opposite of the TF convention. 

  /sys executes synchronously.  To execute a command asynchronously (in the 
  background), use /quote without the -S option.  

  See: /sh, /quote 

&/telnet

/telnet

  Usage: 

  /TELNET <host> [<port>]
  ____________________________________________________________________________

  Connect to a line-based telnet host.  The telnet login port is used if 
  <port> is omitted.  

  Note that TF operates strictly in line-by-line mode, but telnetd (the server 
  running on the telnet login port) expects character-by- character mode.  So, 
  simple shell operations and anything else which is basically line-by-line 
  should work without much difficulty, but anything that tries to control the 
  screen or expects single keystroke input will not work.  /Telnet is somewhat 
  useful, but not useful enough to alter the fundamental line-by-line nature 
  of TF.  If you want a general telnet client, you know where to find it.  

  TF supports most of the TELNET protocol (even if a command other than 
  /telnet was used to connect).  TF implements the TELNET options ECHO (lets 
  server control echoing of input), SGA (suppress GOAHEAD), EOR (allows use of 
  END-OF-RECORD in prompts), NAWS (allows TF to send window size information 
  to the server), TTYPE (allows server to ask about the terminal type), and 
  BINARY (allows transmission of 8-bit characters).  For TTYPE queries, TF 
  responds "TINYFUGUE", "ANSI-ATTR", "ANSI", and "UNKNOWN", in that order.  
  For information on TELNET protocol, see RFC 854 and 1123.  See also: 
  prompts.  

  See: /addtelnet, /connect, %telopt, %binary_eol, protocols 

&/test

/test

  Usage: 

  /TEST <expression>
  ____________________________________________________________________________

  /test evaluates the <expression> and returns its value, also setting the 
  special variable %?.  The return value may be any type (before version 4.0, 
  only integer values were allowed).  A new variable scope is NOT created.  

  /Test can be useful for evaluating an expression for its side effects, 
  ignoring the return value.  For example, the command "/test kbdel(kbpoint() 
  - 1)" will perform a backspace, and "/test regmatch('foo(.*)', 'foobar')" 
  will assign "bar" to %P1.  

  Before version 3.5, /test was frequently used as the condition of an /IF or 
  /WHILE statement.  This is no longer needed, since /IF and /WHILE can now 
  take an expression as a condition.  

  Before version 4.0, /test was sometimes used to set the return value of a 
  macro, since a macro's return value is that of the last command executed.  
  The preferred way to do this now is with /return or /result.  

  See: /return, /if, /while, expressions, evaluation, variables 

&/textencode

textencode()

  /require textencode.tf

  Function usage: 

  textencode(<string>)
  textdecode(<encodedstring>)
  ____________________________________________________________________________

  textencode converts <string> to a form that contains only letters, digits, 
  and underscores.  textdecode converts <encodedstring> (returned by a 
  previous call to textencode) back to the original string.  

  These two functions can be useful for converting arbitrary text, such as a 
  world name or the name of a player on a mud, into a form that is safe to use 
  as part of a tf variable or macro name, or a filename.  

  The following example records the time a player connects to the mud, and is 
  safe even if the player name contains characters that are not legal in tf 
  variable names:
  /def -mglob -t'{*} has connected.' record_connect_time = \
       /set connect_time_$[textencode({1})]=$[time()] 

  See: functions 

&/fgrep
&/grep
&/egrep
&/readfile
&/writefile
&/head
&/wc
&/tee
&/copyio
&/fmt
&/uniq
&/randline
&textutil
&textutil.tf

Text Utilities

  /REQUIRE textutil.tf
  ____________________________________________________________________________

  The library file textutil.tf defines several unix-like commands that are 
  particularly convenient when used with the %| pipe to redirect their input 
  or output.  

  In the descriptions below, <filename> is the name of a file, and <in> and 
  <out> are handles of tfio streams.  When <in> is optional, its default is 
  tfin.  

  /fgrep [-cvi] <pattern> 
  /grep [-cv] <pattern> 
  /egrep [-cvi] <pattern> 
          These commands search tfin for lines that match the given pattern, 
          and by default prints those lines.  For /fgrep, a line must contain 
          <pattern> to match; for /grep, the entire line must match the glob 
          pattern <pattern>; for /egrep, it must match the regexp pattern 
          <pattern>.  
          Options: 
          -c      print only the count of matching lines.  
          -v      select only non-matching lines.  
          -i      ignore case (for /fgrep and /egrep only; /grep always 
                  ignores case).  
          Note: these commands are not compatible with those defined in the 
          old library file grep.tf.  

  /readfile <filename> 
          Reads lines from <filename> and writes them to tfout.  

  /writefile [-a] <filename> 
          Reads lines from tfin and writes them to file <filename>.  
          Options: 
          -a      append to file instead of overwriting.  

  /head [-n<count>] [<in>] 
          Reads the first <count> (default 10) lines from <in> or tfin and 
          writes them to tfout.  

  /wc [-lwc] [<in>] 
          Reads lines from <in> or tfin and prints the count of lines, 
          space-separated words, and characters that were read.  
          Options: 
          -l      Print the count of lines only.  
          -w      Print the count of words only.  
          -c      Print the count of characters only.  

  /tee <out> 
          Reads lines from tfin and echoes them to <out> and tfout.  

  /copyio <in> <out> 
          Reads lines from <in> and writes them to <out>.  This can be useful, 
          for example, when you want to send text from a tfio stream to a 
          command that reads only tfin: 

              /copyio <in> o %| /<command>
              

  /fmt    Copies tfin to tfout, with adjacent non-blank lines joined.  

  /uniq   Copies tfin to tfout, with adjacent duplicate lines removed.  

  /randline [<in>] 
          Copies one randomly selected line from <in> or tfin to tfout.  

  ____________________________________________________________________________

  See: tfio, evaluation, substitution, oldgrep 

&/tick
&/tickon
&/tickoff
&/tickset
&/ticksize

/tick

  Usage: 

  /REQUIRE tick.tf

  /tick
  /tickoff
  /tickon
  /tickset
  /ticksize <n>
  ____________________________________________________________________________

  The /tick* commands implement dikumud tick counting, similar to tintin.  
  When the ticker is started with /tickon, it will warn you 10 seconds before 
  each tick, and print "TICK" on the tick.  

  The messages can be changed by redefining the /tick_warn (10-second warning) 
  and /tick_action ("TICK") macros.  You can make them perform any tf command, 
  not just printing.  

  It is up to you to start the ticker in synch with the mud.  If the mud 
  prints something on a tick, you can define a trigger on that which calls 
  /tickon.  

  /Tick displays the time remaining until the next tick.  

  /Tickoff stops the ticker.  

  /Tickon and /tickset reset and start the ticker.  

  /Ticksize sets the tick period to <n> seconds (the default is 75).  

  See: /require, timing, prompts 

&/time

/time

  Usage: 

  /TIME [<format>]
  ____________________________________________________________________________

  Displays the current time.  <Format> is described under "ftime()".  If 
  <format> is omitted, %{time_format} is used.  

  See: time(), ftime(), mktime(), %TZ, %time_format, %clock, idle() 

&/toggle

/toggle

  Usage: 

  /TOGGLE <variable>
  ____________________________________________________________________________

  If <variable> has a value of 0, its value will be set to "1".  If <variable> 
  has a non-zero value, its value will be set to "0".  

  See: variables 

&/tr

/tr

  Usage: 

  /REQUIRE tr.tf

  /TR <domain> <range> <string>
  ____________________________________________________________________________

  <Domain> and <range> are lists of characters of equal length.  Each 
  character in <string> that appears in <domain> is translated to the 
  corresponding character in <range>, and the resulting string is printed.  

  Example:
  command: /def biff = /tr OIS.  01Z! $[toupper({*})]
  command: /biff TinyFugue is cool wares, dude. 
  output: T1NYFUGUE 1Z C00L WAREZ, DUDE!

  See: /replace, expressions, functions 

&/act
&/trigpc
&/trigp
&/trigc
&/trig

/trig

  Usage: 

  /TRIG <pattern> = <body>
  /TRIGP <priority> <pattern> = <body>
  /TRIGC <chance> <pattern> = <body>
  /TRIGPC <priority> <chance> <pattern> = <body>
  ____________________________________________________________________________

  Creates an unnamed macro that will trigger on <pattern> and execute <body>.  
  If <chance> is given with /trigc or /trigpc, it will be the percentage 
  probability of the trigger going off; default is 100%.  If <priority> is 
  given with /trigp or /trigpc, it will be the priority of the trigger; 
  default is 0.  The matching style of the trigger is determined by the global 
  variable %{matching}.  

  If the command fails it returns 0.  Otherwise, it creates a new macro and 
  returns its (positive) number (useful in /undefn and /edit).  

  /trig is equivalent to: /def -t<pattern> = <body>. 
  /trigp is equivalent to: /def -p<priority> -t<pattern> = <body>. 
  /trigc is equivalent to: /def -c<chance> -t<pattern> = <body>. 
  /trigpc is equivalent to: /def -p<priority> -c<chance> -t<pattern> = <body>.

  Note: the /trig commands create macros without names.  Thus each /trig 
  command will create a new macro macro instead of replacing an old macro.  
  For this reason, it is usually better to use /def and give your macros 
  names.  

  See: triggers, evaluation, patterns, /def, /untrig 

&/trigger

/trigger

  Usage: 

  /TRIGGER [-ln] [-g] [-w[<world>]] [-h[<event>]] <text>
  ____________________________________________________________________________

  Executes macros with triggers or hook arguments that match <text>, just as 
  if <text> had come from a socket or a hook event had occurred with <text> as 
  its arguments.  The return value of /trigger is the number of (non-quiet) 
  macros that were executed.  /Trigger is useful for debugging triggers and 
  hooks.  

  Options: 
  -g      Match "global" triggers or hooks that were not defined with /def -w 
  -w<world> 
          Match triggers or hooks for <world>, or the current world if <world> 
          is omitted.  
  -h<event> 
          Match hooks where <event> matches the hook event and <text> matches 
          the hook argument pattern.  Without -h, /trigger matches triggers, 
          not hooks.  
  -n      Do not execute any of the matched macros; instead, display a list of 
          each macro that would have matched, including its fallthru flag, 
          priority, and name.  (Note that if any macro in the list would have 
          executed substitute() or /substitute, the macros listed after it may 
          not be correct.) 
  -l      Like -n, but list each macro in full, as if by /list.  
  If neither -g nor -w options are given, both are assumed.  That is, <text> 
  is matched against global triggers or hooks, as well as triggers or hooks 
  for the current world.  

  See: triggers, hooks, debugging, /def 

&/false
&/:
&/true

/true

  Usage: 

  /TRUE
  /FALSE
  ____________________________________________________________________________

  /True does nothing, and returns nonzero.  

  /False does nothing, and returns zero.  

  /: is the same as /true.  

&/unbind

/unbind

  Usage: 

  /UNBIND <sequence>
  ____________________________________________________________________________

  Removes a macro with the keybinding <sequence>.  

  See: general, /bind, /purge 

&/undef

/undef

  Usage: 

  /UNDEF <name>... 
  ____________________________________________________________________________

  For each <name> given, /undef removes the definition of the macro with that 
  name.  

  The return value of /undef is the number of macros that were removed.  

  See: macros, /def, /purge, /undefn, /undeft, /untrig, /unhook 

&/undefn

/undefn

  Usage: 

  /UNDEFN <number> ... 
  ____________________________________________________________________________

  Removes macros with the numbers specified in the arguments.  Macro numbers 
  can be determined with /list, or from the return value of the command used 
  to create the macro.  

  See: macros, /def, /list, /purge, /undef 

&/undeft

/undeft

  Usage: 

  /UNDEFT <trigger>
  ____________________________________________________________________________

  Removes a macro with a trigger associated with it that is triggered by the 
  pattern <trigger>.  <Trigger> is matched against existing triggers using 
  simple comparison.  

  See: macros, triggers, /def, /purge, /undef 

&/unhook

/unhook

  Usage: 

  /UNHOOK <event> [<pattern>]
  ____________________________________________________________________________

  Removes a macro with an associated hook on <event> <pattern>.  

  See: hooks, /hook, /purge, /undef 

&/unset

/unset

  Usage: 

  /UNSET <name>
  ____________________________________________________________________________

  /Unset removes the value of variable <name>.  

  /Unset returns 0 if an error occurred, nonzero otherwise.  

  See: variables, /set, /setenv, /let 

&/untrig

/untrig

  Usage: 

  /UNTRIG [-a<attrs>] <trigger>
  ____________________________________________________________________________

  Removes a macro with an associated trigger that is triggered by the pattern 
  <trigger> and has attributes <attrs>.  If -a<attrs> is omitted, -an is 
  assumed.  <Trigger> is matched against existing triggers using simple 
  comparison.  

  See: triggers, /trig, /purge, /undef 

&/unworld

/unworld

  Usage: 

  /UNWORLD <name>... 
  ____________________________________________________________________________

  For each <name> given, /unworld removes the definition of the world with 
  that name.  The history for removed worlds will be deleted, but some or all 
  of the lines may still exist in the global history.  

  The return value of /unworld is the number of worlds that were removed.  

  See: worlds, /addworld 

&/ver
&/version

/version

  Usage: 

  /VERSION
  /VER
  ____________________________________________________________________________

  /Version displays the TinyFugue version you're running and the operating 
  system for which it was compiled (if known).  

  /Ver displays an abbreviated version number.  

  The latest version of TF can be found at http://tinyfugue.sourceforge.net/.  

  See: /changes 

&/watchdog

/watchdog

  Usage: 

  /WATCHDOG [OFF|ON]
  /WATCHDOG <n1> [<n2>]
  ____________________________________________________________________________

  Sets the flag %{watchdog}.  This flag determines whether Fugue will watch 
  for identical lines and suppress them.  Fugue looks for lines which have 
  occurred <n1> times out of <n2> (<n1> defaults to 2 and <n2> to 5) and 
  suppress them, so with the default settings Fugue will suppress any lines 
  that have occurred 2 times out of the last 5.  

  The <n1> and <n2> settings for /watchdog are distinct from the <n1> and <n2> 
  settings for /watchname.  

  The flag %{watchdog} defaults to 0 (off).  

  See: %watchdog, /watchname 

&/watchname

/watchname

  Usage: 

  /WATCHNAME [OFF|ON]
  /WATCHNAME <n1> [<n2>]
  ____________________________________________________________________________

  Sets the flag %{watchname}.  This flag determines whether Fugue will watch 
  for players displaying lots of output.  Fugue looks for names which have 
  begun the line <n1> times out of <n2> (<n1> defaults to 4 and <n2> to 5) and 
  gag that person (with a message), so with the default settings Fugue will 
  gag any person whose name has begun 4 of the last 5 lines.  

  The <n1> and <n2> settings for /watchname are distinct from the <n1> and 
  <n2> settings for /watchdog.  

  The flag %{watchname} defaults to 0 (off).  

  See: %watchname, /watchdog 

&/while
&/do
&/done
&/while

/while

  Usage: 

  /WHILE (expr) list /DONE
  /WHILE list /DO list /DONE
  ____________________________________________________________________________

  The <list>s may be any list of commands.  The return value of a <list> is 
  the return value of the last command executed in the <list>.  Each <list> 
  must be terminated by "%;".  

  The <list> or <expr> following the /WHILE is called the condition.  The 
  condition is executed or evaluated, and if its result is non-zero, the next 
  <list> is executed.  This sequence is repeated until the condition returns 
  zero.  

  The /BREAK command can be used within the loop to terminate the loop early.  
  The loop can also be terminated early by catching a SIGINT (usually 
  generated by typing ^C).  If the variable %{max_iter} is non-zero, the loop 
  will terminate automatically if the number of iterations reaches that 
  number.  

  When /WHILE is used on the command line, "%;" command separation will be 
  done even if %sub=off.  Of course, full substitution will be done if 
  %sub=full.  

  Example: 


    /def count = \
        /let i=1%; \
        /while (i <= {1}) \
            say %{i}%; \
            /let i=$[i + 1]%; \
        /done

  The command "/count 10" will execute the commands "say 1", "say 2", ...  
  "say 10".  

  See: evaluation, /test, /break, /for 

&/world

/world

  Usage: 

  /WORLD [-lqnxfb] [<world>]
  /WORLD <host> <port>
  ____________________________________________________________________________

  If <world> is already connected, "/world <world>" is equivalent to "/fg 
  <world>", and brings <world> into the foreground.  If <world> is not 
  connected, "/world <world>" is equivalent to "/connect <world>", and 
  attempts to open a connection to that world.  

  The second form is equivalent to "/connect <host> <port>".  

  The -lqnxfb options are the same as those for /fg and /connect.  

  See: /connect, /fg 

&
&hilites
&gags
&underline
&reverse
&flash
&dim
&bell
&bold
&attrs
&attributes
&display attributes
&attribute

display attributes

  Many TF commands take an argument to specify an attribute list, containing 
  one or more of: "n" (none), "x" (exclusive), "g" (gag), "G" (nohistory), "L" 
  (nolog), "A" (noactivity), "u" (underline), "r" (reverse), "B" (bold), "b" 
  (bell), "h" (hilite), "E" (error), "W" (warning), or "C<color>" (color).  
  These attributes are used to display text associated with the command.  Use 
  commas to separate attributes within an attribute list; commas may be 
  omitted between single-letter attributes.  For example, "BuCred,Cbgyellow" 
  means bold underlined red text on a yellow background.  

  "None" ("n") is useful for finding macros without attributes (e.g.  "/list 
  -an") or for turning off attributes in the middle of a line (e.g.  "/echo -p 
  foo @{u}bar@{n} baz").  

  Normally, new attributes are combined with the pre-existing attributes.  But 
  if the new attributes include "x" (exclusive), the pre-existing display 
  attributes are turned off first.  So, for example, if one trigger with -au 
  and another trigger with -Pr match the same line, the whole line will be 
  underlined and part of it will also be reversed; but if the second trigger 
  had -Pxr instead, then most of the line would be underlined, and part would 
  be reversed but not underlined.  

  The "G" (nohistory) attribute prevents the line from being recorded in 
  history.  The "L" (nolog) attribute prevents the line from being recorded in 
  a log file.  

  The "A" (noactivity) attribute prevents the line from causing an ACTIVITY 
  hook or a nonzero moresize().  For example, the following command prevents 
  people connecting and disconnecting from counting as activity: 

        /def -aA -q -t"{*} has {*connected.}" noact_connect
    

  The "C<name>" (Color) attribute allows you to name a color.  The "C" must be 
  followed by the <name> of the color; a comma after the <name> can be used to 
  separate it from attributes that follow it.  Depending on your terminal and 
  how tf was compiled, there may be 8, 16, or 256 colors available.  See: 
  color.  

  The "h" (hilite), "E" (error), and "W" (warning) attributes are special.  
  When "h", "E", or "W" is specified, it is replaced with the attributes 
  listed in the %{hiliteattr}, %{error_attr}, or %{warning_attr} variable, 
  respectively.  Additionally, error and warning messages generated by tf 
  automatically have the "E" and "W" attributes, so you can alter their 
  appearance by setting the corresponding variable.  For example, the commands 

        /set hiliteattr=r
        /echo -ahu foobar

  will display the word "foobar" with reverse and underline attributes.  
  %{hiliteattr} makes it easy to change the meaning of all your hilite macros 
  at once, without editing each one individually.  

  The "f" (flash) and "d" (dim) attributes are accepted for backward 
  compatiblity, but ignored.  

  All attributes except 'n' may be combined usefully.  (Even gags can be 
  combined with other attributes: combining 'g' and 'B', for example, will gag 
  the text initially, but will display it as bold if it is recalled with 
  /recall -ag.) 

  It is possible to apply attributes to a part of a line, using /partial or 
  the -P option of /def.  If two or more partial attributes overlap, their 
  effects will be combined (unless the "x" attribute is used).  For example, 
  overlapping bold and reverse will appear bold and reverse; overlapping blue 
  and red will appear magenta.  

  Ansi attribute codes sent by the server will be interpreted by tf if 
  %{emulation} is set to "ansi_attr".  See: %emulation.  

  As of version 5.0, attributes in string values are preserved by just about 
  every string operation, including commands, variables, expression operators, 
  functions, regexp substitutions, $() command substitution, and status bar 
  field expressions.  The inline_attr() function can be used to convert 
  attribute codes within a string to actual attributes.  

  Attributes not supported by your terminal type will be stored, but not 
  displayed.  

&%catch_ctrls

%catch_ctrls

  See: %emulation 
&/color_off
&color
&colour
&colours
&256colors
&colors

colors

  Color is enabled by default.  To disable it, use "/color_off"; to re-enable 
  color using ANSI codes, use "/color_on".  

  The color attribute allows you to specify a foreground color with "C<name>" 
  or a background color with "Cbg<name>".  Any terminal that supports color 
  should support the 8 basic colors: black (black), red, green, yellow, blue, 
  magenta, cyan, white (white).  (If you are reading this in tf, and the 
  previous sentence did not contain colored words, you do not have working 
  color support.  If it contained strange codes, you should do "/color_off" or 
  redefine the codes as described below.) The standard library defines these 8 
  basic colors with ANSI control codes, which will work on most terminals that 
  support color.  

  Many terminals also support brighter versions of the 8 basic colors, but may 
  need to be configured to do so.  On xterm, you may want to disable the 
  "boldColors" resource so that bold plus a normal color does not produce one 
  of these bright colors.  The bright color names are: gray, brightred, 
  brightgreen, brightyellow, brightblue, brightmagenta, brightcyan, or 
  brightwhite.  The standard library defines these 8 bright colors with ISO 
  6429 extension control codes, which will work on most terminals that support 
  16 colors.  

  Some newer terminals can display 256 colors.  If tf was built with the 
  "256colors" feature, tf will recognize the following additional color names. 
  Names names of the form "rgb<R><G><B>" describe a color within a 6x6x6 color 
  cube: <R>, <G> and <B> are each a single digit between 0 and 5 that 
  specifies the brightness of the red, green, or blue component of the color.  
  For example, "rgb020" is a dark green, and "rgb520" is reddish orange.  
  Names of the form "gray<N>" describe a point on a grayscale, where <N> is 
  between 0 (dark) and 23 (light).  The standard library defines the "rgb*" 
  and "gray*" colors with xterm 256 color extension control codes.  

  To test the functionality and appearance of colors in tf, you can "/load 
  testcolor.tf".  This will also show the <R>, <G> and <B> values of each 
  color.  

  You can use a defined color in any attribute string.  For example, to make 
  /hilite'd text appear blue, you can /set hiliteattr=Cblue.  

  To define your own control codes for terminals that don't accept the 
  predefined codes, you will need to edit the color variables.  The code to 
  enable foreground or background color <name> is stored in a variable called 
  %{start_color_<name>} or %{start_color_bg<name>}.  The code to turn off 
  colors is stored in %{end_color}.  These variables may contain carat 
  notation and backslashed ascii codes in decimal, octal, or hexadecimal 
  (e.g., ESC is ^[, \27, \033, or \0x1B).  

  The default definition of %end_color is "\033[39;49;0m", which should work 
  on most ANSI-like terminals.  If this does not work on your terminal, then 
  try "/set end_color \033[30;47;0m" (for black on white) or "/set end_color 
  \033[37;40;0m" (for white on black).  

  If %{emulation} is set to "ansi_attr" (the default), then ANSI, ISO 6429, 
  and xterm 256 color extension codes sent by the server will be interpreted 
  by tf.  As a result, if the %{start_color_<name>} variables are set 
  correctly for your terminal, tf will translate color codes from the server 
  into codes for your terminal, displaying them correctly even if your 
  terminal does not use the same codes the server sends.  See: %emulation.  

  Note for "screen(1)" users: to make 8-16 colors work under Screen, you need 
  the following screenrc settings: 

      termcap  xterm AF=\E[3%dm
      terminfo xterm AF=\E[3%p1%dm
      termcap  xterm AB=\E[4%dm
      terminfo xterm AB=\E[4%p1%dm
    

  To make 256 colors work under Screen, it must have been compiled with 
  "--enable-colors256", and you need the following screenrc settings: 

      terminfo xterm Co=256
      termcap  xterm Co=256
      termcap  xterm AF=\E[38;5;%dm
      terminfo xterm AF=\E[38;5;%p1%dm
      termcap  xterm AB=\E[48;5;%dm
      terminfo xterm AB=\E[48;5;%p1%dm
    

  Colors are numbered 0 through 255 in the order in which they are described 
  above, but refering to colors by their enumeration number is generally not 
  recommended, as the numbering is subject to change.  In particular, the 
  numbering and interpretation of background colors changed in version 5.0 
  beta 7.  

  See: attributes 

&copy
&warranty
&copying
&copyright

copyright

  TinyFugue - programmable mud client
  Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004, 
  2005, 2006-2007 Ken Keys 

  PCRE regexp package is Copyright (C) 1997-1999 University of Cambridge 

  For bug reports, questions, suggestions, etc., see "problems".  

  This program is free software; you can redistribute it and/or modify it 
  under the terms of the GNU General Public License as published by the Free 
  Software Foundation; either version 2 of the License, or (at your option) 
  any later version.  

  This program is distributed in the hope that it will be useful, but WITHOUT 
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
  more details.  

  You should have received a copy of the GNU General Public License along with 
  this program; if not, write to the Free Software Foundation, Inc., 675 Mass 
  Ave, Cambridge, MA 02139, USA.  

#sites
#find
#where
#www
#ftp
  The latest information and latest version of TinyFugue can be found at 
  http://tinyfugue.sourceforge.net/.  Other sites may or may not have the 
  latest version.  

&debug
&debugger
&debugging

Debugging

  Debugging topics: 

    * %kecho - echo keyboard input 
    * %mecho - echo macros as they execute 
    * %qecho - echo generated /quote text 
    * %secho - echo text sent to server 
    * %pedantic - enable extra warnings 
    * %defcompile - display syntax errors when macros are defined instead 
      of the first time they are used 
    * %emulation=debug - display nonprintable characters 
    * %telopt - echo telnet negotiation 
    * /trigger -n - see what macros would be triggered 
    * /addworld -e - simulated "loopback" server 
    * /runtime - measure running time of commands 

  See also: hints 

&syntax
&body
&macro body
&reentrance
&execution
&expansion
&evaluation

evaluation

  A Builtin Command is any of the commands listed under "commands".  All 
  builtin commands start with "/".  All builtins have a return value, usually 
  nonzero for success and 0 for failure.  

  A Macro Command is a user-defined command.  Macro commands also start with 
  '/'.  The return value of a macro is the return value of its body when 
  executed.  

#/!
#/@
#/#
#/
  A command starting with a single "/" is either a Macro Command or a Builtin 
  Command.  If the "/" is followed by "!", the return value of the command 
  will be negated.  If the "/" or "/!" is followed by "@", the rest of the 
  word is interpreted as the name of a Builtin Command.  If the "/" or "/!" is 
  followed by "#", the rest of the word is interpreted as the number of a 
  macro.  If neither "@" nor "#" is used (the normal case), the rest of the 
  word is interpreted as a macro if there is one with that name, otherwise it 
  is interpreted as the name of a Builtin Command.  If the name does not match 
  any macro or Builtin Command, the NOMACRO hook is called.  
#

  A Simple Command is any command that does not start with "/".  The text of 
  such a command is sent directly to the current world, if there is one.  The 
  return value of a simple command is 1 if the text is successfully sent to 
  the current world, otherwise 0.  To send a line that starts with "/" without 
  having it interpreted as a Macro Command or Builtin Command, use a leading 
  "//"; the first "/" will be stripped.  

  A Compound Command is one of /IF.../ENDIF or /WHILE.../DONE.  These are 
  described under separate help sections.  Their return value is that of the 
  last command executed.  

  A List is a sequence of commands separated by "%;" (separator) or "%|" 
  (pipe) tokens.  The commands are executed in sequence, but may be aborted 
  early with the /RETURN or /BREAK commands.  and the return value of the List 
  is the return value of the last command executed in the sequence.  An empty 
  List has a return value of 1.  

  Two commands separated by "%|" pipe token mentioned above will have the 
  output stream (tfout) of the first connected to the input stream (tfin) of 
  the second.  The first command runs to completion before the second command 
  begins; the second command should stop reading tfin when it becomes empty.  
  Simple Commands have no tfin or tfout, so they may not be piped.  The tfout 
  of a Compound Command may not be piped directly, but the output of a macro 
  that contains a Compound Command may be piped.  

  Some characters within a macro body undergo substitution.  These special 
  characters are not interpreted as themselves, but cause some evaluation to 
  be performed, and the result substituted in place of these characters.  This 
  is described under "substitution".  

#scope
#dynamic scope
  When an expansion begins, a new scope is created.  Any local variables 
  created during the expansion will be placed in this new scope.  The scope 
  and all variables in it are destroyed when the expansion exits.  

  Any variable reference will refer to the variable with that name in the 
  nearest enclosing (i.e., most recently created) still existing scope.  This 
  is called "dynamic scope".  

  Lexical scope can be simulated to some extent by using variable 
  substitutions with the correct number of "%"s instead of variable 
  references.  (Remember, a "reference" uses the name by itself in an 
  expression, like "/test foo"; a "substitution" uses "%" characters, like 
  "/test %foo").  

#
  See: commands, macros, substitution, /if, /while 

&expnonvis
&expnonvisusal
&experimental non-visual mode

experimental non-visual mode

  TF 5.0 beta 5 has a new experimental non-visual mode ("expnonvis") that 
  fixes design flaws in traditional non-visual mode.  I may get rid of 
  traditional non-visual mode in the future, so if you use it, I suggest you 
  try expnonvis mode now and let me know if you don't like it.  To enable 
  expnonvis mode, "/set expnonvis=on" and "/set visual=off".  You may also 
  want to "/set kecho=on" (see below).  

  In the new expnonvis mode, input is only ever visible on the bottom line.  
  It scrolls your input buffer left and right as needed to display the part of 
  the input buffer in the neighborhood of the cursor.  The part of the line 
  that is "off the left edge" of the screen is simply not visible.  In 
  traditional non-visual mode, that part of the line would scroll up, 
  polluting the output region with partial input lines.  

  The "only on bottom line" rule applies even when you hit return to execute 
  the input line.  Your input is erased, and the command is executed; it does 
  not scroll up.  If you want to see the input text scroll up, you can "/set 
  kecho=on"; this will print the entire input, not just the last segment of it 
  that fit within the screen width.  You may also want to set %kecho_attr so 
  that the echoed input is easily distinguishable from regular output.  

  The minimum amount of scrolling is determined by the %sidescroll variable, 
  which defaults to 1.  For slow terminals, you may wish to increase this.  
  Any movement that would exceed half the screen width does not use the 
  terminal's scrolling, but instead redraws the line.  

  The current implementation probably has a few bugs; if the screen display 
  ever appears incorrect, use ^R or ^L to redraw it.  I don't think there are 
  any fatal bugs, but it is possible that some remain, so don't try expnonvis 
  unless you don't mind crashing tf.  Terminals without the delete character 
  capability are not yet supported, but will be in the future.  

&logic
&math
&strings
&arithmetic
&expression
&expressions

expressions

  Expressions apply operators to numeric and string operands, and return a 
  result.  They can be used in $[...] expression subs, the condition of /if 
  and /while statements, the condition of /def -E, and as arguments to 
  /return, /result, and /test commands.  

#float
#real
#integer
#string
#dtime
#atime
#hours:minutes:seconds
#hours:minutes
#hh:mm
#hh:mm:ss
#types
#scalar
#scalars
#operands

Operands

  Operands can be any of: 

    * Integer constants (e.g., 42).  
    * Real decimal point constants ("reals", for short) containing a 
      decimal point (e.g., 12.3456789) or exponent (e.g., 1e-2) or both (e.g., 
      1.23e4).  
    * Time duration ("dtime") values of the form <hours>:<minutes>, 
      <hours>:<minutes>:<seconds>, or <seconds> (where <seconds> may contain a 
      decimal point followed by up to 6 digits), will be interpreted as real 
      seconds (e.g., 0:01:02.3 == 62.3), and can be used anywhere a number is 
      expected.  
    * Absolute time ("atime") values, in the form of a number with up to 6 
      decimal places.  On most systems, this represents the number of seconds 
      since 1970-01-01 00:00:00 UTC.  
    * Strings of characters, surrounded with quotes (", ', or `, with the 
      same kind of quote on each end), like "hello world".  
    * Variable references (see below) like visual.  
    * Variable substitutions (see below) like {visual} and {1}.  
    * Macro substitutions like ${COMPRESS_SUFFIX}.  
    * Command substitutions like $(/listworlds -s).  

  Named variables may be accessed by simply using their name (with no leading 
  '%').  This is called a variable reference, and is the preferred way of 
  using a variable in an expression.  The special substitutions (*, ?, #, <n>, 
  L<n>, P<n>, R) may not be used this way.  

  Variable substitutions of the form "{selector}" and "{selector-default}" may 
  be used.  They follow the same rules as variable substitution in macros, 
  except that there is no leading '%', and the '{' and '}' are required.  The 
  special substitutions (*, ?, #, <n>, L<n>, P<n>, R) are allowed.  

  Macro-style variable substitutions beginning with '%' may also be used, but 
  are not recommended, since the multiple '%'s required in nested macros can 
  quickly get confusing.  It always easier to use one of the above methods.  

#operators

Operators

  In the following list, operators are listed in groups, from highest to 
  lowest precedence.  Operators listed together have equal precedence.  The 
  letters in the table below correspond to the type of objects acted on by the 
  operators: n for numeric (integer or real); s for string; e for any 
  expression.  All operators group left-to-right except assignment, which 
  groups right-to-left.  If any binary numeric operator is applied to two 
  integers, the result will be an integer, unless the result would overflow, 
  in which case it is converted to real.  If either operand is a real, the 
  other will be converted to real if it is not already a real, and the result 
  will be a real.  

  (e)         Parentheses, for grouping.  

  func(args)  Perform function <func> on arguments <args>.  (see: functions).  

  !n          Boolean NOT (1 if n==0, otherwise 0).  
  +n          Unary positive (useful for converting a string to a number).  
  -n          Unary negative.  
  ++v         Equivalent to (v := v + 1).  
  --v         Equivalent to (v := v - 1).  

  n1 * n2     Numeric multiplication.  
  n1 / n2     Numeric division.  Remember, if both operands are type integer, 
              the result will be truncated to integer.  

  n1 + n2     Numeric addition.  
  n1 - n2     Numeric subtraction.  

  n1 = n2     Numeric equality (but easily confused with assignment; you are 
              advised to use == instead).  
  n1 == n2    Numeric equality.  
  n1 != n2    Numeric inequality.  
  s1 =~ s2    String equality (case sensitive, attribute insensitive).  
  s1 !~ s2    String inequality (case sensitive, attribute insensitive).  
  s1 =/ s2    String s1 matches glob pattern s2.  
  s1 !/ s2    String s1 does not match glob pattern s2.  
  n1 < n2     Numeric less than.  
  n1 <= n2    Numeric less than or equal.  
  n1 > n2     Numeric greater than.  
  n1 >= n2    Numeric greater than or equal.  

  n1 & n2     Boolean AND.  n2 will be evaluated if and only if n1 is nonzero. 

  n1 | n2     Boolean OR.  n2 will be evaluated if and only if n1 is zero.  

  n ? e1 : e2 
  n ? : e2    Conditional.  If n is nonzero, the result is the value of 
              expression e1; otherwise it is the value of expression e2.  If 
              e1 is omitted, the value of n is used in its place.  Note that 
              digits followed by a colon is interpreted as a dtime value, so 
              if the e2 operand of the ?: operator is an integer, you must 
              separate it from the colon (with a space or parenthesis, for 
              example).  

  v := e      Assignment.  The identifier "v" refers to the variable in the 
              nearest scope.  If not found, a new variable is created at the 
              global level, as if by /set.  If v is a special variable, the 
              value of e may need to be converted to the type of v, or the 
              assignment may fail altogther if the value is not legal for v.  
              The value of the assignment expression is the new value of v.  
  v += n      Equivalent to v := v + (n).  
  v -= n      Equivalent to v := v - (n).  
  v *= n      Equivalent to v := v * (n).  
  v /= n      Equivalent to v := v / (n).  

  e1 , e2     Comma.  Expressions e1 and e2 are evaluated; the result is the 
              value of e2.  Only useful if e1 has some side effect.  

  The comparison operators return 0 for false, nonzero for true.  The boolean 
  operators (& and |) stop evaluating as soon as the value of the expression 
  is known ("short-circuit"), and return the value of the last operand 
  evaluated.  This does not affect the value of the expression, but is 
  important when the second operand performs side effects.  

  Normal (non-enumerated) Variables set with any of the assignment operators 
  keep the type of the expression assigned to them.  This is different than 
  /set and /let, which always assign a string value to the variables.  This 
  distinction is important for real numeric values, which lose precision if 
  converted to a string and back.  
#conversion

  All operands will be automatically converted to the type expected by the 
  operator.  

    * String to numeric: leading signs, digits, colons, and exponents are 
      interpreted as an integer, decimal (real), or dtime (real) value; e.g., 
      "12abc" becomes 12, "12.3junk" becomes 12.3, "0:01:02.3" becomes 
      0:01:02.3, and "xyz" becomes 0.  
    * Integer to real: straightforward.  
    * Real to integer: the fractional part is truncated.  
    * Enumerated variable to string: straightforward string value.  
    * Enumerated variable to numeric: one integer stands for each of the 
      allowed values.  "Off" is always 0, "on" is always 1, etc.  This makes 
      (!visual) and (visual == 0) the same as (visual =~ 'off').  
    * Integer to string: straightforward.  
    * Real to string: decimal notation if the exponent is greater than -5 
      and less than %sigfigs, otherwise exponential notation.  
    * Normal (non-enumerated) variables are treated as whatever type their 
      value has.  

#

Examples

  Given the variables 

      /set X=5
      /set name=Hawkeye
      /set visual=1

  here are some expressions and their values: 

      Expression             Value   Comments
      ----                   -----   --------
      3 + X * 2                 13   3 + (5 * 2) = 13.
      "foo" =~ "bar"             0   "foo" is not identical to "bar".
      name =/ 'hawk*'            1   "Hawkeye" matches the glob "hawk*".
      X =~ "+5"                  0   X is interpreted as string "5".
      X == "+5"                  1   string "+5" is converted to integer 5.
      visual & (X > 0)           1   visual is nonzero, AND %X is positive.

  See: functions, /test, evaluation, patterns 

&file
&files
&filenames
&filename expansion

filename expansion

  Certain strings are treated as filenames in tf (%{TFHELP}; %{TFLIBDIR}; 
  %{TFLIBRARY}; arguments to /load, fwrite(); etc.).  Those strings undergo 
  filename expansion as described below.  

  If <file> begins with '~', all characters after the '~' up to the first '/' 
  or end of string are treated as a user name, and the '~' and user name are 
  replaced with the name of the home directory of that user.  If the user name 
  is empty, %{HOME} is substituted.  

  For example, if bob's home directory is /users/bob, then the command "/load 
  ~bob/macros.tf" will attempt to load the file /users/bob/macros.tf.  

  "~user" expansion is not supported on systems that do not have the 
  getpwnam() function.  

&function
&functions

functions

#macro
#function syntax

  In an expression, a function operates on 0 or more arguments and returns a 
  result.  A function call is made with a function name, followed by a 
  parenthesized list of comma-separated arguments: "name(arg1, arg2, ...  
  argN)".  

  There are three kinds of objects that can be called as functions: builtin 
  functions, macros, and builtin commands.  They are searched in that order, 
  so if a builtin function and a macro have the same name, using that name in 
  a function call will invoke the builtin function.  

  A macro called as a function can be called with any number of arguments; 
  each argument corresponds to a positional parameter (%1, %2, etc.).  For 
  example, if "spam" is a macro, the function call 
  spam("foo", "bar", "baz")

  will set the parameters the same as in the command invocation 
  /spam foo bar baz

  The function call syntax allows positional parameters to contain spaces, 
  which is not possible in the command syntax.  (Note: prior to version 4.0, a 
  macro called as a function could only take 0 or 1 arguments, and a single 
  argument was broken into positional parameters at whitespace.) A macro can 
  set its return value using /return or /result.  

  A builtin command called as a function can have 0 or 1 arguments; the 
  argument is treated as a command line.  For example, the function call 
  def("-t'{*} has arrived.' greet = :waves.")

  is the same as the command invocation 
  /def -t'{*} has arrived.' greet = :waves. 

  To evaluate a function for its "side effect" only, you can call it from 
  /test and ignore the return value (e.g., "/test kbdel(0)").  

#builtin
Builtin functions

  In the following list of builtin functions, the first letter of each 
  argument indicates its type: <s> for string, <i> for integer, <r> for real, 
  <n> for any numeric type, or <f> for flag (0 or "off"; or, 1 or "on").  

Mathematical functions

  Angles are in radians.  
#abs
#abs()
  abs(n)  Absolute value of <n>.  Result has the same numeric type as <n>.  
#sin
#sin()
  sin(r)  (real) Sine of <r>.  
#cos
#cos()
  cos(r)  (real) Cosine of <r>.  
#tan
#tan()
  tan(r)  (real) Tangent of <r>.  
#asin
#asin()
  asin(r) 
          (real) Arcsine of <r>, in the range [-pi/2, pi/2].  <r> must be in 
          the domain [-1, 1].  
#acos
#acos()
  acos(r) 
          (real) Arccosine of <r>, in the range [0, pi].  <r> must be in the 
          domain [-1, 1].  
#atan
#atan()
  atan(r) 
          (real) Arctangent of <r>, in the range [-pi/2, pi/2].  
#exp
#exp()
  exp(r)  (real) e raised to the power <r>.  
#pow
#pow()
  pow(n1, n2) 
          (real) <n1> raised to the power <n2>.  If <n1> is negative, <n2> 
          must be an integer.  
#sqrt
#sqrt()
  sqrt(n) 
          (real) Square root of <n> (same as pow(<n>, 0.5)).  
#log
#log()
#ln
#ln()
#log10
#log10()
  ln(n)   (real) Natural logarithm of <n>.  <n> must be positive.  The base B 
          logarithm of any number N can be found with the expression ln(N) / 
          ln(B).  
  log10(n) 
          (real) Base 10 logarithm of <n>.  <n> must be positive.  
#mod
#mod()
  mod(i1,i2) 
          (int) Remainder of <i1> divided by <i2>.  
#trunc
#trunc()
  trunc(r) 
          (int) Integer part of <r>.  
#random
#rand
#rand()
  rand()  (int) Random integer in the range [0, system maximum].  
  rand(i) 
          (int) Random integer in the range [0, <i> - 1].  
  rand(i1,i2) 
          (int) Random integer in the range [<i1>, <i2>].  
#

Input/output functions

#
  echo(s1 [,attrs [,inline [,dest]]]) 
          (int) Echoes <s1> to the screen or <dest> with attributes <attrs>, 
          interpreting inline attribute codes if the flag <inline> is 1 or 
          "on".  See: "echo()".  
#
  send(s1[, world[, flags]]) 
          (int) Sends string <s1> to <world >.  See send().  
#
  prompt(s1) 
          (int) Sets the prompt of the current socket to <s1>.  See /prompt.  
#fwrite
#fwrite()
  fwrite(s1,s2) 
          Writes string <s2> to the end of file <s1>.  fwrite() is good for 
          writing a single line, but when writing multiple lines it is more 
          efficient to use tfopen(), a series of tfwrite(), and a tfclose().  
          Display attributes in <s2> are not written.  
#tfopen
#tfopen()
  tfopen(s1, s2) 
  tfopen() 
          (int) Open a tfio stream using file <s1> and mode <s2>.  See tfio.  
#tfclose
#tfclose()
  tfclose(i) 
          (int) Close the stream indicated by handle <i>.  See tfio.  
#tfread
#tfread()
  tfread(i, v) 
  tfread(v) 
          (int) Read into variable <v> from the stream indicated by handle 
          <i>.  See tfio.  
#tfwrite
#tfwrite()
  tfwrite(i, s) 
  tfwrite(s) 
          (int) Write <s> to the stream indicated by handle <i>.  See tfio.  
#tfflush
#tfflush()
  tfflush(i) 
          Flushes the stream indicated by handle <i>.  
  tfflush(i, f) 
          Disables (if <f> is 0 or "off") or enables (if <f> is 1 or "on") 
          automatic flushing for the stream indicated by handle <i>.  See 
          tfio.  
#read
#read()
  read()  Obsolete.  Use tfread() instead.  
#

String functions

  String positions are always counted from 0.  Therefore the first character 
  of a string <s> is substr(s, 0, 1), and the last character is substr(s, 
  strlen(s)-1).  

  Range checking is done on string positions.  Any position given outside the 
  allowed range will be silently forced to the closest value that is in the 
  range.  
#ascii
#ascii()
  ascii(s) 
          (int) Integer code of the first character of <s>, The character does 
          not have to be ASCII, but may be any character allowed by your 
          locale.  
#char
#char()
  char(i) 
          (str) character with integer code <i>.  If <i> is outside the range 
          allowed by your locale, it will be silently forced into the allowed 
          range.  
#tolower
#tolower()
  tolower(s) 
  tolower(s, i) 
          (str) Convert the first <i> (default all) characters in <s> to lower 
          case.  
#toupper
#toupper()
  toupper(s) 
  toupper(s, i) 
          (str) Convert the first <i> (default all) characters in <s> to upper 
          case.  
#pad
#pad()
  pad([s, i]...) 
          (str) There may be any number of (<s>, <i>) pairs.  For each pair, 
          <s> is padded with spaces to a length equal to the absolute value of 
          <i>.  If <i> is positive, <s> is right-justified (left-padded); If 
          <i> is negative, <s> is left-justified (right-padded).  The result 
          is the concatenation of all the padded strings.  
#regmatch
#regmatch()
  regmatch(s1, s2) 
          (int) If string <s2> matches regexp <s1>, regmatch() returns a 
          positive integer indicating the number of captured substrings 
          (including %P0).  regmatch() returns 0 if string <s2> does not match 
          regexp <s1>.  After a successful match, captured substrings can 
          later be extracted using the Pn variables or %Pn substitutions.  
          (See also: regexp) 
#
#replace()
  replace(s1, s2, s3) 
          (int) Returns <s3> with every occurance of <s1> replaced with <s2>.  
          See: "/replace".  
#strcat
#strcat()
  strcat(s...) 
          (str) Returns the concatenation of all string arguments.  
#strchr
#strchr()
  strchr(s1, s2) 
  strchr(s1, s2, i) 
          (int) Searches for any character of <s2> in <s1> starting at 
          position <i> (default 0), and returns the position if found, or -1 
          if not found.  If <i> is negative, it is counted as an absolute 
          value from the end of <s>.  
#strcmp
#strcmp()
  strcmp(s1, s2) 
          (int) Returns an integer less than, equal to, or greater than 0 if 
          <s1> is lexicographically less than, equal to, or greater than <s2>, 
          respectively.  
#strcmpattr
#strcmpattr()
  strcmpattr(s1, s2) 
          (int) Like strcmp(), except that in order for the strings to be 
          considered equal, both their text and their attributes must be 
          equal.  In other words, strcmp(encode_attr(<s1>), encode_attr(<s2>)) 
          The ordering of attributes is not documented, and may change between 
          versions of tf.  
#strlen
#strlen()
  strlen(s) 
          (int) Length of string <s>.  
#strncmp
#strncmp()
  strncmp(s1, s2, i) 
          (int) Like strcmp(), but compares only the first <i> characters of 
          <s1> and <s2>.  
#strrchr
#strrchr()
  strrchr(s1, s2) 
  strrchr(s1, s2, i) 
          (int) Searches backward in <s1> starting at position <i> (default: 
          end of <s1>) for any character of <s2>, and returns the position if 
          found, or -1 if not found.  If <i> is negative, it is counted as an 
          absolute value from the end of <s>.  
#strrep
#strrep()
  strrep(s, i) 
          (str) Returns a string containing <i> repetitions of <s>.  
#strstr
#strstr()
  strstr(s1, s2) 
  strstr(s1, s2, i) 
          (int) Searches for <s2> in <s1> starting at position <i> (default 
          0), and returns the position if found, or -1 if not found.  
#substr
#substr()
  substr(s, i1) 
  substr(s, i1, i2) 
          (str) Substring of <s>, starting at position <i1>, with length <i2>. 
          If <i2> is omitted, it defaults to the remaining length of <s>.  If 
          <i1> or <i2> is negative, they are counted as absolute values from 
          the end of <s>.  
#strip_attr
#strip_attr()
  strip_attr(s) 
          (str) Returns <s> with all display attributes removed.  
#inline_attr
#inline_attr()
#decode_attr
#decode_attr()
  decode_attr(s1 [, s2 [, f]]) 
          (str) Returns <s1> with "@{<attr>}" codes interpeted as display 
          attributes, as in /echo -p.  If present, <s2> is a string of 
          attributes that will be applied to the entire string (as in /echo 
          -a<s2>).  If <f> is present and equal to 0 or "off", then 
          "@{<attr>}" codes are not interpeted; this is useful for applying 
          <s2> attributes with no other effects.  
#encode_attr
#encode_attr()
  encode_attr(s) 
          (str) Returns <s> with display attributes encoded in "@{<attr>}" 
          form.  
#decode_ansi
#decode_ansi()
  decode_ansi(s) 
          (str) Returns <s> with attribute control codes interpeted as display 
          attributes, and, if %expand_tabs is on, tabs are expanded to spaces 
          according to %tabsize.  Any attributes originally on <s> are not 
          copied to the result.  The attribute control codes recognzied 
          include ANSI codes, ISO 6429 16-color extension codes, and xterm 
          256-color extension codes.  
#encode_ansi
#encode_ansi()
  encode_ansi(s) 
          (str) Returns <s> with display attributes encoded in terminal 
          control code form.  The control codes generated include ANSI codes, 
          ISO 6429 16-color extension codes, and xterm 256-color extension 
          codes.  
#
  textencode(s) 
          (str) Returns <s> converted to a form containing only letters, 
          digits, and underscores.  See textencode().  
#
  textdecode(s) 
          (str) Converts <s>, the result of textencode(), back to its original 
          form.  See textencode().  
#

Keyboard buffer functions

#kbdel
#kbdel()
  kbdel(i) 
          (int) Delete from the cursor to position <i> in the input buffer.  
          Returns the new position.  
#kbgoto
#kbgoto()
  kbgoto(i) 
          (int) Move the cursor to position <i> in the input buffer.  Returns 
          the new position (which may be different than <i> if <i> would put 
          the cursor outside the buffer).  
#kbhead
#kbhead()
  kbhead() 
          (str) Return the current input up to the cursor.  
#kblen
#kblen()
  kblen() 
          (int) Length of current input line.  
#kbmatch
#kbmatch()
  kbmatch() 
  kbmatch(i) 
          (int) Finds one of "()[]{}" under or to the right of the position 
          <i> (default: cursor position), and returns the position of its 
          match, or -1 if not found.  (See also: keybindings) 
#kbpoint
#kbpoint()
  kbpoint() 
          (int) Return the current position of the cursor in input.  
#kbtail
#kbtail()
  kbtail() 
          (str) Return the current input after the cursor.  
#kbwordleft
#kbwordleft()
  kbwordleft() 
  kbwordleft(i) 
          (int) Position of the beginning of the word left of <i> within the 
          input buffer.  <i> defaults to the current cursor position.  (See 
          also: %wordpunct) 
#kbwordright
#kbwordright()
  kbwordright() 
  kbwordright(i) 
          (int) Position just past the end of the word right of <i> within the 
          input buffer.  <i> defaults to the current cursor position.  (See 
          also: %wordpunct) 
#keycode
#keycode()
  keycode(s) 
          (str) String generated by typing the key labeled <s>, as defined in 
          the termcap entry corresponding to the value of %TERM.  See also: 
          keybindings.  
#

Information functions

#time
#time()
  time()  (atime) Absolute system time in seconds, to the nearest microsecond 
          (typically measured since 1970-01-01 00:00:00 UTC).  See also: 
          cputime(), mktime(), idle(), sidle(), /time, ftime().  
#cputime
#cputime()
  cputime() 
          (real) CPU time used by tf, or -1 if not available.  The resolution 
          depends on the operating system.  See also: /runtime, time(), /time. 
#columns
#columns()
  columns() 
          (int) Number of columns on the screen.  See also: hooks (RESIZE), 
          lines(), winlines(), %COLUMNS.  
#lines
#lines()
  lines() 
          (int) Number of lines on the screen.  To get the number of lines in 
          the output window, use winlines().  See also: hooks (RESIZE), 
          winlines(), columns(), %LINES.  
#winlines
#winlines()
  winlines() 
          (int) Number of lines in the output window.  See also: hooks 
          (RESIZE), lines(), columns().  
#morepaused
#morepaused()
  morepaused([s1]) 
          (int) Returns 1 if output of world <s1> is paused (by more or (dokey 
          pause).  If omitted, <s1> defaults to the current world.  See also: 
          moresize().  
#morescroll
#morescroll()
  morescroll(i) 
          (int) If <i> is positive, this function scrolls <i> lines of text 
          from the window buffer into the window from the bottom.  If <i> is 
          negative, it reverse-scrolls abs(<i>) lines of text from the window 
          buffer into the window from the top.  If abs(<i>) is larger than one 
          screenful, the actual scrolling is skipped, and only the end result 
          is displayed.  Returns the number of lines actually scrolled.  
#moresize
#moresize()
  moresize([s1 [, s2]]) 
          (int) Returns a line count for world <s2>, or the current world if 
          <s2> is omitted.  If <s1> is omitted or blank, the count is the 
          number of lines below the bottom of the output window (i.e., queued 
          at a more prompt).  If <s1> contains "n", it counts only new lines 
          that have never been seen, not lines that had been displayed and 
          then reverse scrolled off.  If <s1> contains "l", it counts only 
          lines that match the current /limit.  "n" and "l" may be combined.  
          If all lines that would be counted have the "A" (noactivity) 
          attribute, the result will normally be 0.  But if <s1> contains "a", 
          lines with "A" attributes are counted anyway.  In all cases, the 
          count is the number of physical (after wrapping) lines.  Note that a 
          return value of 0 does not necessarily indicate that output is not 
          paused; it may be the case that output is paused and there are just 
          0 lines below the bottom of the window, or that all the lines have 
          the "A" attribute.  Use morepaused(), to tell if output is paused.  
          See also: morepaused(), nactive().  
#nactive
#nactive()
  nactive() 
          (int) Number of active worlds (ie, worlds with unseen text).  
  nactive(s) 
          (int) Number of unseen lines in world <s>.  
          Note: when nactive() (with or without arguments) is called from a 
          trigger, the line that caused the trigger is not counted by 
          nactive() because it has not yet been fully processed (for example, 
          a lower priority trigger might gag the line).  nactive(<s>) is 
          equivalent to moresize("n", <s>).  See also: moresize().  
#world_info
#world_info()
  world_info(s1, s2) 
          (str) Return the value of field <s2> of world <s1>, 
  world_info(s2) 
          (str) Return the value of field <s2> of the current world.  
  world_info() 
          (str) Return the name of the current world.  See worlds.  
#fg_world
#fg_world()
  fg_world() 
          (str) Returns the name of the world associated with the foreground 
          socket.  
#is_connected
#is_connected()
  is_connected() 
          (int) Returns 1 if the current socket is connected, 0 otherwise.  
  is_connected(s) 
          (int) Returns 1 if world <s> is connected, 0 otherwise.  See also 
          is_open().  
#is_open
#is_open()
  is_open() 
          (int) Returns 1 if the current socket is open, 0 otherwise.  
  is_open(s) 
          (int) Returns 1 if world <s> is open, 0 otherwise.  
#idle
#idle()
  idle()  (dtime) Number of seconds (to the nearest microsecond) since the 
          last keypress.  
  idle(s) 
          (dtime) Number of seconds (to the nearest microsecond) since the 
          last text was received on the socket connected to world <s>, or -1 
          on error.  
#sidle
#sidle()
  sidle() 
  sidle(s) 
          (dtime) Number of seconds (to the nearest microsecond) since the 
          last text was sent on the current socket or the socket connected to 
          world <s>, or -1 on error.  
#nlog
#nlog()
  nlog()  (int) Number of open log files.  
#nmail
#nmail()
  nmail() 
          (int) Number of monitored mail files containing unread mail.  See 
          mail.  
#nread
#nread()
  nread() 
          (int) Returns a positive number if a read from the keyboard is in 
          progress, 0 otherwise.  
#getpid
#getpid()
  getpid() 
          (int) The operating system's process id for tf.  
#gethostname
#gethostname()
  gethostname() 
          (str) Returns the host's name, or an empty string if the host name 
          is not available.  
#systype
#systype()
  systype() 
          (str) System type: "unix" (includes MacOS X), "os/2", or "cygwin32". 
#

Other functions

#
  addworld(name, type, host, port, char, pass, file, use_proxy) 
          Defines or redefines a world.  See "addworld()".  
#
  eval(s1 [, s2]) 
          (str) Evaluates <s1> as a macro body.  See: /eval.  
#filename
#filename()
  filename(s) 
          (str) Performs filename expansion on <s> as described under 
          "filenames".  
#
  ftime(s,n) 
  ftime(s) 
  ftime() 
          (str) Formats a system time <n> (obtained from time()) according to 
          format <s>, or prints an error message and returns an empty string 
          if <n> is out of range.  See: ftime().  
#mktime
#mktime()
  mktime(year [, month [, day [, hour [, minute [, second [, 
  microsecond]]]]]]) 
          (atime) Returns the system time in seconds of the date in the local 
          time zone represented by the arguments.  Returns -1 if the arguments 
          do not represent a valid date.  Omitted month or day arguments 
          default to 1; other omitted arguments default to 0.  See: %TZ, 
          ftime(), /time, 
#
  getopts(s1, s2) 
          (int) Parse macro options according to format <s1>.  See 
          "getopts()".  
#test()
  test(s) 
          Interprets the contents of the string s as an expression and returns 
          the result.  See also: /test, /expr.  
#status_fields()
  status_fields([i]) 
          Returns the list of fields of status row i, or row 0 if i is 
          omitted.  status area.  
#
  substitute(s [,attrs [,inline]]) 
          (int) Replaces trigger text.  See "/substitute".  
#

  Examples: 

  Capitalize first letter of string <s>: 

        strcat(toupper(substr(s, 0, 1)), substr(s, 1))

  Extract the number from a string <dbref> of the form "(#123PML)": 

        0 + substr(dbref, strchr(dbref, "#") + 1)

  See: expressions 

&getopts
&getopts()

getopts()

  Usage: 

  getopts(<options> [, <init>])
  ____________________________________________________________________________

  getopts() is a function that parses and validates macro options according to 
  the format described by <options>.  <Options> is a list of letters that 
  getopts() will accept.  If a letter is followed by ":", the option will be 
  expected to have a string argument; if a letter is followed by "#", the 
  option will be expected to have a expression argument that evaluates to a 
  (possibly signed) integer; if a letter is followed by "@", the option will 
  be expected to have a time argument.  The option syntax accepted by 
  getopts() is a subset of that accepted by builtin tf commands, as described 
  under "options".  

  When an option is found, getopts() creates a new local variable named 
  "opt_X", where "X" is the letter of the option.  If an argument is expected, 
  the variable will get that argument as its value; otherwise, the variable 
  will have a value of "1".  

  If <init> is given, the variables corresponding to each letter of <options> 
  are initialized to <init> before processing the command line options.  If 
  <init> is omitted, the variables are not initialized, so if variables with 
  the same names already exist and are not set by getopts(), they will be 
  unchanged.  You can use this to set the variables to some default value 
  before calling getopts().  

  The argument list will be shifted to discard the options that have been 
  parsed, so %{*} will contain the remainder of the arguments, without the 
  options.  

  If getopts() encounters an error, it will print an error message and return 
  0; otherwise, it returns nonzero.  

  Using getopts(), /escape, and /split, it is possible to write macros that 
  behave just like builtin tf commands.  

  Here's a contrived example to illustrate how getopts() works: 


    /def foo = \
        /if (!getopts("abn#s:", "")) /return 0%; /endif%; \
        /echo option a:  %{opt_a}%;\
        /echo option b:  %{opt_b}%;\
        /echo option n:  %{opt_n}%;\
        /echo option s:  %{opt_s}%;\
        /echo args: %{*}%;\
        /split %{*}%;\
        /echo name: %{P1}%;\
        /echo body: %{P2}

  Now, all of these commands are equivalent: 

        /foo -a -b -n5 -s"can't stop" -- whiz = bang biff
        /foo -a -b -n5 -s'can\'t stop' whiz = bang biff
        /foo -n5 -ba -s`can't stop` whiz = bang biff
        /foo -as"can't stop" -bn5 whiz = bang biff

  and produce this output: 

        option a:  1
        option b:  1
        option n:  5
        option s:  can't stop
        args: whiz = bang biff
        name: whiz
        body: bang biff

  But the command: 

        /foo -a -x whiz = bang biff

  produces the error: 

        % foo: invalid option 'x'
        % foo: options: -ab -n<integer> -s<string>

  See: expressions, functions, options, /escape, /split 

&style
&tips
&hints

hints

  Some hints and style tips: 

    * Use a high-priority trigger on yourself to prevent loops.  Say I 
      want to throw a tomato at anyone who says the word "tomato", and I write 
      the following trigger: 

        /def -t"*tomato*" tomato = :throws a tomato at %1.

      If Ben uses the word tomato, I will trigger, and then see the text 
      "Hawkeye throws a tomato at Ben." That text contains the word tomato, 
      which will trigger me again, creating an infinite loop.  One way to 
      prevent this is by creating a high-priority trigger on myself which does 
      nothing: 

        /def -p99999 -t"{Hawkeye|You}*" anti_loop

      Now, when I see "Hawkeye throws a tomato at Ben", the /anti_loop trigger 
      will catch it before /tomato does, so I won't loop.  

    * Use multiple lines, spacing, and indentation in /load files.  
      Normally, commands must be on one line.  But in files read with /load, 
      if a line ends in '\', the following line will have leading whitespace 
      stripped and the two lines will be joined.  This makes it much easier 
      (for humans) to read complex macros.  Compare the two identical macros 
      below, and see which is easier to read.  


        /def count=/let i=1%;/while (i<=%1) say %i%;/let i=$[i+1]%;/done


        /def count = \
            /let i=1%; \
            /while ( i <= %1 ) \
                say %i%; \
                /let i=$[i + 1]%; \
            /done

    * Use comments in /load files.  Complicated macros are much easier to 
      read if you include a short comment describing the arguments to the 
      macro and what it does.  Lines beginning with ';' or '#' are comments, 
      and are ignored during /load.  

    * Name all triggers and hooks.  If you ever need to /load a file a 
      second time, triggers, hilites, hooks, and gags without names may be 
      duplicated.  But if they are named, old copies of macros will be 
      replaced with new copies of macros with the same name.  Naming macros 
      also makes them easier to manipulate with commands like /list and 
      /undef.  

    * Don't use "weird" characters in macro names.  Although any macro 
      name is legal, some characters can have unwanted expansion effects.  
      Weird characters are also harder to read.  You should stick to letters, 
      numbers, and '_' characters.  In particular, avoid '~' characters, since 
      they are used in library macros.  

    * Use local variables instead of global variables if possible.  This 
      avoids conflicts when two macros use a variable with the same name.  If 
      you're using a variable in an expression, use /let first to initialize 
      the variable in the local scope.  But remember, when you use a variable 
      reference (by name, as opposed to a variable substitution using "%"), TF 
      uses dynamic scoping (see: scope).  

    * Use variable references instead of %-substitutions in expressions.  
      Because macro bodies are expanded, something like "/test %1" is prone to 
      problems if %1 contains any special characters.  But by using a variable 
      reference you can avoid this problem; for example, "/test {1}".  

    * "/set pedantic=on" to make tf generate warnings about some potential 
      problems.  

    * "/set defcompile=on" to see syntax errors in a macro when you define 
      it, instead of waiting until you first run it.  

    * "/set mecho=on" to see what commands are being executed, or /connect 
      to a normal or connectionless socket defined with "/addworld -e" to see 
      what you're sending to the socket.  

    * "/set emulation=debug" and "telopt=on" to see exactly what the 
      socket is sending to tf.  

    * Use the -n or -l option of /trigger to see a list of trigger macros 
      that would match a given line.  

  See also debugging.  

&history

history

  Associated topics: 

  scrollback
  /recall
  /quote
  /histsize
  /recordline
  ^<string1>^<string2>
  Recall previous/next keys (RECALLB/RECALLF, default ^P and ^N)
  Recall beginning/end keys (RECALLBEG/RECALLEND, default ^[< and ^[>)
  Search backward/forward keys (SEARCHB/SEARCHF, default ^[p and ^[n)

  TinyFugue stores lines in 4 different types of history lists.  Input history 
  records the last 100 non-repeated commands from the keyboard, including the 
  current line.  Each world has a world history, which stores 1000 lines of 
  output from that world.  Local history stores 100 lines of output generated 
  by TF, i.e.  anything that didn't come from a world.  Global history is an 
  integrated list of 1000 lines from TF and every world.  The history sizes 
  can be changed with the /histsize command and the %{histsize} variable.  

  /recall is used to display text from any of the history lists.  The /quote 
  command may be used to quote out of any history list using the /quote # 
  feature.  

#^^
#^
  Typing ^<string1>^<string2> finds the last command in the input history 
  containing <string1>, replaces <string1> with <string2>, and executes the 
  modified line.  

#
  The recall keys replace the current input with a line from the input history 
  list.  See /dokey for details.  

  See also /log.  
&hook
&hooks

hooks

  Associated topics: 
  /def    define a macro with any fields 
  /hook   define a hook macro 
  /unhook 
          undefine a hook macro 
  /trigger -h 
          call a hook macro 
  %hook   enable hooks 
  %max_hook 
          maximum hook rate 

  Hooks are a method of calling a macro based on special events within TF, in 
  much the same way as triggers call macros based on text received from a 
  socket.  Hooks allow the user to customize the behavior of TinyFugue and 
  automate special functions.  

  A hook definition has two parts: an <event> and a <pattern>.  When the event 
  occurs, the macro will be executed if the arguments supplied by the event 
  match the macro's <pattern> (see the section on "patterns").  

  If multiple hooks match the same event and pattern, one or more are selected 
  as described under "priority".  

  Most hooks have a default message associated with them, which will be 
  displayed with the attributes of the hook if one is defined.  Thus a hook 
  with a gag attribute will suppress the display of the message.  

  Hook may have multi-shots, in which case it and the macro it is associated 
  with is removed after executing a specified number of times.  

  In the table below, 'A' or 'W' in the message column indicates the location 
  of the message display: 
  A       the message is printed to the the alert stream (i.e., the status 
          line).  
  W       the message is printed to the appropriate world's stream; if that 
          world is not the foreground world, the message is also printed to 
          the alert stream.  
  Otherwise, the message is sent to the the tferr stream (i.e., the screen).  

    Event Name  Arguments       Default Message or Action
    ----------  ---------       -------------------------
#ACTIVITY
    ACTIVITY    world           A '% Activity in world <world>'
                                  (called only the first time activity
                                  occurs on a given socket.)
#BAMF
    BAMF        world           W '% Bamfing to <world>'
#BGTEXT
    BGTEXT      world             Text was printed in background world <world>
#BACKGROUND
#BGTRIG
    BGTRIG      world           A '% Trigger in world <world>'
#CONFAIL
    CONFAIL     world, reason   W '% Connection to <world> failed: <reason>'
#CONFAIL
    CONFAIL     world, reason   W '% Unable to connect to <world>: <reason>'
#CONFLICT
    CONFLICT    macro             '% <macro> conflicts with builtin command.'
#CONNECT
    CONNECT     world, cipher   W '% Connected to <world>[ using <cipher>].'
#ICONFAIL
    ICONFAIL    world, reason   W '% Intermediate connection to <world>
                                  failed: <reason>'
#DISCONNECT
    DISCONNECT  world, reason   W '% Connection to <world> closed: <reason>.'
                                  (Called if you send the server's disconnect
                                  command (e.g., "QUIT") or socket closes, but
                                  not if you use /dc.)
#KILL
    KILL        pid               (process ends)
#LOAD
    LOAD        file              '% Loading commands from file <file>'
#LOADFAIL
    LOADFAIL    file, reason      '% <file>: <reason>'
#LOG
    LOG         file              '% Logging to file <file>'
#LOGIN
    LOGIN       world             (automatic login)
#MAIL
    MAIL        file            A '% You have new mail in <file>.'
                                  (See: mail).
#MORE
    MORE                          '--More--' (reverse bold)
#NOMACRO
    NOMACRO     name              '% <name>: No such command or macro'
#PENDING
    PENDING     world           W '% Hostname lookup for <world> in progress'
    PENDING     world, address  A '% Trying to connect to <world>: <address>'
#PREACTIVITY
    PREACTIVITY world             (Activity in world <world>)
                                  (called only the first time activity
                                  occurs on a given socket.)
#PROCESS
    PROCESS     pid               process starts
#PROMPT
    PROMPT      text              <text> is a partial (unterminated) line
                                  from the server.  See "prompts"
#PROXY
    PROXY       world             (proxy connection to <world> has completed)
#REDEF
    REDEF       obj_type, name    '% Redefined <obj_type> <name>'
#RESIZE
    RESIZE      columns, lines    (window was resized)
                                  (see also: columns(), lines())
#SEND
    SEND        text              (text sent to current socket)
                                  (see note below ("hooks"))
#SHADOW
    SHADOW      var_name          '% Variable <var_name> overshadows global'
#SHELL
    SHELL       type, command     '% Executing <type>: <command>'
#SIGHUP
    SIGHUP                        (SIGHUP signal caught; tf may terminate)
#SIGTERM
    SIGTERM                       (SIGTERM signal caught; tf terminates)
#SIGUSR1
    SIGUSR1                       (SIGUSR1 signal caught; no effect)
#SIGUSR2
    SIGUSR2                       (SIGUSR2 signal caught; no effect)
#WORLD
    WORLD       world           W (foreground socket changes)

#
  Notes: 

  The -w and -T options to /def can be used to restrict hooks to matching only 
  when the current world matches the world or world type.  

  When a macro is defined with the same name as an existing macro, the REDEF 
  hook will be called, unless the new macro is identical to the original.  

  BGTRIG used to be called BACKGROUND, and the old name still works.  Its "% 
  Trigger in world " message can be quieted for individual triggers by 
  defining them with /def -q, or for all triggers with "/def -ag -hBGTRIG".  

  The SEND hook is called whenever text would be sent to the current socket.  
  If a SEND hook matches the text that would be sent, the text is not sent 
  (unless the hook was defined with /def -q), and the hook is executed 
  instead.  By default, SEND hooks are not invoked from send() or /send, but 
  there is an option to do so; SEND hooks are invoked from any macro or 
  command line that sends plain text.  

  When successfully connected to a new socket, these events occur: 1) If this 
  is a proxy connection, the PROXY hook is called; 2) If there is a file 
  associated with the world, the file will be loaded (and the LOAD hook will 
  be called).  3) If this is not a proxy connection, the CONNECT hook is 
  called; 4) If %{login} is on, a character and password are defined, and this 
  is not a proxy connection, the LOGIN hook is called.  

  When a (non-gagged) line is displayed in a background world, the PREACTIVITY 
  hook is called immediately before the line is displayed, and the ACTIVITY 
  hook is called immediately after.  Thus, functions like moresize() and 
  nactive() will give different results in the two hooks.  Any activity 
  generated by a PREACTIVITY hook will not recursively cause another 
  PREACTIVITY or ACTIVITY event.  

  The SIGHUP, SIGTERM, SIGUSR1, and SIGUSR2 hooks are called when the 
  corresponding signal is received.  If SIGHUP is received and SIGHUP was not 
  ignored when tf was started, or SIGTERM was received, TF will terminate 
  immediately after executing the hook; if the hook calls any commands with 
  delayed effects (a /repeat or /quote without -S, a nonblocking /connect, 
  etc), those effects will not occur before termination.  

  A hook's message, if any, is displayed (with its attributes) before any of 
  the hooked macros are executed.  Prior to version 5.0, the message was 
  displayed after executing hooked macros, which may have generated their own 
  output, which was sometimes confusing.  

  Examples: 


      /hook ACTIVITY|DISCONNECT {TT|SM}* = /world %1

  will cause TF to automatically switch to TT or SM if either becomes active 
  or disconnected.  

      /def -T'tiny.mush' -hSEND mush_escape = /send - $(/escape \%[ %*)

  will catch any line sent to a world of type 'tiny.mush', escape all 
  occurrences of '%', '[' and '\' within that line, and send the new line 
  instead of the original.  This is useful for avoiding unwanted 
  interpretation of '%', '[', and '\' on TinyMUSH servers.  

      /hook SIGHUP = /log on%; /recall /10

  will log the last 10 lines of output if you are unexpectedly disconnected 
  from your tf session.  

#CONNETFAIL
  The CONNETFAIL hook, which existed in versions 5.0 alpha 13 through 5.0 beta 
  6, has been replaced with the ICONFAIL hook.  
#

  See also: macros, triggers, patterns, priority, signals.  

&topics

topics

  Topics marked with + are new; those marked with * have changed since the 
  last version.  Many topics also have subtopics that are not listed here 
  (e.g., individual variables, hooks, and functions).  


   *copying       copyright; no warranty
    intro         introduction to tf
    startup       how to start tf
    interface     how input works
    tfrc          personal config file
   *visual        split-screen mode
   *commands      list of commands
   *worlds        defining worlds
   *patterns      glob and regexp pattern matching
   *variables     state and environment
   *globals       special tf variables
    attributes    special text display
    prompts       using LP/Diku prompts
    problems      bugs, core dumps, etc.
   *evaluation    macro body execution
    macros        user-defined commands
   *sockets       world connections
    history       recall and logging
    priority      trigger/hook selection
   *keybindings   keyboard operations
    color         terminal color codes
   *protocols     protocols supported by TF
    expressions   math and string operations
    triggers      automatic command execution based on incoming text
   *hooks         automatic command execution based on tf events
   +mail          mail checking
    library       macros and variables in stdlib.tf
   *tools         extra commands in tools.tf
    utilities     useful extra command files
   *processes     timed commands and command quoting
   *subs          arithmetic, command, macro, and variable substitutions
   *functions     special expression operations
   *hints         some hints and style tips for macro programming
   +debugging     debugging your macros
   *tfio          output, error, and world streams
   *proxy         connecting to outside hosts via a proxy server (firewall)
   +locale        multi-language support
    

&typing
&user
&interface

interface

  Any input line that does not begin with '/' will be sent directly to the 
  foreground world, if there is one.  A line starting with more than one '/' 
  will be sent to the forground socket after having the first '/' removed.  
  (Exception: lines may be caught with a SEND hook before being sent; see 
  "hooks").  

  Any input line beginning with a single '/' is a TF command, which will be 
  interpreted as described in "evaluation".  

  Input lines of the form "^old^new" will cause TF to search backward in the 
  input history for a line containing "old", replace that text with "new", and 
  execute the modified command.  See: history.  

  Many special functions, such as backspace, can be performed by special keys 
  or sequences of keys.  See "dokey" for a complete list.  You can also define 
  your own commands and bind them to key sequences.  See bind.  

  Normally, user input does not undergo the expansion that macro bodies 
  undergo.  The /eval command can be used to expand text before executing it.  
  If the %{sub} flag is on (it is off by default), user input undergoes macro 
  body expansion without the %{sub} flag.  The %{sub} flag also applies to 
  text generated by "^old^new" history commands.  See: history, /sub, 
  variables 

  Control characters may be input literally.  A literal control character will 
  be displayed in the input window in printable form in bold reverse.  Note 
  that since most control keys are also parts of the default keybindings, it 
  will usually be necessary to type ^V (/dokey LNEXT) to avoid invoking the 
  keybinding.  

  International characters may be input if your locale is set to a locale that 
  supports them and your system supports locales.  Any input character that is 
  not valid in your locale and has the high bit set (normally generated by 
  holding the "meta" key) will be translated to ESC plus that character with 
  the high bit stripped (assuming %meta_esc is on).  This allows M-x and ^[x 
  to invoke the same ^[x keybinding.  See locale, %meta_esc, %istrip.  

  If standard input is not a terminal, visual mode will not be allowed, and tf 
  will continue to operate even after EOF is read, until /quit or something 
  else terminates it.  

  See also: visual, options 

&intro
&me
&newbie
&tinyfugue
&introduction

introduction

  TinyFugue is a MUD client.  It helps you connect to a MUD, in a much more 
  convenient manner than telnet.  You can connect to a mud world using the 
  same syntax as you would with telnet: "tf <host> <port>".  Or, while running 
  tf, you can use "/connect <host> <port>".  To make things easier, you can 
  give names to worlds, using /addworld, and then use "tf <name>" and 
  "/connect <name>".  If you store a set of /addworld commands in a file, TF 
  can read them automatically when it starts.  You can even connect to more 
  than one world at the same time, and switch between them.  See: /connect, 
  /fg, /addworld, worlds, tfrc.  

  Normally, TF will split the screen into two windows: one for input, and one 
  for output.  TF will display useful information on the line separating the 
  two windows, such as the name of the foreground world.  See: windows.  

  Any line you type that starts with a single '/' is a tf command.  Anything 
  else you type will be sent to the mud.  See: interface, commands.  

  You can define your own tf commands, called macros.  The simplest type of 
  macro is just an abbreviation or alias for a longer command or commands.  
  But macros can also perform much more powerful tasks.  See: macros, /def.  

  You can tell tf to watch for certain patterns in the text from the mud, and 
  then do special things when it sees that pattern: display the text in a 
  special way (hilite); not display the text at all (gag); execute a macro 
  command (trigger); or do any combination of these.  See: attributes, 
  triggers, /hilite, /gag, /trig, /def.  

  TF keeps a history of every line it prints, every line sent by the mud, and 
  every command you enter.  You can see those histories using /recall.  You 
  can also have this text saved in a file using /log.  See: history, /recall, 
  /log.  

  See also: topics 

&keys
&key
&kbbind
&kbfunc
&kbfunc.tf
&kbbind.tf
&keybindings

keybindings

Default keybindings

  TF's default command line editing keys are similar to those in emacs and 
  bash.  In addition, several features may be invoked by more than one 
  keybinding, and TF has keybindings for unique features like switching the 
  foreground socket.  

  Here, and throughout the TF documentation, the notation "^X" means the 
  character generated by typing the X key while holding the CTRL key.  Also, 
  "^[" can be more easily typed just by pressing the ESC key.  /Def -b and 
  /bind accept the ^X notation as well as "\<number>" notation, where <number> 
  is the octal, hexadecimal, or decimal number of the character's ascii value. 
  For example, the escape character can be given in any of these forms: ^[, 
  \033, \0x1B, or \27.  

  In the tables below, keys with "*" in the "Meaning" column make use of kbnum 
  (see below).  

#named keys
Named keys
  To redefine the named keys, see the section titled "Mapping Named Keys to 
  functions".  

  Key         Command                 Meaning
  ---         -------                 -------
  Up          /kb_up_or_recallb       *cursor up or recall bkwd input history
  Down        /kb_down_or_recallf     *cursor down or recall fwd input history
  Right       /dokey RIGHT            *cursor right
  Left        /dokey LEFT             *cursor left
  Center      (none)

  Esc_Left    /fg -<                  *foreground previous socket
  Esc_Right   /fg ->                  *foreground next socket

  Ctrl_Up     /dokey_recallb          *recall backward input
  Ctrl_Down   /dokey_recallf          *recall forward input
  Ctrl_Right  /dokey_wright           *word right
  Ctrl_Left   /dokey_wleft            *word left

  Insert      /test insert:=!insert    toggle insert mode
  Delete      /dokey dch              *delete character
  Home        /dokey_home              cursor to beginning of line
  End         /dokey_end               cursor to end of line
  PgDn        /dokey_pgdn             *scroll forward a screenful
  PgUp        /dokey_pgup             *scroll back a screenful
  Tab         /dokey page             *scroll forward a screenful

  Ctrl_Home   /dokey_recallbeg         recall first line of input
  Ctrl_End    /dokey_recallend         recall last line of input
  Ctrl_PgDn   /dokey_flush             scroll forward to last screenful
  Ctrl_PgUp   (reserved for future use)

  F1          /help                    help
  F2          (none)                   (function key F1)
  ...
  F20         (none)                   (function key F20)

  nkpTab      (none)                   (see "keypad" section below)
  nkpEnt      (none)                   (see "keypad" section below)
  nkp*        (none)                   (see "keypad" section below)
  nkp+        (none)                   (see "keypad" section below)
  nkp,        (none)                   (see "keypad" section below)
  nkp-        (none)                   (see "keypad" section below)
  nkp.        (none)                   (see "keypad" section below)
  nkp/        (none)                   (see "keypad" section below)
  nkp0        (none)                   (see "keypad" section below)
  ...
  nkp9        (none)                   (see "keypad" section below)
  nkp=        (none)                   (see "keypad" section below)

#unnamed keys
Unnamed key sequences

  String  Command                 Meaning
  ------  -------                 -------
  "^A"    /dokey_home              cursor to beginning of line
  "^B"    /dokey LEFT             *cursor left
  "^D"    /dokey_dch              *delete character to the right
  "^E"    /dokey_end               cursor to end of line
  "^F"    /dokey RIGHT            *cursor right
  "^G"    /beep 1                  beep
  "^H"    (internal)              *backspace
  "^I"    /key_tab                 perform the function assigned to the TAB key
  "^J"    (internal)               execute current line
  "^K"    /dokey_deol              delete to end of line
  "^L"    /dokey redraw            redraw (not clear) screen
  "^M"    (internal)               execute current line
  "^N"    /dokey recallf          *recall forward input history
  "^P"    /dokey recallb          *recall backward input history
  "^Q"    /dokey LNEXT             input next key literally (may be overridden
                                   by terminal)
  "^R"    /dokey REFRESH           refresh line
  "^S"    /dokey PAUSE             pause screen
  "^T"    /kb_transpose_chars     *transpose characters
  "^U"    /kb_backward_kill_line   delete to beginning of line
  "^V"    /dokey LNEXT             input next key literally
  "^W"    /dokey BWORD            *delete backward word (space-delimited)
  "^?"    (internal)              *backspace
  "^X^R"  /load ~/.tfrc            reload personal config file
  "^X^V"  /version                 display version information
  "^X^?"  /kb_backward_kill_word  *delete backward word (punctuation-delimited)
  "^X["   /dokey_hpageback        *scroll back a half screenful
  "^X]"   /dokey_hpage            *scroll forward a half screenful
  "^X{"   /dokey_pageback         *scroll back a screenful
  "^X}"   /dokey_page             *scroll forward a screenful
  "^[^E"  /kb_expand_line          expand current input line in place
  "^[^H"  /kb_backward_kill_word  *delete backward word (punctuation-delimited)
  "^[^I"  /complete                complete current word, depending on context
  "^[^L"  /dokey clear             clear screen (can be refilled with scrollback)
  "^[^N"  /dokey line             *scroll forward one line
  "^[^P"  /dokey lineback         *scroll back one line
  "^[^W"  /complete worldname      complete TF world name
  "^[$"   /complete macroname      complete TF macro name
  "^[%"   /complete variable       complete TF variable name
  "^[/"   /complete filename       complete file name (unix only)
  "^[ "   /kb_collapse_space       change multiple spaces to a single space
  "^[-"   /set kbnum=-             start kbnum entry with -
  "^[0"   /set kbnum=+0            start kbnum entry with 0
  ...
  "^[9"   /set kbnum=+9            start kbnum entry with 9
  "^[;"   /complete user_defined   complete from %{completion_list}
  "^[="   /kb_goto_match           move cursor to matching parenthesis/bracket
  "^[."   /kb_last_argument        input last word of previous line
  "^[<"   /dokey recallbeg         go to beginning of input history
  "^[>"   /dokey recallend         go to end of input history
  "^[J"   /dokey selflush          selective flush (similar to "/dokey flush"
                                   followed by "/limit -a")
  "^[L"   /kb_toggle_limit         toggle between /unlimit and /relimit
  "^[_"   /kb_last_argument        input last word of previous line
  "^[b"   /dokey_wleft            *cursor to beginning of word
  "^[c"   /kb_capitalize_word     *capitalize word
  "^[d"   /kb_kill_word           *delete forward word
  "^[f"   /dokey_wright           *cursor to end of word
  "^[h"   /dokey_hpage            *scroll forward a half screenful
  "^[i"   /complete input_history  complete from previously typed words
  "^[j"   /dokey flush             jump to last screenful of text
  "^[l"   /kb_downcase_word       *convert word to lower case
  "^[n"   /dokey searchf          *search forward input history
  "^[p"   /dokey searchb          *search backward input history
  "^[u"   /kb_upcase_word         *convert word to upper case
  "^[v"   /@test insert:=!insert   toggle insert mode
  "^[w"   /to_active_or_prev_world /fg next active world, or previous world
  "^[{"   /fg -<                  *foreground previous socket
  "^[}"   /fg ->                  *foreground next socket
  "^[^?"  /kb_backward_kill_word  *delete backward word (punctuation-delimited)
  "^]"    /bg                      put all sockets in background

#

Other useful commands not bound by default

  Command                 Meaning
  -------                 -------
  /dokey_bspc             *delete character
  /dokey UP               *cursor up
  /dokey DOWN             *cursor down
  /dokey RECALLB          *recall input backward
  /dokey RECALLF          *recall input forward
  /dokey NEWLINE           execute input line

#terminal
#tty
#stty
Terminal keys
  Some keys are interpeted by the terminal, not TF, so if you want to change 
  them, you must do so outside of TF (e.g.  with stty in unix).  Typical unix 
  terminal keys include: 

      Key   Name   Meaning
      ---   ----   -------
      ^C    int    generates a SIGINT signal.
      ^\    quit   generates a SIGQUIT signal.
      ^Z    susp   suspends the TF process

  When TF starts, it disables the terminal driver's "stop" and "start" keys 
  (typically ^S and ^Q), so they are available for binding within TF.  
#

Using keys

  Keys F1...F12 are the function keys, located across the top of most 
  keyboards.  

  Keys with names of the form "esc_<name>" correspond to the ESC key followed 
  by the <name> key.  There is an "esc_<name>" for every single key in the 
  Named Key table above, but only the ones with default meanings are listed in 
  the table; the rest are available for custom definitions.  

  On recent versions of xterm with the modifyCursorKeys resource, tf can 
  recognize when the CTRL, SHIFT, or META modifier is held down while pressing 
  the editor keys (insert, delete, home, end, pgdn, pgup), arrow keys, or 
  numbered function keys, and calls /key_ctrl_<name>, /key_shift_<name>, or 
  /key_meta_<name>, respectively.  Additionally, by default, each 
  /key_meta_<name> calls the corresponding /key_esc_<name>, so, for example, 
  pressing META-Left has the same effect as ESC Left.  Note that some xterms 
  capture shift_insert, shift_pgup, and shift_pgdn by default for their own 
  use, so tf will not receive these sequences.  If you use another terminal 
  emulator that generates unique character sequences for ctrl-, shift-, and 
  meta-modified keys, you can bind those sequences to call the corresponding 
  /key_<mod>_<name> (and send them to the tf author for inclusion in a future 
  release of tf).  

#keypad
#numeric keypad
Numeric keypad
  TF tries to put the keypad in "application mode", which on many terminals 
  will make the keypad keys generate unique character sequences.  Application 
  mode can be disabled by setting %keypad to "off".  The meaning of your 
  numeric keypad keys depends on your terminal emulator and its settings, the 
  setting of %keypad in tf, and the state of your NumLock key.  Two common 
  configurations of the keypad are shown below.  A <name> on a key in the 
  diagram indicates that it is bound in tf to "/key_<name>".  

              configuration A                   configuration B

       +------+------+------+------+     +------+------+------+------+
       |      |      |      |      |     |      |nkp/  |nkp*  |nkp-  |
       +------+------+------+------+     +------+------+------+------+
       |Home  |Up    |PgUp  |      |     |nkp7  |nkp8  |nkp9  |nkp+  |
       +------+------+------+      |     +------+------+------+      |
       |Left  |Center|Right |      |     |nkp4  |nkp5  |nkp6  |      |
       +------+------+------+------+     +------+------+------+------+
       |End   |Down  |PgDn  |      |     |nkp1  |nkp2  |nkp3  |nkpEnt|
       +------+------+------+      |     +------+------+------+      |
       |   Insert    |Delete|      |     |    nkp0     |nkp.  |      |
       +-------------+------+------+     +-------------+------+------+

  How this works for some specific terminals: 
  X Consortium xterm 
          %keypad=on and NumLock on gives configuration B above; %keypad=off 
          and NumLock on gives normal digit/punctuation keys; and NumLock off 
          gives configuration A.  
  XFree86/X.Org xterm 
          Identical to X Consortium xterm if you disable the "Alt/numlock 
          modifiers" option (under the ctrl-leftclick menu); if you do not, 
          then %keypad=on and NumLock on gives normal digit/punctuation keys, 
          and there is no way to get configuration B.  There is also a "VT220 
          keyboard" option; if that is enabled, %keypad=on and NumLock off 
          gives configuration B, and all other combinations of %keypad and 
          NumLock give normal digit/punctuation keys.  
  linux (Linux console) 
          %keypad=on gives configuration B, with these changes: "NumLock" 
          calls /key_f1, "/" calls /key_f2, "*" calls /key_f3, and "-" calls 
          /key_f4.  With %keypad=off, NumLock chooses between configuration A 
          and normal digit/punctuation keys.  (Prior to TF 5.0 beta 7, it was 
          often impossible to set %keypad=on because many (if not all) "linux" 
          termcap entries were missing a necessary code; TF now supplies that 
          code automatically if it is missing and %TERM is "linux".) 
  konsole and gnome-terminal 
          As far as I can tell, %keypad has no effect, NumLock chooses between 
          configuration A and normal digit/punctuation keys, and there is no 
          way to get configuration B.  
  PuTTY   %keypad=on and NumLock on gives configuration B above; %keypad=off 
          and NumLock on gives normal digit/punctuation keys; and NumLock off 
          gives a configuration similar to configuration A.  
  Mac OSX Terminal 
          By default, Terminal's keypad always acts like normal 
          digit/punctuation keys.  But if you turn on "strict vt100 keypad 
          behavior" under Terminal | Window Settings | Emulation, then 
          %keypad=on will give a configuration similar to configuration B.  
#

  In some environments, unnamed key sequences consisting of "^[" (ESC) 
  followed by one other character may also be typed by holding the META key 
  while typing the other character instead of typing ESC before the other 
  character.  See %meta_esc.  

  The one-time warning about certain new keybindings in 5.0 can be disabled by 
  setting the variable warn_5keys=off.  
#mapping_named_keys

Mapping Named Keys to functions

  Named keys have two levels of mapping: first the character sequence 
  generated by the key is bound (with /def -b) to call a macro named 
  key_<name>; then the macro key_<name> is defined to execute a command.  If 
  you wish to change the functionality of any named key, you should do so by 
  redefining key_<name>.  For example, if you want Insert to invoke your own 
  macro /foo, you should redefine "/def key_insert = /foo".  You should only 
  make a direct keybinding if a key on your terminal generates a character 
  sequence not covered by TF's default bindings; and then you should only bind 
  the character sequence to call key_<name> (but first, see the "keypad" 
  section above).  For example, if your Insert key generates "^[Q", you can 
  bind it with "/def -b'^[Q' = /key_insert".  You should never redefine any of 
  the predefined /dokey_* or /kb_* commands.  

  There are several advantages to this two-level mapping: redefining a key's 
  function is independent of the terminal; and adding keybindings for new 
  terminals is independent of the functions invoked by a named key.  

  Examples of popular alternatives to the standard key definitions: 

  Make PgUp and PgDn to scroll a half screen instead of a full screen: 

      /def key_pgdn = /dokey_hpage
      /def key_pgup = /dokey_hpageback

  Make up and down arrow keys perform movement only: 

      /def key_up = /dokey_up
      /def key_down = /dokey_down

  Make up and down arrow keys perform input recall only: 

      /def key_up = /dokey_recallb
      /def key_down = /dokey_recallf

  Before version 5.0, /def -B was the only way to bind a named key to a macro. 
  This, however, has been superceded by the use of "key_<name>" macros.  
  Whereas /def -B depends strictly on termcap entries, the bindings to 
  "key_<name>" macros are automatically generated from TF's own list of 
  standard keybindings in addition to termcap entries.  Termcap entries are 
  often incomplete or not well matched to your terminal emulator; TF's 
  additional keybindings fill in the gaps.  So, to redefine the meaning of a 
  named key, you should redefine "/def key_<name> = ...", not "/def -B<name> = 
  ...".  The names recognized by /def -B are different than the names in the 
  Named Key table.  For reference, they are: the function keys "F0", "F1",...  
  "F19"; the keypad keys "KP1" (upper left), "KP2" (center), "KP3" (upper 
  right), "KP4" (lower left), "KP5" (lower right); the arrow keys "Up", 
  "Down", "Right", "Left"; and the other keys, "Backspace", "Clear EOL", 
  "Clear EOS", "Clear Screen", "Delete", "Delete Line", "Home", "Home Down", 
  "Insert", "Insert Line", "PgDn", "PgUp", "Scroll Down", "Scroll Up".  They 
  must be spelled as shown, but capitalization is ignored.  The function 
  keycode() can be used to find the string generated by a key (as defined in 
  the termcap entry for %TERM).  
#mapping_char_seqs

Mapping character sequences to functions

  /Def -b (or /bind) allows you to bind a character sequence to a macro body.  
  Typing that sequence at the keyboard (which may mean pressing a single key 
  that generates the sequence) will then execute the macro body.  

  TF's input handler recognizes ^H and ^? as backspace and ^J and ^M as 
  newline, even when they are not bound to anything.  However, if a keybinding 
  is defined for any of these keys, it will override the internal handling of 
  that key.  

  At startup, TF also examines the terminal driver settings for character 
  sequences corresponding to the /dokey functions BWORD, DLINE, REFRESH, and 
  LNEXT, and binds them accordingly in addition to the default bindings listed 
  above.  

Mapping character sequences to Named Keys

  Because TF runs in a terminal and not in a windowing system, it does not see 
  actual keystrokes, but only the characters generated by a keystroke.  For 
  example, the up arrow key on many terminals generates "^[[A", and that is 
  what TF receives.  Thus, TF uses a set of definitions like "/def 
  -b'<charsequence>' = /key_<name>" to map chracter sequences to the keys that 
  generate them.  If two different keys generate the same sequence of 
  characters, there is no way for TF to tell them apart.  

  At startup, TF automatically binds character sequences to the named key 
  macros according to vt100, vt220, ANSI, and xterm definitions, plus OS/2 
  definitions if running on OS/2, as well as the termcap entry corresponding 
  to your %TERM variable.  If the named keys on your terminal generate 
  character sequences that are not recognized by TF, you will need to bind 
  them yourself with "/def -b'<charsequence>' = /key_<name>".  For example, if 
  your terminal's PgUp key generates "^[[3~", TF will think you pressed 
  Delete, since that is the character sequence generated by Delete on most 
  terminals.  To tell TF about PgUp on your terminal, you should do "/def 
  -b'^[[3~' = /key_pgup".  

#Terminal
#terminal.app
#osx
#os x
#OS X Terminal
  Note for Mac OS X Terminal.app users: by default, Terminal.app traps PageUp 
  and PageDown keys itself and does not send them to the application (tf).  It 
  does however send Shift-PageUp and Shift-PageDown to the application, so you 
  can use these to scroll in tf running inside Terminal.  You can also tell 
  Terminal to send the unshifted keys to tf by redefining them in Terminal | 
  Window Settings | Keyboard.  

#teraterm
#niftytelnet
#broken emulators
  Note: some broken terminal emulators (TeraTerm, NiftyTelnet) send incorrect 
  character sequences for the editor keypad (insert, delete, home, end, pgup, 
  pgdn).  For TeraTerm users, the preferred fix is to copy 
  %TFLIBDIR/teraterm.keyboard.cnf to KEYBOARD.CNF in their TeraTerm directory; 
  this will help all applications you run within TeraTerm, not just TF.  Users 
  of either terminal emulator may work around the problem with "/load 
  kb_badterm.tf".  
#

  Note that before version 3.5 alpha 21 or beta 1, it was usually harmless to 
  "/set TERM=vt100" on terminals that accepted a superset of vt100 display 
  codes.  However, the termcap key definitions are often different for 
  terminals that are otherwise similar (e.g., vt100 and xterm share many 
  display codes, but the key definitions are different), so setting %TERM 
  incorrectly may interfere with the operation of named keys.  Xterm users 
  should also note that since 5.0, TF has its own scrollback, and xterm's 
  scrollback will not work properly even if you try to trick TF with 
  TERM=vt100.  

#kbnum

"Kbnum" argument

  With the default keybindings, ESC followed by an optional "-" and any number 
  of digits sets the global variable %kbnum.  By default, the current %kbnum 
  value is displayed near the right end of the status line.  Then, when any 
  other keybinding is typed, that keybinding may use the value of %kbnum.  
  Whether the keybinding uses the value or not, %kbnum is cleared after the 
  keybinding has run.  Most keybindings that use %kbnum use it as a repeat 
  count.  For example, typing "ESC 1 2 x" is the same as typing "x" 12 times.  
  For keybindings that have a sense of direction, negative values of %kbnum 
  reverse that direction: for example, typing "ESC - 4 PgDn" is like typing 
  "PgUp" 4 times.  The "^G" (/beep) keybinding does not honor %kbnum, so it 
  can be used to cancel %kbnum with no effect.  The variable %max_kbnum sets 
  an upper limit on the value of %kbnum that can be entered by the ESC and 
  digit keys, to prevent typos from sending TF into very long loops.  

  The interpretation of %kbnum must be done by the command called from the 
  keybinding; it is not done automatically by TF.  So, for %kbnum to be 
  meaningful in a macro you write, you must implement those semantics 
  yourself.  Additionally, most of the standard "/kb_*" and "/dokey" commands 
  that use %kbnum are optimized to not simply repeat the command a number of 
  times, but instead calculate only the end result.  For example, ESC 300 TAB 
  does not laboriously scroll 300 screenfuls of text onto the screen, but 
  figures out what the 300th screenful looks like and draws that immediately.  
  It does this because /dokey_page calls "/test morescroll( winlines() * 
  (kbnum?:1))".  

  To set %kbnum by means other than the default keybindings above, simply /set 
  it as you would any other variable.  Once it is set, all typed digits are 
  appended to it.  When any non-digit key is typed, that key will be executed, 
  and %kbnum will be cleared.  
#kbnum

Other key bindings

#kbstack.tf
#kb-bash.tf
#kb-emacs.tf
#kbregion.tf
#cut
#paste
#cut and paste
#bash
#emacs
#extra keybindings

  Some additional keyboard operations can be defined by /loading these library 
  files: 
  kb-old.tf 
          keybindings like those in TF 4.0 and earlier 
  kb-emacs.tf 
          additional emacs-like keybindings 
  kbregion.tf 
          cut-and-paste operations 
  kbstack.tf 
          save the current input line with ESC DOWN and restore it later with 
          ESC UP.  
  See the comments at the top of each file for further documentation.  
#
  ____________________________________________________________________________

  See also: /dokey, /bind, /complete, %wordpunct, signals.  

&stdlib.tf
&local.tf
&lib
&library
&library
&standard library

standard library

  When TF is started, commands are loaded from the standard library 
  (%{TFLIBDIR}/stdlib.tf).  If the installer has created an optional local 
  library (%{TFLIBDIR}/local.tf), that will also be loaded.  Macros defined in 
  the standard library are marked with the invisible option ("-i") so they 
  will not be processed by /list, /save and /purge unless forced.  Redefining 
  or undefining such a macro will clear the -i option, so customized macros 
  with the same names as library macros can be created, listed, saved, and 
  purged.  

  See also: utilities 

#filename macros

Filenames:

  These macros may be redefined to any filename.  LOGFILE contains the default 
  filename used by /log.  MACROFILE, HILITEFILE, GAGFILE, TRIGFILE, BINDFILE, 
  HOOKFILE, and WORLDFILE contain the default filenames used by the /load* and 
  /save* families of commands.  
#

#list*

List commands:

  /listdef <spec> 
          equivalent to '/list <spec>'.  
  /listhilite <spec> 
          lists hilites on <spec>.  
  /listgag <spec> 
          lists gags on <spec>.  
  /listtrig <spec> 
          lists triggers on <spec>.  
  /listbind <spec> 
          lists key bindings matching <spec> 
  /listhook <spec> 
          lists hooks matching <spec>.  

  See: /list 

#purge*

Purge commands:

  /purgedef <spec> 
          purges macros whose name matches <spec> 
  /purgehilite <spec> 
          purges macros with hilites on <spec> 
  /purgegag <spec> 
          purges macros with gags on <spec> 
  /purgetrig <spec> 
          purges macros with triggers on <spec> 
  /purgedeft <spec> 
          purges named macros with triggers on <spec> 
  /purgebind <spec> 
          purges key bindings matching <spec>.  
  /purgehook <spec> 
          purges hooks matching <spec>.  

  See: /purge 

#load*

Load commands:

  /loaddef, /loadhilite, /loadgag, /loadtrig, /loadbind, /loadhook, 
  /loadworld.  All take a <file> argument; if the argument is omitted, the 
  appropriate default filename macro is used.  

  See: /load 

#save*

Save commands:

  /savedef, /savehilite, /savegag, /savetrig, /savebind, /savehook, 
  /saveworld.  All take a <file> argument.  If <file> is omitted, the 
  appropriate default filename macro is used.  

  See: /save 

#compress
#COMPRESS_READ
#$COMPRESS_READ
#COMPRESS_SUFFIX
#$COMPRESS_SUFFIX
#compression

File compression:

  The helpfile, personal config file, and files read with /load may be stored 
  compressed on disk.  If TF can not find a file with the specified name, it 
  will add ${COMPRESS_SUFFIX} to the filename and try to read it by piping it 
  through ${COMPRESS_READ}.  ${COMPRESS_READ} should contain the name of a 
  shell command that takes a filename as an argument, and prints its output on 
  standard output.  The default values for ${COMPRESS_SUFFIX} and 
  ${COMPRESS_READ} defined in the library are ".Z" and "zcat" for unix, ".zip" 
  and "unzip -p" for os/2.  Undefining ${COMPRESS_SUFFIX} will disable this 
  feature.  Note: /save, /saveworld, and /log do not write compressed files.  

#retry
#retry_off

World connection commands:

  /retry <world> [<delay>] 
          Try to connect to <world>; repeat every <delay> seconds until 
          successful.  
  /retry_off [<world>] 
          Cancels "/retry <world>" (default: all worlds) 

#hilite_whisper
#hilite whisper
#hilite_page
#hilite page

Hilite commands:

  /hilite_whisper, /hilite_page, /nohilite_whisper, and /nohilite_page turn on 
  or off hiliting several different page and whisper formats.  

#

Backward compatible commands:

  /reply, /act, /nolog, /nologin, /nologme, /noquiet, and /nowrap are provided 
  for compatibility.  

&8-bit
&8 bit
&characters
&character set
&iso-8859-1
&iso-8859
&iso 8859
&latin1
&international
&i18n
&internationalization
&internationalisation
&locale

locale

  On many systems, "/setenv LC_CTYPE=en_US" will allow you to use characters 
  in the 8-bit ISO 8859 character set.  If this does not work on your system, 
  or you want to use a non-English locale, or you just want to learn more, 
  keep reading.  

  A locale defines a set of rules for a language and culture.  If the platform 
  on which TF runs supports locales, TF will support the following categories 
  of locale rules: 
  LC_CTYPE 
          determines what characters are allowed, and whether they should be 
          treated as letters, digits, puctuation, or control characters.  When 
          using a locale with an 8-bit character set, make sure that %istrip 
          is off and %meta_esc is off or nonprint, so you can type 8-bit 
          characters with the meta key.  
  LC_TIME 
          determines the names and formats used in displaying dates and times 
          with /time, ftime(), etc.  

  The user can set the locale either by having special variables defined in 
  the environment before starting TF (preferred), or by setting them while TF 
  is running (they will automatically be exported to the environment even if 
  /set is used).  The exact rules for setting locale depend on the platform, 
  and should be found your system's documentation for setlocale().  The rules 
  are usually something like this: 

    * If the variable LC_ALL is set, its value is used as the locale for 
      all supported categories.  
    * Otherwise, if the variable with the name of a category (e.g., 
      LC_CTYPE) is set, its value is used as the locale for that category.  
    * Otherwise, if the variable LANG is set, its value is used as the 
      locale for any supported categories that were not covered by the first 
      two rules.  
    * If none of those are set for a category, the default "C" locale is 
      used for that category, which allows the 7-bit ASCII character set and 
      US English date and time formats.  

  The valid values for the locale variables depend on your system.  On a POSIX 
  system, the valid values can be listed with the shell command "locale -a".  

  Bugs: 

    * LC_COLLATE and LC_MESSAGES categories are not supported.  
    * In glob patterns, there is no way to specify a range of all letters 
      that works in all locales.  E.g., "[A-Za-z]" works in the standard "C" 
      locale, but not necessarily in others.  (However, in regexp patterns, 
      locale information is used to define character type operators like "\w" 
      and "\W", case insensitivity, etc.) 
    * TF will convert character 0x80 to the character 0x00.  This is not 
      usually an issue, since character 0x80 is not a printable character in 
      the character sets of most locales (including all ISO character sets).  

  If your system has locale support, but does not have any locales installed, 
  you can get the POSIX 1003.2 WG15-collection locale definitions from 
  ftp://dkuug.dk/i18n/ or ftp://i44ftp.info.uni-karlsruhe.de/pub/linux/ctype/. 

  Note that even though TF supports locales with non-ASCII character sets, not 
  all MUD servers support non-ASCII character sets.  Many servers simply 
  discard characters that are not printable ASCII.  Among servers that do 
  support non-ASCII characters, the most commonly used set is ISO-8859-1 
  (Latin1).  When choosing a locale for TF, you should choose one that uses 
  the same character set as the servers you use.  

  Note to linux users and other users of GNU libc: at least some versions of 
  GNU localedef generate invalid LC_TIME information from the WG15-collection 
  sources, and the GNU libc causes any program that tries to use the invalid 
  LC_TIME information to crash.  Workarounds: delete the LC_TIME data; or, do 
  not set any of the LC_ALL, LC_TIME, or LANG variables.  

&autologin
&login

login

  If the %{login} flag is on when you connect to a world, and that world was 
  defined with a character, password, and optional worldtype, TF will attempt 
  to automatically login to that world.  

  Autologin is done by a hook defined in the standard library.  The hook for 
  the default worldtype uses TinyMUD login format; there are also hooks for 
  "tiny", "lp", "lpp", and "telnet" worldtypes.  You can also define your own 
  LOGIN hooks.  

  See: hooks, variables, /addworld 

&macros

macros

  A macro is basically a named set of commands.  The simplest kind of macro 
  has a name and a body.  The body is a list of one or more commands, 
  separated by '%;' tokens.  These commands are executed when the macro is 
  called.  For example, if you define a macro like 

      /def time_warp = :jumps to the left!%;:steps to the right!

  and call it by typing 

      /time_warp

  you will execute the commands 

      :jumps to the left!
      :steps to the right!

  A macro name is the way of calling it from the command line or from another 
  macro.  You can execute a macro by typing '/' followed by the name of the 
  macro.  If a macro and builtin have the same name, the macro will be called. 
  Typing '/@' followed by the name will always call the builtin command.  

  A macro body, or execution text, is the commands and/or text executed when 
  the macro is called.  This text is evaluated according to the rules 
  described under "evaluation".  

  Macros actually have many more fields, described below.  All fields 
  (including name and body) are optional.  

  name    The name of the macro.  Names should begin with a letter, and 
          contain letters, numbers, or '_' characters.  

  body    One or more commands to be executed when macro is called.  The body 
          is compiled to an efficient internal format the first time it is 
          needed, so each future call can execute it more quickly.  

  number  All macros are automatically numbered sequentially.  This field can 
          not be changed.  

  trigger 
          when text matches the trigger pattern, the macro may be called.  

  hook    the macro can be called when a TF hook event occurs.  

  keybinding 
          the macro will be called when its keybinding is typed.  

  shots   the macro will be deleted after it is triggered or hooked a certain 
          number of times.  

  priority 
          when multiple triggers match the same text, the one with the highest 
          priority is selected (see "priority").  

  fall-thru 
          on a trigger or hook, allows additional macros of lower priority to 
          be run (see "priority").  

  world   the macro can only be triggered/hooked by text/events from a 
          particular world.  

  worldtype 
          the macro can only be triggered/hooked by text/events from a 
          particular type of world.  

  expression 
          the macro can only be triggered/hooked if expression is non-zero.  

  attributes 
          bold, underline, etc.  for displaying trigger text.  

  probability 
          when triggered, the macro has a certain probability of being 
          executed.  

  invisibility 
          prevents handling of macro by /list, /save, or /purge.  
  Macros may be called in several ways: 

    * a command of the form "/name" or "/#number" 
    * triggered by text from a socket (see "triggers") 
    * hooked by a tinyfugue event (see "hooks") 
    * by keybindings 

  Associated commands: 
  /def    define a named macro, with any fields 
  /trig   define a trigger macro 
  /hilite 
          define a hilite macro 
  /gag    define a gag macro 
  /bind   define a keybinding macro 
  /hook   define a hook macro 
  /undef  undefine a named macro 
  /unhook 
          undefine a hook macro 
  /unbind 
          undefine a keybinding macro 
  /undefn 
          undefine a macro by number 
  /undeft 
          undefine a macro by trigger 
  /purge  undefine a set of macros 
  /list   display a list of macros 
  /load   load commands from a file 
  /save   save macro definitions to a file 

  See also: triggers, gags, hilites, hooks 

&mail
&mail check
&mail checking

mail checking

  If %{maildelay} is nonzero, TF will check for mail every %{maildelay} 
  seconds.  TF checks for mail in each file in the space-separated list of 
  files in the %{TFMAILPATH} variable (literal spaces in TFMAILPATH may be 
  quoted by preceeding them with a backslash).  If %{TFMAILPATH} is not set, 
  TF will check in the single file named by the %{MAIL} variable.  

  TF considers a mailfile to have unread mail if the file has been written 
  more recently than it has been read.  When this changes for any of the 
  monitored files, TF updates the mail indicator on the status line (actually, 
  the "@mail" status).  When TF determines that a mailfile contains new mail, 
  it calls the MAIL hook, which by default prints "You have new mail".  If a 
  mailfile is not empty the first time TF checks it, TF just prints "You have 
  mail" without calling the MAIL hook.  

  If an error occurs while checking any file, an error message will be 
  displayed only once, until that error clears up (or changes to a different 
  error), but TF will continue to check that file.  To disable checking, even 
  after an error, you must remove the file from %{TFMAILPATH} or %{MAIL}.  

  The nmail() function returns the number of monitored mail files containing 
  unread mail.  

  MAIL and/or MAILPATH variables are usually set in the environment before TF 
  starts.  If %{MAIL} is not set when TF starts, TF will try to set it to the 
  name of the system mail directory plus your user name (if the system mail 
  directory was defined when TF was installed).  If MAILPATH (which uses ":" 
  as a delimiter) is set when TF starts, it is transferred to %{TFMAILPATH} 
  (which uses space as a delimiter).  

  See: nmail(), variables, special variables, /set, mailing list.  

&majordomo
&listserv
&mail list
&mailing list

mailing list

  The TinyFugue mailing list is an email forum for discussion of topics 
  related to TinyFugue.  To subscribe, follow the instructions at 
  http://tinyfugue.sourceforge.net/ 

&mccpv1
&mccpv2
&mccp

Mud Client Compression Protocol

  TF supports versions 1 and 2 of the Mud Client Compression Protocol (MCCP) 
  described at http://www.randomly.org/projects/MCCP/.  MCCP allows a server 
  to compress the data stream it sends to the client (TF), which may improve 
  throughput on a poor connection.  

  MCCP is transparent to the user.  When TF connects to a server that supports 
  MCCP, it will be enabled automatically, unless the mccp variable is off.  
  The listsockets command will indicate that MCCP is enabled.  

  MCCP v1 is broken, and may not be supported in the future if it is found to 
  interfere with valid protocols.  If you use a server that has only MCCP v1, 
  you should encourage the owner to upgrade to add support for v2.  

  See also: protocols, telnet 

&visual
&visual mode
&nonvisual
&non-visual
&screen
&mode

mode

  TinyFugue has two main interface modes: Visual and non-visual.  Visual mode 
  will be enabled by default, unless your %{TERM} does not support it, or 
  %{visual} is explicitly turned off in .tfrc, or tf is started with the -v 
  option.  Visual mode can be turned off or on with the "/visual" command.  

#visual

Visual mode

  The Visual interface has two windows: the bottom window is for input, the 
  top for output.  TF maintains a separate virtual window for each open 
  socket; only the foreground world's window is displayed.  If your terminal 
  can scroll in a region, output will scroll; otherwise if your terminal can 
  delete and insert lines, TF will simulate scrolling; otherwise it will wrap 
  from bottom to top, clearing two lines ahead.  The %{scroll} variable can be 
  set to explicitly choose scrolling or wrapping.  The %{isize}, %{cleardone}, 
  and %{clearfull} variables can be used to customize the visual display.  
  See: %isize, %cleardone, %clearfull.  

  The two windows are separated by a status line, which can be formatted by 
  the user as described under status line.  

  If you are using a terminal emulator that emulates different terminal types, 
  the recommended type to use is vt220, vt100, or ansi (in that order), with 
  %{TERM} set to the same value.  Scrolling may appear jumpy under ansi, but 
  will be smooth under vt220 and vt100.  vt220 also provides some additional 
  features that may make command line editing smoother (especially over a slow 
  modem).  

#nonvisual

Non-visual mode

  In the non-visual interface, input and output are both displayed on the 
  bottom line.  If you are typing and output appears, your input is cleared, 
  the output is displayed and everything above it scrolls, and your input is 
  redisplayed on the last line.  If your input has wrapped around to a second 
  or third line, only the last line will be cleared and redisplayed.  

#
  ____________________________________________________________________________

  In both modes, the output window is redrawn whenever necessary: when its 
  size changes, when the mode changes, when %wrap, %wrapsize, or %wrapspace 
  change, or when TF resumes after /suspend or /sh.  

  In both modes, output text is wrapped around at a right margin of one less 
  than the number of columns on your screen (typically 79) unless wrapping has 
  been turned off.  In addition, when text is wrapped, all wrapped lines after 
  the first will be indented 4 spaces to help distinguish them from the 
  beginning of an original line (configurable by setting %wrapspace).  See: 
  columns(), %wrap, %wrapsize, %wrappunct, %wrapspace.  

  If the %{more} flag is on, output is suspended when the screen is full, and 
  you can use the TAB key to continue.  See: /more, /dokey.  

&-
&--
&options

options

  Many commands take options to modify their behavior, following these rules 
  (similar to UNIX conventions, but not identical): 

    * All options must be immediately preceded by '-'.  
    * Options may be grouped after a single '-'.  
    * Some options may take string, numeric, or time arguments.  There 
      must be no space between the option and the argument.  
    * String option-arguments may be delimited by a space, double quotes, 
      single quotes, or backquotes.  
    * A literal delimiter character or '\' within a delimited string must 
      be escaped by preceding it with '\'.  
    * A numeric option-argument may be given as an expression that 
      evaluates to a numeric value.  If the expression contains spaces or 
      quotes, they must be quoted or escaped as in a string option-argument.  
    * All options must precede normal arguments.  
    * A '-' or '--' by itself may be used to mark the end of the options.  
      This is useful when the first regular argument begins with '-'.  
    * A '-?' or invalid option will produce a list of valid options.  

  See also: getopts().  

&patterns

patterns

  Patterns are used throughout TF, including triggers, hooks, /purge, /list, 
  /limit, /recall, and expressions.  There are four styles of pattern matching 
  available: 
  simple  target string and pattern string must be identical 
  glob    similar to shell filename patterns 
  regexp  perl-compatible regular expressions 
  substr  target string must contain pattern string 
  The style used by a particular command is determined either by the use of 
  the -m option or the setting of the global variable %{matching}.  

#comparison
#simple
#simple matching

Simple matching ("simple")

  The pattern is compared directly to the string.  There are no special 
  characters.  Case is significant.  

#substr
#contain

Substring matching ("substr")

  The string must contain the pattern.  There are no special characters.  Case 
  is significant.  

#smatch
#globbing
#glob

Globbing ("glob")

  Globbing is the default matching style, and was the only style available 
  before version 3.2.  It is similar to filename expansion ("globbing") used 
  by many shells (but unlike shells, tf uses glob only for comparison, not 
  expansion).  

  There are several special sequences that can be used in tf globbing: 

    * The '*' character matches any number of characters.  

    * The '?' character matches any one character.  

    * Square brackets ([...]) can be used to match any one of a sequence 
      of characters.  Ranges can be specified by giving the first and last 
      characters with a '-' between them.  If '^' is the first character, the 
      sequence will match any character NOT specified.  

    * Curly braces ({...}) can be used to match any one of a list of 
      words.  Different words can be matched by listing each within the 
      braces, separated by a '|' (or) character.  Both ends of {...} will only 
      match a space or end of string.  Therefore "{foo}*" and "{foo}p" do not 
      match "foop", and "*{foo}" and "p{foo}" do not match "pfoo".  

      Patterns containing "{...}" can easily be meaningless.  A valid {...} 
      pattern must: (a) contain no spaces, (b) follow a wildcard, space, or 
      beginning of string, (c) be followed by a wildcard, space, or end of 
      string.  

      The pattern "{}" will match the empty string.  

    * Any other character will match itself, ignoring case.  A special 
      character can be made to match itself by preceding it with '\' to remove 
      its special meaning.  

  Examples:
  "d?g" matches "dog", "dig" and "dug" but not "dg" or "drug". 
  "d*g" matches "dg", "dog", "drug", "debug", "dead slug", etc. 
  "{d*g}" matches "dg", "dog", "drug", "debug", but not "dead slug". 
  "M[rs]." matches "Mr." and "Ms."
  "M[a-z]" matches "Ma", "Mb", "Mc", etc. 
  "[^a-z]" matches any character that is not in the English alphabet. 
  "{storm|chup*}*" matches "chupchup fehs" and "Storm jiggles". 
  "{storm|chup*}*" does NOT match "stormette jiggles". 

#re
#regex
#regexp
#regexps
#regular expressions

Regular expressions ("regexp")

  TF implements regular expressions with the package PCRE 2.08, Copyright (c) 
  1997-1999 University of Cambridge.  The PCRE regexp syntax is documented on 
  its own page under the topic "pcre".  

  The syntax and semantics of these regular expressions is nearly identical to 
  those in perl 5, and is roughly a superset of those used in versions of tf 
  prior to 5.0.  There is one incompatability with old tf regexps: the "{" 
  character is now special, and must be written "\{" to match a literal "{".  
  To help with the transition to the new syntax, you will be warned if you use 
  a regexp containing "{", unless you turn off the warn_curly_re variable.  

  If all letters in a regexp are lower case, the regexp will default to using 
  caseless matching.  If a regexp contains any upper case letters, it will 
  default to case-sensitive matching.  Of course, you can explicitly specify 
  caseless matching by including "(?i)" at the beginning of the regexp, or 
  case-sensitive by including "(?-i)".  

  Regexps will honor the locale that was set when the regexp was defined.  
  Locale affects caseless matching, and determines whether characters are 
  letters, digits, or whatever.  So, for example, while the regexp "[A-Za-z]" 
  will match only English letters, "[^\W\d_]" will match any letter defined by 
  the locale.  

  After a regexp match, %Pn substitutions can be used to get the value of the 
  string that matched various parts of the regexp.  See %Pn.  

  For those of you who care about code details: TF compiles PCRE regexps with 
  the PCRE_DOLLAR_ENDONLY and PCRE_DOTALL options.  

  See also: regmatch(), substitution.  

Comparison of glob and regexps. 

  In a glob, '*' and '?' by themselves match text.  In a regexp, '*' and '?' 
  are only meaningful in combination with the pattern they follow.  Regexps 
  are not "anchored"; that is, the match may occur anywhere in the string, 
  unless you explicitly use '^' and/or '$' to anchor it.  Globs are anchored, 
  and must match the entire string.  

      regexp              equivalent glob
      ------              -----------------
      "part of line"      "*part of line*"
      "^entire line$"     "entire line"
      "\bword\b"          "*{word}*"
      "^(you|hawkeye) "   "{you|hawkeye} *"
      "foo.*bar"          "*foo*bar*"
      "f(oo|00)d"         "*{*food*|*f00d*}*"
      "line\d"            "*line[0-9]*"
      "^[^ ]+ whispers,"  "{*} whispers,*"
      "foo(xy)?bar"       "*{*foobar*|*fooxybar*}*"
      "zoo+m"             none
      "foo ?bar"          none
      "(foo bar|frodo)"   none

Notes. 

    * For best performance, make the beginning of your patterns as 
      specific as possible.  
    * Do not use ".*" or "^.*" at the beginning of a regexp.  It is very 
      inefficient, and not needed.  Use %PL instead if you need to retrieve 
      the substring to the left of the match.  
    * If a glob and regexp can do the same job, the glob is usually 
      slightly faster.  But if using a glob instead of a regexp would mean you 
      need some extra code, then that extra code will cost much more than the 
      regexp would have.  So if only a regexp can do what you need, don't 
      hesitate to use it.  

&pcre
&pcre syntax
  This document was extracted from the pcre.3.html documentation, Copyright 
  (c) 1997-1999 University of Cambridge, and minimally adapted for use in 
  TinyFugue.  

    * 
#SEC13
      REGULAR EXPRESSION DETAILS 

      The syntax and semantics of the regular expressions supported by PCRE 
      are described below.  Regular expressions are also described in the Perl 
      documentation and in a number of other books, some of which have copious 
      examples.  Jeffrey Friedl's "Mastering Regular Expressions", published 
      by O'Reilly (ISBN 1-56592-257-3), covers them in great detail.  The 
      description here is intended as reference documentation.  

      A regular expression is a pattern that is matched against a subject 
      string from left to right.  Most characters stand for themselves in a 
      pattern, and match the corresponding characters in the subject.  As a 
      trivial example, the pattern 


        The quick brown fox

      matches a portion of a subject string that is identical to itself.  The 
      power of regular expressions comes from the ability to include 
      alternatives and repetitions in the pattern.  These are encoded in the 
      pattern by the use of <meta-characters>, which do not stand for 
      themselves but instead are interpreted in some special way.  

      There are two different sets of meta-characters: those that are 
      recognized anywhere in the pattern except within square brackets, and 
      those that are recognized in square brackets.  Outside square brackets, 
      the meta-characters are as follows: 


        \      general escape character with several uses
        ^      assert start of subject (or line, in multiline mode)
        $      assert end of subject (or line, in multiline mode)
        .      match any character except newline (by default)
        [      start character class definition
        |      start of alternative branch
        (      start subpattern
        )      end subpattern
        ?      extends the meaning of (
               also 0 or 1 quantifier
               also quantifier minimizer
        *      0 or more quantifier
        +      1 or more quantifier
        {      start min/max quantifier

      Part of a pattern that is in square brackets is called a "character 
      class".  In a character class the only meta-characters are: 


        \      general escape character
        ^      negate the class, but only if the first character
        -      indicates character range
        ]      terminates the character class

      The following sections describe the use of each of the meta-characters.  
    * 
#SEC14
      BACKSLASH 

      The backslash character has several uses.  Firstly, if it is followed by 
      a non-alphameric character, it takes away any special meaning that 
      character may have.  This use of backslash as an escape character 
      applies both inside and outside character classes.  

      For example, if you want to match a "*" character, you write "\*" in the 
      pattern.  This applies whether or not the following character would 
      otherwise be interpreted as a meta-character, so it is always safe to 
      precede a non-alphameric with "\" to specify that it stands for itself.  
      In particular, if you want to match a backslash, you write "\\".  

      If a pattern is compiled with the "x" (PCRE_EXTRA) option, whitespace in 
      the pattern (other than in a character class) and characters between a 
      "#" outside a character class and the next newline character are 
      ignored.  An escaping backslash can be used to include a whitespace or 
      "#" character as part of the pattern.  

      A second use of backslash provides a way of encoding non-printing 
      characters in patterns in a visible manner.  There is no restriction on 
      the appearance of non-printing characters, apart from the binary zero 
      that terminates a pattern, but when a pattern is being prepared by text 
      editing, it is usually easier to use one of the following escape 
      sequences than the binary character it represents: 


        \a     alarm, that is, the BEL character (hex 07)
        \cx    "control-x", where x is any character
        \e     escape (hex 1B)
        \f     formfeed (hex 0C)
        \n     newline (hex 0A)
        \r     carriage return (hex 0D)
        \t     tab (hex 09)
        \xhh   character with hex code hh
        \ddd   character with octal code ddd, or backreference

      The precise effect of "\cx" is as follows: if "x" is a lower case 
      letter, it is converted to upper case.  Then bit 6 of the character (hex 
      40) is inverted.  Thus "\cz" becomes hex 1A, but "\c{" becomes hex 3B, 
      while "\c;" becomes hex 7B.  

      After "\x", up to two hexadecimal digits are read (letters can be in 
      upper or lower case).  

      After "\0" up to two further octal digits are read.  In both cases, if 
      there are fewer than two digits, just those that are present are used.  
      Thus the sequence "\0\x\07" specifies two binary zeros followed by a BEL 
      character.  Make sure you supply two digits after the initial zero if 
      the character that follows is itself an octal digit.  

      The handling of a backslash followed by a digit other than 0 is 
      complicated.  Outside a character class, PCRE reads it and any following 
      digits as a decimal number.  If the number is less than 10, or if there 
      have been at least that many previous capturing left parentheses in the 
      expression, the entire sequence is taken as a <back reference>.  A 
      description of how this works is given later, following the discussion 
      of parenthesized subpatterns.  

      Inside a character class, or if the decimal number is greater than 9 and 
      there have not been that many capturing subpatterns, PCRE re-reads up to 
      three octal digits following the backslash, and generates a single byte 
      from the least significant 8 bits of the value.  Any subsequent digits 
      stand for themselves.  For example: 


        \040   is another way of writing a space
        \40    is the same, provided there are fewer than 40
                  previous capturing subpatterns
        \7     is always a back reference
        \11    might be a back reference, or another way of
                  writing a tab
        \011   is always a tab
        \0113  is a tab followed by the character "3"
        \113   is the character with octal code 113 (since there
                  can be no more than 99 back references)
        \377   is a byte consisting entirely of 1 bits
        \81    is either a back reference, or a binary zero
                  followed by the two characters "8" and "1"

      Note that octal values of 100 or greater must not be introduced by a 
      leading zero, because no more than three octal digits are ever read.  

      All the sequences that define a single byte value can be used both 
      inside and outside character classes.  In addition, inside a character 
      class, the sequence "\b" is interpreted as the backspace character (hex 
      08).  Outside a character class it has a different meaning (see below).  

      The third use of backslash is for specifying generic character types: 


        \d     any decimal digit
        \D     any character that is not a decimal digit
        \s     any whitespace character
        \S     any character that is not a whitespace character
        \w     any "word" character
        \W     any "non-word" character

      Each pair of escape sequences partitions the complete set of characters 
      into two disjoint sets.  Any given character matches one, and only one, 
      of each pair.  

      A "word" character is any letter or digit or the underscore character, 
      that is, any character which can be part of a Perl "word".  The 
      definition of letters and digits is controlled by PCRE's character 
      tables, and may vary if locale- specific matching is taking place (see 
      "Locale support" above).  For example, in the "fr" (French) locale, some 
      character codes greater than 128 are used for accented letters, and 
      these are matched by \w.  

      These character type sequences can appear both inside and outside 
      character classes.  They each match one character of the appropriate 
      type.  If the current matching point is at the end of the subject 
      string, all of them fail, since there is no character to match.  

      The fourth use of backslash is for certain simple assertions.  An 
      assertion specifies a condition that has to be met at a particular point 
      in a match, without consuming any characters from the subject string.  
      The use of subpatterns for more complicated assertions is described 
      below.  The backslashed assertions are 


        \b     word boundary
        \B     not a word boundary
        \A     start of subject (same as "^" in tf)
        \Z     end of subject (same as "$" in tf)
        \z     end of subject (same as "$" in tf)

      These assertions may not appear in character classes (but note that "\b" 
      has a different meaning, namely the backspace character, inside a 
      character class).  

      A word boundary is a position in the subject string where the current 
      character and the previous character do not both match \w or \W (i.e.  
      one matches \w and the other matches \W), or the start or end of the 
      string if the first or last character matches \w, respectively.  
    * 
#SEC15
      CIRCUMFLEX AND DOLLAR 

      Outside a character class, in the default matching mode, the circumflex 
      character is an assertion which is true only if the current matching 
      point is at the start of the subject string.  Inside a character class, 
      circumflex has an entirely different meaning (see below).  

      Circumflex need not be the first character of the pattern if a number of 
      alternatives are involved, but it should be the first thing in each 
      alternative in which it appears if the pattern is ever to match that 
      branch.  If all possible alternatives start with a circumflex, that is, 
      if the pattern is constrained to match only at the start of the subject, 
      it is said to be an "anchored" pattern.  (There are also other 
      constructs that can cause a pattern to be anchored.) 

      A dollar character is an assertion which is true only if the current 
      matching point is at the end of the subject string.  Dollar need not be 
      the last character of the pattern if a number of alternatives are 
      involved, but it should be the last item in any branch in which it 
      appears.  Dollar has no special meaning in a character class.  
    * 
#SEC17
      SQUARE BRACKETS 

      An opening square bracket introduces a character class, terminated by a 
      closing square bracket.  A closing square bracket on its own is not 
      special.  If a closing square bracket is required as a member of the 
      class, it should be the first data character in the class (after an 
      initial circumflex, if present) or escaped with a backslash.  

      A character class matches a single character in the subject; the 
      character must be in the set of characters defined by the class, unless 
      the first character in the class is a circumflex, in which case the 
      subject character must not be in the set defined by the class.  If a 
      circumflex is actually required as a member of the class, ensure it is 
      not the first character, or escape it with a backslash.  

      For example, the character class [aeiou] matches any lower case vowel, 
      while [^aeiou] matches any character that is not a lower case vowel.  
      Note that a circumflex is just a convenient notation for specifying the 
      characters which are in the class by enumerating those that are not.  It 
      is not an assertion: it still consumes a character from the subject 
      string, and fails if the current pointer is at the end of the string.  

      When caseless matching is set, any letters in a class represent both 
      their upper case and lower case versions, so for example, a caseless 
      [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not 
      match "A", whereas a caseful version would.  

      The minus (hyphen) character can be used to specify a range of 
      characters in a character class.  For example, [d-m] matches any letter 
      between d and m, inclusive.  If a minus character is required in a 
      class, it must be escaped with a backslash or appear in a position where 
      it cannot be interpreted as indicating a range, typically as the first 
      or last character in the class.  

      It is not possible to have the literal character "]" as the end 
      character of a range.  A pattern such as [W-]46] is interpreted as a 
      class of two characters ("W" and "-") followed by a literal string 
      "46]", so it would match "W46]" or "-46]".  However, if the "]" is 
      escaped with a backslash it is interpreted as the end of range, so 
      [W-\]46] is interpreted as a single class containing a range followed by 
      two separate characters.  The octal or hexadecimal representation of "]" 
      can also be used to end a range.  

      Ranges operate in ASCII collating sequence.  They can also be used for 
      characters specified numerically, for example [\000-\037].  If a range 
      that includes letters is used when caseless matching is set, it matches 
      the letters in either case.  For example, [W-c] is equivalent to 
      [][\^_`wxyzabc], matched caselessly, and if character tables for the 
      "fr" locale are in use, [\xc8-\xcb] matches accented E characters in 
      both cases.  

      The character types \d, \D, \s, \S, \w, and \W may also appear in a 
      character class, and add the characters that they match to the class.  
      For example, [\dABCDEF] matches any hexadecimal digit.  A circumflex can 
      conveniently be used with the upper case character types to specify a 
      more restricted set of characters than the matching lower case type.  
      For example, the class [^\W_] matches any letter or digit, but not 
      underscore.  

      All non-alphameric characters other than \, -, ^ (at the start) and the 
      terminating ] are non-special in character classes, but it does no harm 
      if they are escaped.  
    * 
#SEC18
      VERTICAL BAR 

      Vertical bar characters are used to separate alternative patterns.  For 
      example, the pattern 


        gilbert|sullivan

      matches either "gilbert" or "sullivan".  Any number of alternatives may 
      appear, and an empty alternative is permitted (matching the empty 
      string).  The matching process tries each alternative in turn, from left 
      to right, and the first one that succeeds is used.  If the alternatives 
      are within a subpattern (defined below), "succeeds" means matching the 
      rest of the main pattern as well as the alternative in the subpattern.  
    * 
#SEC19
      INTERNAL OPTION SETTING 

      The settings of PCRE_CASELESS, PCRE_EXTENDED, and PCRE_UNGREEDY can be 
      changed from within the pattern by a sequence of Perl option letters 
      enclosed between "(?" and ")".  The option letters are 


        i  for PCRE_CASELESS
        x  for PCRE_EXTENDED
        U  for PCRE_UNGREEDY (not in perl)

      For example, (?x) sets extended matching.  It is also possible to unset 
      these options by preceding the letter with a hyphen, and a combined 
      setting and unsetting such as (?x-i), which sets extended and while 
      unsetting caseless, is also permitted.  If a letter appears both before 
      and after the hyphen, the option is unset.  

      The scope of these option changes depends on where in the pattern the 
      setting occurs.  For settings that are outside any subpattern (defined 
      below), the effect is the same as if the options were set or unset at 
      the start of matching.  The following patterns all behave in exactly the 
      same way: 


        (?i)ABC
        A(?i)BC
        AB(?i)C
        ABC(?i)

      Such "top level" settings apply to the whole pattern (unless there are 
      other changes inside subpatterns).  If there is more than one setting of 
      the same option at top level, the rightmost setting is used.  

      If an option change occurs inside a subpattern, the effect is different. 
      This is a change of behaviour in Perl 5.005.  An option change inside a 
      subpattern affects only that part of the subpattern that follows it, so 


        (a(?-i)b)c

      matches abc, Abc, abC and AbC, and no other strings (remember, in tf, 
      regexps are caseless by default if they do not contain any capital 
      letters).  By this means, options can be made to have different settings 
      in different parts of the pattern.  Any changes made in one alternative 
      do carry on into subsequent branches within the same subpattern.  For 
      example, 


        X(a(?i)b|c)

      matches "Xab", "XaB", "Xc", and "XC", even though when matching "C" the 
      first branch is abandoned before the option setting.  This is because 
      the effects of option settings happen at compile time.  There would be 
      some very weird behaviour otherwise.  
    * 
#SEC20
      SUBPATTERNS 

      Subpatterns are delimited by parentheses (round brackets), which can be 
      nested.  Marking part of a pattern as a subpattern does two things: 

      1.  It localizes a set of alternatives.  For example, the pattern 


        cat(aract|erpillar|)

      matches one of the words "cat", "cataract", or "caterpillar".  Without 
      the parentheses, it would match "cataract", "erpillar" or the empty 
      string.  

      2.  It sets up the subpattern as a capturing subpattern (as defined 
      above).  When the whole pattern matches, that portion of the subject 
      string that matched the subpattern is remembered for the TinyFugue %Pn 
      substitutions.  Opening parentheses are counted from left to right 
      (starting from 1) to obtain the numbers of the capturing subpatterns.  

      For example, if the string "the red king" is matched against the pattern 


        the ((red|white) (king|queen))

      the captured substrings are "red king", "red", and "king", and are 
      numbered 1, 2, and 3.  

      The fact that plain parentheses fulfil two functions is not always 
      helpful.  There are often times when a grouping subpattern is required 
      without a capturing requirement.  If an opening parenthesis is followed 
      by "?:", the subpattern does not do any capturing, and is not counted 
      when computing the number of any subsequent capturing subpatterns.  For 
      example, if the string "the white queen" is matched against the pattern 


        the ((?:red|white) (king|queen))

      the captured substrings are "white queen" and "queen", and are numbered 
      1 and 2.  The maximum number of captured substrings is 99, and the 
      maximum number of all subpatterns, both capturing and non-capturing, is 
      200.  

      As a convenient shorthand, if any option settings are required at the 
      start of a non-capturing subpattern, the option letters may appear 
      between the "?" and the ":".  Thus the two patterns 


        (?i:saturday|sunday)
        (?:(?i)saturday|sunday)

      match exactly the same set of strings.  Because alternative branches are 
      tried from left to right, and options are not reset until the end of the 
      subpattern is reached, an option setting in one branch does affect 
      subsequent branches, so the above patterns match "SUNDAY" as well as 
      "Saturday".  
    * 
#SEC21
      REPETITION 

      Repetition is specified by quantifiers, which can follow any of the 
      following items: 


        a single character, possibly escaped
        the . metacharacter
        a character class
        a back reference (see next section)
        a parenthesized subpattern (unless it is an assertion - see below)

      The general repetition quantifier specifies a minimum and maximum number 
      of permitted matches, by giving the two numbers in curly brackets 
      (braces), separated by a comma.  The numbers must be less than 65536, 
      and the first must be less than or equal to the second.  For example: 


        z{2,4}

      matches "zz", "zzz", or "zzzz".  A closing brace on its own is not a 
      special character.  If the second number is omitted, but the comma is 
      present, there is no upper limit; if the second number and the comma are 
      both omitted, the quantifier specifies an exact number of required 
      matches.  Thus 


        [aeiou]{3,}

      matches at least 3 successive vowels, but may match many more, while 


        \d{8}

      matches exactly 8 digits.  An opening curly bracket that appears in a 
      position where a quantifier is not allowed, or one that does not match 
      the syntax of a quantifier, is taken as a literal character.  For 
      example, {,6} is not a quantifier, but a literal string of four 
      characters.  

      The quantifier {0} is permitted, causing the expression to behave as if 
      the previous item and the quantifier were not present.  

      For convenience (and historical compatibility) the three most common 
      quantifiers have single-character abbreviations: 


        *    is equivalent to {0,}
        +    is equivalent to {1,}
        ?    is equivalent to {0,1}

      It is possible to construct infinite loops by following a subpattern 
      that can match no characters with a quantifier that has no upper limit, 
      for example: 


        (a?)*

      Earlier versions of Perl and PCRE used to give an error at compile time 
      for such patterns.  However, because there are cases where this can be 
      useful, such patterns are now accepted, but if any repetition of the 
      subpattern does in fact match no characters, the loop is forcibly 
      broken.  

      By default, the quantifiers are "greedy", that is, they match as much as 
      possible (up to the maximum number of permitted times), without causing 
      the rest of the pattern to fail.  The classic example of where this 
      gives problems is in trying to match comments in C programs.  These 
      appear between the sequences /* and */ and within the sequence, 
      individual * and / characters may appear.  An attempt to match C 
      comments by applying the pattern 


        /\*.*\*/

      to the string 


        /* first command */  not comment  /* second comment */

      fails, because it matches the entire string due to the greediness of the 
      .* item.  

      However, if a quantifier is followed by a question mark, then it ceases 
      to be greedy, and instead matches the minimum number of times possible, 
      so the pattern 


        /\*.*?\*/

      does the right thing with the C comments.  The meaning of the various 
      quantifiers is not otherwise changed, just the preferred number of 
      matches.  Do not confuse this use of question mark with its use as a 
      quantifier in its own right.  Because it has two uses, it can sometimes 
      appear doubled, as in 


        \d??\d

      which matches one digit by preference, but can match two if that is the 
      only way the rest of the pattern matches.  

      If the "U" (PCRE_UNGREEDY) option is set (an option which is not 
      available in Perl) then the quantifiers are not greedy by default, but 
      individual ones can be made greedy by following them with a question 
      mark.  In other words, it inverts the default behaviour.  

      When a parenthesized subpattern is quantified with a minimum repeat 
      count that is greater than 1 or with a limited maximum, more store is 
      required for the compiled pattern, in proportion to the size of the 
      minimum or maximum.  

      If a pattern starts with .* or .{0,}, then the pattern is implicitly 
      anchored, because whatever follows will be tried against every character 
      position in the subject string, so there is no point in retrying the 
      overall match at any position after the first.  PCRE treats such a 
      pattern as though it were preceded by \A.  

      When a capturing subpattern is repeated, the value captured is the 
      substring that matched the final iteration.  For example, after 


        (tweedle[dume]{3}\s*)+

      has matched "tweedledum tweedledee" the value of the captured substring 
      is "tweedledee".  However, if there are nested capturing subpatterns, 
      the corresponding captured values may have been set in previous 
      iterations.  For example, after 


        /(a|(b))+/

      matches "aba" the value of the second captured substring is "b".  
    * 
#SEC22
      BACK REFERENCES 

      Outside a character class, a backslash followed by a digit greater than 
      0 (and possibly further digits) is a back reference to a capturing 
      subpattern earlier (i.e.  to its left) in the pattern, provided there 
      have been that many previous capturing left parentheses.  

      However, if the decimal number following the backslash is less than 10, 
      it is always taken as a back reference, and causes an error only if 
      there are not that many capturing left parentheses in the entire 
      pattern.  In other words, the parentheses that are referenced need not 
      be to the left of the reference for numbers less than 10.  See the 
      section entitled "Backslash" above for further details of the handling 
      of digits following a backslash.  

      A back reference matches whatever actually matched the capturing 
      subpattern in the current subject string, rather than anything matching 
      the subpattern itself.  So the pattern 


        (sens|respons)e and \1ibility

      matches "sense and sensibility" and "response and responsibility", but 
      not "sense and responsibility".  If caseful matching is in force at the 
      time of the back reference, then the case of letters is relevant.  For 
      example, 


        ((?i)rah)\s+\1

      matches "rah rah" and "RAH RAH", but not "RAH rah", even though the 
      original capturing subpattern is matched caselessly.  

      There may be more than one back reference to the same subpattern.  If a 
      subpattern has not actually been used in a particular match, then any 
      back references to it always fail.  For example, the pattern 


        (a|(bc))\2

      always fails if it starts to match "a" rather than "bc".  Because there 
      may be up to 99 back references, all digits following the backslash are 
      taken as part of a potential back reference number.  If the pattern 
      continues with a digit character, then some delimiter must be used to 
      terminate the back reference.  If the "x" (PCRE_EXTENDED) option is set, 
      this can be whitespace.  Otherwise an empty comment can be used.  

      A back reference that occurs inside the parentheses to which it refers 
      fails when the subpattern is first used, so, for example, (a\1) never 
      matches.  However, such references can be useful inside repeated 
      subpatterns.  For example, the pattern 


        (a|b\1)+

      matches any number of "a"s and also "aba", "ababaa" etc.  At each 
      iteration of the subpattern, the back reference matches the character 
      string corresponding to the previous iteration.  In order for this to 
      work, the pattern must be such that the first iteration does not need to 
      match the back reference.  This can be done using alternation, as in the 
      example above, or by a quantifier with a minimum of zero.  
    * 
#SEC23
      ASSERTIONS 

      An assertion is a test on the characters following or preceding the 
      current matching point that does not actually consume any characters.  
      The simple assertions coded as \b, \B, \A, \Z, \z, ^ and $ are described 
      above.  More complicated assertions are coded as subpatterns.  There are 
      two kinds: those that look ahead of the current position in the subject 
      string, and those that look behind it.  

      An assertion subpattern is matched in the normal way, except that it 
      does not cause the current matching position to be changed.  Lookahead 
      assertions start with (?= for positive assertions and (?! for negative 
      assertions.  For example, 


        \w+(?=;)

      matches a word followed by a semicolon, but does not include the 
      semicolon in the match, and 


        foo(?!bar)

      matches any occurrence of "foo" that is not followed by "bar".  Note 
      that the apparently similar pattern 


        (?!foo)bar

      does not find an occurrence of "bar" that is preceded by something other 
      than "foo"; it finds any occurrence of "bar" whatsoever, because the 
      assertion (?!foo) is always true when the next three characters are 
      "bar".  A lookbehind assertion is needed to achieve this effect.  

      Lookbehind assertions start with (?<= for positive assertions and (?<! 
      for negative assertions.  For example, 


        (?<!foo)bar

      does find an occurrence of "bar" that is not preceded by "foo".  The 
      contents of a lookbehind assertion are restricted such that all the 
      strings it matches must have a fixed length.  However, if there are 
      several alternatives, they do not all have to have the same fixed 
      length.  Thus 


        (?<=bullock|donkey)

      is permitted, but 


        (?<!dogs?|cats?)

      causes an error at compile time.  Branches that match different length 
      strings are permitted only at the top level of a lookbehind assertion.  
      This is an extension compared with Perl 5.005, which requires all 
      branches to match the same length of string.  An assertion such as 


        (?<=ab(c|de))

      is not permitted, because its single top-level branch can match two 
      different lengths, but it is acceptable if rewritten to use two 
      top-level branches: 


        (?<=abc|abde)

      The implementation of lookbehind assertions is, for each alternative, to 
      temporarily move the current position back by the fixed width and then 
      try to match.  If there are insufficient characters before the current 
      position, the match is deemed to fail.  Lookbehinds in conjunction with 
      once-only subpatterns can be particularly useful for matching at the 
      ends of strings; an example is given at the end of the section on 
      once-only subpatterns.  

      Several assertions (of any sort) may occur in succession.  For example, 


        (?<=\d{3})(?<!999)foo

      matches "foo" preceded by three digits that are not "999".  Notice that 
      each of the assertions is applied independently at the same point in the 
      subject string.  First there is a check that the previous three 
      characters are all digits, then there is a check that the same three 
      characters are not "999".  This pattern does <not> match "foo" preceded 
      by six characters, the first of which are digits and the last three of 
      which are not "999".  For example, it doesn't match "123abcfoo".  A 
      pattern to do that is 


        (?<=\d{3}...)(?<!999)foo

      This time the first assertion looks at the preceding six characters, 
      checking that the first three are digits, and then the second assertion 
      checks that the preceding three characters are not "999".  

      Assertions can be nested in any combination.  For example, 


        (?<=(?<!foo)bar)baz

      matches an occurrence of "baz" that is preceded by "bar" which in turn 
      is not preceded by "foo", while 


        (?<=\d{3}(?!999)...)foo

      is another pattern which matches "foo" preceded by three digits and any 
      three characters that are not "999".  

      Assertion subpatterns are not capturing subpatterns, and may not be 
      repeated, because it makes no sense to assert the same thing several 
      times.  If any kind of assertion contains capturing subpatterns within 
      it, these are counted for the purposes of numbering the capturing 
      subpatterns in the whole pattern.  However, substring capturing is 
      carried out only for positive assertions, because it does not make sense 
      for negative assertions.  

      Assertions count towards the maximum of 200 parenthesized subpatterns.  
    * 
#SEC24
      ONCE-ONLY SUBPATTERNS 

      With both maximizing and minimizing repetition, failure of what follows 
      normally causes the repeated item to be re-evaluated to see if a 
      different number of repeats allows the rest of the pattern to match.  
      Sometimes it is useful to prevent this, either to change the nature of 
      the match, or to cause it fail earlier than it otherwise might, when the 
      author of the pattern knows there is no point in carrying on.  

      Consider, for example, the pattern \d+foo when applied to the subject 
      line 


        123456bar

      After matching all 6 digits and then failing to match "foo", the normal 
      action of the matcher is to try again with only 5 digits matching the 
      \d+ item, and then with 4, and so on, before ultimately failing.  
      Once-only subpatterns provide the means for specifying that once a 
      portion of the pattern has matched, it is not to be re-evaluated in this 
      way, so the matcher would give up immediately on failing to match "foo" 
      the first time.  The notation is another kind of special parenthesis, 
      starting with (?> as in this example: 


        (?>\d+)bar

      This kind of parenthesis "locks up" the part of the pattern it contains 
      once it has matched, and a failure further into the pattern is prevented 
      from backtracking into it.  Backtracking past it to previous items, 
      however, works as normal.  

      An alternative description is that a subpattern of this type matches the 
      string of characters that an identical standalone pattern would match, 
      if anchored at the current point in the subject string.  

      Once-only subpatterns are not capturing subpatterns.  Simple cases such 
      as the above example can be thought of as a maximizing repeat that must 
      swallow everything it can.  So, while both \d+ and \d+? are prepared to 
      adjust the number of digits they match in order to make the rest of the 
      pattern match, (?>\d+) can only match an entire sequence of digits.  

      This construction can of course contain arbitrarily complicated 
      subpatterns, and it can be nested.  

      Once-only subpatterns can be used in conjunction with lookbehind 
      assertions to specify efficient matching at the end of the subject 
      string.  Consider a simple pattern such as 


        abcd$

      when applied to a long string which does not match it.  Because matching 
      proceeds from left to right, PCRE will look for each "a" in the subject 
      and then see if what follows matches the rest of the pattern.  If the 
      pattern is specified as 


        ^.*abcd$

      then the initial .* matches the entire string at first, but when this 
      fails, it backtracks to match all but the last character, then all but 
      the last two characters, and so on.  Once again the search for "a" 
      covers the entire string, from right to left, so we are no better off.  
      However, if the pattern is written as 


        ^(?>.*)(?<=abcd)

      then there can be no backtracking for the .* item; it can match only the 
      entire string.  The subsequent lookbehind assertion does a single test 
      on the last four characters.  If it fails, the match fails immediately.  
      For long strings, this approach makes a significant difference to the 
      processing time.  
    * 
#SEC25
      CONDITIONAL SUBPATTERNS 

      It is possible to cause the matching process to obey a subpattern 
      conditionally or to choose between two alternative subpatterns, 
      depending on the result of an assertion, or whether a previous capturing 
      subpattern matched or not.  The two possible forms of conditional 
      subpattern are 


        (?(condition)yes-pattern)
        (?(condition)yes-pattern|no-pattern)

      If the condition is satisfied, the yes-pattern is used; otherwise the 
      no-pattern (if present) is used.  If there are more than two 
      alternatives in the subpattern, a compile-time error occurs.  

      There are two kinds of condition.  If the text between the parentheses 
      consists of a sequence of digits, then the condition is satisfied if the 
      capturing subpattern of that number has previously matched.  Consider 
      the following pattern, which contains non-significant white space to 
      make it more readable (assume the "x" PCRE_EXTENDED option) and to 
      divide it into three parts for ease of discussion: 


        ( \( )?    [^()]+    (?(1) \) )

      The first part matches an optional opening parenthesis, and if that 
      character is present, sets it as the first captured substring.  The 
      second part matches one or more characters that are not parentheses.  
      The third part is a conditional subpattern that tests whether the first 
      set of parentheses matched or not.  If they did, that is, if subject 
      started with an opening parenthesis, the condition is true, and so the 
      yes-pattern is executed and a closing parenthesis is required.  
      Otherwise, since no-pattern is not present, the subpattern matches 
      nothing.  In other words, this pattern matches a sequence of 
      non-parentheses, optionally enclosed in parentheses.  

      If the condition is not a sequence of digits, it must be an assertion.  
      This may be a positive or negative lookahead or lookbehind assertion.  
      Consider this pattern, again containing non-significant white space, and 
      with the two alternatives on the second line: 


        (?(?=[^a-z]*[a-z])
        \d{2}[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )

      The condition is a positive lookahead assertion that matches an optional 
      sequence of non-letters followed by a letter.  In other words, it tests 
      for the presence of at least one letter in the subject.  If a letter is 
      found, the subject is matched against the first alternative; otherwise 
      it is matched against the second.  This pattern matches strings in one 
      of the two forms dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are 
      digits.  
    * 
#SEC26
      COMMENTS 

      The sequence (?# marks the start of a comment which continues up to the 
      next closing parenthesis.  Nested parentheses are not permitted.  The 
      characters that make up a comment play no part in the pattern matching 
      at all.  

      If the "x" PCRE_EXTENDED option is set, an unescaped # character outside 
      a character class introduces a comment that continues up to the next 
      newline character in the pattern.  
    * 
#SEC27
      PERFORMANCE 

      Certain items that may appear in patterns are more efficient than 
      others.  It is more efficient to use a character class like [aeiou] than 
      a set of alternatives such as (a|e|i|o|u).  In general, the simplest 
      construction that provides the required behaviour is usually the most 
      efficient.  Jeffrey Friedl's book contains a lot of discussion about 
      optimizing regular expressions for efficient performance.  

      Beware of patterns that contain nested indefinite repeats.  These can 
      take a long time to run when applied to a string that does not match.  
      Consider the pattern fragment 


        (a+)*

      This can match "aaaa" in 33 different ways, and this number increases 
      very rapidly as the string gets longer.  (The * repeat can match 0, 1, 
      2, 3, or 4 times, and for each of those cases other than 0, the + 
      repeats can match different numbers of times.) When the remainder of the 
      pattern is such that the entire match is going to fail, PCRE has in 
      principle to try every possible variation, and this can take an 
      extremely long time.  

      An optimization catches some of the more simple cases such as 


        (a+)*b

      where a literal character follows.  Before embarking on the standard 
      matching procedure, PCRE checks that there is a "b" later in the subject 
      string, and if there is not, it fails the match immediately.  However, 
      when there is no following literal this optimization cannot be used.  
      You can see the difference by comparing the behaviour of 


        (a+)*\d

      with the pattern above.  The former gives a failure almost instantly 
      when applied to a whole line of "a" characters, whereas the latter takes 
      an appreciable time with strings longer than about 20 characters.  
    * 
#SEC28
      AUTHOR 

      Philip Hazel <ph10@cam.ac.uk> 
      University Computing Service, 
      New Museums Site, 
      Cambridge CB2 3QG, England.  
      Phone: +44 1223 334714 

      Last updated: 29 July 1999 
      Copyright (c) 1997-1999 University of Cambridge.  

&priorities
&fallthru
&fall-thru
&selection
&priority
&priority rules

priority

  When more than one macro is matched by a trigger or hooked event, the 
  following rules are used to select which of the macros will be applied 
  (i.e., have its attributes applied to the text, and its body executed): 

    * Macros are compared in order of decreasing priority.  
    * Fall-thrus of a given priority are compared before non-fall-thrus of 
      the same priority.  
    * Each matching fall-thru macro is applied immediately when it is 
      found.  
    * When the first matching non-fall-thru macro is found, all the 
      non-fall-thrus of equal priority are collected, and the search ends.  
      One of the non-fall-thrus is chosen at random and applied.  

  So, in the simple case when there are no fall-thrus, the highest priority 
  match is chosen.  If there is more than one of the highest priority, one of 
  those is chosen at random.  

  These priority rules apply even to macros defined or undefined by a macro 
  found during the search.  For example, if a mud line triggers a fall-thru 
  macro /foo, and /foo defines a new trigger macro /bar which also matches the 
  line, then /bar may be triggered if it has lower priority than /foo.  

  A macro's priority is set with /def -p; its fall-thru option is set with 
  /def -F.  

  Use the /trigger -n command to display a list of the triggers triggers or 
  hooks will match a given string.  

  See: triggers, hooks, macros, /def 

&bug
&bugs
&core
&crash
&error
&report
&hawkeye
&kkeys
&kenkeys
&author
&support
&problems

problems

  If you have an old version of TF, chances are your bug has already been 
  fixed.  Current information and the latest version of TF can be found at 
  http://tinyfugue.sourceforge.net/.  

  For general bug reports, questions, etc, visit the website above 
  (preferred), or email kenkeys@users.sourceforge.net.  For problems specific 
  to the OS/2 version, contact Andreas Sahlbach at asa@stardiv.de.  When 
  reporting a problem or bug, please provide this information: 

    * The full version number of TF (type "/version" in tf).  Please give 
      the full number, don't just say something like "beta 4" or "the latest 
      version".  
    * The operating system name and version.  (On unix systems, type 
      "uname -a" in the shell to get the exact version information.) 
    * If tf won't install, send the output of the installation process (on 
      UNIX, that's the output of configure and make).  Don't leave out parts 
      just because you don't know what they mean or think they're irrelevant.  
    * If you have a bug or core: do NOT send the core file, but do send 
      the debugging dump file (tf.<NNNNN>.dump) if tf generated one.  If not, 
      give me ALL messages from tf (not just the last line).  In either case, 
      tell me what you did or what happened before the problem, and whether 
      the problem is repeatable.  
    * Optional: If you have a core, you know how to use a debugger, tf was 
      compiled with core dumps enabled, and tf did not generate a debugging 
      dump file, a manual stack trace would be useful (use the 'bt full' 
      command in gdb or 'where' in dbx).  If you don't know how, at least 
      provide the other information described above.  

#
  The following bugs are known.  Don't bother reporting them.  

    * The %{lp} and %{emulation} variables should work on a per-socket 
      basis (This is partially overcome with WORLD hooks).  
    * If a shell quote (/quote !) reads a partial line from the child 
      process, tf will hang until the line is completed.  
    * /recall by timestamp doesn't work when switching to/from daylight 
      savings time (but /recall by age always works).  

&tinyprocesses
&process
&proc
&processes

processes

  Associated topics: 

  /quote
  /repeat
  /ps
  /kill
  %ptime
  %lpquote

  The /quote and /repeat commands in Fugue are done by setting up internal 
  processes that run concurrently with normal input and output.  

  /ps can be used to get a listing of the currently running processes and 
  their process ID's (for use with /kill).  

  /kill can be used to terminate a process.  

  Processes can be either synchronous or asynchronous.  Synchronous processes 
  (started with the -S option) run immediately when they are started, and run 
  to completion (unless TF is interrupted) before any other commands are 
  executed.  Synchronous processes are new in version 3.3 beta 10.  

  Asynchronous processes are merely scheduled to be run by a /quote or /repeat 
  command; the actual execution occurs at some later time.  They can be run 
  based on two different criteria: 

  1.  Normally, processes run whenever a specific period of time has elapsed.  
  The delay can be specified when the process is started, or will default to 
  the value of %{ptime}.  

  2.  If the %{lpquote} flag is on or the process was started with the -P 
  option, a process run whenever a prompt is received from the server, 
  indicating that the previous command has completed.  If the process was 
  started with a -w option, only prompts from the specified world will trigger 
  its execution.  Example: 

          /quote -P /send `/_echo n%; /_echo w%; /_echo w%; /_echo s

  will send the commands "n", "w", "w", and "s", waiting between each one 
  until the prompt following the previous command is seen.  

  If an asynchronous /quote or /repeat is followed immediately by another 
  command, the other command will run first, because the asynchronous process 
  was only scheduled, not actually executed (even with -n or -0 options).  Use 
  a synchronous /quote or /repeat to force the process to run before any other 
  commands.  

  Bodies of /repeat undergo macro body expansion when they are executed; text 
  generated by /quote does not.  

  See also: utilities (/at, /tick) 

&goahead
&eor
&end-of-record
&prompt protocol

prompt protocol

  TF will recognize the TELNET protocol commands GOAHEAD or END-OF-RECORD as 
  the end of a prompt.  If you are responsible for a server that has prompts, 
  and wish to make it more friendly to TF users, choose one of these options: 

  GOAHEAD: Send IAC GA (\377 \371) after each prompt.  This is the easier of 
  the two options.  In many servers, this can be done at the beginning of the 
  routine that reads user input.  Disadvantage: could possibly cause problems 
  in clients that don't understand TELNET protocol (but usually, they will 
  just pass it through to the terminal, which will usually ignore it).  

  END-OF-RECORD: Send IAC WILL EOR (\377 \373 \031) when the user connects.  
  If the client responds with IAC DO EOR, then you can send IAC END-OF-RECORD 
  (\377 \357) after each prompt; otherwise, do nothing special in prompts.  
  Disadvantage: requires extra state per descriptor and more understanding of 
  telnet protocol.  Advantage: minimizes potential problems for clients that 
  do not recognize telnet protocol.  

  To debug telnet option negotiations, you may find it useful to "/set telopt 
  on" in TF.  

  For more information on TELNET protocol, see RFCs 854, 855, 885, and 1123.  

  See also: /telnet, telopt, prompts, protocols 

&lp
&diku
&prompt
&prompts

prompts

  Most LP muds, Diku muds, telnetd, and some other types of servers send 
  unterminated prompts, that is, prompts that do not end with newline or any 
  other special character.  Normally, TF will not display text until a newline 
  is received, so you may not see the prompt until after you press return.  
  But if the %{lp} flag is on, TF will attempt to separate these prompts from 
  normal text and display them correctly.  

  The recommended way to use the %{lp} flag is to define your worlds with one 
  of the /addlp, /adddiku, or /addtelnet commands.  The %{lp} flag will be 
  turned on automatically when you switch to such a world, and turned off for 
  the other predefined world types.  See: /addworld.  

  TF also provides a PROMPT hook, which allows you to tell it what to look for 
  in a prompt.  When an unterminated line is received, the PROMPT hook is 
  called immediately.  If there is no match, TF will use the timeout method 
  described below (if %{lp} is on).  But if there is a matching PROMPT hook, 
  TF will forget about the line (unless the hook was defined with /def -q) and 
  let the hook deal with it.  By combining the PROMPT hook with the /prompt 
  command, you can recognize most prompts immediately without having to use 
  the %{lp} timing mechanism.  The typical way of doing this is: 

      /def -h"PROMPT *> " catch_prompt = /test prompt({*})

  So, whenever TF receives an unterminated line that ends in "> ", 
  catch_prompt will see it, and use /prompt to copy it to the current prompt.  

  If an unterminated line is not matched by any PROMPT hook, and it is not 
  followed by more text within a short period of time, TF will assume it is a 
  prompt.  This method is not foolproof.  If the delay is too short, broken 
  lines will look like prompts, and will briefly appear in the input window 
  until the rest of the line arrives, at which time both parts of the line 
  will be printed as normal output.  If the delay is too long, there will be 
  an annoying delay before displaying real prompts.  

  The delay can be varied by setting the variable prompt_wait.  Its default 
  value is 0.25 seconds.  

  All of this hackery can be avoided if the server sends unambiguous prompts.  
  TF will recognize "*\b" (that is, "*" followed by backspace) and anything 
  ending with GOAHEAD or END-OF-RECORD telnet characters.  When TF sees such 
  text, it does not wait for a delay, but calls the PROMPT hook immediately; 
  if there is no match, TF displays the prompt immediately.  To avoid some 
  minor glitches, you should leave the %{lp} flag off when connected to such a 
  server.  If you are responsible for a server and wish to make it more 
  TF-friendly, see "prompt protocol".  

  See also: %login, prompt protocol, /addworld 

&protocol
&ip
&ipv4
&ipv6
&ssl
&rfc
&rfcs
&protocols

Protocols

  TF supports the following protocols: 

    * TCP over IPv4 (RFC 791) 
    * TCP over IPv6 (RFC 2460, 3493), if supported by the host 
    * TELNET Protocol (RFC 854, 855) (See: telnet) 
    * Generic proxy servers (See: proxy) 
    * ANSI display attributes (See: %emulation) 
    * EOR and GOAHEAD prompt protocol (See: prompt protocol) 
    * Mud Client Compression Protocol version 2, if TF was compiled with 
      zlib (See: mccp) 
    * Secure Socket Layer (SSL), if TF was compiled with libssl.  (See: 
      addworld, connect) 

  RFCs can be obtained from 

    * http://www.rfc-editor.org/rfc.html 
    * http://info.internet.isi.edu/1/in-notes/rfc 
    * http://www.garlic.com/~lynn/rfcietf.html 
    * http://www.cis.ohio-state.edu/hypertext/information/rfc.html 
    * ftp://wuarchive.wustl.edu/doc/rfc/ 
    * ftp://nis.nsf.net/documents/rfc/ 
    * ftp://src.doc.ic.ac.uk/rfc/ 

  and other sites.  

&firewall
&proxy
&/proxy_connect
&/proxy_command
&proxy server

proxy server

  If %{proxy_host} is set, all connections will go through a proxy server 
  (firewall) defined by %proxy_host and %proxy_port.  Note that %{proxy_host} 
  should usually not be set if TF has been compiled to use SOCKS.  

  When the connection to %proxy_host %proxy_port is made, only the PROXY hook 
  is called; the CONNECT and LOGIN hooks which are normally called after 
  making a connection are not called when a proxy is used.  A PROXY hook 
  defined in the standard library calls /proxy_command, which by default sends 
  "telnet ${world_host} ${world_port}", and then invoke the CONNECT and LOGIN 
  hooks (which, by default, bring the world into the foreground and perform an 
  automatic login).  

  Before the connection to the proxy server is made, ${world_host}, 
  ${world_port}, error messages, and /listsockets all refer to the proxy 
  server; after the connection is made, they refer to the target server 
  defined in /addworld.  

  The proxy connection command is done with this standard macro: 

  /def -i proxy_connect = telnet ${world_host} ${world_port}

  If your proxy server requires a different command, you should redefine 
  proxy_connect.  That will be sufficient for most proxy servers.  (Before 
  version 5.0, a custom connect command required you to redefine 
  proxy_command.  This should be avoided now if possible.) 

  If your proxy server has more complex requirements, or you want better error 
  detection, you will need to redefine the proxy_command macro.  By default, 
  proxy_command immediately calls /proxy_connect, enables localecho, and 
  invokes the CONNECT and LOGIN hooks.  There are several reasons you might 
  want to redefine proxy_command: 

    * The default proxy_command can not detect when proxy_connect fails, 
      so it will always send your login command even if the proxy server did 
      not connect to the target server.  
    * Your proxy server may not accept commands immediately, so 
      proxy_command should wait for some indication that the proxy server is 
      ready before sending commands.  

  For example, say you use a Gauntlet telnet proxy that leaves localecho off; 
  prints a "tn-gw->" prompt; requires you to send "telnet <hostname> <port>" 
  to connect; after a successful connection, prints "Connected to <hostname>"; 
  and after a failed connection prints an error message and prints another 
  prompt.  So, you could use this definition: 

  /def proxy_command =\
      /def -p10000 -w -1 -h'PROMPT tn-gw->' =\
          /proxy_connect%%; \
          /localecho on%%; \
          /def -p10002 -w -1 -h'PROMPT tn-gw->' proxy_error_$${world_name} =\
              /undef proxy_success_$$${world_name}%%%;\
              /dc%%;\
          /def -p10002 -w -1 -t'Connected to *' proxy_success_$${world_name} =\
              /undef proxy_error_$$${world_name}%%%;\
              /trigger -hCONNECT $$${world_name}%%%;\
              /if ($$${world_character} !~ "" & $$${world_login}) \
                  /trigger -hLOGIN ${world_name}%%%;\
              /endif

  The first /def waits for the first prompt before doing anything.  It then 
  sends the connection command, turns localecho back on, and sets up macros to 
  catch the results of the connection command.  The success trigger undefines 
  the error hook, and invokes the CONNECT and LOGIN hooks.  The error hook 
  undefines the success trigger and disconnects from the proxy.  

  See: /addworld, %proxy_host, %proxy_port 

&redirection

redirection

  If TF is started with input or output redirected, %more will be ignored and 
  SIGINT (^C) will kill TF without prompting.  TF will not exit when EOF is 
  reached; the /quit command must be given explicitly.  

  On UNIX systems, it is possible to write a tf script starting with the 
  lines: 

      #!/bin/sh
      exec tf -n $* <$0

  and following with any tf commands.  The file can then be executed directly 
  like a shell script.  

&scrolling
&scrollback
&windows
&window
&virtual window
&virtual windows

virtual windows

  Starting in version 5.0, TF maintains a separate virtual window for each 
  open socket, including the "(no world)" pseudo-socket.  Normally, a window 
  scrolls when text is written to it.  If the more flag is set, automatic 
  scrolling will stop when the window becomes full.  You can manually scroll 
  forwards and backwards in each socket's window using the keys in the table 
  below.  

  Per-socket windows make it unnecessary to finish reading the text on one 
  socket before switching to another.  When you bring a new socket into the 
  foreground, the old socket's window is hidden, but remembers all of its text 
  and current position; when you return that old socket to the foreground, the 
  text is redrawn at the remembered position, and you can resume reading where 
  you left off.  A dividing line makes it easy to find the point where the old 
  text ends and the new text begins.  The text of a window is also refilled 
  after resuming from /suspend or /sh, and even when the terminal's size 
  changes.  

  In the table below, the "/dokey" columns indicate the argument to the /dokey 
  command that performs the scrolling, and the "keys" column indicates the 
  default keystrokes that perform the scrolling.  

      scroll       ....forward....   ...backward....
      amount       /dokey  keys      /dokey     keys
      -----------  ------- -------   ---------- ----
      normal       PgDn    PgDn      PgUp       PgUp
      1/2 screen   hpage   ^[h ^X]   hpageback  ^X[
      1 screen     page    TAB ^X}   pageback   ^X{
      1 line       line    ^[^N      lineback   ^[^P

  Note that the line-scrolling keys may be typable as meta-ctrl-n and 
  meta-ctrl-p (depending on your %meta_esc and locale).  "Normal" scrolling is 
  a full screenful by default.  If you prefer PgUp and PgDn to scroll a half 
  screen instead, you should redefine 

      /def key_pgdn = /dokey_hpage
      /def key_pgup = /dokey_hpageback

  Some terminal emulators do not send PgUp and PgDn keys to tf.  If you have 
  such a terminal, you may wish to 

      /bind ^F = /dokey_page
      /bind ^B = /dokey_pageback

  If you're an emacs user, you may want to bind 

      /bind ^V = /dokey_page
      /bind ^[v = /dokey_pageback

  (or, "/load kb-emacs.tf").  

  A virtual screen can be redrawn with ^L, or cleared with ^[^L (ESC ctrl-L).  
  Once lines are cleared from a screen, they can be redrawn by scrolling back 
  to them.  They are not automatically redrawn when you hide the screen and 
  then unhide it again.  

  Some hooks need to print messages that do not make sense at the bottom of 
  the foreground window (as they did before version 5.0).  For example, if you 
  have world Foo in the foreground, and get activity in world Bar, it would 
  not make sense for the ACTIVITY hook to print "% Activity in world Bar" to 
  Foo's window.  Firstly, you might want to know about the activity even if 
  you are not at the end of Foo's window buffer.  Secondly, after you read the 
  text in Bar and returned to Foo, the message would still be at the bottom of 
  Foo's window buffer, misleadingly.  Many messages of this type are now 
  delivered as "alerts".  An alert appears temporarily on the status line, 
  where you can see it immediately and it will not outlive its usefulness.  
  Also, because text from different worlds is not mixed in 5.0, the WORLD hook 
  no longer prints "--- World <name> ---".  

  The /limit command will filter the text displayed in a window.  The counters 
  in the more prompt will count only the lines that match the limit.  

  If your terminal emulator has its own scrollback, it probably will not work 
  very well with tf.  To avoid confusion and avoid polluting your terminal's 
  scrollback with garbage, tf tries to switch to the terminal's "alternate 
  buffer", which does not keep scrollback.  But not all terminals and 
  configurations allow this (for example, xterm does, but only if the termcap 
  or terminfo entry contains the correct codes, and it has not been disabled 
  with xterm's titeInhibit resource).  If the terminal can not switch to an 
  alternate buffer, the terminal's scrollback may appear to work for a while, 
  but will become jumbled as soon as you switch worlds in tf or use tf's 
  scrollback.  You are advised to not attempt to use your terminal's 
  scrollback at all while running tf.  

  See also: interface, visual, /limit, keybindings.  
&interrupt
&hangup
&sigwinch
&signals

signals

  TF catches several signals from the operating system and handles them 
  specially: 
  SIGINT (normally generated by typing ^C) 
          Aborts any running macro or blocking hostname resolution or connect, 
          and, if interactive is on, offers a menu of choices:
          C) continue tf; X) exit; T) disable triggers; P) kill processes.  If 
          interactive is off, tf exits without prompting.  
  SIGQUIT (normally generated by typing ^\) 
          If interactive is on, TF prompts the user to quit.  If the answer is 
          'y', or interactive is off, TF will dump a core file if configured 
          to do so, and exit.  
  SIGTERM 
          Calls the SIGTERM hook, and then exits TF.  
  SIGHUP (normally generated when the terminal disconnects) 
          Calls the SIGHUP hook, and then exits TF if SIGHUP was not ignored 
          when tf was started.  
  SIGUSR1 
          Calls the SIGUSR1 hook.  TF does not exit.  
  SIGUSR2 
          Calls the SIGUSR2 hook.  TF does not exit.  
  SIGTSTP (normally generated by typing ^Z) 
          Suspends the TF process, like /suspend.  
  SIGWINCH (normally generated by resizing the terminal) 
          Redraws the screen, and calls the RESIZE hook.  

  See also: hooks, /signal 

&
&sockets

sockets

  Associated topics: 
  /connect 
          open a socket connection to a world 
  /dc     close (disconnect) a socket 
  /fg     bring a socket into the foreground 
  %login  enable automatic login 
  /listsockets 
          display a list of open sockets 
  fg_world() 
          name of foreground world 
  idle()  idle time 
  nactive() 
          number of active sockets, or number of undisplayed lines 
  is_connected() 
          tests whether a socket is connected 
  is_open() 
          tests whether a socket is open 
  %background 
          determines when to process text from background sockets 
  %bg_output 
          determines how to display text from background sockets 

#current
#foreground
#background
#foreground/background/current
  A socket is a world-in-use, including a network connection (usually) and a 
  virtual window for displaying text.  TF can have multiple sockets open 
  simultaneously.  Only one of these can be displayed at a time; this is 
  called the foreground socket.  In visual mode, the name of the world on the 
  foreground socket is displayed on the status line.  Other sockets are in the 
  background.  Text from any socket is triggered and stored in history 
  immediately, but is not displayed until that socket is brought into the 
  foreground.  Handling of events in background sockets can be customized with 
  the %{bg_output} and %{background} flags.  

  The current socket is the socket to which commands are sent.  The current 
  socket is almost always the same as the foreground socket, except: 1) when a 
  macro is triggered from any socket, that socket becomes the current socket 
  for the duration of that macro execution; 2) when a /repeat or /quote with 
  world redirection runs (-w option), that world's socket becomes the current 
  socket for the duration of the process execution.  

#
  Text from a socket goes through a number of checks before being displayed.  
  If the text matches any trigger patterns, a macro may be executed, or the 
  text may be gagged or hilited.  If the text was not gagged, TF also checks 
  to see if it should be suppressed because of %quiet, /watchdog or 
  /watchname.  Finally, the text is added to the world's history and the 
  global history, and is queued for display.  

  You can open a new socket in several ways: 

    * By giving the world name or address on the command line when 
      starting tf.  
    * By using a /connect or /world command.  
    * By "bamfing" through a portal between muds (see "bamf").  

  You can switch between foreground sockets with the /fg command; the /dokey 
  socketb and /dokey socketf commands, which by default are bound to ESC-left 
  and ESC-right; and with the ESC-w keybinding, which switches to the next 
  world with activity, or if there is none, to the last world you were on.  

  If the %{quitdone} flag is on, and you disconnect from all worlds (either 
  with /dc or because the other end of the socket's network connection 
  closes), TF will exit.  

  If the %{sockmload} flag is on, a world's macro file will be loaded when you 
  switch to the socket for that world (either with the next and previous 
  socket keys or with the /world command).  

  TF supports several TELNET options; see telnet.  

  If %{proxy_host} is defined, all connections will go through a proxy server. 
  See: proxy.  

  Normally, certain types of disconnection can only be detected when you try 
  to send something on a connection.  TF uses the socket option SO_KEEPALIVE 
  to detect such disconnections even when idle, but it usually takes at least 
  2 hours to detect.  The time limit is usually a property of the operating 
  system, and can not be set by TF or an unprivileged user.  
#loopback
#connectionless
#connectionless socket

  A "connectionless" socket is created when you /connect to a world that does 
  not have a host or port defined.  If the world also has the echo flag set, 
  any text you "send" to the socket is immediately "received", as if you were 
  connected to an echo server.  

  See also: worlds 

&flags
&globals
&global variables
&environment
&enumerated variable
&enumerated variables
&special
&special variable
&special variables

special variables

  Many options in TF can be controlled by setting special global variables.  
  Many variables have a limited number of permitted values, with corresponding 
  integer values; these are called enumerated variables.  All flags are 
  enumerated variables which can have the values "off" (0) or "on" (1).  
  Numeric variables can have any integer value (within the range allowed by 
  your system).  Attempting to unset numeric variable or give it a string 
  value will force its value to 0.  Dtime variables represent a time duration 
  or period; their values can be written as a number of seconds or in 
  hours:minutes[:seconds] format, with up to 6 decimal places (microseconds).  
  A variable's type (enumerated, numeric, dtime, or string) affects its 
  behavior in expressions.  

Special substitute-only variables

  The following special variables may be used only in substitutions, never as 
  a variable reference in an expression.  

##
#%#
  #       The number of words in a macro's argument text.  

#?
#%?
  ?       The string return value of the most recently executed command 
          (builtin or macro).  (Macros) called as functions return their value 
          and do not set %?.) 

#
  1,2... 
  L1,L2... 
  * 
  R       Positional parameters.  See "substitution".  (As of 5.0 beta 7, 
          these are case sensitive.) 

#
  P<n> 
  PL 
  PR      The text matched by the <n>th parenthesized subexpression, or the 
          text to the left or right of the matched text, in the last 
          successful regexp comparison.  See %Pn for more details.  (As of 5.0 
          beta 7, these are case sensitive.) 

#

Special global variables

  The following special global variables can be examined and set.  In the 
  following list, a '=' following a variable name indicates its default value. 
  For variables that do not have defaults listed, the default is dependent on 
  your system or configuration.  

#COLUMNS
#%COLUMNS
  COLUMNS 
          If this variable is set in the environment when TF starts, TF will 
          use its value instead of the value from the terminal driver.  See 
          %LINES, columns().  

#HOME
#%HOME
  HOME    Your home directory, used by /cd and filename expansion.  This is 
          usually inherited from the environment when TF starts.  

#LANG
#%LANG
  LANG    The current locale.  See locale.  Automatically exported to the 
          environment when set.  

#LC_ALL
#%LC_ALL
  LC_ALL  The current locale.  See locale.  Automatically exported to the 
          environment when set.  

#LC_CTYPE
#%LC_CTYPE
  LC_CTYPE 
          The current locale for character classification.  See locale.  
          Automatically exported to the environment when set.  

#LC_TIME
#%LC_TIME
  LC_TIME 
          The current locale for time formatting.  See locale.  Automatically 
          exported to the environment when set.  

#LINES
#%LINES
  LINES   If this variable is set in the environment when TF starts, TF will 
          use its value instead of the value from the terminal driver.  See 
          %COLUMNS, lines().  

#%MAIL
  MAIL    The name of a file which TF may check for mail.  See: mail.  

#SHELL
#%SHELL
  SHELL   Shell used by /sh and /quote !.  This is usually inherited from the 
          environment when TF starts.  

#terminal
#term
#TERM
#%TERM
  TERM    Terminal type.  Changing the value of %TERM at any time will cause 
          TF to re-initialize its display functions to use the new value.  The 
          value of %TERM should agree with your actual terminal or emulator.  
          If your emulator supports multiple terminal types, the recommended 
          type to use is vt220, vt100, or ansi (in that order).  %TERM is 
          usually inherited from the environment when TF starts.  See also: 
          mode.  

#TFHELP
#%TFHELP
  TFHELP=%{TFLIBDIR}/tf-help 
          The name of the file used by /help.  

#TFLIBDIR
#%TFLIBDIR
  TFLIBDIR 
          The name of the TF library directory, which should contain the help 
          file (tf-help), the standard library (stdlib.tf), the local library 
          (local.tf), and many useful utility files.  The default value of 
          TFLIBDIR is set when TF is installed, but can be overridden by 
          setting it in the environment before starting TF.  This directory 
          will be searched by /load if TFPATH is blank or not set.  See also: 
          /load.  

#TFLIBRARY
#%TFLIBRARY
  TFLIBRARY=%{TFLIBDIR}/stdlib.tf 
          The name of the library file loaded at startup.  This can be set in 
          the environment before starting TF, to load from an alternate 
          library file.  

#MAILPATH
#TFMAILPATH
#%TFMAILPATH
  TFMAILPATH 
          A space-separated list of files which TF may check for mail.  
          Literal spaces in a filename must be preceded by "\".  See: mail.  

#TFPATH
#%TFPATH
  TFPATH= 
          A space-separated list of directories that will be searched by 
          /load.  Literal spaces in a directory name must be preceded by "\".  
          If this is set, %{TFLIBDIR} will be ignored by /load, so be sure to 
          include the value of %{TFLIBDIR} in %{TFPATH} if you want to be able 
          to /load files with relative names from the standard library 
          directory.  See also: /load.  

#timezone
#time zone
#TZ
#%TZ
  TZ      On most systems, the timezone used to display formatted times.  In 
          the United States, the value is usually the local timezone name, 
          followed by the difference in hours from GMT, followed by an 
          optional daylight saving timezone name; for example, "PST8PDT".  For 
          details, see your system documentation for tzset(3) or environ(5).  
          This is usually inherited from the environment when TF starts, and 
          is automatically exported to the environment when set.  

#alert_attr
#%alert_attr
  alert_attr=Br 
          The attributes used to display alert text on the status line.  

#alert_time
#%alert_time
  alert_time=5.0 
          (dtime) The number of seconds that alert text is displayed on the 
          status line.  See tfio.  

#background
#%background
  background=on 
          (flag) If on, text from background worlds is processed and recorded 
          immediately upon receipt.  Otherwise, the text is ignored until the 
          socket is brought into the foreground.  In either case, the text is 
          not displayed until the socket is brought into the foreground (but 
          see %{bg_output}).  

#backslash
#%backslash
  backslash=on 
          (flag) Enables use of '\' to quote the following character literally 
          during macro expansion.  Generally, this should only be turned off 
          if you are having problems with '\' in macros written before version 
          3.0.  

#bamf
#%bamf
  bamf=off 
          (enumerated) 
          off     (0): server "portals" are ignored.  
          on      (1): Unter-style bamfing is enabled (disconnect).  
          old     (2): Old-style bamfing is enabled (no disconnect).  
          See /bamf.  

#bg_output
#%bg_output
  bg_output=on 
          (flag) When a world is brought into the foreground, %bg_output 
          determines how to display output that was produced while the world 
          was in the background: If on, the window display resumes where it 
          left off; if off, the window display jumps to the end, showing only 
          the last screenful.  Turning %bg_output off is equivalent to always 
          using the -q option with /fg.  The %bg_output flag has no effect on 
          other processing, including triggers and history.  This flag is 
          ignored if the %{background} flag is off.  %{background} is tested 
          when the world is foregrounded (in versions before 5.0, it was 
          tested when the text was received).  (See also: /fg -q) 

#binary_eol
#%binary_eol
  binary_eol=LF 
          Determines what to send as end-of-line marker in TELNET BINARY mode. 
          Valid values are "LF", "CR", and "CRLF".  (See: /telnet) 

#borg
#%borg
  borg=on 
          (flag) Enables trigger bodies (attributes are unaffected).  (See: 
          triggers, %max_trig) 

#clearfull
#%clearfull
  clearfull=off 
          (flag) In visual mode, clear input window rather than scroll when 
          full.  Always on if terminal can not scroll.  

#cleardone
#%cleardone
  cleardone=off 
          (flag) In visual mode, enables clearing of input window when return 
          is pressed.  

#%clock
  clock   This variable is no longer supported.  To disable the status bar 
          clock, use "/clock off".  To make the clock display in 12-hour 
          format, do "/clock %I:%M".  See /clock.  

#clock_format
#%clock_format
  clock_format=%H:%M 
          The format of the clock displayed on the status line.  To make the 
          clock display in 12-hour format, "/set clock_format=%I:%M".  See 
          also: /clock, %time_format.  

#connect
#%connect
  connect=nonblocking 
          Set to "blocking" or "nonblocking" to determine how /connect works.  
          Default is "nonblocking" on platforms that support it.  Nonblocking 
          allows you to continue doing other things while TF tries to 
          establish a new connection.  See also %gethostbyname.  

#defcompile
#%defcompile
  defcompile=off 
          (flag) If off, macro bodies are compiled the first time they are 
          executed; if on, macro bodies are compiled immediately when they are 
          defined.  Since syntax checking is performed during compilation, 
          setting defcompile=on will allow you to see the syntax errors in a 
          macro when you define it instead of waiting until execution.  

#%e
  e=2.718281828...  
          Euler's number.  

#expand_tabs
#%expand_tabs
  expand_tabs=on 
          (flag) If on (and %emulation is "print", "ansi_strip", or 
          "ansi_attr"), tabs received from a server are expanded to spaces 
          (according to %tabsize) immediately, before any trigger processing.  
          If off, tab characters are left in received lines.  

#raw
#canon
#print
#ansi
#ansi_strip
#ansi_attr
#emulation
#%emulation
  emulation=ansi_attr 
          Determines how special codes sent by the server should be 
          interpreted by TF.  The set of printable characters is determined by 
          the current locale.  Valid values for %emulation are: 
          raw:    No conversion is done; lines are not wrapped; all 
                  nonprintable characters are displayed, and their effect is 
                  undefined (depending mainly on your terminal).  TF's input 
                  display is not guaranteed correct; use at your own risk.  
                  This mode allows the server to have most of the control over 
                  the screen, but is not guaranteed to give the desired 
                  effect, and will interfere with trigger matching.  For best 
                  results, %visual should be "off", and TF attributes should 
                  not be used.  "Raw" is not recommended unless you know what 
                  you're doing.  
          print:  Tabs are expanded (if %expand_tabs is on); backspaces are 
                  interpreted; lines are wrapped; nonprintable characters 
                  removed.  
          ansi_strip: 
                  Like "print", but ANSI display codes are also removed.  
          ansi_attr: 
                  Like "ansi_strip", but ANSI display attribute codes will be 
                  converted to TF's internal format and displayed correctly 
                  (on any terminal).  Other ANSI display codes (e.g., cursor 
                  motion) will be removed.  Recommended, especially for 
                  servers that send vt100/ansi display attribute codes.  
          debug:  converts nonprinting characters to a printable form.  See 
                  also: %telopt.  
          See also: %istrip, %meta_esc, %tabsize, %expand_tabs, locale, 
          attributes, debugging.  

#end_color
#%end_color
  end_color 
          The code that should be sent to your terminal to return to normal 
          color after a %{start_color_*} code.  See: color.  

#error_attr
#%error_attr
  error_attr 
          Defines the attributes used by the "E" attribute.  Can be any 
          combination of attributes, including color names.  See: attributes.  

#gag
#%gag
  gag=on  (flag) Enable the gag attribute.  (See: /gag, /nogag) 

#gethostbyname
#%gethostbyname
  gethostbyname=nonblocking 
          Set to "blocking" or "nonblocking" to determine how /connect does 
          hostname resolution.  See also %connect.  

#gpri
#%gpri
  gpri=0  Priority of subsequent /gags.  (See: /gag) 

#hook
#%hook
  hook=on 
          (flag) Enable hooks.  (See: hooks, /hook, %max_hook.) Note that 
          autologin and automatic %{lp} setting will not work if %{hook} is 0. 

#hilite
#%hilite
  hilite=on 
          (flag) Enable display attributes, whether from a trigger, the 
          server, or whatever.  (See: /hilite, /nohilite) 

#hiliteattr
#%hiliteattr
  hiliteattr=B 
          Defines the attributes used by hilites.  Can be any combination of 
          attributes, including color names.  (See: attributes, /hilite) 

#histsize
#%histsize
  histsize=1000 
          When a new world history is created, it will have space for 
          %{histsize} lines.  A world history is created the first time text 
          is sent to it.  (See also: /histsize) 

#hpri
#%hpri
  hpri=0  Priority of subsequent /hilites.  

#insert
#typeover
#%insert
  insert=on 
          (flag) If on, keyboard input is inserted; if off, input overstrikes 
          existing text.  

#interactive
#%interactive
  interactive 
          (flag) If off, TF will not prompt for /quit, returning from /sh, 
          SIGINT (^C), or SIGQUIT (^\).  Defaults to on if standard input and 
          output are attatched to a terminal, off otherwise.  

#isize
#%isize
  isize=3 
          Size of input window in visual mode.  The output window will be 
          redrawn when this is changed.  See also: lines(), winlines().  

#istrip
#%istrip
  istrip=off 
          (flag) If on, the meta (high) bit will be stripped from all input 
          characters.  Note that this will prevent %meta_esc and locales with 
          8-bit characters from working correctly.  

#%kbnum
  kbnum=  A value that can be set by typing ESC followed by digits, to be used 
          as an argument (repeat count) for a subsequent keybinding.  See: 
          keybindings.  

#kecho
#%kecho
  kecho=off 
          (flag) Enables echoing of keyboard input, preceded by %{kprefix}.  
          See also: %{kecho_attr}.  %{secho}.  /localecho, /addworld -e.  

#kecho_attr
#%kecho_attr
  kecho_attr 
          Attributes used for lines echoed by %{kecho}.  

#keepalive
#%keepalive
  keepalive=on 
          (flag) Enable periodic "pings" (TCP keepalive) of servers, to 
          prevent network timeouts and detect dropped connections.  Note: the 
          timing of keepalive messages is a system parameter that can not be 
          changed from tf.  

#%keypad
  keypad=on 
          (flag) Enable application keypad mode, if supported by the terminal. 
          Application keypad mode makes the numeric keypad generate characters 
          different than the usual digit characters, so they may be 
          distinguished from the digit keys across the top of the keyboard.  
          See: keybindings.  

#kprefix
#%kprefix
  kprefix= 
          Prefix prepended to lines echoed by %{kecho}.  

#%login
  login=on 
          (flag) Enable automatic login hook.  (See: automatic login, hooks, 
          /world) 

#lp
#%lp
  lp=off  (flag) Displays partial lines as prompts, after a short timeout.  
          Useful for LP and Diku MUDs.  (See: prompts) 

#lpquote
#%lpquote
  lpquote=off 
          (flag) If on, all /quote and /repeat processes run when an LP prompt 
          is received instead of when a timer expires.  The -P option of 
          /quote and /repeat provides the same feature on a per-process basis. 
          (See: processes) 

#maildelay
#%maildelay
  maildelay=0:01:00.0 (60 seconds) 
          (dtime) Delay between mail checks.  Setting this to 0 disables mail 
          checking.  The file to be checked is named by the %{MAIL} variable.  

#matching
#%matching
  matching=glob 
          (enumerated) Determines the default pattern matching style.  
          "simple": 
                  straightforward string comparison.  
          "glob": 
                  shell-like matching (as before version 3.2).  
          "regexp": 
                  regular expression.  
          See also: patterns, regmatch(), %Pn.  

#max_hook
#%max_hook
  max_hook=1000 
          Maximum number of hooks allowed in a 10 second period.  When this 
          value is exceeded, a message is printed and %hook is automatically 
          turned off to disable hooks.  This helps prevent infinite hook 
          loops.  A value of 0 will allow unlimited hooks.  

#max_instr
#iteration
#iterations
#instruction
#instructions
#%max_instr
  max_instr=1000000 
          Maximum number of instructions in a macro execution.  A value of 0 
          will allow unlimited instructions.  An "instruction" is a basic 
          internal tf operation, such as addition, testing an /if or /while 
          condition, a substitution, sending a line of text to a server, or 
          joining two commands with a "%|" pipe.  

#max_kbnum
#%max_kbnum
  max_kbnum=999 
          The maximum value of kbnum that can be set via the keyboard.  See: 
          keybindings.  

#max_recur
#recursion
#recursions
#%max_recur
  max_recur=100 
          Maximum depth of recursive macro calls or triggers.  This helps 
          prevent infinite macro loops.  A value of 0 will allow unlimited 
          recursion.  

#max_trig
#%max_trig
  max_trig=1000 
          Maximum number of triggers allowed in a 10 second period.  When this 
          value is exceeded, a message is printed and %borg is automatically 
          turned off to disable triggers.  This helps prevent infinite trigger 
          loops.  A value of 0 will allow unlimited triggers.  

#%mccp
  mccp=on (if tf was compiled with MCCP support) 
          (flag) If on, MCCPv2 is allowed on new connections.  See mccp.  

#mecho
#%mecho
  mecho=off 
          (enumerated) 
          "off" (0): 
                  do not echo macro expansions.  
          "on" (1): 
                  echo expansions of non-invisible macros.  
          "all" (2): 
                  echo expansions of all macros.  
          %{mprefix} will be prepended once for each recursion level when 
          macro expansion echoing is enabled.  See also: %{mecho_attr}, 
          debugging.  

#mecho_attr
#%mecho_attr
  mecho_attr 
          Attributes used for lines echoed by %{mecho}.  

#meta_esc
#meta
#%meta_esc
  meta_esc=nonprint 
          (enumerated) If %istrip is off, typed characters with their meta 
          (high) bit set may have the meta bit stripped and be prefixed with 
          an ESC character.  This allows META-x and ESC x to invoke the same 
          keybinding.  Possible values of %meta_esc: 
          "off" (0): 
                  Never convert a meta bit to ESC.  
          "on" (1): 
                  Always convert a meta bit to ESC.  
          "nonprint" (2): 
                  Convert a meta bit to ESC only if the meta bit makes the 
                  character unprintable in the current locale.  
          Meta bit conversion can be prevented for a single keystroke by 
          preceeding it with the LNEXT key (^V), regardless of the state of 
          %meta_esc.  

#more
#%more
  more=off 
          (flag) Displays output one screenfull at a time.  (See: /more) 

#mprefix
#%mprefix
  mprefix=+ 
          Prefix prepended to lines echoed by %{mecho}.  

#oldslash
#%oldslash
  oldslash=on 
          (flag) If on, sequences of more than one '/' in a macro body will be 
          compressed by one during macro expansion.  This allows macros 
          written before version 3.0 to work properly.  With oldslash=off, 
          only slashes at the beginning of a body are handled specially.  You 
          are encouraged to turn this off.  (See: evaluation) 

#%pi
  pi=3.141592654...  
          The ratio of a circle's circumference to its diameter.  

#pedantic
#%pedantic
  pedantic=off 
          (flag) If on, TF will generate warnings about some potential 
          problems in your macro code.  Often the warnings indicate code that 
          is technically valid but may not do what you intended.  See also 
          debugging.  

#prompt_sec
#%prompt_sec
#prompt_usec
#%prompt_usec
  prompt_sec 
  prompt_usec 
          Obsolete.  Use %{prompt_wait} instead.  
#prompt_wait
#%prompt_wait
  prompt_wait=0.25 
          (dtime) The delay (in seconds) used to recognize unterminated 
          prompts.  (See: prompts).  

#proxy_host
#%proxy_host
#proxy_port
#%proxy_port
  proxy_host= 
  proxy_port=23 
          These two variables describe the proxy server used for opening 
          connections.  (See: proxy).  

#ptime
#%ptime
  ptime=1.0 
          (dtime) Default delay (in seconds) between /quote and /repeat 
          process runs.  

#qecho
#%qecho
  qecho=off 
          (flag) Echoing of /quote text.  See also: %{qprefix}, %{qecho_attr}, 
          debugging.  

#qecho_attr
#%qecho_attr
  qecho_attr 
          Attributes used for lines echoed by %{qecho}.  

#qprefix
#%qprefix
  qprefix= 
          Prefix prepended to lines echoed by %{qecho}.  

#quiet login
#quiet
#%quiet
  quiet=off 
          (flag) Gag text after login until the mud sends "Use the WHO 
          command", "### end of messages ###", or 25 lines.  Note: This will 
          not function correctly on MUDs which don't send those strings or 25 
          lines in the introductory text.  

#quitdone
#%quitdone
  quitdone=off 
          (flag) Quit upon disconnection from last socket.  

#redef
#%redef
  redef=on 
          (flag) Allows redefinition of existing worlds, keybindings, and 
          named macros.  

#refreshtime
#%refreshtime
  refreshtime=100000 
          (int) The delay (in microseconds) for redisplaying your keyboard 
          input after it is overwritten by incoming text in non-visual mode.  
          If you have a slow connection between you and tf, you may wish to 
          increase this delay.  The default is 100000 (1/10 second).  

#scroll
#%scroll
  scroll=on 
          (flag) In visual mode, scroll output instead of wrapping from bottom 
          to top.  

#secho
#%secho
  secho=off 
          (flag) Echoing of text before sending it to the server (above the 
          TELNET layer).  See also: %{sprefix}, %{secho_attr}, %{kecho}.  
          %{telopt}, debugging.  

#secho_attr
#%secho_attr
  secho_attr 
          Attributes used for lines echoed by %{secho}.  

#shpause
#%shpause
  shpause=on 
          (flag) Wait for a keypress after returning from /sh (unless 
          %interactive is off).  

#sigfigs
#%sigfigs
  sigfigs=15 
          The maximum number of significant digits to display when printing a 
          floating point number.  Note that 16 or more may introduce rounding 
          error.  Also note that some real numbers with up to 6 decimal places 
          are stored with fixed points, not floating points, so are not 
          affected by sigfigs (or rounding error).  

#snarf
#%snarf
  snarf=off 
          (flag) Don't send empty lines to the server.  

#sockmload
#%sockmload
  sockmload=off 
          (flag) Load macro files when foregrounding a world ("/dokey 
          socketf", "/dokey socketb", or "/fg").  Normally, a world's macro 
          file is loaded only when TF first connects to it.  (Note: the WORLD 
          hook is more useful than sockmload).  

#sprefix
#%sprefix
  sprefix= 
          Prefix prepended to lines echoed by %{secho}.  

#start_color
#%start_color
#start_color_*
#%start_color_*
#start_color_name
#%start_color_name
#start_color_<name>
#%start_color_<name>
#start_color_bgname
#%start_color_bgname
#start_color_bg<name>
#%start_color_bg<name>
  start_color_<name> 
  start_color_bg<name> 
          The control code that should be sent to your terminal to produce 
          foreground or background color <name>.  See: color.  

#status_attr
#%status_attr
  status_attr 
          The attributes used to display the status area in visual mode.  See: 
          status area.  

#%status_fields
  status_fields 
          Deprecated. The list of fields displayed on row 0 of the status area 
          in visual mode.  See: status area.  

#status_height
#%status_height
  status_height=1 
          The number of rows in the status area in visual mode.  See: status 
          area.  

#status_pad
#%status_pad
  status_pad=_ 
          The padding character used in displaying the status area in visual 
          mode.  See: status area.  

#tab
#%tab
#tabs
#tabsize
#%tabsize
  tabsize=8 
          Tabs will be replaced with spaces to pad to a multiple of 
          %{tabsize}.  See also: %expand_tabs, %emulation.  

#telopt
#%telopt
  telopt=off 
          (flag) Display telnet option negotiations (for debugging purposes).  
          See also: %emulation=debug, debugging.  

#textdiv
#separator
#separator.tf
#divider
#=====
#dividing line
#%textdiv
  textdiv=on 
          (enumerated) When you bring a socket into the foreground, TF can 
          help you distinguish old text that has been displayed before from 
          new text that is being displayed for the first time by printing a 
          dividing line between the old and new text or by clearing the old 
          text.  The setting of %textdiv controls this behavior: 
          "off" (0): 
                  Never print a divider or clear the screen; just draw old and 
                  new text normally.  
          "on" (1): 
                  Print a %textdiv_str divider between old and new text.  The 
                  divider is temporary: when it scrolls off the screen, or the 
                  screen is backgrounded, it disappears forever.  
          "always" (2): 
                  Print a %textdiv_str divider after the old text even if 
                  there is no new text.  
          "clear" (3): 
                  Clear (don't redraw) all old text before displaying new 
                  text.  Old text can be manually redisplayed by scrolling 
                  back.  
          See also: %textdiv_str, /fg.  

#textdiv_str
#%textdiv_str
  textdiv_str====== 
          The dividing line printed between old and new text when bringing a 
          socket to the foreground.  See %textdiv.  

#tfhost
#%tfhost
  tfhost= 
          Name or address to use for the client (tf) end of connections.  See 
          also: addworld, connect.  

#sub
#%sub
  sub=off 
          See: /sub.  

#time_format
#%time_format
  time_format=%H:%M 
          The format used to display times in /recall and /time.  The default 
          displays hours and minutes.  See ftime() for a description of the 
          format.  See also: %clock_format.  

#visual
#%visual
  visual=on 
          (flag) Divides the screen into an input window and an output window. 
          The output window will be redrawn when this is changed.  (See: mode) 

#warn_5keys
#%warn_5keys
  warn_5keys=on 
          (flag) If on, TF will warn the first time some of the new 5.0 
          keybindings are used.  

#warn_curly_re
#%warn_curly_re
  warn_curly_re=on 
          (flag) If on, TF will warn when using a regexp containing '{', which 
          has a new meaning in version 5.0.  

#warn_status
#%warn_status
  warn_status=on 
          (flag) If on, TF will warn when directly setting %status_fields, 
          %status_int_more, %status_int_world, or %status_int_clock, which 
          have new default values and new ways to set them in version 5.0.  
          See status line.  

#warning_attr
#%warning_attr
  error_attr 
          Defines the attributes used by the "W" attribute.  Can be any 
          combination of attributes, including color names.  See: attributes.  

#watchdog
#%watchdog
  watchdog=off 
          (flag) Gag repeated lines.  (See: /watchdog) 

#watchname
#%watchname
  watchname=off 
          (flag) Gag overactive players.  (See: /watchname) 

#wordpunct
#%wordpunct
  wordpunct=_ 
          List of punctuation that will be considered to be part of a word 
          instead of delimiting the ends of a word, by kbwordleft() and 
          kbwordright() (and therefore by /dokey WLEFT, WRIGHT, etc).  

#wordwrap
#wrap
#%wrap
  wrap=on 
          (flag) Enable wordwrap on the screen.  TF will try to break lines at 
          spaces or other punctuation to fit them within %{wrapsize} columns.  
          %{wrap} is ignored if %{emulation} is "raw".  See also: 
          %{wrappunct}, %{wrapsize}, %{wrapspace}.  

#wraplog
#%wraplog
  wraplog=off 
          (flag) Enable wordwrap in log files.  See also: %wrap.  

#wrappunct
#%wrappunct
  wrappunct=10 
          When wrapping, allow wrapping at any punctuation if wrapping only at 
          spaces would have caused more than %wrappunct characters to wrap.  
          This can make long URLs look nicer, but harder to cut and paste.  
          Setting %wrappunct to 0 disables wrapping at punctuation other than 
          spaces.  

#wrapsize
#%wrapsize
  wrapsize=79 
          Lines (input and output) extending past this column will be split.  
          Default value is one less than the number of columns on your 
          terminal (typically 80).  Output is not wrapped if %{emulation} is 
          "raw".  See also: %wrap, %wrappunct, %wrapspace, columns().  

#wrapspace
#indent
#indenting
#indentation
#%wrapspace
  wrapspace=4 
          Wrapped text is indented by this many spaces.  See also: %wrap, 
          %wrapsize.  

#
  The following builtin commands set the corresponding variables, and also 
  perform additional functions: /gag, /hilite, /hook, /nogag, /nohilite, 
  /watchdog, and /watchname 

  The standard library also defines the following macros to set the values of 
  the corresponding variables: /background, /bamf, /borg, /clearfull, 
  /cleardone, /gpri, /hpri, /insert, /isize, /login, /lp, /lpquote, /kecho, 
  /mecho, /more, /ptime, /qecho, /quiet, /quitdone, /redef, /shpause, 
  /sockmload, /sub, /visual and /wrapspace.  

  Note: The variables 'L' and 'R' are reserved (see: variables).  You should 
  not assign values to them.  

  See: variables, /set 

&status
&status fields
&%status_fields
&visual bar
&visual line
&status bar
&status_line
&status line
&status area

status line

  In visual mode, the input and output windows are separated by a status line, 
  which by default looks something like this: 

    More 156_WorldName____________(Read)_(Active: n)_(Log)_(Mail)_(Over)_12:34

    * "More" indicates how many more lines of text are waiting to be seen. 
    * "<WorldName>" is the name of the foreground socket's world.  
    * "(Read)" indicates that keyboard input is being read by read().  
    * The "(Active: n)" indicator shows the number of sockets with unseen 
      text.  
    * "(Log)" indicates that there is one or more log file open.  
    * "(Mail)" or "Mail n" indicates the number of files named by %MAIL or 
      %MAILPATH that contain unread mail.  
    * "(Over)" indicates that typed characters will overstrike instead of 
      insert (that is, %insert is off).  
    * The current time is displayed at the right end of the status line.  

Configuring the status area

  The status area may contain 1 or more rows; the number is determined by 
  %status_height.  The rows are numbered from the top starting at 0.  Each row 
  is defined as a list of fields.  A status field is defined as follows: 

    * an optional field name 
    * an optional ":" and number indicating the field width 
    * an optional ":" and attribute 

  The current list of status fields for row <N> can be fetched with 
  status_fields(<N>).  
#%status_field_defaults
#status_rm
#status_edit
#status_defaults
#status_save
#status_restore
#status_add
#/clock
#/status_rm
#/status_edit
#/status_defaults
#/status_save
#/status_restore
#/status_add
  The following commands modify the fields of the status area: 
  /clock off 
          Remove the clock from the status bar (equivalent to "/status_rm 
          @clock").  

  /clock on 
          Add a clock to the end of status row 0 if there is not already a 
          clock on status row 0.  The width of the @clock field will be set 
          exactly wide enough to hold a time formatted according to 
          %clock_format.  

  /clock [<format>] 
          Add a clock to the end of status row 0 if there is not already a 
          clock on status row 0; in either case, use <format> to control the 
          format of the clock (see ftime() for the meaning of <format>).  If 
          <format> is omitted, it defaults to "%H:%M".  The width of the 
          @clock field will be set exactly wide enough to hold a time 
          formatted according to <format>.  

          Example: display a clock in 12-hour format: 
                  /clock %I:%M 

  /status_defaults 
          Restore list of status fields for all rows and their formats 
          (%status_int_* and %status_var_*) to their default values.  
          (Previous versions of tf had a %status_field_defaults variable; this 
          is now deprecated.) 

  /status_save <name> 
          Save the current list of fields in row 0 into memory slot with label 
          <name>.  <Name> must be a legal variable name.  (Saved fields will 
          be forgotten when tf exits.) 

  /status_restore <name> 
          Restore the list of fields in row 0 that was previously saved with 
          "/status_save <name>".  

  /status_rm [-r<N>] <name> 
          Remove status field <name> from status row <N>.  If -r is not 
          specified, all rows are searched.  Only the first matching field is 
          removed.  If there are unnamed pad fields on both sides of the named 
          field, the one with the smaller width is also removed; if the named 
          field is at the beginning or end of a row, the neighboring pad field 
          (if any) is removed.  

          Example: Remove the @mail field from the status bar: 
                  /status_rm @mail 

  /status_add [<options>] <name>[:<width>[:<attributes>]] ...  
          Add status field <name> to the status bar with optional <width> and 
          <attributes>.  Options: 
          -r<N>   add to row <N> (default 0) 
          -A      add after all other fields (i.e., at end) 
          -A<field> 
                  add after existing field <field> 
          -B      add before all other fields (i.e., at beginning) 
          -B<field> 
                  add before existing field <field> 
          -s<N>   insert padding of <N> spaces between the new field and the 
                  neighbor selected by -A or -B (default 1) 
          -x      don't add the field if one with the same name is already 
                  present 
          -c      clear all existing fields before adding new fields 
          If neither -A nor -B is given, -A is assumed.  

          Example: Add a new field after the world name to display the 
          contents of the variable "hp": 
                  /status_add -A@world hp:4 

          Multiple fields may be specified, but padding is not automatically 
          added between them; you must specify padding explicly.  For example, 
                  /status_add -Aclock foo:4 :1 bar:4 :2 baz:4 
          is equivalent to 
                  /status_add -Aclock foo:4 
                  /status_add -Afoo bar:4 
                  /status_add -Abar -s2 baz:4 

  /status_edit [-r<N>] <name>[:<width>[:<attributes>]] 
          If field <name> currently exists in any status row, replace it with 
          <name>[:<width>[:<attributes>]].  Neighboring padding is unchanged.  
          If -r is given, only row <N> is searched.  Only the first matching 
          field is edited.  

          Example: Change the @log field to say "L" instead of "(Log)", and 
          change the field's width to match: 
                  /set status_int_log=nlog() ? "L" : "" 
                  /status_edit @log:1 

#

  For backward compatiblity, you can get and set the status fields for row 0 
  via the %status_fields variable, but doing so is deprecated.  

  The default list of status fields is: 

      @more:8:Br :1 @world :1 @read:6 :1 @active:11 :1 @log:5 :1 @mail:6 :1 insert:6 :1 kbnum:4 :1 @clock:5
    

  There are several types of fields: 

    * Unnamed fields create padding between the fields on either side of 
      it.  Each of the ":1" fields in the default status_fields puts a space 
      of 1 character between the other fields.  
    * Field names beginning with "@" correspond to internal states.  For 
      example, "@more" will be updated whenever the number of unseen lines 
      changes.  
    * Field names containing only letter, digits, and underscores 
      correspond to variables.  Whenever there is a change in the value of the 
      variable with the same name, the field will be updated.  The value an 
      unset variable is considered to be the empty string.  For example, 
      whenever the %insert variable changes, the "insert" field is updated.  
      Any variable may be monitored in this manner.  
    * A field whose name is in quotes (", ', or `) has its name (without 
      the quotes) printed literally on the status bar, and is never updated.  
      Use the \ character to escape a quote inside the string.  The default 
      status_fields does not contain any of these literal fields.  

  Any variable may be monitored, but there is a fixed list of internal 
  statuses.  The internal statuses available are: 
  @more   Updated when there is a change in the number of lines below the 
          bottom of the window.  
  @world  Updated when when the foreground world changes.  During the 
          evaluation of the format expression, the current socket is the new 
          socket.  
  @read   Updated when entering or exiting a read() function call.  
  @active 
          Updated when the number of active worlds changes.  During the 
          evaluation of the format expression, the current socket is the 
          socket that became active.  
  @log    Updated when the number of open log files changes.  
  @mail   Updated when mail arrives (See "mail").  
  @clock  Updated every minute, on the minute.  

  A field's width determines how many columns it will take up on the screen.  
  If the width of a string literal field field is omitted, it defaults to the 
  length of the string literal.  One other field width may be omitted or set 
  to 0, which means that field will use whatever columns are unused by the 
  other fields.  Normally, fields are left-justified within the width, but a 
  negative field width will right-justify the field within the absolute value 
  of the width.  A width of "-0" can be used to right-justify the 
  variable-width field.  If the formatted text is wider than the field width, 
  it will be truncated to fit within the specified width.  Fields may also be 
  truncated if they would not fit on the screen.  

  The attributes explicily given in the field definiton are combined with 
  those in the corresponding %status_attr_int_<fieldname> (for internal state 
  fields) or %status_attr_var_<varname> (for variable fields).  The combined 
  attributes are applied to the field text when it is displayed, but not to 
  the padding used to bring the field to the specified width.  The entire 
  status line, including padding, is displayed with the attributes given by 
  %status_attr, which is none by default.  

  To bring fields up to their specified width, they are padded with 
  %status_pad, which is "_" by default.  By setting status_pad to " " and 
  status_attr to "r", you can create a status line that looks more like the 
  one in emacs or the irc client.  

  When a status field is updated, the text displayed for that field is 
  determined by evaluating the expression contained in the variable 
  status_int_<name> (for internal state @<name>) or status_var_<name> (for 
  variable <name>).  Also, for variable fields, if status_var_<name> is not 
  set, the value of the variable will be displayed directly.  Changing a 
  format variable will cause the status line to update.  

  All this may sound rather complex, so an example might help.  The default 
  value of status_fields is: 

    @more:8:Br :1 @world :1 @read:6 :1 @active:11 :1 @log:5 :1 @mail:6 :1 insert:6 :1 kbnum:4 :1 @clock:5
    

  and the corresponding format variables are: 

    /set status_int_more \
         moresize() == 0 ? "" : \
         moresize() > 9999 ? "MuchMore" : \
         pad("More", 4, moresize(), 4)
    /set status_int_world   strcat( \
         fg_world() !~ "" & !is_open(fg_world()) ? "!" : "",  fg_world())
    /set status_int_read    nread() ? "(Read)" : ""
    /set status_int_active  nactive() ? pad("(Active:",0,nactive(),2,")") : ""
    /set status_int_log     nlog() ? "(Log)" : ""
    /set status_int_mail \
         !nmail() ? "" : \
         nmail()==1 ? "(Mail)" : \
         pad("Mail", 0, nmail(), 2)
    /set status_var_insert  insert ? "" : "(Over)"
    /set status_int_clock   ftime(clock_format)
    

  The first field is "@more:8:Br".  So, whenever the number of unseen lines 
  changes, TF looks for the variable status_int_more, and evaluates the 
  expression it contains.  The result of the expression is printed in the 
  first 8 columns of the status line, with attributes "Br" (bold and reverse). 
  The expression was carefully written so that it will never be more than 8 
  characters, because it would be confusing to generate something like 
  "More:12345" and then have it truncated to "More:123" because of the field 
  width of 8.  

  Since the "@world" field has no explicit width, its width is determined 
  dynamically.  The fields on its left are pushed to the left side of the 
  screen, the fields on its right are pushed to the right side of the screen, 
  and the "@world" field uses whatever space remains in the middle.  
#prompt example

  Another example: Say your mud has a prompt like "H:42 M:17> " that shows 
  your hit points and mana, and you want it displayed on the status line like 
  " 42, 17", after the world name.  To do this, call "/status_add -Aworld 
  hp_mana:7", and define a prompt hook: 

    /def -mregexp -h"PROMPT ^H:([^ ]*) M:([^ ]*)> $" hp_mana_hook = \
        /set hp=%P1%; \
        /set mana=%P2%; \
        /set hp_mana=$[pad(hp, 3, ",", 0, mana, 3)]%; \
        /test prompt({*})

#

  See: visual 

&subs
&substitution

substitution

  Before a macro body or arguments to /eval are executed, special character 
  sequences are replaced with new text as described below.  

#%;
#newline
#command separator

Command separation. 
%;

  Separates commands within a macro body.  See evaluation.  

#%|

Pipe. 
%|

  Separates commands within a macro body, and connects the output of the first 
  to the input of the second.  See evaluation.  

#character substitution
#\n
#\\
#ascii

Character substitution. 
\n
\c

  In the first form, the character whose ASCII code is <n> is substituted.  If 
  <n> starts with "0x", it is interpreted as a hexadecimal number; otherwise, 
  if <n> starts with "0", it is interpreted as octal; otherwise, it is 
  interpreted as decimal.  In the second form, the character <c> is 
  substituted.  This is useful for escaping any special meaning <c> has; in 
  particular, "\\" is substituted with "\".  If the variable %{backslash} is 
  off, the \c form does not have this special interpretation.  

#//

Slash compression. 
//... 

  If %{oldslash} is on, sequences of slashes are replaced with a sequence of 
  one fewer slashes.  A single slash, however, is left alone.  This feature 
  remains for backward compatibility only; you are encouraged to turn 
  %{oldslash} off to disable this.  

#$[
#$[]

Expression evaluation. 
$[expression]

  The <expression> is evaluated and its string value is substituted in its 
  place.  See "expressions".  

#$(
#$()
#command subs
#command substitution

Command substitution. 
$(command)

  <Command> is evaluated as if it were the body of a macro: it goes through 
  substitution, and is executed in a new scope.  If <command> contains any ')' 
  characters, they must be escaped by preceding them with '\' so they are not 
  interpreted as the end of the substitution.  The echoed output of <command> 
  is substituted in place of the $(...) construct (much like `...` in most 
  shells).  If <command> produces more than one line of output, they will be 
  concatenated, with a space between each, to form one line.  

  Example: 

          /def showver = :is using tf version $(/ver)

  could be used to tell other mudders what version of tf you're using.  

#$
#${
#${}
#macro subs
#macro substitution

Macro substitution. 
${name}
$name$

  The body of the macro <name> is substituted.  The second form is supported 
  only for backward compatibility, and its use is discouraged.  In the first 
  form, the brackets may be omitted if the subsequent text could not be 
  confused as part of the name.  

  Example: The text "${foo}" would be replaced with the body of the macro 
  named "foo".  

#$$

Dollar compression. 
$$... 

  Sequences of '$'s are replaced by a sequence of one fewer '$'s.  A single 
  '$', however, is left alone, unless it introduces one of the substitutions 
  described above.  This is used to put a literal '$' in text that goes 
  through macro substitution.  

#%
#%{
#%{}
#%n
#%0
#%1
#%-1
#%-n
#%R
#%L
#%*
#%#
#%?
#variable subs
#variable substitution
#positional parameters
#arguments
#parameters
#variables and parameters

Variable and Argument substitution. 
%selector
%{selector}
%{selector-default}

  The value of a variable or an argument to the macro is substituted, as 
  determined by <selector>.  The brackets are recommended for clarity, but may 
  be omitted if there is no default and the text following it can not be 
  misinterpreted as part of the selector.  The selector can be any of: 

  <name>  The value of the variable <name> is substituted.  Names are case 
          sensitive.  

  0       selects the name of the executing macro.  (Before version 4.0, "0" 
          was equivalent to "*").  

  #       selects the count of positional parameters.  

  *       selects all positional parameters.  

  ?       selects the return value of the most recently executed command 
          (builtin or macro).  

  1, 2, 3, etc.  
          selects the corresponding positional parameter.  There is no maximum 
          parameter number; any number greater than %{#} will simply produce 
          an empty substitution.  

  -1, -2, -3, etc.  
          selects all positional parameters except the first, all except the 
          first two, all except the first three, etc.  

  L1, L2, etc.  
          selects the last positional parameter, second-to-last, etc.  "L" is 
          the same as "L1".  (As of 5.0 beta 7, these are case sensitive.) 

  -L1, -L2, etc.  
          selects all positional parameters except the last, all except the 
          last two, etc.  "-L" is the same as "-L1".  (As of 5.0 beta 7, these 
          are case sensitive.) 

  Pn      selects the text matching the <n>th parenthesized subexpression from 
          the last regular expression match.  See %Pn.  (As of 5.0 beta 7, 
          these are case sensitive.) 

  R       selects a positional parameter at random.  (see also: rand()) (As of 
          5.0 beta 7, this is case sensitive.) 

  Variable name and selectors are case sensitive (prior to 5.0 beta 7, "Ln", 
  "Pn" and "R" selectors were not).  No substitutions are performed on 
  <selector>.  

  If the substitution determined by the <selector> would be empty, and a 
  <default> value is given, the default will be substituted instead.  Thus 
  "%{1-foofle}" is replaced with the first word if there is one, or "foofle" 
  if not.  The <default> value may contain variable, macro, expression, and 
  command substitutions.  

  The meaning of "positional parameters" depends on how the macro was called.  
  If called with the traditional "/name ..." command syntax, each 
  space-separated word is a positional parameter.  If called with the 
  "name(...)" function syntax, each function argument is a positional 
  parameter; if more than one is selected, they are concatenated, with a space 
  between each.  If called as a trigger, the positional parameters are the 
  words in the text that triggered the macro.  In a hook call, the positional 
  parameters are the hook arguments.  In an /eval statement, they are 
  inherited from the caller.  

  Note that in expressions, it is easiest to omit the % and just use the 
  {selector[-default]} part.  If the selector is a variable name and no 
  default is desired, the name may be used directly in an expressions without 
  % or {...}.  

#%{PL}
#%PL
#%{PR}
#%PR
#%{Pn}
#%Pn
#%P
#subexpressions
#regexp subexpressions

Regexp subexpressions. 
%{Pn}
%{PL}
%{PR}

  This is actually a special case of variable substitution.  The %P variables 
  get their values from the last successful regexp match in scope.  %P0 
  expands to the text matched by the entire regexp.  %Pn expands to the text 
  matched by the <n>th parenthesised subexpression of the regexp.  %PL and %PR 
  expand to the text to the left and right, respectively, of the text matched 
  by the entire regexp.  The "scope" of a regexp match is the lifetime of the 
  macro expansion it triggered, hooked, or in which it occurred (i.e., with 
  regmatch()).  

  For example, after the text "Jabba the Hutt goes east." matches the regexp 

    " goes ([^ ]*)\.$"

  then the following expansions will be available until the macro exits: PL = 
  "Jabba the Hutt"; P0 = " goes east."; P1 = "east".  

  The number <n> can be any nonnegative number.  If there is no subexpression 
  corresponding to <n>, the substitution will be ignored.  When parentheses 
  are nested, <n> refers to the order of the opening parentheses.  

  The %Pn subs will always refer to the first regexp match on the line, even 
  if a partial hilite (/def -P) causes the regexp to be applied more than 
  once.  

#%%
#percent compression

Percent compression. 
%%... 

  Sequences of '%'s are replaced by a sequence of one fewer '%'s.  A single 
  '%', however, is left alone unless it introduces one of the substitutions 
  described above.  This is used to put a literal '%' in text that goes 
  through macro substitution.  

#

Examples 

  Here are a couple of simple examples.  

  Definition: /def advice = whisper %1 = Let the wookie win. 
  Command: /advice R2D2
  Sends: whisper R2D2 = Let the wookie win. 

  Definition: /set ending=meister
  Definition: /def greet = :waves to %{1-Jack}%{ending}. 
  Command: /greet
  Sends: :waves to Jackmeister. 
  Command: /greet Dave
  Sends: :waves to Davemeister. 

  For some more complex examples, look at the files in TFLIBDIR.  

  See: evaluation, expressions 

&summary

summary

  Type "/help intro" for basic information on using TF. 
  Type "/help topics" for a list of other help topics. 
  Type "/help commands" for a complete list of TF builtin commands. 
  Type "/help /help" for instructions on using /help. 

  If you are having problems with TF and wish to contact the author, see 
  "problems".  

  If you are having trouble reading the help sections because text is 
  scrolling off the screen, try typing "/more on" before /help, and then when 
  you get a "--More--" prompt, press TAB or PageDown when you're ready to 
  continue.  

&command line
&commandline
&startup
&initialization
&invocation
&tf

tf

  Syntax: 

  tf [-L<dir>] [-f[<file>]] [-c<command>] [-vlqn] [<world>]
  tf [-L<dir>] [-f[<file>]] [-c<command>] [-vlq] <host> <port> 
  ____________________________________________________________________________

  At startup, TF takes the following steps: 

    * Initializes special variables.  Any variables defined in the 
      environment will override TF's default values for the variables with the 
      same name.  
    * Loads commands from the standard macro library (stdlib.tf), the 
      optional local macro library (local.tf), and your personal configuration 
      file (see tfrc).  
    * Executes <command>, if one was given.  
    * Enables visual mode if -v was not given and %visual has not been 
      explicitly set to "off".  
    * Tries to connect to <world>, or <host> <port>.  If no world is 
      given, and the -n option is not given, TF will try to connect to the 
      first world defined with addworld() in the configuration file(s).  If no 
      worlds are defined, or TF can not connect to the specified world, TF 
      will start up in unconnected mode.  

  Options: 
  -L<dir> 
          Use <dir> instead of %TFLIBDIR as library directory.  
  -f<file> 
          Load <file> instead of the normal personal config file.  
  -f      Do not load any personal config file at startup.  
  -c<command> 
          Execute <command> after loading config file.  <Command> is treated 
          as if it had been typed on the tf command line (i.e., the value of 
          %sub is significant).  
  -n      Do not connect to a world automatically at startup if no <world> or 
          <host>/<port> are specified.  
  -l      Disable automatic login.  (see: login) 
  -q      Enable quiet login.  (see: %quiet) 
  -v      Disable automatic switch to visual mode.  

  The library directory is determined by the first of the following which has 
  a value: -L option; %TFLIBDIR environment variable; or, compiled-in default. 
  The standard library file is determined by the first of the following which 
  has a value: TFLIBRARY environment variable; or, appending "/stdlib.tf" to 
  %TFLIBDIR.  

  TF honors several locale categories, which can be set to make TF work better 
  with languages other than English.  See locale.  

  See http://tinyfugue.sourceforge.net/ for the latest info on TF.  

  See also: intro, tfrc, library, worlds, /addworld 

&tfout
&tferr
&alert
&streams
&tfio

tfio

  TF normally does its output through "streams", which are analagous to the 
  streams of C stdio.  

  Output from most tf commands, including /echo, are output to the "tfout" 
  stream, which is normally attached to the screen.  tfout may be redirected 
  with a command /quote, $() command substitution, or %| pipe.  

  Many TF error messages, hook messages, and the output of "/echo -e" are 
  output to the "tferr" stream, which is always attached to the screen, and 
  may not be redirected.  

  Some TF error messages, hook messages, and the output of "/echo -A" are 
  output to the "alert" stream.  In visual mode, text sent to the alert stream 
  is displayed briefly on the status line status line, where it can be seen 
  immediately even if you're at a more prompt.  The duration of the alert 
  display is determined by %alert_time.  In nonvisual mode, text sent to the 
  alert stream is redirected to the tferr stream.  

  Text from a world or "/echo -w" is sent to a stream for that world.  Text 
  sent to a world stream will be stored in the history of that world.  If that 
  world is the foreground world, the text is sent to the screen immediately; 
  otherwise, it will not be displayed until world is brought into the 
  foreground.  

  Commands that read input (using tfread()) read by default from "tfin", which 
  is normally attached to the keyboard.  tfin may be redirected with a %| 
  pipe.  

  All streams have a handle which can be used as an argument to the tfio 
  functions.  The handles for tfin, tfout, and tferr are "i", "o", and "e", 
  respectively.  The handles for streams opened with tfopen() are integers.  

tfopen()

  The tfopen(name, mode) function can be used to open arbitrary streams.  If 
  called with no arguments, tfopen() opens an unnamed "q" mode stream.  The 
  <mode> argument describes the usage of the stream: 
  "w"     Open a file "<name>" for writing.  Write operations will overwrite 
          existing file contents, if any.  
  "a"     Open a file "<name>" for appending.  Write operations will occur 
          after existing file contents, if any.  
  "r"     Open a file "<name>" for reading.  (see also: "/quote '").  
  "p"     Execute a shell command "<name>" and read its output (see also: 
          "/quote !").  
  "q"     Open a queue for reading and writing.  The <name> argument will 
          appear in the output of /liststreams, but has no other meaning.  
  A "q" mode stream may be thought of as a place to hold lines for passing 
  between two or more commands.  

  If successful, the tfopen() function returns a positive number which is the 
  handle of the new stream, which should be used in subsequent calls to 
  tfread(), tfwrite(), and tfclose().  If it fails, the tfopen() function 
  returns -1.  

  A call to tfwrite() or tfread() on a stream opened with a mode that does not 
  allow that operation will return -1.  

  The /liststreams command will display a list of open streams.  

tfclose()

  When a stream opened by tfopen() is no longer needed, it should be closed 
  with tfclose(handle), which will flush the stream and release its resources. 
  tfclose() can be used on the tfout stream (handle "o") within a macro body 
  to prevent further output from subsequent commands in that macro body; 
  closing the tfin stream (handle "i") will prevent further reads; and closing 
  the tferr stream (handle "e") is not allowed.  

tfwrite()

  The tfwrite(handle, line) function writes a <line> of text to the stream 
  designated by <handle>.  If <handle> is omitted, the tfout stream is used 
  (so tfwrite(line) is equivalent to echo(line)).  Display attributes of line 
  are stripped if it is written outside of tf (i.e., to a file or pipe).  

  If an OS file (mode "w" or "a") is set to autoflush (the default), then each 
  line written is flushed to the file immediately.  If you are writing a large 
  number of lines, it is more efficient to disable autoflushing with 
  tfflush(handle, "off"), and manually force a flush with tfflush(handle) or 
  tfclose(handle) after writing the large block.  tfflush() has no meaning on 
  files of mode "p", "q", or "r".  Streams are flushed automatically when 
  closed.  

tfread()

  The tfread(handle, variable) function reads a line from the stream 
  designated by <handle>.  If <handle> is omitted, the tfin stream is used.  
  If successful, the line is assigned to <variable>, and tfread() returns the 
  (non-negative) length of the line.  If <variable> did not already exist, it 
  is created at the global level, as if by /set.  If there are no lines 
  available to read, or an error occurs, tfread() returns -1.  For "r" and "p" 
  mode streams, a -1 return value indicates end-of-file; the only valid 
  operation on the stream after that is tfclose().  But for a "q" mode stream, 
  a -1 return value may just mean there are currently no lines in the queue; 
  more lines may be added by tfwrite(), and then tfread() will be able to read 
  them.  

Keyboard Reading

  tfread() from the keyboard is special.  It can only be done from a command 
  line command; trying to do it directly or indirectly from a trigger, hook, 
  keybinding, or process is an error, and will make the tfread() return -1.  
  It reads a line of input from the keyboard until the newline key is pressed 
  or "/dokey newline" is executed.  During the read, all existing keybindings 
  continue to work normally.  Any text already in the input buffer is not 
  cleared when the read starts.  Text entered after the read starts is 
  appended to the existing text, and when the read ends, its result is the 
  entire input buffer.  Lines entered during a read are not saved in the input 
  history (but you can use "/recordline -i" to save them explicitly).  

  A read from the keyboard (and the macro that called it) can be interrupted 
  with a SIGINT, normally generated by typing CTRL-C.  

  During a keyboard read, if a macro calls /dokey newline, the newline will 
  not be executed immediately, but will be held until the rest of the commands 
  in the macro are processed.  For example, consider the keybinding "/def 
  -b'^[^M' = /dokey newline%; /send go".  Normally, typing ^[^M would execute 
  the current input buffer, then send "go" to the server.  But during a 
  keyboard read, typing ^[^M would send "go" first, and then do the newline 
  that completes the read.  

  The library file textutil.tf defines several commands that are useful with 
  tfio.  

  See: interface, /liststreams, /input, expressions, nread(), functions, 
  textutil.tf 

&config
&configuration
&customization
&customizing
&tfrc
&tinytalk
&.tinytalk
&.tfrc

.tfrc

  At startup, TF attempts to load and execute commands from the personal 
  config file named "~/.tfrc", "~/tfrc", "./.tfrc" or "./tfrc".  This file can 
  contain any commands you want executed automatically when TF starts.  

  Some useful commands to include in your personal config file: 

  /addworld 
          Define a world.  TF will automatically connect to the first world if 
          not started with the "-n" option.  
  /def    Define a macro (including triggers, hilites, gags, keybindings, and 
          hooks).  
  /set    Set a variable.  There are many special variables that change the 
          behavior of tf, listed under "special variables".  
  /load   Load commands from another file.  
  /require 
          Load a library file.  

  TFLIBDIR contains a sample "tfrc" file that you may want to copy and modify 
  to fit your tastes.  

  For backward compatibility, TF will load ~/.tinytalk if it exists.  The use 
  of ~/.tinytalk is discouraged.  

  See: startup, library, special variables, /load 

&timer
&timing

timing

  See: processes, /repeat, /quote, utilities (/at, /tick), %clock, /time.  
&tools
&/reedit
&/edmac
&/edvar
&/edworld
&/name
&/getline
&/xtitle
&xterm
&tools.tf

tools.tf

  Usage: 

  /REQUIRE tools.tf
  ____________________________________________________________________________

  /EDMAC <macroname> 
  /EDVAR <variablename> 
  /EDWORLD <worldname> 
          Stick an existing macro, variable, or world definition in the input 
          window for editing.  

  /NAME [<name>] 
          Change your character name (on a TinyMUD style mud).  

  /GETLINE <n> 
          Grab the <n>th line from history and stick it in the input buffer.  

  /XTITLE <text> 
          Put <text> on the titlebar of an xterm.  

  See: /sh, /edit, /recall, tfrc 

&triggers

triggers

  Before we get into the gory details, here's a simple example of a trigger: 

    /def -t"{*} has arrived." greet = :waves to %1.

  This command defines a macro called "greet".  Whenever text like "Bob has 
  arrived." is received, /greet will be executed automatically, sending the 
  text ":waves to Bob." to the server.  

  Associated commands: 
  /def    define a macro with any fields 
  /trig   define a trigger macro 
  /trigp  define a trigger macro with priority 
  /trigc  define a trigger macro with probability 
  /trigpc 
          define a trigger macro with probability and priority 
  /gag    define a trigger macro to gag text 
  /hilite 
          define a trigger macro to hilite text 
  /trigger 
          call a trigger macro manually 
  /substitute 
          modify the text that invoked the trigger 

  Triggers are a method of calling a macro based on incoming text.  When a 
  line of text from a socket matches the trigger pattern of a macro, that 
  macro becomes a candidate for automatic execution.  

  If multiple macros have triggers which match the same text, one or more are 
  chosen for execution as described under "priority".  

  The <text> which triggers a macro is given to the macro as arguments, as if 
  it had been called with ``/<macro> <text>''.  Positional parameters (e.g., 
  %1) refer the the corresponding word in the triggering text.  If the trigger 
  is a regexp, subexpression parameters refer to the text matched by the 
  corresponding parenthesised subexpression (see also: %Pn).  

  If the selected macro(s) have display attributes, the attributes are used to 
  display the text which triggered the macro.  

  If a macro has the world field set, it can only be triggered by text from 
  that world.  

  If a macro has a probability less than 100%, it might not be executed even 
  if it is triggered.  

  Triggers can be disabled by turning the %{borg} flag off.  

  If the %{background} flag is turned off, text from background sockets will 
  not cause triggering until that socket is brought into the foreground.  

  Triggers can also be invoked manually with the command /trigger.  The 
  command "/trigger -n" can be used to test which triggers would match a given 
  line.  

  The /def command is the only way to define a multi-shot trigger.  All other 
  commands which define triggers will create permanent triggers.  

  Note that tf may run slowly if there are many triggers defined, since every 
  trigger must be compared against every received line of text.  Choose your 
  triggers carefully.  See also "patterns".  

  Triggers are only matched against normal lines.  To have a macro invoked by 
  a prompt, use the prompt hook.  

  By default, TF expands tabs and removes ANSI display codes and other non 
  printable characters from received lines before comparing them against 
  triggers, so your triggers need to match only visible text.  But if you 
  change %expand_tabs or %emulation, received lines may still contain 
  invisible codes when compared against triggers.  

  Trigger patterns are not expanded for variable substitutions or anything 
  else.  To get the effect of a variable trigger, write a macro that redefines 
  the trigger.  For example, 

      /def set_victim = \
          /def -t"%{1} has arrived." kill_victim = \
              kill %%{1}
    

  Then, to change the victim to "Bill", type "/set_victim Bill".  

  See also: patterns, macros, gags, hilites, hooks, priority, %max_trig 

&util
&utils
&map
&/psh
&space_page
&/speedwalk
&tintin
&/watch
&utilities

utilities

  The library directory %{TFLIBDIR} contains many useful utility files ending 
  in ".tf".  To use any one of them, simply /load or /require the file.  For 
  example, to enable ESC-TAB completion automatically, just "/require 
  completion.tf" from your .tfrc file.  Some of the more useful files: 

  alias.tf 
          /alias, etc: create commands without '/'.  
  at.tf   /at: execute commands at a specified time.  
  filexfer.tf 
          /putfile, /getfile: transfer files to/from a mud.  
  kb-os2.tf 
          Extra default key bindings for OS/2 keyboards.  
  kbbind.tf 
          Default keybindings.  
  kbfunc.tf 
          Macros used by kbbind.tf.  
  map.tf  Mapping commands (like tintin).  
  psh.tf  /psh: like /sh, but uses your favorite shell.  
  quoter.tf 
          Various quoting macros.  
  rwho.tf 
          Remote WHO from a mudwho server.  
  spc-page.tf 
          Old-style SPACE key scrolling at --More-- prompt.  
  spedwalk.tf 
          Single character movement (like tintin).  
  spell.tf 
          Spelling checker.  
  tick.tf 
          Diku tick counter (like tintin).  
  tintin.tf 
          tintin-like commands.  
  tr.tf   /tr: character translation 
  watch.tf 
          /watch: Watch for a particular player.  

  There are also other files, not listed here.  

  For complete instructions on any of these utilities, see the help section 
  for that topic if there is one, or read the comments at the top of each 
  file.  Sorry, I haven't gotten around to documenting them very well.  

  Note to unix users: many library files were renamed in version 3.5, but the 
  old names still work (via soft links).  

&variables
&variable

variables

  Associated commands: 
  /listvar 
          list values of variables.  
  /set    set the value of a global variable 
  /let    set the value of a local variable 
  /setenv 
          set the value of an environment variable 
  /unset  unset a variable 
  /export 
          move an global variable to the environment 
  /edvar  edit a variable's value 
  := operator 
          assign a value of any type to a variable.  

  A TinyFugue variable has a name and a value.  Names are case sensitive, and 
  should start with a letter and contain only letters, numbers, and 
  underscores.  A value can be a text string (including display attributes), 
  integer, or real number, but some special variables will automatically 
  convert an assigned value to a particular type.  

  Variables may either be local, global, or exported.  Global variables are 
  visible to all tf commands; they are defined with /set or /setenv, or 
  imported from the environment when tf starts.  Local variables are created 
  with /let or assignment expressions, and only exist in the scope in which 
  they were created.  Exported variables are global variables which are also 
  visible to subshells, so they can be used by commands /sh, the '!' option of 
  /quote, and file uncompression.  Variables are exported if they were defined 
  with /setenv, explicitly exported with /export, or imported from tf's parent 
  environment.  

  The value of a variable can be obtained using a '%' substitution (see 
  "substitution"), or by simply using its name in an expression (see 
  "expressions").  

  See "special variables" for a list of special variables.  

&worlds

worlds

  Associated commands: 
  /addworld 
          define a new world 
  /world  connect to a defined world 
  /dc     disconnect from a world 
  /unworld 
          undefine a world 
  /purgeworld 
          undefine a group of worlds 
  /saveworld 
          save world definitions to a file 
  /loadworld 
          load world definitions from a file 
  /listworlds 
          display world definitions 
  /edworld 
          edit a world definition 
  world_info() 
          get world information 

#$world_name
#$world_character
#$world_password
#$world_host
#$world_port
#$world_mfile
#$world_type
#fields
  Fugue stores a list of "worlds" that it knows about.  Each world has several 
  fields associated with it: 
  name    a label used to refer to the world 
  type    an optional string for matching /def -T 
  character 
          optional login name 
  password 
          optional login password 
  host    server's internet host name, IPv4 address, or (if your platform 
          supports it) IPv6 address 
  port    server's TCP port number or name 
  mfile   optional macro file 
  login   "1" if automatic login is enabled for the world's socket, "0" 
          otherwise.  
  proxy   "1" if this world's socket is using a proxy, "0" otherwise 
  src     optional name or address used for client (tf) end of connection.  
  cipher  current cipher used by SSL connection to world.  

  The character name, password, and type are used by automatic login, if the 
  %{login} flag is on.  

  The macro file is loaded when a socket is opened to the world.  It can 
  contain any commands you want executed automatically when you connect to 
  that world.  If the flag %{sockmload} is on, this file will also be loaded 
  whenever you switch to a world with the SOCKETB and SOCKETF keys (see 
  sockets, /dokey, hooks (CONNECT)).  

  World information can be accessed with the macro expansion 
  ${world_fieldname} or the function world_info(worldname, fieldname), where 
  <fieldname> is one of the fields described above.  

  For example: 
  /eval say I am ${world_character} on ${world_name}.  
  This would tell the rest of the world some stuff they probably don't care 
  about, namely the label your Fugue has assigned to the current world and the 
  character name under which it logged on.  
#

  Fugue also keeps track of a world named "default", which is just a dummy 
  world with a character name and password, and optionally a macro file.  If a 
  default world is defined, worlds without character, password, or file fields 
  will use the values from the default world.  

  See also: sockets 

&