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
|
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "JOE" "" "March 2016" "" ""
.
.SH "NAME"
\fBJOE\fR \- Joe\'s Own Editor
.
.SH "Syntax"
\fBjoe [global\-options] [ [local\-options] filename ]\.\.\.\fR
.
.br
\fBjstar [global\-options] [ [local\-options] filename ]\.\.\.\fR
.
.br
\fBjmacs [global\-options] [ [local\-options] filename ]\.\.\.\fR
.
.br
\fBrjoe [global\-options] [ [local\-options] filename ]\.\.\.\fR
.
.br
\fBjpico [global\-options] [ [local\-options] filename ]\.\.\.\fR
.
.SH "Description"
JOE is a powerful console screen editor\. It has a "mode\-less" user interface which is similar to many user\-friendly PC editors\. Users of Micro\-Pro\'s WordStar or Borland\'s "Turbo" languages will feel at home\. JOE is a full featured UNIX screen\-editor though, and has many features for editing programs and text\.
.
.P
JOE also emulates several other editors\. JSTAR is a close imitation of WordStar with many "JOE" extensions\. JPICO is a close imitation of the Pine mailing system\'s PICO editor, but with many extensions and improvements\. JMACS is a GNU\-EMACS imitation\. RJOE is a restricted version of JOE, which allows you to edit only the files specified on the command line\.
.
.P
Although JOE is actually five different editors, it still requires only one executable, but one with five different names\. The name of the editor with an "rc" appended gives the name of JOE\'s initialization file, which determines the personality of the editor\.
.
.P
JOE is free software; you can distribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation\. JOE is available over the Internet from \fIhttp://www\.sourceforge\.net/projects/joe\-editor\fR\.
.
.SH "Usage"
To start the editor, type \fBjoe\fR followed by zero or more names of files you want to edit\. Each file name may be preceded by a local option setting (see the local options table which follows)\. Other global options, which apply to the editor as a whole, may also be placed on the command line (see the global options table which follows)\. If you are editing a new file, you can either give the name of the new file when you invoke the editor, or in the editor when you save the new file\. A modified syntax for file names is provided to allow you to edit program output, standard input/output, or sections of files or devices\. See the section \fIFilenames\fR below for details\.
.
.P
Once you are in the editor, you can type in text and use special control\-character sequences to perform other editing tasks\. To find out what the control\-character sequences are, read the rest of this man page or type \fB^K H\fR for help in the editor\.
.
.P
Now for some obscure computer\-lore:
.
.P
The \fB^\fR means that you hold down the \fBControl\fR key while pressing the following key (the same way the \fBShift\fR key works for uppercase letters)\. A number of control\-key sequences are duplicated on other keys, so that you don\'t need to press the control key: \fBEsc\fR will work in place of \fB^[\fR, \fBDel\fR will work in place of \fB^?\fR, \fBBackspace\fR will work in place of \fB^H\fR, \fBTab\fR will work in place of \fB^I\fR, \fBReturn\fR or \fBEnter\fR will work in place of \fB^M\fR and \fBLinefeed\fR will work in place of \fB^J\fR\. Some keyboards may give you trouble with some control keys\. \fB^\fR_, \fB^^\fR and \fB^@\fR can usually be entered without pressing shift (i\.e\., try \fB^\-\fR, \fB^6\fR and \fB^2\fR)\. Other keyboards may reassign these to other keys\. Try: \fB^\.\fR, \fB^,\fR and \fB^/\fR\. \fB^Space\fR can usually be used in place of \fB^@\fR\. \fB^\e\fR and \fB^]\fR are interpreted by many communication programs, including telnet and kermit\. Usually you just hit the key twice to get it to pass through the communication program\.
.
.P
On some keyboards, holding the \fBAlt\fR key down while pressing another key is the same as typing \fBEsc\fR before typing the other key\.
.
.P
Once you have typed \fB^K H\fR, the first help window appears at the top of the screen\. You can continue to enter and edit text while the help window is on\. To page through other topics, hit \fBEsc ,\fR and \fBEsc \.\fR (that is, \fBEsc ,\fR and \fBEsc \.\fR)\. Use \fB^K H\fR to dismiss the help window\.
.
.P
You can customize the keyboard layout, the help screens and a number of behavior defaults by copying JOE\'s initialization file (usually \fB/etc/joe/joerc\fR) to \fB\.joerc\fR in your home directory and then by modifying it\. See the section \fIjoerc\fR below\.
.
.P
To have JOE used as your default editor for e\-mail and News, you need to set the \fBEDITOR\fR and \fBVISUAL\fR environment variables in your shell initialization file (\fB\.cshrc\fR or \fB\.profile\fR) to refer to JOE (JOE usually resides as \fB/usr/bin/joe\fR)\.
.
.P
There are a number of other obscure invocation parameters which may have to be set, particularly if your terminal screen is not updating as you think it should\. See the section \fIEnvironment variables\fR below\.
.
.P
\fI\fR
.
.SH "Command Line Options"
These options can also be specified in the joerc file\. Local options can be set depending on the file\-name extension\. Programs (\.c, \.h or \.p extension) usually have autoindent enabled\. Wordwrap is enabled on other files, but rc files have it disabled\.
.
.P
An option is enabled when it\'s given like this:
.
.IP "" 4
.
.nf
\-wordwrap
.
.fi
.
.IP "" 0
.
.P
An option is disabled when it\'s given like this:
.
.IP "" 4
.
.nf
\-\-wordwrap
.
.fi
.
.IP "" 0
.
.P
Some options take arguments\. Arguments are given like this:
.
.IP "" 4
.
.nf
\-lmargin 5
.
.fi
.
.IP "" 0
.
.P
The following global options may be specified on the command line:
.
.IP "\(bu" 4
asis
.
.br
Characters with codes above 127 will be sent to the terminal as\-is, instead of as inverse of the corresponding character below 128\. If this does not work, check your terminal server\. This option has no effect if UTF\-8 encoding is used\.
.
.br
.
.IP "\(bu" 4
assume_256color
.
.br
Assume ANSI\-like terminal emulator supports 256 colors even if termcap entry says it doesn\'t\.
.
.br
.
.IP "\(bu" 4
assume_color
.
.br
Assume ANSI\-like terminal emulator supports color even if termcap entry says it doesn\'t\.
.
.br
.
.IP "\(bu" 4
text_color \fBcolor\fR
.
.br
Set color for text\.
.
.br
.
.IP "\(bu" 4
status_color \fBcolor\fR
.
.br
Set color for status bar\.
.
.br
.
.IP "\(bu" 4
help_color \fBcolor\fR
.
.br
Set color for help\.
.
.br
.
.IP "\(bu" 4
menu_color \fBcolor\fR
.
.br
Set color for menus\.
.
.br
.
.IP "\(bu" 4
prompt_color \fBcolor\fR
.
.br
Set color for prompts\.
.
.br
.
.IP "\(bu" 4
msg_color \fBcolor\fR
.
.br
Set color for messages\.
.
.br
.
.IP "\(bu" 4
autoswap
.
.br
Automatically swap \fB^K B\fR with \fB^K K\fR if necessary to mark a legal block during block copy/move commands\.
.
.br
.
.IP "\(bu" 4
backpath path
.
.br
Sets path to a directory where all backup files are to be stored\. If this is unset (the default) backup files are stored in the directory containing the file\.
.
.br
.
.IP "\(bu" 4
baud nnn
.
.br
Set the baud rate for the purposes of terminal screen optimization (overrides value reported by stty)\. JOE inserts delays for baud rates below 19200, which bypasses tty buffering so that typeahead will interrupt the screen output\. Scrolling commands will not be used for 38400 baud and above\. This is useful for X\-terms and other console ttys which really aren\'t going over a serial line\.
.
.br
.
.IP "\(bu" 4
beep
.
.br
Enable beeps when edit commands return errors, for example when the cursor goes past extremes\.
.
.br
.
.IP "\(bu" 4
break_links
.
.br
When enabled, JOE first deletes the file before writing it in order to break hard\-links and symbolic\-links\.
.
.br
.
.IP "\(bu" 4
break_hardlinks
.
.br
When enabled, and the file is not a symbolic links, JOE first deletes the file before writing it in order to break hard\-links\.
.
.br
.
.IP "\(bu" 4
brpaste
.
.br
When JOE starts, send command to the terminal emulator that enables "bracketed paste mode" (but only if the terminal seems to have the ANSI command set)\. In this mode, text pasted into the window is bracketed with ESC [ 2 0 0 ~ and ESC [ 2 0 1 ~\.
.
.br
.
.IP "\(bu" 4
columns nnn
.
.br
Set number of columns in terminal emulator (in case termcap entry is wrong)\. This is only useful on old system which don\'t have the "get window size" ioctl\.
.
.br
.
.IP "\(bu" 4
csmode
.
.br
Enable continued search mode: Successive \fB^K F\fRs repeat the current search instead of prompting for a new one\.
.
.br
.
.IP "\(bu" 4
dopadding
.
.br
Enable JOE to send padding NULs to the terminal (for very old terminals)\.
.
.br
.
.IP "\(bu" 4
exask
.
.br
When set, \fB^K X\fR prompts for a new name before saving the file\.
.
.br
.
.IP "\(bu" 4
floatmouse
.
.br
When set, mouse clicks can position the cursor beyond the ends of lines\.
.
.br
.
.IP "\(bu" 4
guess_crlf
.
.br
When set, JOE tries to guess the file format MS\-DOS or UNIX\.
.
.br
.
.IP "\(bu" 4
guess_indent
.
.br
When set, JOE tries to guess the indentation character and indentation step based on the contents of the file\. The algorithm is to find the greatest common factor of the three most common indentations found in the file\.
.
.br
.
.IP "\(bu" 4
guess_non_utf8
.
.br
When set, enable guessing of non\-UTF\-8 files in UTF\-8 locales\.
.
.br
.
.IP "\(bu" 4
guess_utf8
.
.br
When set, enable guessing of UTF\-8 files in non\-UTF\-8 locales\.
.
.br
.
.IP "\(bu" 4
guess_utf16
.
.br
When set, enable guessing of UTF\-16 files\. If a UTF\-16BE or UTF\-16LE file is detected, it is converted to UTF\-8 during load, and converted back to UTF\-16 during save\.
.
.br
.
.IP "\(bu" 4
helpon
.
.br
When set, start off with the on\-line help enabled\.
.
.br
.
.IP "\(bu" 4
help_is_utf8
.
.br
When set, the help text in the joerc file is assumed to be UTF\-8\.
.
.br
.
.IP "\(bu" 4
icase
.
.br
Search is case insensitive by default when set\.
.
.br
.
.IP "\(bu" 4
joe_state
.
.br
Enable reading and writing of ~/\.joe_state file
.
.br
.
.IP "\(bu" 4
joexterm
.
.br
Set this if xterm was configured with \-\-paste64 option for better mouse support\.
.
.br
.
.IP "\(bu" 4
keepup
.
.br
The column number on the status line is updated constantly when this is set, otherwise it is updated only once a second\.
.
.br
.
.IP "\(bu" 4
language \fBlanguage\fR
.
.br
Sets language for aspell\.
.
.br
.
.IP "\(bu" 4
lightoff
.
.br
Automatically turn off \fB^K B\fR \fB^K K\fR highlighting after a block operation\.
.
.br
.
.IP "\(bu" 4
lines nnn
.
.br
Set number of lines in terminal emulator (in case termcap entry is wrong)\. This is only useful on old system which don\'t have the "get window size" ioctl\.
.
.br
.
.IP "\(bu" 4
marking
.
.br
Enable marking mode: highlights between \fB^K B\fR and cursor\.
.
.br
.
.IP "\(bu" 4
menu_above
.
.br
Put menus above prompt instead of below them\.
.
.br
.
.IP "\(bu" 4
menu_explorer
.
.br
Stay in menu when a directory is selected (otherwise the directory is added to the path and the cursor jumps back to the prompt)\.
.
.br
.
.IP "\(bu" 4
menu_jump
.
.br
Jump into the file selection menu when \fBTab\fR \fBTab\fR is hit\.
.
.br
.
.IP "\(bu" 4
mid
.
.br
If this option is set and the cursor moves off the window, the window will be scrolled so that the cursor is in the center\. This option is forced on slow terminals which don\'t have scrolling commands\.
.
.br
.
.IP "\(bu" 4
left nn
.
.br
This sets the number of columns the screen scrolls to the left when cursor moves past the left edge or when the crawll command is issued\. If nn is negative, then it\'s the fraction of the screen to scroll\. For example, \-2 means scroll 1/2 the screen\.
.
.br
.
.IP "\(bu" 4
right nn
.
.br
This sets the number of columns the screen scrolls to the right when cursor moves past the right edge or when the crawlr command is issued\. If nn is negative, then it\'s the fraction of the screen to scroll\. For example, \-3 means scroll 1/3 the screen\.
.
.br
.
.IP "\(bu" 4
mouse
.
.br
Enable xterm mouse support\.
.
.br
.
.IP "\(bu" 4
nobackups
.
.br
Disable backup files\.
.
.br
.
.IP "\(bu" 4
nocurdir
.
.br
Disable current\-directory prefix in prompts\.
.
.br
.
.IP "\(bu" 4
noexmsg
.
.br
Disable exiting message ("File not changed so no update needed")
.
.br
.
.IP "\(bu" 4
nolinefeeds
.
.br
Disable sending linefeeds to preserve screen history in terminal emulator\'s scroll\-back buffer (only relevant when notite mode is enabled)\.
.
.br
.
.br
.
.IP "\(bu" 4
nolocks
.
.br
Disable EMACS compatible file locks\.
.
.br
.
.IP "\(bu" 4
nomodcheck
.
.br
Disable periodic file modification check\.
.
.br
.
.IP "\(bu" 4
nonotice
.
.br
This option prevents the copyright notice from being displayed when the editor starts\.
.
.br
.
.IP "\(bu" 4
nosta
.
.br
This option eliminates the top\-most status line\. It\'s nice for when you only want to see your text on the screen or if you\'re using a vt52\.
.
.br
.
.IP "\(bu" 4
notagsmenu
.
.br
Disable selection menu for tags search with multiple results\.
.
.br
.
.IP "\(bu" 4
notite
.
.br
Disable ti and te termcap sequences which are usually set up to save and restore the terminal screen contents when JOE starts and exits\.
.
.br
.
.IP "\(bu" 4
pastehack
.
.br
If keyboard input comes in as one block assume it\'s a mouse paste and disable autoindent and wordwrap\.
.
.br
.
.IP "\(bu" 4
noxon
.
.br
Disable \fB^S\fR and \fB^Q\fR flow control, possibly allowing \fB^S\fR and \fB^Q\fR to be used as editor keys\.
.
.br
.
.IP "\(bu" 4
orphan
.
.br
Orphan extra files given on the command line instead of creating windows for them (the files are loaded, but you need to use switch\-buffer commands to access them)\.
.
.br
.
.IP "\(bu" 4
pg nnn
.
.br
Set number of lines to keep during Page Up and Page Down (use \-1 for 1/2 window size)\.
.
.br
.
.IP "\(bu" 4
regex
.
.br
Use standard regular expression syntax by default, instead of the JOE syntax (where special characters have their meaning only when preceded with backslash)\.
.
.br
.
.IP "\(bu" 4
restore
.
.br
Set to have cursor positions restored to last positions of previously edited files\.
.
.br
.
.IP "\(bu" 4
rtbutton
.
.br
Swap left and right mouse buttons\.
.
.br
.
.IP "\(bu" 4
search_prompting
.
.br
Show previous search string in search command (like in PICO)\.
.
.br
.
.IP "\(bu" 4
skiptop nnn
.
.br
When set to N, the first N lines of the terminal screen are not used by JOE and are instead left with their original contents\. This is useful for programs which call JOE to leave a message for the user\.
.
.br
.
.IP "\(bu" 4
square
.
.br
Enable rectangular block mode\.
.
.br
.
.IP "\(bu" 4
transpose
.
.br
Transpose rows with columns in all menus\.
.
.br
.IP "\(bu" 4
title
.
.br
Display context (titles) in status line. When enabled this shows the first line of the function that the cursor is in on the status line\. The syntax file context.jsf identifies which lines are title lines\.
.
.br
.
.IP "\(bu" 4
type
.
.br
Select file type, overriding the automatically determined type\. The file types are defined in the \fBftyperc\fR file\.
.
.br
.
.IP "\(bu" 4
undo_keep nnn
.
.br
Sets number of undo records to keep (0 means infinite)\.
.
.br
.
.IP "\(bu" 4
usetabs
.
.br
Set to allow rectangular block operations to use tabs\.
.
.br
.
.IP "\(bu" 4
wrap
.
.br
Enable search to wrap to beginning of file\.
.
.br
.
.IP "" 0
.
.P
The following local options may be specified on the command line:
.
.IP "\(bu" 4
+nnn
.
.br
The cursor starts on the specified line\.
.
.br
.
.IP "\(bu" 4
autoindent
.
.br
Enable auto\-indent mode\. When you hit \fBEnter\fR on an indented line, the indentation is duplicated onto the new line\.
.
.br
.
.IP "\(bu" 4
c_comment
.
.br
Enable \fB^G\fR skipping of C\-style comments /\fI\.\.\.\fR/
.
.br
.
.IP "\(bu" 4
cpara \fBcharacters\fR
.
.br
Sets list of characters which can indent paragraphs\.
.
.br
.
.IP "\(bu" 4
cnotpara \fBcharacters\fR
.
.br
Sets list of characters which begin lines which are definitely not part of paragraphs\.
.
.br
.
.IP "\(bu" 4
cpp_comment
.
.br
Enable \fB^G\fR skipping of C++\-style comments // \.\.\.
.
.br
.
.IP "\(bu" 4
crlf
.
.br
JOE uses CR\-LF as the end of line sequence instead of just LF\. This is for editing MS\-DOS or VMS files\.
.
.br
.
.IP "\(bu" 4
encoding \fBencoding\fR
.
.br
Set file encoding (like utf\-8 or 8859\-1)\.
.
.br
.
.IP "\(bu" 4
flowed
.
.br
Set to force an extra space after each line of a paragraph but the last\.
.
.br
.
.IP "\(bu" 4
force
.
.br
When set, a final newline is appended to the file if there isn\'t one when the file is saved\.
.
.br
.
.IP "\(bu" 4
french
.
.br
When set, only one space is inserted after periods in paragraph reformats instead of two\.
.
.br
.
.IP "\(bu" 4
hex
.
.br
Enable hex\-dump mode\.
.
.br
.
.IP "\(bu" 4
highlight
.
.br
Enable syntax highlighting\.
.
.br
.
.IP "\(bu" 4
highlighter_context
.
.br
Enable use of syntax file to identify comments and strings which should be skipped over during \fB^G\fR matching\.
.
.br
.
.IP "\(bu" 4
indentc nnn
.
.br
Sets the indentation character for shift left and shift right (\fB^K ,\fR and \fB^K \.\fR)\. Use 32 for \fBSpace\fR, 9 for \fBTab\fR\.
.
.br
.
.IP "\(bu" 4
indentfirst
.
.br
When set, the smart home key jumps to the indentation point first, otherwise it jumps to column 1 first\.
.
.br
.
.IP "\(bu" 4
istep nnn
.
.br
Sets indentation step\.
.
.br
.
.IP "\(bu" 4
linums
.
.br
Enable line number display\.
.
.br
.
.IP "\(bu" 4
lmargin
.
.br
Set left margin\.
.
.br
.
.IP "\(bu" 4
lmsg
.
.br
Define left\-side status bar message\.
.
.br
.
.IP "\(bu" 4
overwrite
.
.br
Enable overtype mode\. Typing overwrites existing characters instead of inserting before them\.
.
.br
.
.IP "\(bu" 4
picture
.
.br
Enable "picture" mode\- allows cursor to go past ends of lines\.
.
.br
.
.IP "\(bu" 4
pound_comment
.
.br
\fB^G\fR ignores # \.\.\. comments\.
.
.br
.
.IP "\(bu" 4
purify
.
.br
Fix indentation if necessary before shifting or smart backspace\. For example, if indentation uses a mix of tabs and spaces, and indentc is space, then indentation will be converted to all spaces before the shifting operation\.
.
.br
.
.IP "\(bu" 4
rdonly
.
.br
Set read\-only mode\.
.
.br
.
.IP "\(bu" 4
rmargin nnn
.
.br
Set right margin\.
.
.br
.
.IP "\(bu" 4
rmsg \fBstring\fR
.
.br
Define right\-side status bar message\.
.
.br
.
.IP "\(bu" 4
semi_comment
.
.br
\fB^G\fR ignores ; \.\.\. comments\.
.
.br
.
.IP "\(bu" 4
single_quoted
.
.br
\fB^G\fR ignores \'\.\.\.\'
.
.br
.
.IP "\(bu" 4
smartbacks
.
.br
Enable smart backspace and tab\. When this mode is set backspace and tab indent or unindent based on the values of the istep and indentc options\.
.
.br
.
.IP "\(bu" 4
smarthome
.
.br
Home key first moves cursor to beginning of line, then if hit again, to the first non\-blank character\.
.
.br
.
.IP "\(bu" 4
smsg \fBstring\fR
.
.br
Define status command format when cursor is on a character\.
.
.br
.
.IP "\(bu" 4
spaces
.
.br
Insert spaces when \fBTab\fR key is hit\.
.
.br
.
.IP "\(bu" 4
syntax \fBsyntax\fR
.
.br
Set syntax for syntax highlighting\.
.
.br
.
.IP "\(bu" 4
tab nnn
.
.br
Set tab stop width\.
.
.br
.
.IP "\(bu" 4
text_delimiters \fBword delimiter list\fR
.
.br
Give list of word delimiters which \fB^G\fR will step through\.
.
.IP "" 0
.
.P
For example, "begin=end:if=elif=else=endif" means that \fB^G\fR will jump between the matching if, elif, else and endif\.
.
.IP "\(bu" 4
vhdl_comment
.
.br
\fB^G\fR ignores \-\- \.\.\. comments
.
.br
.
.IP "\(bu" 4
wordwrap
.
.br
JOE wraps the previous word when you type past the right margin\.
.
.br
.
.IP "\(bu" 4
zmsg \fBstring\fR
.
.br
Define status command format when cursor is at end of file\.
.
.br
.
.IP "\(bu" 4
xmsg \fBstring\fR
.
.br
Define startup message (usually the copyright notice)\.
.
.br
.
.IP "\(bu" 4
aborthint \fBstring\fR
.
.br
Give the key sequence to show in prompts for abort (usually ^C)\.
.
.br
.
.IP "\(bu" 4
helphint \fBstring\fR
.
.br
Give the key sequence to show in prompts for help (usually ^K H)\.
.
.br
.
.IP "" 0
.
.SS "Colors and attributes"
Combine attributes and up to one foreground color and one background color to create arguments for color options like text_color\. For example: bold+bg_green+blue
.
.IP "\(bu" 4
Attributes: bold, inverse, blink, dim, underline, and italic
.
.IP "\(bu" 4
Foreground colors: white, cyan, magenta, blue, yellow, green, red, or black
.
.IP "\(bu" 4
Background colors: bg_white, bg_cyan, bg_magenta, bg_blue, bg_yellow, bg_green, bg_red or bg_black
.
.IP "" 0
.
.P
With a 16 color or 256 color terminal emulator (export TERM=xterm\-16color), these brighter than normal colors become available:
.
.IP "\(bu" 4
Foreground: WHITE, CYAN, MAGENTA, BLUE, YELLOW, GREEN, RED or BLACK
.
.IP "\(bu" 4
Background: bg_WHITE, bg_CYAN, bg_MAGENTA, bg_BLUE, bg_YELLOW, bg_GREEN, bg_RED or bg_BLACK
.
.IP "" 0
.
.P
With a 256 color terminal emulator (export TERM=xterm\-256color), these become available:
.
.IP "\(bu" 4
fg_RGB and bg_RGB, where R, G and B rand from 0 \- 5\. So: fg_500 is bright red\.
.
.IP "\(bu" 4
fg_NN and bg_NN give shades of grey, where the intensity, NN, ranges from 0 \- 23\.
.
.IP "" 0
.
.SS "Status line definition strings"
\-lmsg defines the left\-justified string and \-rmsg defines the right\-justified string\. The first character of \-rmsg is the background fill character\.
.
.P
\-smsg defines the status command (\fB^K Space\fR)\. \-zmsg defines it when the cursor is at the end of the file\. The last character of smsg or zmsg is the fill character\.
.
.P
The following escape sequences can be used in these strings:
.
.IP "" 4
.
.nf
%t 12 hour time
%u 24 hour time
%T O for overtype mode, I for insert mode
%W W if wordwrap is enabled
%I A if autoindent is enabled
%X Rectangle mode indicator
%n File name
%m \'(Modified)\' if file has been changed
%* \'*\' if file has been changed
%R Read\-only indicator
%r Row (line) number
%c Column number
%o Byte offset into file
%O Byte offset into file in hex
%a Ascii value of character under cursor
%A Ascii value of character under cursor in hex
%w Width of character under cursor
%p Percent of file cursor is at
%l No\. lines in file
%k Entered prefix keys
%S \'*SHELL*\' if there is a shell running in window
%M Macro recording message
%y Syntax
%e Encoding
%x Context (first non\-indented line going backwards)
%dd day
%dm month
%dY year
%Ename% value of environment variable
%Tname% value of option (ON or OFF for Boolean options)
.
.fi
.
.IP "" 0
.
.P
These formatting escape sequences may also be given:
.
.IP "" 4
.
.nf
\ei Inverse
\eu Underline
\eb Bold
\ed Dim
\ef Blink
\el Italic
.
.fi
.
.IP "" 0
.
.P
.
.br
.
.SH "Basic Editing"
When you type characters into the editor, they are normally inserted into the file being edited (or appended to the file if the cursor is at the end of the file)\. This is the normal operating mode of the editor\. If you want to replace some existing text, you have to delete the old text before or after you type in the replacement text\. The \fBBackspace\fR key can be used for deleting text: move the cursor to right after the text you want to delete and hit \fBBackspace\fR a number of times\.
.
.P
Hit the \fBEnter\fR or \fBReturn\fR key to insert a line\-break\. For example, if the cursor was in the middle of a line and you hit \fBEnter\fR, the line would be split into two lines with the cursor appearing at the beginning of the second line\. Hit \fBBackspace\fR at the beginning of a line to eliminate a line\-break\.
.
.P
Use the arrow keys to move around the file\. If your keyboard doesn\'t have arrow keys (or if they don\'t work for some reason), use \fB^F\fR to move forwards (right), \fB^B\fR to move backwards (left), \fB^P\fR to move to the previous line (up), and \fB^N\fR to move to the next line (down)\. The right and left arrow keys simply move forwards or backwards one character at a time through the text: if you\'re at the beginning of a line and you press left\-arrow, you will end up at the end of the previous line\. The up and down arrow keys move forwards and backwards by enough characters so that the cursor appears in the same column that it was in on the original line\.
.
.P
If you want to indent the text you enter, you can use the \fBTab\fR key\. This inserts a special control character which makes the characters which follow it begin at the next tab stop\. Tab stops normally occur every 8 columns, but this can be changed with the \fB^T D\fR command\. PASCAL and C programmers often set tab stops on every 4 columns\.
.
.P
If for some reason your terminal screen gets messed up (for example, if you receive a mail notice from biff), you can have the editor refresh the screen by hitting \fB^R\fR\.
.
.P
There are many other keys for deleting text and moving around the file\. For example, hit \fB^D\fR to delete the character the cursor is on instead of deleting backwards like \fBBackspace\fR\. \fB^D\fR will also delete a line\-break if the cursor is at the end of a line\. Type \fB^Y\fR to delete the entire line the cursor is on or \fB^J\fR to delete just from the cursor to the end of the line\.
.
.P
Hit \fB^A\fR to move the cursor to the beginning of the line it\'s on\. Hit \fB^E\fR to move the cursor to the end of the line\. Hit \fB^U\fR or \fB^V\fR for scrolling the cursor up or down 1/2 a screen\'s worth\.
.
.br
"Scrolling" means that the text on the screen moves, but the cursor stays at the same place relative to the screen\. Hit \fB^K U\fR or \fB^K V\fR to move the cursor to the beginning or the end of the file\. Look at the help screens in the editor to find even more delete and movement commands\.
.
.P
If you make a mistake, you can hit \fB^_\fR to "undo" it\. On most keyboards you hit just \fB^\-\fR to get \fB^_\fR, but on some you might have to hold both the \fBShift\fR and \fBControl\fR keys down at the same time to get it\. If you "undo" too much, you can "redo" the changes back into existence by hitting \fB^^\fR (type this with just \fB^6\fR on most keyboards)\.
.
.SS "Cursor position history"
If you were editing in one place within the file, and you then temporarily had to look or edit some other place within the file, you can get back to the original place by hitting \fB^K \-\fR\. This command actually returns you to the last place you made a change in the file\. You can step through a history of places with \fB^K \-\fR and \fB^K =\fR, in the same way you can step through the history of changes with the "undo" and "redo" commands\.
.
.SS "Save and exit"
When you are done editing the file, hit \fB^K X\fR to exit the editor\. You will be prompted for a file name if you hadn\'t already named the file you were editing\.
.
.P
When you edit a file, you actually edit only a copy of the file\. So if you decide that you don\'t want the changes you made to a file during a particular edit session, you can hit \fB^C\fR to exit the editor without saving them\.
.
.P
If you edit a file and save the changes, a backup copy of that file is created in the current directory, with a \fB~\fR appended to the name, which contains the original version of the file\.
.
.SS "File operations"
You can hit \fB^K D\fR to save the current file (possibly under a different name from what the file was called originally)\. After the file is saved, you can hit \fB^K E\fR to edit a different file\.
.
.P
If you want to save only a selected section of the file, see the section on \fIBlocks\fR below\.
.
.P
If you want to include another file in the file you\'re editing, use \fB^K R\fR to insert it\.
.
.P
\fI\fR
.
.SS "Filenames"
Wherever JOE expects you to enter a file name, whether on the command line or in prompts within the editor, you may also type:
.
.IP "\(bu" 4
!command
.
.IP "" 0
.
.P
To read or write data to or from a shell command\. For example, use \fBjoe \'!ls\'\fR to get a copy of your directory listing to edit or from within the editor use \fB^K D !mail jhallen@world\.std\.com\fR to send the file being edited to me\.
.
.IP "\(bu" 4
>>filename
.
.IP "" 0
.
.P
Use this to have JOE append the edited text to the end of the file "filename\."
.
.IP "\(bu" 4
filename,START,SIZE
.
.IP "" 0
.
.P
Use this to access a fixed section of a file or device\. \fBSTART\fR and \fBSIZE\fR may be entered in decimal (ex\.: 123) octal (ex\.: 0777) or hexadecimal (ex\.: 0xFF)\. For example, use \fBjoe /dev/fd0,508,2\fR to edit bytes 508 and 509 of the first floppy drive in Linux\.
.
.IP "\(bu" 4
\-
.
.IP "" 0
.
.P
Use this to get input from the standard input or to write output to the standard output\. For example, you can put JOE in a pipe of commands: \fBquota \-v | joe | mail root\fR, if you want to complain about your low quota\.
.
.SS "Using JOE in a shell script"
JOE used to use /dev/tty to access the terminal\. This caused a problem with idle\-session killers (they would kill JOE because the real tty device was not being accessed for a long time), so now JOE only uses /dev/tty if you need to pipe a file into JOE, as in:
.
.IP "" 4
.
.nf
echo "hi" | joe
.
.fi
.
.IP "" 0
.
.P
If you want to use JOE in a shell script which has its stdin/stdout redirected, but you do not need to pipe to it, you should simply redirect JOE\'s stdin/stdout to /dev/tty:
.
.IP "" 4
.
.nf
joe filename </dev/tty >/dev/tty
.
.fi
.
.IP "" 0
.
.P
.
.br
.
.br
.
.SS "Word wrap and formatting"
If you type past the right edge of the screen in a C or PASCAL language file, the screen will scroll to the right to follow the cursor\. If you type past the right edge of the screen in a normal file (one whose name doesn\'t end in \.c, \.h or \.p), JOE will automatically wrap the last word onto the next line so that you don\'t have to hit \fBEnter\fR\. This is called word\-wrap mode\. Word\-wrap can be turned on or off with the \fB^T W\fR command\. JOE\'s initialization file is usually set up so that this mode is automatically turned on for all non\-program files\. See the section below on the \fIjoerc\fR file to change this and other defaults\.
.
.P
Aside for Word\-wrap mode, JOE does not automatically keep paragraphs formatted like some word\-processors\. Instead, if you need a paragraph to be reformatted, hit \fB^K J\fR\. This command "fills in" the paragraph that the cursor is in, fitting as many words in a line as is possible\. A paragraph, in this case, is a block of text separated above and below by a blank line\.
.
.P
The margins which JOE uses for paragraph formatting and word\-wrap can be set with the \fB^T L\fR and \fB^T R\fR commands\. If the left margin is set to a value other than 1, then when you start typing at the beginning of a line, the cursor will immediately jump to the left margin\.
.
.P
There are a number of options which control the paragraph reformatter and word wrapper:
.
.IP "\(bu" 4
The \fBcpara\fR option provides a list of characters which can indent a paragraph\. For example, in e\-mail quoted matter is indicated by \fB>\fR at the beginnings of line, so this character should be in the cpara list\.
.
.IP "\(bu" 4
The \fBcnotpara\fR option provides a list of characters which, if they are the first non\-whitespace character of a line, indicate that the line is not to be included as part of a paragraph for formatting\. For example, lines beginning with \'\.\' in nroff can not be paragraph lines\.
.
.IP "\(bu" 4
Autoindent mode affects the formatter\. If autoindent is disabled, only the first line will be indented\. If autoindent is enabled, the entire paragraph is indented\.
.
.IP "\(bu" 4
\fBfrench\fR determines how many spaces are inserted after periods\.
.
.IP "\(bu" 4
When \fBflowed\fR is enabled, a space is inserted after each but the last line of the paragraph\. This indicates that the lines belong together as a single paragraph in some programs\.
.
.IP "\(bu" 4
When \fBovertype\fR is enabled, the word wrapper will not insert lines\.
.
.IP "" 0
.
.SS "Centering"
If you want to center a line within the margins, use the \fB^K A\fR command\.
.
.SS "Spell checker"
Hit \fBEsc N\fR to check the spelling of the word the cursor is on using the aspell program (or ispell program if you modify the joerc file)\. Hit \fBEsc L\fR to check the highlighted block or the entire file if no block is highlighted\.
.
.P
JOE passes the language and character encoding to the spell checker\. To change the language, hit \fB^T V\fR\. For example, use en_US for English\.
.
.SS "Overtype mode"
Sometimes it\'s tiresome to have to delete old text before or after you insert new text\. This happens, for example, when you are changing a table and you want to maintain the column position of the right side of the table\.
.
.br
When this occurs, you can put the editor in overtype mode with \fB^T T\fR\.
.
.br
When the editor is in this mode, the characters you type in replace existing characters, in the way an idealized typewriter would\. Also, \fBBackspace\fR simply moves left instead of deleting the character to the left, when it\'s not at the end or beginning of a line\. Overtype mode is not the natural way of dealing with text electronically, so you should go back to insert\-mode as soon as possible by typing \fB^T T\fR again\.
.
.P
If you need to insert while you\'re in overtype mode, hit \fB^@\fR\. This inserts a single \fBSpace\fR into the text\.
.
.SS "Control and Meta characters"
Each character is represented by a number\. For example, the number for \'A\' is 65 and the number for \'1\' is 49\. All of the characters which you normally see have numbers in the range of 32 \- 126 (this particular arbitrary assignment between characters and numbers is called the ASCII character set)\. The numbers outside of this range, from 0 to 255, aren\'t usually displayed, but sometimes have other special meanings\. The number 10, for example, is used for the line\-breaks\. You can enter these special, non\-displayed \fBcontrol characters\fR by first hitting \fB^Q\fR and then hitting a character in the range \fB@ A B C \.\.\. X Y Z [ ^ ] \e _\fR to get the number 0 \- 31, and ? to get 127\. For example, if you hit \fB^Q J\fR, you\'ll insert a line\-break character, or if you hit \fB^Q I\fR, you\'ll insert a \fBTab\fR character (which does the same thing the \fBTab\fR key does)\. A useful control character to enter is 12 (\fB^Q L\fR), which causes most printers to advance to the top of the page\. You\'ll notice that JOE displays this character as an underlined L\. You can enter the characters above 127, the \fBmeta characters\fR, by first hitting \fB^\e\fR\. This adds 128 to the next (possibly control) character entered\. JOE displays characters above 128 in inverse\-video\. Some foreign languages, which have more letters than English, use the meta characters for the rest of their alphabet\. You have to put the editor in \fBasis\fR mode to have these passed untranslated to the terminal\.
.
.P
\fBNote:\fR JOE now normally passes all 8\-bits to the terminal unless the locale is set to C or POSIX\. If the locale is C or POSIX, then the \fBasis\fR flag determines if \fBmeta characters\fR are shown in inverse video or passed directly to the terminal\.
.
.P
\fBNote:\fR In older version of JOE, you had to use \fBEsc \'\fR to enter control characters\.
.
.SH "Character sets and UTF\-8"
JOE natively handles two classes of character sets: UTF\-8 and byte coded (like ISO\-8859\-1)\. For these character sets, the file is loaded as\-is into memory, and is exactly preserved during save, even if it contains UTF\-8 coding errors\.
.
.P
It can not yet natively handle other major classes such as UTF\-16 or GB2312\. There are other restrictions: character sets must use LF (0x0A) or CR\-LF (0x0D \- 0x0A) as line terminators, space must be 0x20 and tab must be 0x09\. Basically, the files must be UNIX or MS\-DOS compatible text files\.
.
.P
This means EBCDIC will not work properly (but you would need to handle fixed record length lines anyway) and character sets which use CR terminated lines (MACs) will not yet work\.
.
.P
JOE now supports UTF\-16 (both big endian and little endian)\. It supports UTF\-16 by converting to UTF\-8 during load, and converting back to UTF\-16 during save\.
.
.P
The terminal and the file can have different encodings\. JOE will translate between the two\. Currently, one of the two must be UTF\-8 for translation to work\.
.
.P
The character set for the terminal and the default character set assumed for files is determined by the \'LC_ALL\' environment variable (and if that\'s not set, LC_CTYPE and LANG are also checked)\.
.
.P
For example, if LC_ALL is set to:
.
.IP "" 4
.
.nf
de_DE
.
.fi
.
.IP "" 0
.
.P
Then the character set will be ISO\-8859\-1\.
.
.P
If LC_ALL is set to:
.
.IP "" 4
.
.nf
de_DE\.UTF\-8
.
.fi
.
.IP "" 0
.
.P
The character set will be UTF\-8\.
.
.P
Hit \fB^T E\fR to change the coding for the file\. Hit \fBTab\fR \fBTab\fR at this prompt to get a list of available codings\. There are a number of built\-in character sets, plus you can install character sets in the ~/\.joe/charmaps and /usr/share/joe/charmaps directories\.
.
.P
Check: /usr/share/i18n/charmaps for example character set files\. Only byte oriented character sets will work\. Also, the file should not be gzipped (all of the charmap files in /usr/share/i18n/charmaps on my computer were compressed)\. The parser is very bad, so basically the file has to look exactly like the example one in /usr/share/joe/charmaps\.
.
.P
You can hit \fB^K Space\fR to see the current character set\.
.
.P
You can hit \fB^Q x\fR to enter a Unicode character if the file coding is UTF\-8\.
.
.SH "Prompts"
Most prompts record a history of the responses you give them\. You can hit up and down arrow to step through these histories\.
.
.P
Prompts are actually single line windows with no status line, so you can use any editing command that you normally use on text within the prompts\. The prompt history is actually just other lines of the same "prompt file"\. Thus you can can search backwards though the prompt history with the normal \fB^K F\fR command if you want\.
.
.P
Since prompts are windows, you can also switch out of them with \fB^K P\fR and \fB^K N\fR\.
.
.SS "Completion and selection menus"
You can hit \fBTab\fR in just about any prompt to request JOE to complete the word you are typing\. If JOE beeps, there are either no completions or many\. As with the "bash" shell, hit \fBTab\fR twice to bring up a list of all the possibilities\. This list is actually a menu, but by default, the cursor does not jump into it since it is usually easier to just type in your selection\. You can, however, jump into the menu window with \fB^K P\fR (move to previous window) and use the arrow keys and <Enter> to make your selection\. Also in a menu, you can hit the first letter of any of the items to make the cursor jump directly to it\. The \fB^T\fR option menu works like this\.
.
.P
If the menu is too large to fit in the window, you can hit Page Up and Page Down to scroll it (even if you have not jumped into it)\.
.
.P
\fBTab\fR completion works in the search and replace prompts as well\. In this case, JOE tries to complete the word based on the contents of the buffer\. If you need search for the \fBTab\fR character itself, you can enter it with \fB^Q Tab\fR\.
.
.P
Also, you can hit \fBEsc Enter\fR in a text window to request JOE to complete the word you are typing\. As with the search prompt, JOE tries to complete the word based on the contents of the buffer\. It will bring up a menu of possibilities if you hit \fBEsc Enter\fR twice\.
.
.SH "Where am I?"
Hit \fB^K Space\fR to have JOE report the line number, column number, and byte number on the last line of the screen\. The number associated with the character the cursor is on (its ASCII code) is also shown\. You can have the line number and/or column number always displayed on the status line by placing the appropriate escape sequences in the status line setup strings\. Edit the joerc file for details\.
.
.SH "What if I hit <strong>^K</strong> by accident?"
Hit the space bar\. This runs an innocuous command (it shows the line number on the status bar)\.
.
.SH "Temporarily suspending the editor"
If you need to temporarily stop the editor and go back to the shell, hit \fB^K Z\fR\. You might want to do this to stop whatever you\'re editing and answer an e\-mail message or read this man page, for example\. You have to type \fBfg\fR or \fBexit\fR (you\'ll be told which when you hit \fB^K Z\fR) to return to the editor\.
.
.SH "Searching for text"
Hit \fB^K F\fR to have the editor search forwards or backwards for a text fragment (\fBstring\fR) for you\. You will be prompted for the text to search for\. After you hit \fBEnter\fR, you are prompted to enter options\.
.
.br
You can just hit \fBEnter\fR again to have the editor immediately search forwards for the text, or you can enter one or more of these options:
.
.IP "\(bu" 4
\fBb\fR
.
.br
.
.IP "" 0
.
.P
Search backwards instead of forwards\.
.
.IP "\(bu" 4
\fBi\fR
.
.br
.
.IP "" 0
.
.P
Treat uppercase and lower case letters as the same when searching\. Normally uppercase and lowercase letters are considered to be different\.
.
.IP "\(bu" 4
\fBnnn\fR
.
.br
.
.IP "" 0
.
.P
(where \fBnnn\fR is a number) If you enter a number, JOE searches for the Nth occurrence of the text\. This is useful for going to specific places in files structured in some regular manner\.
.
.IP "\(bu" 4
\fBr\fR
.
.br
.
.IP "" 0
.
.P
Replace text\. If you enter the \fBr\fR option, then you will be further prompted for replacement text\. Each time the editor finds the search text, you will be prompted as to whether you want to replace the found search text with the replacement text\. You hit: \fBy\fR to replace the text and then find the next occurrence, \fBn\fR to not replace this text, but to then find the next occurrence, \fBr\fR to replace all of the remaining occurrences of the search text in the remainder of the file without asking for confirmation (subject to the \fBnnn\fR option above), or \fB^C\fR to stop searching and replacing\.
.
.P
You can also hit \fBB\fR or \fBBackspace\fR to back up to the previously found text (if it had been replaced, the replacement is undone)\.
.
.IP "\(bu" 4
\fBa\fR
.
.br
.
.IP "" 0
.
.P
The search covers all loaded buffers\. So to replace all instances of "foo" with "bar" in all \.c files in the current directory:
.
.IP "" 4
.
.nf
joe *\.c
^K F
foo <Enter>
ra <Enter>
bar <Enter>
.
.fi
.
.IP "" 0
.
.IP "\(bu" 4
\fBe\fR
.
.br
.
.IP "" 0
.
.P
The search covers all files in the grep or make error list\. You can use a UNIX command to generate a list of files and search and replace through the list\. So to replace all instances of "foo" with "bar" in all \.c files which begin with f\. You can also use "ls" and "find" instead of grep to create the file list\.
.
.IP "" 4
.
.nf
Esc G
grep \-n foo f*\.c <Enter>
^K F
foo <Enter>
re <Enter>
bar <Enter>
.
.fi
.
.IP "" 0
.
.IP "\(bu" 4
\fBx\fR
.
.br
.
.IP "" 0
.
.P
JOE will use the standard syntax for regular expressions if this option is given\. In the standard syntax, these characters have their special meanings directly, and do not have to be escaped with backslash: \., *, +, ?, {, }, (, ), |, ^, $ and [\.
.
.IP "\(bu" 4
\fBy\fR
.
.br
.
.IP "" 0
.
.P
JOE will use the JOE syntax for regular expressions instead of the standard syntax\. This overrides the "\-regex" option\.
.
.IP "\(bu" 4
\fBv\fR
.
.br
.
.IP "" 0
.
.P
JOE will send debug information about the regular expression to the startup log\. The log can be viewed with the showlog command\.
.
.P
You can hit \fB^L\fR to repeat the previous search\.
.
.P
You can hit \fB^K H\fR at the search and replace options prompt to bring up a list of all search and replace options\.
.
.SS "Regular Expressions"
A number of special character sequences may be entered as search text:
.
.IP "\(bu" 4
\fB\e*\fR
.
.br
.
.IP "" 0
.
.P
This finds zero or more of the item to the left\. For example, if you give \fBAB\e*C\fR as the search text, JOE will try to find an A followed by any number of Bs, and then a C\.
.
.IP "\(bu" 4
\fB\e+\fR
.
.br
.
.IP "" 0
.
.P
This finds one or more of the item to the left\. For example, if you give \fBAB\e+C\fR as the search text, JOE will try to find an A followed by one or more Bs, and then a C\.
.
.IP "\(bu" 4
\fB\e?\fR
.
.br
.
.IP "" 0
.
.P
This indicates that the item to the left is optional\. For example, if you give \fBAB\e?C\fR as the search text, JOE will find AC or ABC\.
.
.IP "\(bu" 4
\fB\e{min,max}\fR
.
.br
.
.IP "" 0
.
.P
This indicates that JOE should try to find a string with a specific number of occurrences of the item to the left\. For example, \fBAX\e{2,5}B\fR will match these strings: AXXB, AXXXB, AXXXXB, and AXXXXXB\. Min can be left out to indicate 0 occurrences\. Max (and the comma) can be left out to indicate any number of occurrences\.
.
.IP "\(bu" 4
\fB\e\.\fR
.
.br
.
.IP "" 0
.
.P
This finds exactly one character\. For example, if you give \fBA\e\.B\fR as the search text, JOE will find AXB, but not AB or AXXB\.
.
.IP "\(bu" 4
\fB\e!\fR
.
.br
.
.IP "" 0
.
.P
This works like \fB\.\fR, but matches a balanced C\-language expression\. For example, if you search for \fBmalloc(\e!\e*)\fR, then JOE will find all function calls to \fBmalloc\fR, even if there was a \fB)\fR within the parenthesis\.
.
.IP "\(bu" 4
\fB\e|\fR
.
.br
.
.IP "" 0
.
.P
This finds the item on the left or the item on the right\. For example, if you give \fBA\e|B\fR as the search text, JOE will try to find either an A or a B\.
.
.IP "\(bu" 4
\fB\e( \e)\fR
.
.br
.
.IP "" 0
.
.P
Use these to group characters together\. For example, if you search for \fB\e(foo\e)\e+\fR, then JOE will find strings like "foo", and "foofoofoo"\.
.
.IP "\(bu" 4
\fB^ \e$\fR
.
.br
.
.IP "" 0
.
.P
These match the beginnings and endings of lines\. For example, if you give \fB^test\e$\fR, then JOE with find \fBtest\fR on a line by itself\.
.
.IP "\(bu" 4
\fB\e\fI\e\e\fR\fR
.
.br
.
.IP "" 0
.
.P
These match the beginnings and endings of words\. For example, if you give \fB\e\fIis\e\e\fR\fR, then JOE will find the word "is" but will not find the "is" in "this"\.
.
.IP "\(bu" 4
\fB\e[\.\.\.]\fR
.
.br
.
.IP "" 0
.
.P
This matches any single character which appears within the brackets\. For example, if \fB\e[Tt]his\fR is entered as the search string, then JOE finds both \fBThis\fR and \fBthis\fR\. Ranges of characters can be entered within the brackets\. For example, \fB\e[A\-Z]\fR finds any uppercase letter\. If the first character given in the brackets is \fB^\fR, then JOE tries to find any character not given in the the brackets\. To include \fB\-\fR itself, include it as the last or first character (possibly after \fB^\fR)\.
.
.IP "\(bu" 4
\fB\e\e\fR
.
.br
.
.IP "" 0
.
.P
Matches a single \e\.
.
.IP "\(bu" 4
\fB\en\fR
.
.br
.
.IP "" 0
.
.P
This finds the special end\-of\-line or line\-break character\.
.
.P
A number of special character sequences may also be given in the replacement string:
.
.IP "\(bu" 4
\fB\e&\fR
.
.br
.
.IP "" 0
.
.P
This gets replaced by the text which matched the search string\. For example, if the search string was \fB\e\fI\e*\e\e\fR\fR, which matches words, and you give \fB"\e&"\fR, then JOE will put quote marks around words\.
.
.IP "\(bu" 4
\fB\e1 \- \e9\fR
.
.br
.
.IP "" 0
.
.P
These get replaced with the text which matched the Nth grouping; the text within the Nth set of \e( \e)\.
.
.IP "\(bu" 4
\fB\el, \eu\fR
.
.br
.
.IP "" 0
.
.P
Convert the next character of the replacement text to lowercase or uppercase\.
.
.IP "\(bu" 4
\fB\eL, \eU\fR
.
.br
.
.IP "" 0
.
.P
Convert all following replacement text to lowercase or uppercase\. Conversion stops when \eE is encountered\.
.
.IP "\(bu" 4
\fB\e\e\fR
.
.br
.
.IP "" 0
.
.P
Use this if you need to put a \fB\e\fR in the replacement string\.
.
.IP "\(bu" 4
\fB\en\fR
.
.br
.
.IP "" 0
.
.P
Use this if you need to put a line\-break in the replacement string\.
.
.P
Some examples:
.
.P
Suppose you have a list of addresses, each on a separate line, which starts with "Address:" and has each element separated by commas\. Like so:
.
.P
Address: S\. Holmes, 221b Baker St\., London, England
.
.P
If you wanted to rearrange the list, to get the country first, then the city, then the person\'s name, and then the address, you could do this:
.
.P
Type \fB^K F\fR to start the search, and type:
.
.P
\fBAddress:\e(\e\.\e*\e),\e(\e\.\e*\e),\e(\e\.\e*\e),\e(\e\.\e*\e)\e$\fR
.
.P
to match "Address:", the four comma\-separated elements, and then the end of the line\. When asked for options, you would type \fBr\fR to replace the string, and then type:
.
.P
\fBAddress:\e4,\e3,\e1,\e2\fR
.
.P
To shuffle the information the way you want it\. After hitting return, the search would begin, and the sample line would be changed to:
.
.P
Address: England, London, S\. Holmes, 221b Baker St\.
.
.P
\fI\fR
.
.SS "Escape sequences"
JOE understands the following escape sequences withing search and replacement strings:
.
.IP "\(bu" 4
\ex{10ffff}
.
.br
.
.IP "" 0
.
.P
This matches a specific Unicode code point given in hexadecimal\.
.
.IP "\(bu" 4
\exFF
.
.br
.
.IP "" 0
.
.P
This matches a specific character specified in hexadecimal\.
.
.IP "\(bu" 4
\e377
.
.br
.
.IP "" 0
.
.P
This matches a specific character specified in octal\.
.
.IP "\(bu" 4
\ep{Ll}
.
.br
.
.IP "" 0
.
.P
This matches any character in the named Unicode category or block\.
.
.P
The block names, such as "Latin\-1 Supplement" or "Arabic" can be found here:
.
.P
Unicode Blocks \fIftp://ftp\.unicode\.org/Public/8\.0\.0/ucd/Blocks\.txt\fR
.
.P
The category names such as "Ll" can be found here:
.
.P
Unicode Categories \fIftp://ftp\.unicode\.org/Public/5\.1\.0/ucd/UCD\.html#General_Category_Values\fR
.
.P
Note that a single letter matches all of the category names which start with that letter\. For example, \ep{N} (any number) include \ep{Nd} (decimal digit), \ep{Nl} (letter number) and \ep{No} (other number)\.
.
.IP "\(bu" 4
\ed
.
.br
.
.IP "" 0
.
.P
This matches any Unicode digit\. This is the same as \ep{Nd}\.
.
.IP "\(bu" 4
\eD
.
.br
.
.IP "" 0
.
.P
This matches anything except for a Unicode digit\. This is the same as \e[^\ep{Nd}]\.
.
.IP "\(bu" 4
\ew
.
.br
.
.IP "" 0
.
.P
This matches any word character\. This is the same as \e[^\ep{C}\ep{P}\ep{Z}]\.
.
.IP "\(bu" 4
\eW
.
.br
.
.IP "" 0
.
.P
This matches anything except for a word character\. This is the same as \e[\ep{C}\ep{P}\ep{Z}]\.
.
.IP "\(bu" 4
\es
.
.br
.
.IP "" 0
.
.P
This matches any space character\. This is the same as \e[\et\er\ef\en\ep{Z}]\.
.
.IP "\(bu" 4
\eS
.
.br
.
.IP "" 0
.
.P
This matches anything except for a spacing character\. This is the same as \e[^\et\er\ef\en\ep{Z}]\.
.
.IP "\(bu" 4
\ei
.
.br
.
.IP "" 0
.
.P
This matches an identifier start character\. This is the same as \e[\ep{L}\ep{Pc}\ep{Nl}]\.
.
.IP "\(bu" 4
\eI
.
.br
.
.IP "" 0
.
.P
This matches anything except for an identifier start character\. This is the same as \e[^\ep{L}\ep{Pc}\ep{Nl}]\.
.
.IP "\(bu" 4
\ec
.
.br
.
.IP "" 0
.
.P
This matches an identifier continuation character\. This is the same as \e[\ei\ep{Mn}\ep{Mc}\ep{Nd}\ex{200c}\ex{200d}]\.
.
.IP "\(bu" 4
\eC
.
.br
.
.IP "" 0
.
.P
This matches anything except for an identifier continuation character\. This is the same as \e[^\ei\ep{Mn}\ep{Mc}\ep{Nd}\ex{200c}\ex{200d}]\.
.
.IP "\(bu" 4
\et Tab
.
.IP "\(bu" 4
\en Newline
.
.IP "\(bu" 4
\er Carriage return
.
.IP "\(bu" 4
\eb Backspace
.
.IP "\(bu" 4
\ea Alert
.
.IP "\(bu" 4
\ef Formfeed
.
.IP "\(bu" 4
\ee Escape
.
.IP "\(bu" 4
\e\e Backslash
.
.IP "" 0
.
.SH "Incremental search"
Use \fBEsc S\fR to start an increment search forwards, or \fBEsc R\fR to start an incremental search backwards\. As you type the search string, the cursor will jump to the first text that matches the regular expression you have entered so far\.
.
.P
Hit \fBEsc S\fR or \fBEsc R\fR again to find the next occurrence of the text or to switch the direction of the search\.
.
.P
\fB^S\fR, \fB^\e\fR and \fB^L\fR have the same effect as \fBEsc S\fR\. \fB^R\fR has the same effect as \fBEsc R\fR\. These keys are to support JMACS\.
.
.P
Hit \fBBackspace\fR to undo the last incremental search action\. The last action could be a repeat of a previous search or the entering of a new character\.
.
.P
Use \fB^Q\fR to insert control characters into the search text\. Previously, ` could also be used for this\.
.
.P
Hit any other key to exit the increment search\.
.
.SH "Goto matching delimiter"
Hit \fB^G\fR to jump between matching delimiters\. This works on both character delimiters (like \'(\' and \')\') and word delimiters for languages like Pascal and Verilog which use "begin" and "end" to delimit blocks\. It also works for matching start and end tags in XML\. If a word is not known, \fB^G\fR starts a search with the word moved into the search prompt\.
.
.P
For \fB^G\fR to work on word delimiters, the cursor must be positioned on the first letter of the word\. So in XML, if the cursor is on the < in <foo>, it will jump to the >\. But if it is one the \'f\', it will jump to the matching </foo>\. Likewise, in C, \fB^G\fR will jump between #if, #else and #endif, but you need to position the cursor on the letter, not the \'#\'\.
.
.P
\fB^G\fR is smart enough to skip delimiters found in quoted or commented\-out matter\. You need to tell JOE how your language indicates this: see the \fBftyperc\fR file for examples of how this is done\.
.
.P
The are a number of options which control the behavior of \fB^G\fR\. These options control which kinds of comments \fB^G\fR can skip over:
.
.IP "\(bu" 4
c_comment
.
.IP "\(bu" 4
cpp_comment
.
.IP "\(bu" 4
pount_comment
.
.IP "\(bu" 4
semi_comment
.
.IP "\(bu" 4
vhdl_comment
.
.IP "" 0
.
.P
These options determine which kinds of strings \fB^G\fR can skip over:
.
.IP "\(bu" 4
single_quoted
.
.IP "\(bu" 4
double_quoted
.
.IP "" 0
.
.P
This option allows an annotated syntax file to determine which text can be counted as comments or strings which can be skipped over by \fB^G\fR:
.
.IP "\(bu" 4
highlighter_context
.
.IP "" 0
.
.P
This option enables the use of syntax files to identify comments and strings which should be skipped over during \fB^G\fR matching\. The syntax file states should be annotated with the \fBstring\fR and \fBcomment\fR keywords for this to work\.
.
.IP "\(bu" 4
text_delimiters
.
.IP "" 0
.
.P
This option provides a list of word delimiters to match\. For example, "begin=end:if=elif=else=endif" means that \fB^G\fR will jump between the matching if, elif, else and endif\. It will also jump between begin and end\.
.
.P
\fB^G\fR has a built\-in table for matching character delimiters\- it knows that \fB(\fR goes with \fB)\fR\.
.
.P
\fB^G\fR has a built\-in parser to handle start/end tag matching for XML\.
.
.P
\fI\fR
.
.SH "Regions"
If you want to move, copy, save or delete a specific section of text, you can do it with highlighted blocks\. First, move the cursor to the start of the section of text you want to work on, and press \fB^K B\fR\. Then move the cursor to the character just after the end of the text you want to affect and press \fB^K K\fR\. The text between the \fB^K B\fR and \fB^K K\fR should become highlighted\. Now you can move your cursor to someplace else in your document and press \fB^K M\fR to move the highlighted text there\.
.
.br
You can press \fB^K C\fR to make a copy of the highlighted text and insert it to where the cursor is positioned\. \fB^K Y\fR to deletes the highlighted text\. \fB^K W\fR, writes the highlighted text to a file\.
.
.P
A very useful command is \fB^K /\fR, which filters a block of text through a UNIX command\. For example, if you select a list of words with \fB^K B\fR and \fB^K K\fR, and then type \fB^K / sort\fR, the list of words will be sorted\. Another useful UNIX command for \fB^K /\fR, is \fBtr\fR\. If you type \fB^K / tr a\-z A\-Z\fR, then all of the letters in the highlighted block will be converted to uppercase\.
.
.SS "How do I deselect a highlighted region?"
After you are finished with some region operations, you can just leave the highlighting on if you don\'t mind it (but don\'t accidentally hit \fB^K Y\fR)\. If it really bothers you, however, just hit \fB^K B ^K K\fR, to turn the highlighting off\.
.
.P
Beginning with JOE 4\.2, you can hit \fB^C\fR to cancel the region selection\.
.
.SS "New ways of selecting regions"
The classic way is to hit \fB^K B\fR at the beginning and \fB^K K\fR at the end\. These set pointers called markb and markk\. Once these are set you can jump to markb with \fBEsc B\fR and jump to markk with \fBEsc K\fR\.
.
.P
New way: hit Ctrl\-\fBRight Arrow\fR to start selecting rightward\. Each time you hit Ctrl\-\fBRight Arrow\fR, the block is extended one more to the right\. This uses a simple macro: "begin_marking,rtarw,toggle_marking"\.
.
.P
Unfortunately, there is no standard way to get the keysequence given by the terminal emulator when you hit Ctrl\-\fBRight Arrow\fR\. Instead you have to determine this sequence yourself and enter it directly in the joerc file\. Some examples are given for Xterm and gnome\-terminal\. Hit \fB^Q\fR Ctrl\-\fBRight Arrow\fR within JOE to have the sequence shown on your screen\. Note that Putty uses \fBEsc Esc [ C\fR which will not appear with \fB^Q Right Arrow\fR (also \fBEsc Esc\fR is the set bookmark command, so you need to unbind it to do this in Putty)\.
.
.P
Also you can hit Ctrl\-\fBDelete\fR to cut and Ctrl\-\fBInsert\fR to paste if the sequence for these keys are known\.
.
.P
The mouse can also be used to select text if mouse support is enabled in JOE\.
.
.SH "Indenting program blocks"
Auto\-indent mode is toggled with the \fB^T I\fR command\. The \fBjoerc\fR file is normally set up so that files with names ending with \.p, \.c or \.h have auto\-indent mode enabled\. When auto\-indent mode is enabled and you hit \fBEnter\fR, the cursor will be placed in the same column that the first non\-whitespace character was on in the original line\.
.
.P
You can use the \fB^K ,\fR and \fB^K \.\fR commands to shift a block of text to the left or right\. If no highlighting is set when you give these commands, the program block (as indicated by indentation) that the cursor is located in will be selected, and will be moved by subsequent \fB^K ,\fR and \fB^K \.\fR commands\.
.
.P
The number of columns these commands shift by and the character used for shifting can be set through the istep and indentc options\. These options are available in the \fB^T\fR menu\. Also, \fB^T =\fR can be used to quickly select from a number of common values for indentation step and character\.
.
.P
JOE has a number of additional options related to indenting programs:
.
.IP "\(bu" 4
smartbacks
.
.br
Enable smart backspace and tab\. When this mode is set \fBBackspace\fR and \fBTab\fR indent or unindent based on the values of the istep and indentc options\.
.
.br
.
.IP "\(bu" 4
smarthome
.
.br
The \fBHome\fR and \fB^A\fR keys first move the cursor to the beginning of the line, then if hit again, to the first non\-blank character\.
.
.br
.
.IP "\(bu" 4
indentfirst
.
.br
Smart home goes to first non\-blank character first, instead of going to the beginning of the line first\.
.
.br
.
.IP "\(bu" 4
purify
.
.br
Fix indentation if necessary before shifting or smart backspace\. For example, if indentation uses a mix of tabs and spaces, and indentc is space, then indentation will be converted to all spaces before the shifting operation\.
.
.br
.
.IP "\(bu" 4
guess_indent
.
.br
When set, JOE tries to guess the indentation character and indentation step based on the contents of the file\. The algorithm is to find the greatest common factor of the three most common indentations found in the file\.
.
.br
.
.IP "" 0
.
.SH "Rectangle mode"
Type \fB^T X\fR to have \fB^K B\fR and \fB^K K\fR select rectangular blocks instead of stream\-of\-text blocks\. This is also known as columnar mode\. This mode is useful for moving, copying, deleting or saving columns of text\. You can also filter columns of text with the \fB^K /\fR command\- if you want to sort a column, for example\. The insert file command, \fB^K R\fR is also affected\.
.
.P
When rectangle mode is selected, overtype mode is also useful (\fB^T T\fR)\. When overtype mode is selected, rectangles will replace existing text instead of getting inserted before it\. Also the delete block command (\fB^K Y\fR) will clear the selected rectangle with \fBSpaces\fR and \fBTabs\fR instead of deleting it\. Overtype mode is especially useful for the filter block command (\fB^K /\fR), since it will maintain the original width of the selected column\.
.
.SH "Picture mode"
Use \fB^T P\fR to enter or exit picture mode\. Picture mode helps with ASCII drawings\.
.
.P
Picture mode controls how JOE handles the case where the cursor is past the ends of lines\. This happens when you use the up or down arrow keys to move the cursor from the end of a long line to a short line\.
.
.P
If you attempt to type a character in this case:
.
.P
If picture mode is off, the cursor will jump to the end of the line and insert it there\.
.
.P
If picture mode is on, the line is filled with spaces so that the character can be inserted at the cursor position\.
.
.SH "Windows"
You can edit more than one file at the same time or edit two or more different places of the same file\. To do this, hit \fB^K O\fR, to split the screen into two windows\. Use \fB^K P\fR or \fB^K N\fR to move the cursor into the top window or the lower window\. Use \fB^K E\fR to edit a new file in one of the windows\. A window will go away when you save the file with \fB^K X\fR or abort the file with \fB^C\fR\. If you abort a file which exists in two windows, one of the window goes away, not the file\.
.
.P
You can hit \fB^K O\fR within a window to create even more windows\. If you have too many windows on the screen, but you don\'t want to eliminate them, you can hit \fB^K I\fR\. This will show only the window the cursor is in, or if there was only one window on the screen to begin with, try to fit all hidden windows on the screen\. If there are more windows than can fit on the screen, you can hit \fB^K N\fR on the bottom\-most window or \fB^K P\fR on the top\-most window to get to them\.
.
.P
If you gave more than one file name to JOE on the command line, each file will be placed in a different window\.
.
.P
You can change the height of the windows with the \fB^K G\fR and \fB^K T\fR commands\.
.
.SS "Windowing system model"
JOE has an unusual model for its windowing system\. Basically you have a ring of windows, but only a section of this ring may fit on the screen\. The windows not on the screen still exist, they are just scrolled off\. When you hit \fB^K N\fR on the bottom window of the screen, it scrolls further windows from the ring onto the screen, possibly letting the top window scroll out of view\.
.
.P
Native JOE tries to keep each loaded buffer in a window, so users can find all of the buffers by scrolling through the windows\. The \fBexplode\fR command (\fB^K I\fR) either expands all windows to the size of the screen so that only one window can fit on the screen, or shrinks them all as much as possible to fit many on the screen\.
.
.P
On the other hand, JOE supports "orphan" buffers\- files loaded into the editor, but which are not in a window\. \fB^C\fR normally closes a window and discards the buffer that was in it\. If you hit \fB^C\fR on the last remaining window, it will normally exit the editor\. However, if there are orphan buffers, \fB^C\fR will instead load them into this final window to give you a chance to explicitly discard them\. If the \fBorphan\fR option is given on the command line, as in \fBjoe \-orphan *\.c\fR, then JOE only loads the first file into a window and leaves all the rest as orphans\.
.
.P
\fBorphan\fR also controls whether the edit command \fB^K E\fR creates a new window for a newly loaded file, or reuses the current window (orphaning its previous occupant)\.
.
.P
The \fBbufed\fR command prompts for a name of a buffer to switch into a window\. Its completion list will show all buffers, including orphans and buffers which appear in other windows\. \fBEsc V\fR and \fBEsc U\fR (\fBnbuf\fR and \fBpbuf\fR commands) allow you to cycle through all buffers within a single window\.
.
.P
Windows maintain a stack of occupants to support the pop\-up shell window feature\. When a pop\-up window is dismissed, the previous buffer is returned to the window\.
.
.SH "Scratch buffers"
Scratch buffers are buffers which JOE does not worry about trying to preserve\. JOE will not ask to save modified scratch buffers\. Pop\-up shell windows, the startup log and compile and grep message windows are scratch buffers\. You can create your own scratch buffer with the \fBscratch\fR command\.
.
.P
The following commands load scratch buffers:
.
.IP "\(bu" 4
\fBshowlog\fR Show startup log
.
.IP "\(bu" 4
\fBmwind\fR Show message window (compile / grep messages from \fBEsc C\fR and \fBEsc G\fR commands)\.
.
.IP "" 0
.
.SH "Keyboard macros"
Macros allow you to record a series of keystrokes and replay them with the press of two keys\. This is useful to automate repetitive tasks\. To start a macro recording, hit \fB^K [\fR followed by a number from 0 to 9\. The status line will display (Macro n recording\.\.\.)\. Now, type in the series of keystrokes that you want to be able to repeat\. The commands you type will have their usual effects\. Hit \fB^K ]\fR to stop recording the macro\. Hit \fB^K\fR followed by the number you recorded the macro in to execute one iteration of the key\-strokes\.
.
.P
For example, if you want to put "**" in front of a number of lines, you can type:
.
.P
\fB^K [ 0 ^A **\fR\fIdown arrow\e\fR \fB^K ]\fR
.
.P
Which starts the macro recording, moves the cursor to the beginning of the line, inserts "**", moves the cursor down one line, and then ends the recording\. Since we included the key\-strokes needed to position the cursor on the next line, we can repeatedly use this macro without having to move the cursor ourselves, something you should always keep in mind when recording a macro\.
.
.SS "Keyboard macro subroutines"
If you find that the macro you are recording itself has a repeated set of key\-strokes in it, you can record a macro within the macro, as long as you use a different macro number\. Also you can execute previously recorded macros from within new macros\.
.
.SS "Query suspend"
If your macro includes a prompt for user input, and you want the user to fill in the prompt every time the macro is executed, hit \fB^K ?\fR at the point in the macro recording where the user action is required\. Keyboard input will not be recorded at this point\. When the user completes the prompt, macro recording will continue\.
.
.P
When the macro is executed, the macro player will pause at the point where \fB^K ?\fR was entered to allow user input\. When the user completes the prompt, the player continues with the rest of the macro\.
.
.SS "Repeat"
You can use the repeat command, \fB^K \e\fR, to repeat a macro, or any other edit command or even a normal character, a specified number of times\. Hit \fB^K \e\fR, type in the number of times you want the command repeated and press \fBEnter\fR\. The next edit command you now give will be repeated that many times\. For example, to delete the next 20 lines of text, type:
.
.P
\fB^K \e 20\fR\fIreturn\fR\fB^Y\fR
.
.SH "Macros and commands"
A macro is a comma separated list of commands\. When the macro is executed, each command is executed until either the end of the list is reached, or one of the commands fails (non\-zero return value from the command)\. Failed commands beep if you have beeps enabled (\fB^T B\fR)\.
.
.P
Hit \fBEsc D\fR to insert the current set of keyboard macros as text into the current buffer\. For example, the "**" insert macro above looks like this:
.
.IP "" 4
.
.nf
home,"**",dnarw ^K 0 Macro 0
.
.fi
.
.IP "" 0
.
.P
You could insert this into your \.joerc file and change the key sequence (the \fBK 0\fR) to something more permanent\.
.
.SS "Define your own"
You can bind macros to key sequences or define your own named macros in the joerc file\. For example, this will define a macro called \fBfoo\fR:
.
.IP "" 4
.
.nf
:def foo eof,bol
.
.fi
.
.IP "" 0
.
.P
\fBfoo\fR will position the cursor at the beginning of the last line of the file\. \fBeof\fR jumps to the end of the file\. \fBbol\fR jumps to the beginning of a line\. Once a macro has been named this way it will show up in the completion list of the \fBEsc X\fR command prompt\.
.
.SS "Command prompt"
You can execute a macro directly by typing it into the command prompt\. Hit \fBEsc X\fR to bring up the command prompt\. Hit \fBTab\fR at this prompt for a completion list of all available commands\.
.
.P
Here is a \fIcomplete list of commands\fR\.
.
.SS "Macro don\'t stop modifier"
Sometimes, you expect commands to sometimes fail, but want the rest of the commands in the list to be executed anyway\. To mark a command which is allowed to fail, postfix it with \'!\'\. For example, here a macro which hits down page in the window above:
.
.IP "" 4
.
.nf
prevw,pgdn!,nextw
.
.fi
.
.IP "" 0
.
.P
If prevw fails, the macro is aborted as usual\. Even if pgdn fails (already at end of buffer), nextw will be executed so that the cursor is returned to the original window\.
.
.SS "Macro repeat argument modifiers"
Repeat arguments can be specified with \fB^K \e\fR\. When a command is executed with a repeat argument, it is repeatedly executed the specified number of times\. If the repeat argument is negative, an opposite command (if one exists) is executed instead\. For example, if you repeat "rtarw" \-3 times, "ltarw" will be repeated 3 times\. If a negative argument is given for a command which does not have an opposite, the repeat argument is ignored\.
.
.P
Normally, if a repeat argument is specified for a macro, the macro is simply repeated the given number of times\. If a negative argument is given, the argument is ignored\.
.
.P
Sometimes you want to allow negative arguments for macros and have their behavior modified\. To do this, postfix each command within the macro which should be switched to its opposite for negative arguments with \'\-\'\. For example, here is the page down other window macro:
.
.IP "" 4
.
.nf
prevw,pgdn\-!,nextw
.
.fi
.
.IP "" 0
.
.P
Now if you execute this with an argument of \-2, it will be repeated twice, but pgup will be executed instead of pgdn\. (note that several postfix modifiers can be placed after each command)\.
.
.P
Sometimes when a repeat argument is given to macro, you want only one of the commands in the list to be repeated, not the entire macro\. This can be indicated as follows:
.
.IP "" 4
.
.nf
prevw,pgdn#!,nextw
.
.fi
.
.IP "" 0
.
.P
If this is executed with an argument of 2, prevw is executed once, pgdn is executed twice, and nextw is executed once\.
.
.P
Finally, even more complex semantics can be expressed with the "if" command:
.
.IP "" 4
.
.nf
if~,"arg<0",then,
ltarw,
else,
rtarw,
endif
.
.fi
.
.IP "" 0
.
.P
When the macro is executed, the "arg" math variable is set to the given repeat argument\. The "argset" variable is set to true if the user set an argument, even if it\'s 1\. If no argument was given, argset is false\.
.
.P
If any command in the list is postfixed with ~ (if above), the macro is not repeated, even if there is an argument\. \'arg\' is still set to the given repeat count, however\.
.
.SS "\'psh\'/\'query\' interaction"
The \'psh\' command saves the \fB^K B\fR and \fB^K K\fR positions on a stack\. When the macro completes, (or when the \'pop\' command is called) the positions are restored\.
.
.P
The \'query\' command suspends macro execution until the current dialog is complete\. It also suspends the automatic \'pop\' which happens at the end of a macro\- so if the macro ends in a dialog you often want to call \'query\' to prevent the \fB^K B\fR \fB^K K\fR positions from being restored too early\.
.
.SH "Tags search"
If you are editing a large C program with many source files, you can use the \fBctags\fR program to generate a \fBtags\fR file\. This file contains a list of program symbols and the files and positions where the symbols are defined\.
.
.P
First, create the tags file with the "ctags" program\. For example:
.
.IP "" 4
.
.nf
ctags *\.c *\.h
.
.fi
.
.IP "" 0
.
.P
This will create a file called "tags" in the current directory\.
.
.P
JOE looks for the "tags" file in the current directory\. If there is none, it will try to open the file specified by the TAGS environment variable\.
.
.P
Paths in the tags file are always relative to location of the tags file itself\.
.
.P
The tags file contains a list of identifier definition locations in one of these formats:
.
.IP "" 4
.
.nf
identifier filename /search\-expression/[;comments]
identifier filename ?search\-expression?[;comments]
identifier filename line\-number[;comments]
.
.fi
.
.IP "" 0
.
.P
Some versions of ctags include class\-names in the identifiers:
.
.IP "" 4
.
.nf
class::member
.
.fi
.
.IP "" 0
.
.P
In this case, JOE will match on any of these strings:
.
.IP "" 4
.
.nf
member
::member
class::member
.
.fi
.
.IP "" 0
.
.P
Some versions of ctags include a filename in the identifier:
.
.IP "" 4
.
.nf
filename:identifier
.
.fi
.
.IP "" 0
.
.P
In this case JOE will only find the identifier if the buffer name matches the filename\.
.
.P
The search\-expression is a vi regular expression, but JOE only supports the following special characters:
.
.IP "" 4
.
.nf
^ at the beginning means expression starts at beginning of line
$ at the end means expression ends at end of line
\ex quote x (suppress meaning of /, ?, ^ or $)
.
.fi
.
.IP "" 0
.
.P
Type \fB^K ;\fR to bring up a tags search prompt\. If the cursor had been on an identifier, the prompt is pre\-loaded with it\. Tab completion works in this prompt (it uses the tags file to find completions)\.
.
.P
When you hit \fBEnter\fR, the tags search commences:
.
.P
If there is one and only one match, JOE will jump directly to the definition\.
.
.P
If there are multiple matches, then the behavior is controlled by the notagsmenu option\. If notagsmenu is enabled JOE jumps to the first definition\. If you hit \fB^K ;\fR again before hitting any other keys, JOE jumps to the next definition, and so on\. The "tagjump" command also performs this function\.
.
.P
If notagsmenu is disabled, JOE brings up a menu of all the matches\. You select the one you want and JOE jumps to it\. If you hit \fB^K ;\fR again before hitting any other keys, the same menu re\-appears with the cursor left in the original location\.
.
.P
You can hit \fB^K \-\fR to move the cursor back to the original location before the tags search (often \fB^C\fR will work as well)\.
.
.P
Since \fB^K ;\fR loads the definition file into the current window, you probably want to split the window first with \fB^K O\fR, to have both the original file and the definition file loaded\.
.
.SH "Calculator"
JOE has a built\-in calculator which can be invoked with \fBEsc M\fR\.
.
.SS "Math functions"
sin, cos, tan, exp, sqrt, cbrt, ln, log, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, int, floor, ceil, abs, erf, erfc, j0, j1, y0, y1
.
.SS "Variables"
.
.IP "\(bu" 4
e
.
.br
Set to \'e\'
.
.br
.
.IP "\(bu" 4
pi
.
.br
Set to \'pi\'
.
.br
.
.IP "\(bu" 4
top
.
.br
Set to line number of top window line
.
.br
.
.IP "\(bu" 4
lines
.
.br
Set to number of lines in file
.
.br
.
.IP "\(bu" 4
line
.
.br
Set to current line number
.
.br
.
.IP "\(bu" 4
col
.
.br
Set to current column number
.
.br
.
.IP "\(bu" 4
byte
.
.br
Set to current byte number
.
.br
.
.IP "\(bu" 4
size
.
.br
Set to buffer size
.
.br
.
.IP "\(bu" 4
height
.
.br
Set to window height
.
.br
.
.IP "\(bu" 4
width
.
.br
Set to window width
.
.br
.
.IP "\(bu" 4
char
.
.br
Set to ASCII val of character under cursor
.
.br
.
.IP "\(bu" 4
markv
.
.br
True if there is a valid block set (^KB \.\.\. ^KK)
.
.br
.
.IP "\(bu" 4
rdonly
.
.br
True if file is read\-only
.
.br
.
.IP "\(bu" 4
arg
.
.br
Current repeat argument
.
.br
.
.IP "\(bu" 4
argset
.
.br
True if a repeat argument was given
.
.br
.
.IP "\(bu" 4
is_shell
.
.br
True if executed in an active shell window
.
.br
.
.IP "\(bu" 4
no_windows
.
.br
No\. buffer windows on the screen
.
.br
.
.IP "\(bu" 4
ans
.
.br
Result of previous expression
.
.br
.
.IP "" 0
.
.SS "Commands"
.
.IP "\(bu" 4
hex
.
.br
Hex display mode
.
.br
.
.IP "\(bu" 4
dec
.
.br
Decimal display mode
.
.br
.
.IP "\(bu" 4
ins
.
.br
Insert \'ans\' into buffer
.
.br
.
.IP "\(bu" 4
sum
.
.br
Sum of numbers in block
.
.br
.
.IP "\(bu" 4
cnt
.
.br
Count numbers in block
.
.br
.
.IP "\(bu" 4
avg
.
.br
Average value of numbers in block
.
.br
.
.IP "\(bu" 4
dev
.
.br
Standard deviation of numbers in block
.
.br
.
.IP "\(bu" 4
eval
.
.br
Evaluate math expressions in block (or whole file if no block set)\.
.
.br
.
.IP "\(bu" 4
joe(\.\.\.)
.
.br
Execute a JOE macro (argument in same format as joerc file macros)\. Return value of JOE macro is returned (for macro success, return true (non\-zero))\.
.
.br
.
.IP "" 0
.
.P
For example:
.
.IP "" 4
.
.nf
joe(sys,"[ 1 == 1 ]",rtn)
.
.fi
.
.IP "" 0
.
.P
([ 1 == 1 ]) is a shell command\. "[" is a synonym for the "test" UNIX command\.
.
.P
Returns true\.
.
.P
Remember: argument for JOE macro command "if" is a math expression\. So for example, the macro:
.
.IP "" 4
.
.nf
if,"joe(sys,\e"[ 1 == 1 ]\e",rtn)",then,"TRUE",endif
.
.fi
.
.IP "" 0
.
.P
Types TRUE into the buffer\.
.
.SS "Operators:"
.
.IP "\(bu" 4
!x
.
.br
Logical not of x\.
.
.br
.
.IP "\(bu" 4
x
.
.br
Raise x to power of y\.
.
.br
.
.IP "\(bu" 4
a*b
.
.br
Multiply\.
.
.br
.
.IP "\(bu" 4
a/b
.
.br
Divide\.
.
.br
.
.IP "\(bu" 4
a%b
.
.br
Modulus\.
.
.br
.
.IP "\(bu" 4
a+b
.
.br
Add\.
.
.br
.
.IP "\(bu" 4
a\-b
.
.br
Subtract\.
.
.br
.
.IP "\(bu" 4
a<b
.
.br
True if a is less than b\.
.
.br
.
.IP "\(bu" 4
a<=b
.
.br
True if a is less than or equal to b\.
.
.br
.
.IP "\(bu" 4
a>b
.
.br
True if a is greater than b\.
.
.br
.
.IP "\(bu" 4
a>=b
.
.br
True if a is greater than or equal to b\.
.
.br
.
.IP "\(bu" 4
a==b
.
.br
True if a equals b\.
.
.br
.
.IP "\(bu" 4
a!=b
.
.br
True if a does not equal b\.
.
.br
.
.IP "\(bu" 4
a&&b
.
.br
True if both a and b are true\.
.
.br
.
.IP "\(bu" 4
a||b
.
.br
True if ether a or b are true\.
.
.br
.
.IP "\(bu" 4
a?b:c
.
.br
If a is true return b, otherwise return c\.
.
.br
.
.IP "\(bu" 4
a=b
.
.br
Assign b to a\.
.
.br
.
.IP "\(bu" 4
a:b
.
.br
Execute a, then execute b\.
.
.br
.
.IP "" 0
.
.TP
&&, || and ? : work as in C and sh as far as side effects: if the
.
.TP
left side of && is false, the right side is not evaluated\.
is expression separator\.
.
.SH "Shell windows"
Hit \fB^K \'\fR to run a command shell in one of JOE\'s windows\. When the cursor is at the end of a shell window (use \fB^K V\fR if it\'s not), whatever you type is passed to the shell instead of the buffer\. Any output from the shell or from commands executed in the shell is appended to the shell window (the cursor will follow this output if it\'s at the end of the shell window)\. This command is useful for recording the results of shell commands\- for example the output of \fBmake\fR, the result of \fBgrep\fRping a set of files for a string, or directory listings from \fBFTP\fR sessions\. Besides typeable characters, the keys \fB^C\fR, \fBBackspace\fR, \fBDel\fR, \fBReturn\fR and \fB^D\fR are passed to the shell\. Type the shell \fBexit\fR command to stop recording shell output\. If you press \fB^C\fR in a shell window, when the cursor is not at the end of the window, the shell is \fBkill\fRed\.
.
.P
If you use Bash, you can hit: \fB^Q Up Arrow\fR and \fB^Q Down Arrow\fR to scroll through Bash\'s history buffer\. Other keys work as well: try \fB^Q ^A\fR to go to beginning of line or \fB^Q ^E\fR to go to end of line\. Unfortunately JOE only emulates a dumb terminal, so you have to use a lot of imagination to do any editing beyond hitting backspace\.
.
.P
In general, any character quoted with \fB^Q\fR is sent to the shell\.
.
.P
Also sent to the shell: \fBTab\fR, \fBBackspace\fR, \fBEnter\fR, \fB^C\fR and \fB^D\fR\.
.
.P
\fI\fR
.
.SH "Pop\-up shell windows"
Hit F1 \- F4 to open and switch between shell windows\.
.
.P
Pop\-up shell windows use a full terminal emulator so that when you type "man ls" it\'s formatted correctly (it works well enough so that some interactive programs can be used)\. Even so, the shell window is still an edit buffer\.
.
.P
The old shell window (with no terminal emulation) still exists: use \fB^K \'\fR to invoke it as usual\. This is useful to see control sequences emitted by a program\.
.
.P
More of the keys get passed to the running program in pop\-up shell windows compared with the older one\. There is a :vtshell section of the joerc file to control which ones\. In particular arrow keys and Ctrl\-C are passed to the program\. It means you can easily step through bash history with the arrow keys, or abort programs the normal way with Ctrl\-C\.
.
.P
On the other hand, loss of Ctrl\-C means it\'s less obvious how to close the window\. One way is to move the cursor off of the shell data entry point (with Ctrl\-P), and then hit Ctrl\-C\. Another is to hit \fB^K Q\fR\. Finally, you can type \'pop\' at the command prompt\.
.
.P
If you need to pass a key to the shell that JOE normally uses, quote it\. For example, if you invoke "emacs \-nw" in the shell window, you can exit it with:
.
.IP "" 4
.
.nf
^Q ^X ^C
.
.fi
.
.IP "" 0
.
.P
To quickly position the cursor back to the point where data is entered into the shell, hit \fB^K V\fR\.
.
.P
When you open a shell window, a JOE\-specific startup\-script is sourced\. It\'s located in /etc/joe/shell\.sh (also /etc/joe/shell\.csh)\. It contains some aliases which allow you to control JOE with fake shell commands\. I have these commands so far:
.
.IP "\(bu" 4
clear
.
.br
erase shell window (delete buffer contents)
.
.br
.
.IP "\(bu" 4
joe file
.
.br
edit a file in JOE
.
.br
.
.IP "\(bu" 4
math 1+2
.
.br
evaluate equation using JOE\'s calculator
.
.br
.
.IP "\(bu" 4
cd xyz
.
.br
change directory, keep JOE up to date
.
.br
.
.IP "\(bu" 4
markb
.
.br
same as ^KB
.
.br
.
.IP "\(bu" 4
markk
.
.br
same as ^KK
.
.br
.
.IP "\(bu" 4
mark command
.
.br
execute shell command, mark it\'s output
.
.br
.
.IP "\(bu" 4
parse command
.
.br
execute shell command, parse it\'s output for file names and line numbers (for find or grep)
.
.br
.
.IP "\(bu" 4
parser comman
.
.br
execute shell command, parse it\'s output for errors (for gcc)
.
.br
.
.IP "\(bu" 4
release
.
.br
release parsed errors
.
.br
.
.IP "\(bu" 4
pop
.
.br
dismiss shell window (same as ^K Q)
.
.br
.
.IP "" 0
.
.P
These work by emitting an escape sequence recognized by the terminal emulator: \fBEsc { joe_macro }\fR\. When this is received, the macro is executed\. For security, only macros defined in the joerc file which begin with "shell_" can be executed this way\.
.
.SS "Use cases"
Pop\-up shell windows have a number of nice use cases:
.
.IP "\(bu" 4
Use it to browse manual pages
.
.IP
Hit F1 and type "man fopen"\. Use \'b\' (\'u\') and space to control \fImore\fR (or \fIless\fR) while viewing the manual\. You can leave the manual on the screen in one window while editing in another window\.
.
.IP "\(bu" 4
Use it to switch directories
.
.IP
Hit F1 and navigate to the directory while using \fIcd\fR\. Once you are in the right place, hit \fB^K E\fR to load a file (or type "edit file" from the shell)\.
.
.IP "\(bu" 4
Use it in conjunction with the error parser to find files
.
.IP
Hit F1 and navigate to a directory\. Use grep or find (or both) to generate a list of files):
.
.IP "" 0
.
.IP "" 4
.
.nf
parse grep \-n FIXME *\.c
.
.fi
.
.IP "" 0
.
.P
Or:
.
.IP "" 4
.
.nf
markb; find \. | xargs grep \-n FIXME; markk; parse
.
.fi
.
.IP "" 0
.
.P
(Note that you can\'t say this:
.
.IP "" 4
.
.nf
parse find \. | xargs grep \-n FIXME
.
.fi
.
.IP "" 0
.
.P
\&\.\.\.the issue is that only the words to the left of the pipe symbol are passed as arguments to the parse command)\.
.
.P
Now use \fB^P\fR to position the cursor on one of the lines of the list\. Hit \fBEsc Space\fR to have JOE edit the file and jump to the specified line (also you can use \fBEsc \-\fR and \fBEsc =\fR to step through the list)\.
.
.IP "\(bu" 4
Use it in conjunction with search and replace to edit many files
.
.IP
Once JOE has a list of files (from above), use search and replace with the \'e\' option to visit all of them:
.
.IP "" 0
.
.IP "" 4
.
.nf
^K F
Find: <text>
Options: re
Replace: <replacement text>
.
.fi
.
.IP "" 0
.
.IP "\(bu" 4
Build your project
.
.IP "" 0
.
.P
Easily capture errors from a build with:
.
.IP "" 4
.
.nf
parserr make
.
.fi
.
.IP "" 0
.
.P
Hit \fBEsc =\fR and \fBEsc \-\fR to step through the errors\.
.
.SS "How it works\.\."
.
.IP "\(bu" 4
There is a new mode "ansi"\. (\fBEsc X\fR mode ansi)\. When this mode is enabled, the screen updater hides escape sequences which are in the buffer\. Otherwise you get a big mess from the sequences surrounding colored output from \'ls\'\.
.
.IP "\(bu" 4
There is a new built\-in syntax: "ansi"\. (\fB^T Y\fR ansi)\. This syntax parses the ANSI color control sequences so that text gets colored\.
.
.IP "\(bu" 4
There is a terminal emulator to interpret control sequences from the shell program\. It emulates a terminal by modifying the contents of an edit buffer\.
.
.IP "\(bu" 4
When the edit window is resized we tell the shell by issuing the TIOCSSIZE or TIOCSWINSZ ioctl\. This way, the program running in the shell knows the window size\.
.
.IP "" 0
.
.SH "Compiler and grep/find parsers"
JOE has two parsers which can be used to generate the error list (list of file names / line numbers)\.
.
.P
The "parserr" command parses the entire buffer, or if the block is set, just the highighted block for compiler error messages\. The messages should be in this format:
.
.IP "" 4
.
.nf
<junk> file\.name <junk> line\-number <junk> : <junk>
.
.fi
.
.IP "" 0
.
.P
The file name needs to be made of numbers, letters, \'/\', \'\.\' and \'\-\'\. It must have at leat one \'\.\' in it\. There needs to be a colon somewhere after the line number\. Lines not in this format are ignored\.
.
.P
The "gparse\' command parses the entire buffer, or if the block is set, just the highlighted block for a list of filenames or filenames with line numbers from "grep \-n", "find" and similar programs\.
.
.IP "" 4
.
.nf
filename
filename:<junk>
filename:line\-number:<junk>
.
.fi
.
.IP "" 0
.
.P
Once JOE has the error list, there are a number of things you can do with it:
.
.IP "\(bu" 4
Visit the files/locations in the list with \fBEsc \-\fR and \fBEsc =\fR
.
.IP "\(bu" 4
Search and replace across all files in the list by using the \'e\' search and replace option\.
.
.IP "\(bu" 4
Clear the list by using the "release" command\.
.
.IP "" 0
.
.P
Also, you can use \fBEsc Space\fR (\'jump\' command) to parse the line the cursor is on and jump to the parsed filename and line number\. \'jump\' uses the grep/find parser unless \'parserr\' had been previously issued in the buffer\.
.
.SS "Grep\-find"
Hit \fBEsc G\fR to bring up the prompt\. Enter a command which results in file names with line numbers, for example: \'grep \-n fred *\.c\'\. This will list all instances of \'fred\' in the *\.c files\. You need the \'\-n\' to get the line numbers\.
.
.P
Now you can hit \fBEsc Space\fR on one of the lines to jump to the selected file\. Also, you can use \fBEsc =\fR and \fBEsc \-\fR to step through each line\.
.
.SS "Compile"
Hit \fBEsc C\fR to save all modified files and then bring up the compile prompt\. Enter the command you want to use for the compiler (typically "make \-w")\. The compiler will run in a shell window\. When it\'s complete, the results are parsed\.
.
.P
The \'\-w\' flag should be given to "make" so that it prints messages whenever it changes directories\. The message are in this format:
.
.IP "" 4
.
.nf
make[1]: Entering directory `/home/jhallen/joe\-editor\-mercurial/joe\'
.
.fi
.
.IP "" 0
.
.P
If there are any errors or warnings from the compiler you can hit \fBEsc Space\fR on one of the lines to jump to the selected file\. Also, you can use \fBEsc =\fR and \fBEsc \-\fR to step through each line\.
.
.SH "Syntax highlighting"
To enable highlight use \fB^T H\fR\.
.
.P
To select the syntax, use \fB^T Y\fR\. You can hit \fBTab\fR \fBTab\fR at the prompt for a completion list\.
.
.P
JOE tries to determine the syntax to use based on the name and contents of the file\. The configuration file /etc/joe/ftyperc contains the definitions\.
.
.P
Each syntax is defined by a file located /usr/share/joe/syntax/\.
.
.SH "How JOE syntax highlighting works"
\fIfrom c\.jsf \fIhttp://joe\-editor\.hg\.sourceforge\.net/hgweb/joe\-editor/joe\-editor/file/tip/syntax/c\.jsf\.in\fR, slightly modified\fR
.
.P
A deterministic state machine that performs lexical analysis of the target language is provided in a syntax file\. (This is the "assembly language" of syntax highlighting\. A separate program could in principal be used to convert a regular expression NFA syntax into this format)\.
.
.P
Each state begins with:
.
.IP "" 4
.
.nf
:<name> <color\-name> <context>
.
.fi
.
.IP "" 0
.
.P
\fIname\e\fR is the state\'s name\.
.
.P
\fIcolor\-name\e\fR is the color used for characters eaten by the state (really a symbol for a user definable color)\.
.
.P
\fIcontext\e\fR tells JOE if the current character is part of a comment or a string\. This allows JOE to skip over comments and strings when matching characters such as parentheses\. To use this feature, the highlighter_context option must be applied to the files highlighted by the corresponding syntax\. To apply the option, add it to ftyperc for those file entries\.
.
.P
The valid contexts are:
.
.IP "\(bu" 4
comment This character is part of a comment\. Example: /* comment */
.
.IP "\(bu" 4
string This character is part of a string\. Examples: "string" \'c\' \'string\'
.
.IP "" 0
.
.P
The comment and string delimiters themselves should be marked with the appropriate context\. The context is considered to be part of the color, so the recolor=\-N and recolormark options apply the context to previous characters\.
.
.P
The first state defined is the initial state\.
.
.P
Within a state, define transitions (jumps) to other states\. Each jump has the form:
.
.IP "" 4
.
.nf
<character\-list> <target\-state\-name> [<option>s]
.
.fi
.
.IP "" 0
.
.P
There are three ways to specify \fIcharacter\-list\e\fRs, either \fB*\fR for any character not otherwise specified, \fB%\fR or \fB&\fR to match the character in the delimiter match buffer (\fB%\fR matches the saved character exactly, while \fB&\fR matches the opposite character, for example ( will match ) when \fB&\fR is used) or a literal list of characters within quotes (ranges and escape sequences allowed: see \fIEscape Sequences\fR)\. When the next character matches any in the list, a jump to the target\-state is taken and the character is eaten (we advance to the next character of the file to be colored)\.
.
.P
The * transition should be the first transition specified in the state\.
.
.P
There are several options:
.
.IP "\(bu" 4
\fBnoeat\fR \- Do not eat the character, instead feed it to the next state (this tends to make the states smaller, but be careful: you can make infinite loops)\. \'noeat\' implies \'recolor=\-1\'\.
.
.IP "\(bu" 4
\fBrecolor=\-N\fR \- Recolor the past N characters with the color of the target\-state\. For example once /* is recognized as the start of C comment, you want to color the /* with the C comment color with recolor=\-2\.
.
.IP "\(bu" 4
\fBmark\fR \- Mark beginning of a region with current position\.
.
.IP "\(bu" 4
\fBmarkend\fR \- Mark end of region\.
.
.IP "\(bu" 4
\fBrecolormark\fR \- Recolor all of the characters in the marked region with the color of the target\-state\. If markend is not given, all of the characters up to the current position are recolored\. Note that the marked region can not cross line boundaries and must be on the same line as recolormark\.
.
.IP "\(bu" 4
\fBbuffer\fR \- Start copying characters to a string buffer, beginning with this one (it\'s OK to not terminate buffering with a matching \'strings\', \'istrings\' or \'hold\' option\- the buffer is limited to leading 23 characters)\.
.
.IP "\(bu" 4
\fBsave_c\fR \- Save character in delimiter match buffer\.
.
.IP "\(bu" 4
\fBsave_s\fR \- Copy string buffer to delimiter match buffer\.
.
.IP "\(bu" 4
\fBstrings\fR \- A list of strings follows\. If the buffer matches any of the given strings, a jump to the target\-state in the string list is taken instead of the normal jump\.
.
.IP "\(bu" 4
\fBistrings\fR \- Same as strings, but case is ignored\. Note: strings and istrings should be the last option on the line\. They cause any options which follow them to be ignored\.
.
.IP "\(bu" 4
\fBhold\fR \- Stop buffering string\- a future \'strings\' or \'istrings\' will look at contents of buffer at this point\. Useful for distinguishing commands and function calls in some languages \'write 7\' is a command \'write (\' is a function call\- hold lets us stop at the space and delay the string lookup until the ( or 7\.
.
.IP "" 0
.
.P
The format of the string list is:
.
.IP "" 4
.
.nf
"string" <target\-state> [<options>s]
"string" <target\-state> [<options>s]
"&" <target\-state> [<options>s] # matches contents of delimiter match buffer
done
.
.fi
.
.IP "" 0
.
.P
(all of the options above are allowed except "strings", "istrings" and "noeat"\. noeat is always implied after a matched string)\.
.
.P
Weirdness: only states have colors, not transitions\. This means that you sometimes have to make dummy states with
.
.IP "" 4
.
.nf
* <next\-state> noeat
.
.fi
.
.IP "" 0
.
.P
just to get a color specification\.
.
.P
Delimiter match buffer is for perl and shell: a regex in perl can be s<\.\.>(\.\.\.) and in shell you can say: <<EOS \.\.\.\.\.\.\. EOS\. The idea is that you capture the first delimiter into the match buffer (the < or first "EOS") and then match it to the second one with "&" in a string or character list\.
.
.SS "Subroutines"
Highlighter state machines can now make subroutine calls\. This works by template instantiation: the called state machine is included in your current state machine, but is modified so that the return address points to the called\. There is still no run\-time stack (the state is represented as a single integer plus the saved delimiter string)\.
.
.P
Recursion is allowed, but is self limited to 5 levels\.
.
.P
\fBNote:\fR this recursion limit is obsolete\. Subroutines now do use a stack so the call\-depth is limitless\.
.
.P
To call a subroutine, use the \'call\' option:
.
.IP "" 4
.
.nf
"\e"" fred call=string(dquote)
.
.fi
.
.IP "" 0
.
.P
The subroutine called \'string\' is called and the jump to \'fred\' is ignored\. The \'dquote\' option is passed to the subroutine\.
.
.P
If you use recolor along with call, the color used is that of the first state of the subroutine\.
.
.P
The subroutine itself returns to the caller like this:
.
.IP "" 4
.
.nf
"\e"" whatever return
.
.fi
.
.IP "" 0
.
.P
If we\'re in a subroutine, it returns to the target state of the call ("fred" in the above example)\. If we\'re not in a subroutine, it jumps to "whatever"\.
.
.P
If you use recolor along with return, the color used is from the returned state ("fred" in the example above)\.
.
.P
There are several ways of delimiting subroutines which show up in how it is called\. Here are the options:
.
.IP "\(bu" 4
\fBcall=string()\fR \- A file called string\.jsf is the subroutine\. The entire file is the subroutine\. The starting point is the first state in the file\.
.
.IP "\(bu" 4
\fBcall=library\.string()\fR \- A file called library\.jsf has the subroutine\. The subroutine within the file is called string\.
.
.IP "\(bu" 4
\fBcall=\.string()\fR \- There is a subroutine called string in the current file\.
.
.IP "" 0
.
.P
When a subroutine is within a file, but is not the whole file, it is delimited as follows:
.
.IP "" 4
.
.nf
\&\.subr string
\. \. \. states for string subroutine \. \. \.
\.end
.
.fi
.
.IP "" 0
.
.P
Option flags can be passed to subroutines which control preprocessor\-like directives\. For example:
.
.IP "" 4
.
.nf
\&\.ifdef dquote
"\e"" idle return
\.endif
\.ifdef squote
"\'" idle return
\.endif
.
.fi
.
.IP "" 0
.
.P
\&\.else is also available\. \.ifdefs can be nested\.
.
.P
\fI\fR
.
.SH "The joerc file"
\fB^T\fR options, the help screens and the key\-sequence to editor command bindings are all defined in JOE\'s initialization file\. If you make a copy of this file (which normally resides in \fB/etc/joe/joerc\fR) to \fB$HOME/\.joerc\fR, you can customize these setting to your liking\. The syntax of the initialization file should be fairly obvious and there are further instructions in it\.
.
.P
The \fBjoerc\fR file has a directive to include another file (:include)\. This facility is used to include a file called \fBftyperc\fR (usually located in \fB/etc/joe/ftyperc\fR)\. \fBftyperc\fR has the file type table which determines which local options (including syntax for the highlighter) are applied to each file type\.
.
.SS "Initialization file loading sequence"
If the path for an initialization file begins with \'/\' (you can specify this with the include directive), JOE only tries to load it from the absolute path\. Otherwise, JOE tries to load initialization files (the joerc file and any files included in it, typically ftyperc) from three places:
.
.IP "\(bu" 4
"$HOME/\.joerc" \- The user\'s personalized joerc file\.
.
.IP "\(bu" 4
"/etc/joe/joerc" \- The system\'s joerc file\. The exact path is fixed during the build, and is determined by the \-\-sysconfdir configure script option\.
.
.IP "\(bu" 4
"*joerc" \- Built\-in file This means JOE searches for the file in a table of files linked in with the JOE binary (they are in the builtins\.c file)\. A built\-in joerc file is provided so that the editor will run in cases where system\'s joerc is inaccessible\.
.
.IP "" 0
.
.P
If the system\'s joerc file is newer than the user\'s joerc file, JOE will print a warning in the startup log\. Previous versions of JOE would prompt the user for this case\- the idea was that JOE may be unusable with an out of date initialization file\.
.
.SS "joerc file sections"
The \fBjoerc\fR file is broken up into a number of sections:
.
.IP "\(bu" 4
Global options Options which are not file specific, like \fBnoxon\fR\.
.
.IP "\(bu" 4
File name and content dependent options Options which depend on the file type, such as \fBautoindent\fR\. The \fBftyperc\fR file is included in this section\.
.
.IP "\(bu" 4
\fB^T\fR menu system definition Use :defmenu to define a named menu of macros\. The \fBmenu\fR command brings up a specific named menu\. \fB^T\fR is a macro which brings up the root menu: \fBmenu,"root",rtn\fR\.
.
.IP "\(bu" 4
Help screen contents Each help screen is named\. The name is used to implement context dependent help\.
.
.IP "\(bu" 4
Key bindings Key binding tables are defined\. You can define as many as you like (you can switch to a specific one with the \fBkeymap\fR command), but the following must be provided:
.
.IP "\(bu" 4
\fBmain\fR Editing windows
.
.IP "\(bu" 4
\fBprompt\fR Prompt windows
.
.IP "\(bu" 4
\fBquery\fR Single\-character query prompts
.
.IP "\(bu" 4
\fBquerya\fR Single\-character query for quote
.
.IP "\(bu" 4
\fBquerysr\fR Single\-character query for search and replace
.
.IP "\(bu" 4
\fBshell\fR Shell windows
.
.IP "\(bu" 4
\fBvtshell\fR Terminal emulator shell windows
.
.IP "" 0
.
.IP "" 0
.
.P
Key binding tables can inherit bindings from already defined tables\. This allows you to group common key bindings into a single table which is inherited by the others\.
.
.SS "Mode command"
Many options can be controlled with the \fB^T\fR menu\. This menu is defined in the joerc file\. Each option in the \fB^T\fR menu just executes a macro\. Usually the macro is the mode command\. You can execute the mode command directly with:
.
.IP "" 4
.
.nf
Esc X mode <enter>
.
.fi
.
.IP "" 0
.
.P
Hit \fBTab\fR \fBTab\fR for a completion list of all options\.
.
.SS "Menu command"
This command calls up a named menu of macros which was defined in the \fBjoerc\fR file\.
.
.IP "" 4
.
.nf
Esc X menu <enter>
.
.fi
.
.IP "" 0
.
.P
As usual, hit \fBTab\fR \fBTab\fR at the prompt for a completion list of the menus which exist\.
.
.P
\fB^T\fR is bound to the simple macro \fBmenu,"root",rtn\fR\- it brings up the root of the options menu system\.
.
.SH "Xterm Mouse support"
There are two levels of mouse support\. The \-mouse option enables the first level, which will work with any stock Xterm\. If \-joexterm is also set, mouse support is enhanced, but you need a recent version of XTerm, and it needs to be \./configured with the \-\-enable\-paste64 option\.
.
.P
When \-mouse is set, you can:
.
.IP "\(bu" 4
Left\-click in a text window to set the cursor position\. Left\-click in a different window to move the cursor to a different window\.
.
.IP "\(bu" 4
Select text with the mouse\. Left\-click and drag to select some text\- it will be as if you had used \fB^K B\fR and \fB^K K\fR to mark it\. Left\-click (but don\'t drag) to position the cursor somewhere else\. Middle click to copy the selected text to the cursor\- it will be as if you had hit \fB^K C\fR\. If you drag past the edge of the text window, the window will auto\-scroll to select more text\. Unfortunately, Xterm does not send any codes when the cursor is outside of the Xterm frame itself, so this only works if the mouse is still contained within the Xterm frame\. I\'ve sent a patch to the Xterm maintainer to improve this, but he has not taken it yet\.
.
.IP "\(bu" 4
Resize windows with the mouse: click and hold on a status line dividing two windows to move it\.
.
.IP "\(bu" 4
Select menu entries (such as any completion menu or the \fB^T\fR options menu): click on the menu item to position the cursor on it\. Double\-click on a menu item to select it (same as hitting return with cursor on it)\.
.
.IP "\(bu" 4
If your mouse has a wheel, turning the wheel will scroll the window with the cursor\.
.
.IP "" 0
.
.P
Unfortunately, when \-mouse is selected, cut and paste between X windows does not work as it normally does in a shell window (left\-click and drag to select, middle click to paste)\. Instead, you have to hold the shift key down to do this: shift\-left\-click and drag to select, and shift\-middle click to paste\. Note that pasting text into JOE this way has problems: any ` characters will get messed up because ` means quote the following control character\. Also if auto\-indent is enabled, pasted text will not be indented properly\.
.
.P
\fBNote:\fR these problems with pasting have been resolved in recent versions of JOE\.
.
.IP "\(bu" 4
JOE enables "bracketed paste" mode in Xterm so that pasted text is bracketed with an escape sequence\. This sequence causes JOE to disable the autoindent, wordwrap and spaces modes for the paste, and restores them when the paste is complete\.
.
.IP "\(bu" 4
Even if the terminal emulator does not have this bracketed paste mode, JOE detects pasted text by timing: If text arrives all at once (all in the same buffer), the text is assumed to be pasted text and autoindent and wordwrap are temporarily disabled\.
.
.IP "" 0
.
.P
When \-joexterm is set (and you have \./configured Xterm with \-\-enable\-paste64):
.
.IP "\(bu" 4
Cut & paste are properly integrated with X\. Text selected with left\-click\-drag is available for pasting into other X windows (even if the selected text is larger than the text window)\. Text selected in other X windows can be pasted into JOE with middle\-click\. There are no problems pasting text containing ` or with auto\-indent\.
.
.IP "" 0
.
.P
\-\-enable\-paste64 allows an application program to communicate Base\-64 encoded selection data to and from the Xterm\. The program has full control over what is in the selection data and when it is received or sent\.
.
.SH "Color Xterm support"
JOE can make use of monochrome Xterm, 8\-color Xterm, 16\-color Xterm, 88\-color Xterm and 256\-color Xterm\. The number of colors which Xterm supports is determined by which "configure" script options are set before the Xterm source code is compiled\. The termcap or terminfo entry must support how your Xterm is configured\. On my Slackware Linux distribution, you have to set the TERM environment variable to one of these:
.
.IP "\(bu" 4
xterm
.
.IP "\(bu" 4
xterm\-color
.
.IP "\(bu" 4
xterm\-16color
.
.IP "\(bu" 4
xterm\-88color
.
.IP "\(bu" 4
xterm\-256color
.
.IP "" 0
.
.P
If the termcap/terminfo entry is missing, you can add the "\-assume_256color" option to the joerc file\. Note that this was broken for terminfo in versions of JOE below 3\.4\.
.
.P
When it is working, the command: "joe \-assume_256color \-text_color bg_222" should have a gray background\.
.
.SH "Hex edit mode"
When this mode is selected (either put \-hex on the command line, or look for "Hex edit mode" after hitting \fB^T\fR), the buffer is displayed as a hex dump, but all of the editing commands operate the same way\. It is most useful to select overtype mode in conjunction with hex dump (hit \fB^T T\fR)\. Then typing will not insert\.
.
.IP "\(bu" 4
To enter the hex byte 0xF8 type \fB^Q x F 8\fR
.
.IP "\(bu" 4
You can use \fB^K C\fR to copy a block as usual\. If overtype mode is selected, the block will overwrite the destination data without changing the size of the file\. Otherwise it inserts\.
.
.IP "\(bu" 4
Hit \fBEsc X byte <Enter>\fR, to jump to a particular byte offset\. Hex values can be entered into this prompt like this: 0x2000\.
.
.IP "\(bu" 4
Search, incremental search, and search & replace all operate as usual\.
.
.IP "" 0
.
.P
\fI\fR
.
.SH "Environment variables"
For JOE to operate correctly, a number of other environment settings must be correct\. The throughput (baud rate) of the connection between the computer and your terminal must be set correctly for JOE to update the screen smoothly and allow typeahead to defer the screen update\. Use the \fBstty nnn\fR command to set this\. You want to set it as close as possible to actual throughput of the connection\. For example, if you are connected via a 1200 baud modem, you want to use this value for \fBstty\fR\. If you are connected via 14\.4k modem, but the terminal server you are connected to connects to the computer a 9600 baud, you want to set your speed as 9600 baud\. The special baud rate of 38400 or \fBextb\fR is used to indicate that you have a very\-high speed connection, such as a memory mapped console or an X\-window terminal emulator\. If you can\'t use \fBstty\fR to set the actual throughput (perhaps because of a modem communicating with the computer at a different rate than it\'s communicating over the phone line), you can put a numeric value in the \fBBAUD\fR environment variable instead (use \fBsetenv BAUD 9600\fR for csh or \fBBAUD=9600; export BAUD\fR for sh)\.
.
.P
The \fBTERM\fR environment variable must be set to the type of terminal you\'re using\. If the size (number of lines/columns) of your terminal is different from what is reported in the TERMCAP or TERMINFO entry, you can set this with the \fBstty rows nn cols nn\fR command, or by setting the \fBLINES\fR and \fBCOLUMNS\fR environment variables\. The terminal size is variable on modern systems and is determined by an ioctl, so these parameters often have no effect\.
.
.P
JOE normally expects that flow control between the computer and your terminal to use \fB^S\fR/\fB^Q\fR handshaking (i\.e\., if the computer is sending characters too fast for your terminal, your terminal sends \fB^S\fR to stop the output and \fB^Q\fR to restart it)\. If the flow control uses out\-of\-band or hardware handshaking or if your terminal is fast enough to always keep up with the computer output and you wish to map \fB^S\fR/\fB^Q\fR to edit commands, you can set the environment variable \fBNOXON\fR to have JOE attempt to turn off \fB^S\fR/\fB^Q\fR handshaking\. If the connection between the computer and your terminal uses no handshaking and your terminal is not fast enough to keep up with the output of the computer, you can set the environment variable \fBDOPADDING\fR to have \fBJOE\fR slow down the output by interspersing PAD characters between the terminal screen update sequences\.
.
.P
Here is a complete list of the environment variables:
.
.IP "\(bu" 4
BAUD
.
.br
Tell JOE the baud rate of the terminal (overrides value reported by stty)\.
.
.br
.
.IP "\(bu" 4
COLUMNS
.
.br
Set number of columns in terminal emulator (in case termcap entry is wrong)\. This is only useful on old system which don\'t have the "get window size" ioctl\.
.
.br
.
.IP "\(bu" 4
DOPADDING
.
.br
Enable JOE to send padding NULs to the terminal when set (for very old terminals)\.
.
.br
.
.IP "\(bu" 4
HOME
.
.br
Used to get path to home directory for ~ expansion and also to find ~/\.joerc file ~/\.joe directory\.
.
.br
.
.IP "\(bu" 4
HOSTNAME
.
.br
Used to get hostname to put in EMACS compatible locks\.
.
.br
.
.IP "\(bu" 4
JOETERM
.
.br
Gives terminal type: JOE will use this instead of TERM if it\'s set\.
.
.br
.
.IP "\(bu" 4
LANG
.
.br
Sets locale (like en_US\.utf\-8)\. JOE uses the first of these which is set: LC_ALL, LC_CTYPE, LANG\.
.
.br
.
.IP "\(bu" 4
LC_ALL
.
.br
Sets locale (like en_US\.utf\-8)\. JOE uses the first of these which is set: LC_ALL, LC_CTYPE, LANG\.
.
.br
.
.IP "\(bu" 4
LC_CTYPE
.
.br
Sets locale (like en_US\.utf\-8)\. JOE uses the first of these which is set: LC_ALL, LC_CTYPE, LANG\.
.
.br
.
.IP "\(bu" 4
LINES
.
.br
Set number of lines in terminal emulator (in case termcap entry is wrong)\. This is only useful on old system which don\'t have the "get window size" ioctl\.
.
.br
.
.IP "\(bu" 4
NOXON
.
.br
Disable \fB^S\fR and \fB^Q\fR flow control, possibly allowing \fB^S\fR and \fB^Q\fR to be used as editor keys\.
.
.br
.
.IP "\(bu" 4
SHELL
.
.br
Path to shell (like /bin/sh)\. This is used in several places: If you are on a system with no job control, this shell is invoked when you hit \fB^K Z\fR\. Also this is the shell which is run in shell windows\. If SHELL is not set (Cygwin) or if it\'s set to /bin/sh, JOE invokes the first of these which exists: /bin/bash, /usr/bin/bash, /bin/sh\.
.
.br
.
.IP "\(bu" 4
SIMPLE_BACKUP_SUFFIX
.
.br
If this is set, it is appended to the file name instead of ~ to create the backup file name\.
.
.br
.
.IP "\(bu" 4
TAGS
.
.br
If set to a path to a file, JOE tries to use this as the "tags" file if there is no "tags" file in the current directory\.
.
.br
.
.IP "\(bu" 4
TEMP
.
.br
If set, gives path to directory to open swapfile instead of /tmp
.
.br
.
.IP "\(bu" 4
TERMCAP
.
.br
Used by JOE\'s built\-in termcap file parser (not used for terminfo)\. A termcap entry can be placed directly in this variable (which will be used if it matches TERM), or if it begins with /, it gives a list of paths to termcap files to search\.
.
.br
.
.IP "\(bu" 4
TERMPATH
.
.br
Gives list of paths to termcap files to search when TERMCAP has a termcap entry (otherwise it\'s ignored)\. The default list of paths to termcap files (when TERMCAP and TERMPATH do not have it) is: "~/\.termcap /etc/joe/termcap /etc/termcap"
.
.br
.
.IP "\(bu" 4
TERM
.
.br
Gives terminal type, like "vt100" or "xterm"\.
.
.br
.
.IP "\(bu" 4
USER
.
.br
Used to get user name for EMACS compatible file locks\.
.
.br
.
.IP "" 0
.
.P
\fI\fR
.
.SH "JOE commands grouped by function"
These commands can be entered at the \fBEsc X\fR prompt\.
.
.SS "Background programs"
.
.IP "\(bu" 4
bknd
.
.br
Run a shell in a window
.
.br
.
.IP "\(bu" 4
vtbknd
.
.br
Run a shell in a terminal emulator window
.
.br
.
.IP "\(bu" 4
killproc
.
.br
Kill program in current window
.
.br
.
.IP "\(bu" 4
run
.
.br
Run a UNIX command in a window
.
.br
.
.IP "\(bu" 4
sys
.
.br
Run a UNIX command and return to editor when done (I/O does not go through editor, but we get the command\'s return status)\.
.
.IP "" 0
.
.SS "Blocks"
.
.IP "\(bu" 4
blkcpy
.
.br
Copy marked block to cursor
.
.br
.
.IP "\(bu" 4
blkdel
.
.br
Delete marked block
.
.br
.
.IP "\(bu" 4
blkmove
.
.br
Move marked block to cursor
.
.br
.
.IP "\(bu" 4
blksave
.
.br
Save marked block into a file
.
.br
.
.IP "\(bu" 4
copy
.
.br
Copy block to kill\-ring
.
.br
.
.IP "\(bu" 4
drop
.
.br
Set markb\. If it was already set, eliminate Ait\.
.
.br
.
.IP "\(bu" 4
dropon
.
.br
Set markb\. If it was already set, eliminate it\. Turn on marking mode\.
.
.br
.
.IP "\(bu" 4
toggle_marking
.
.br
If we\'re in a block: clear markb and markk\. If marking is off: set markb and turn on marking\. If marking is on: set markk (swap if necessary with markb) and turn marking off\.
.
.br
.
.IP "\(bu" 4
begin_marking
.
.br
If we\'re on an edge of a block: set markb to other edge and turn on marking mode\. Otherwise set markb to cursor and turn on marking mode\.
.
.br
.
.IP "\(bu" 4
select
.
.br
Set markb\. If it was already set, do nothing\.
.
.br
.
.IP "\(bu" 4
filt
.
.br
Filter block or file through a UNIX command
.
.br
.
.IP "\(bu" 4
markb
.
.br
Set beginning of block mark
.
.br
.
.IP "\(bu" 4
markk
.
.br
Set end of block mark
.
.br
.
.IP "\(bu" 4
markl
.
.br
Mark current line
.
.br
.
.IP "\(bu" 4
nmark
.
.br
Eliminate markb and markk
.
.br
.
.IP "\(bu" 4
picokill
.
.br
Delete line or block
.
.br
.
.IP "\(bu" 4
pop
.
.br
Restore markb and markk values from stack
.
.br
.
.IP "\(bu" 4
psh
.
.br
Push markb and markk values onto a stack
.
.br
.
.IP "\(bu" 4
swap
.
.br
Switch cursor with markb
.
.br
.
.IP "\(bu" 4
tomarkb
.
.br
Move cursor to markb
.
.br
.
.IP "\(bu" 4
tomarkbk
.
.br
Move cursor to markb or markk
.
.br
.
.IP "\(bu" 4
tomarkk
.
.br
Move cursor to markk
.
.br
.
.IP "\(bu" 4
yank
.
.br
Insert top of kill ring
.
.br
.
.IP "\(bu" 4
yankpop
.
.br
Scroll through kill ring
.
.br
.
.IP "\(bu" 4
yapp
.
.br
Append next kill to top of kill ring
.
.br
.
.IP "\(bu" 4
upper
.
.br
Convert everything in block to uppercase
.
.br
.
.IP "\(bu" 4
lower
.
.br
Convert everything in block to lowercase
.
.IP "" 0
.
.SS "Buffers"
.
.IP "\(bu" 4
bufed
.
.br
Buffer menu
.
.br
.
.IP "\(bu" 4
edit
.
.br
Load file into window: asks to reload if buffer exists
.
.br
.
.IP "\(bu" 4
switch
.
.br
Load file into window: always uses buffer if it exists
.
.br
.
.IP "\(bu" 4
scratch
.
.br
Push a scratch buffer into current window
.
.br
.
.IP "\(bu" 4
popabort
.
.br
Abort and pop window from stack (do nothing if stack empty)
.
.br
.
.IP "\(bu" 4
nbuf
.
.br
Load next buffer into current window
.
.br
.
.IP "\(bu" 4
pbuf
.
.br
Load previous buffer into current window
.
.br
.
.IP "\(bu" 4
reload
.
.br
Re\-read file into buffer (revert)
.
.br
.
.IP "\(bu" 4
reloadall
.
.br
Re\-read all unmodified buffers
.
.IP "" 0
.
.SS "Cursor Motion"
.
.IP "\(bu" 4
bof
.
.br
Move cursor to beginning of file
.
.br
.
.IP "\(bu" 4
bol
.
.br
Move cursor to beginning of line (always)
.
.br
.
.IP "\(bu" 4
bop
.
.br
Move to beginning of a paragraph
.
.br
.
.IP "\(bu" 4
bos
.
.br
Move to beginning of screen
.
.br
.
.IP "\(bu" 4
bkwdc
.
.br
Search backwards for a character
.
.br
.
.IP "\(bu" 4
byte
.
.br
Move cursor to specific byte offset into the file\.
.
.br
.
.IP "\(bu" 4
col
.
.br
Move cursor to specific column number\.
.
.br
.
.IP "\(bu" 4
dnarw
.
.br
Move cursor down one line
.
.br
.
.IP "\(bu" 4
eof
.
.br
Move cursor to end of file
.
.br
.
.IP "\(bu" 4
eol
.
.br
Move cursor to end of line
.
.br
.
.IP "\(bu" 4
eop
.
.br
Move cursor to end of paragraph
.
.br
.
.IP "\(bu" 4
fwrdc
.
.br
Search forward for matching character
.
.br
.
.IP "\(bu" 4
gomark
.
.br
Move cursor to a bookmark
.
.br
.
.IP "\(bu" 4
home
.
.br
Move cursor to beginning of line
.
.br
.
.IP "\(bu" 4
line
.
.br
Move cursor to specified line
.
.br
.
.IP "\(bu" 4
ltarw
.
.br
Move cursor left
.
.br
.
.IP "\(bu" 4
nedge
.
.br
Move cursor to next edge
.
.br
.
.IP "\(bu" 4
nextpos
.
.br
Move cursor to next position in cursor position history
.
.br
.
.IP "\(bu" 4
nextword
.
.br
Move cursor to end of next word
.
.br
.
.IP "\(bu" 4
pedge
.
.br
Move cursor to previous edge
.
.br
.
.IP "\(bu" 4
prevpos
.
.br
Move cursor to previous position in cursor position history
.
.br
.
.IP "\(bu" 4
prevword
.
.br
Move cursor to beginning of previous word
.
.br
.
.IP "\(bu" 4
rtarw
.
.br
Move cursor right
.
.br
.
.IP "\(bu" 4
setmark
.
.br
Set a bookmark
.
.br
.
.IP "\(bu" 4
tomatch
.
.br
Move cursor to matching delimiter
.
.br
.
.IP "\(bu" 4
tos
.
.br
Move cursor to top of screen
.
.br
.
.IP "\(bu" 4
uparw
.
.br
Move cursor up
.
.IP "" 0
.
.SS "Deletion"
.
.IP "\(bu" 4
backs
.
.br
Backspace
.
.br
.
.IP "\(bu" 4
backw
.
.br
Backspace a word
.
.br
.
.IP "\(bu" 4
delbol
.
.br
Delete to beginning of line
.
.br
.
.IP "\(bu" 4
delch
.
.br
Delete character under cursor
.
.br
.
.IP "\(bu" 4
deleol
.
.br
Delete to end of line
.
.br
.
.IP "\(bu" 4
dellin
.
.br
Delete entire line
.
.br
.
.IP "\(bu" 4
delw
.
.br
Delete word to right
.
.IP "" 0
.
.SS "Error parsing"
.
.IP "\(bu" 4
nxterr
.
.br
Goto next parsed error
.
.br
.
.IP "\(bu" 4
parserr
.
.br
Parse errors in current file
.
.br
.
.IP "\(bu" 4
gparse
.
.br
Parse grep list in current file
.
.br
.
.IP "\(bu" 4
jump
.
.br
Parse current line and jump to it
.
.br
.
.IP "\(bu" 4
prverr
.
.br
Go to previous parsed error
.
.br
.
.IP "\(bu" 4
showerr
.
.br
Show current message
.
.br
.
.IP "\(bu" 4
grep
.
.br
Execute grep command, parse when done
.
.br
.
.IP "\(bu" 4
build
.
.br
Execute build command, parse when done
.
.br
.
.IP "\(bu" 4
release
.
.br
Release error/grep records
.
.IP "" 0
.
.SS "Exit"
.
.IP "\(bu" 4
cancel
.
.br
Like abort, but doesn\'t return failure: useful in macros to escape out of a prompt\.
.
.br
.
.IP "\(bu" 4
abort
.
.br
Abort current buffer/window\. Prompt if it is changed\.
.
.br
.
.IP "\(bu" 4
abortbuf
.
.br
Like above, but just fail if it would have to prompt because it\'s the last window on a modified buffer\.
.
.br
.
.IP "\(bu" 4
ask
.
.br
Prompt to save current file: user says yes return, user says no: run \'abort\'\. Use in a macro: "ask,query,exsave"
.
.br
.
.IP "\(bu" 4
exsave
.
.br
Save file and exit
.
.br
.
.IP "\(bu" 4
lose
.
.br
EMACS kill buffer\. The buffer is deleted\- any windows with it get a replacement scratch buffer\.
.
.br
.
.IP "\(bu" 4
querysave
.
.br
Prompt to save each modified buffer\. Use in a macro: "querysave,query,killjoe"
.
.br
.
.IP "\(bu" 4
killjoe
.
.br
Exit JOE immediately without checking for modified buffers
.
.IP "" 0
.
.SS "Files"
.
.IP "\(bu" 4
cd
.
.br
Set directory prefix
.
.br
.
.IP "\(bu" 4
save
.
.br
Save file
.
.br
.
.IP "\(bu" 4
savenow
.
.br
Save immediately, unless file name is not known
.
.br
.
.IP "\(bu" 4
insf
.
.br
Insert a file
.
.IP "" 0
.
.SS "Formatting"
.
.IP "\(bu" 4
center
.
.br
Center line
.
.br
.
.IP "\(bu" 4
fmtblk
.
.br
Format all paragraphs in a block
.
.br
.
.IP "\(bu" 4
format
.
.br
Format current paragraph
.
.br
.
.IP "\(bu" 4
lindent
.
.br
Indent to the left
.
.br
.
.IP "\(bu" 4
rindent
.
.br
Indent to the right
.
.IP "" 0
.
.SS "Help"
.
.IP "\(bu" 4
help
.
.br
Turn help on or off
.
.br
.
.IP "\(bu" 4
hnext
.
.br
Switch to next help screen
.
.br
.
.IP "\(bu" 4
hprev
.
.br
Switch to previous help screen
.
.IP "" 0
.
.SS "Inserting"
.
.IP "\(bu" 4
ctrl
.
.br
Type next key
.
.br
.
.IP "\(bu" 4
finish
.
.br
Complete word in text window
.
.br
.
.IP "\(bu" 4
insc
.
.br
Insert a space
.
.br
.
.IP "\(bu" 4
open
.
.br
Insert newline
.
.br
.
.IP "\(bu" 4
quote
.
.br
Insert a control character
.
.br
.
.IP "\(bu" 4
quote8
.
.br
Insert a meta character
.
.br
.
.IP "\(bu" 4
rtn
.
.br
\fBReturn\fR / \fBEnter\fR key
.
.br
.
.IP "\(bu" 4
type
.
.br
Insert typed character
.
.br
.
.IP "\(bu" 4
secure_type
.
.br
Insert typed character, but only allowed in prompt windows (not allowed in shell windows)
.
.IP "" 0
.
.SS "Macros"
.
.IP "\(bu" 4
macros
.
.br
Insert keyboard macros into current file
.
.br
.
.IP "\(bu" 4
play
.
.br
Execute a macro
.
.br
.
.IP "\(bu" 4
query
.
.br
Suspend macro recording for user query
.
.br
.
.IP "\(bu" 4
record
.
.br
Record a macro
.
.br
.
.IP "\(bu" 4
stop
.
.br
Stop recording macro
.
.IP "" 0
.
.SS "Menu"
.
.IP "\(bu" 4
backsmenu
.
.br
Undo in file completion menu
.
.br
.
.IP "\(bu" 4
bofmenu
.
.br
Move to beginning of menu
.
.br
.
.IP "\(bu" 4
bolmenu
.
.br
Move to beginning of line in a menu
.
.br
.
.IP "\(bu" 4
dnarwmenu
.
.br
Move down one line in a menu
.
.br
.
.IP "\(bu" 4
eolmenu
.
.br
Move cursor to end of line in a menu
.
.br
.
.IP "\(bu" 4
eofmenu
.
.br
Move cursor to end of menu
.
.br
.
.IP "\(bu" 4
ltarwmenu
.
.br
Move cursor left in a menu
.
.br
.
.IP "\(bu" 4
rtarwmenu
.
.br
Move cursor right in menu
.
.br
.
.IP "\(bu" 4
uparwmenu
.
.br
Move cursor up in menu
.
.br
.
.IP "\(bu" 4
dnslidemenu
.
.br
Scroll menu down one line
.
.br
.
.IP "\(bu" 4
upslidemenu
.
.br
Scroll menu up one line
.
.br
.
.IP "\(bu" 4
pgupmenu
.
.br
Scroll menu up
.
.br
.
.IP "\(bu" 4
pgdnmenu
.
.br
Scroll menu down
.
.br
.
.IP "\(bu" 4
tabmenu
.
.br
Tab through menu
.
.IP "" 0
.
.SS "Misc"
.
.IP "\(bu" 4
beep
.
.br
Beep
.
.br
.
.IP "\(bu" 4
execmd
.
.br
Execute a JOE command
.
.br
.
.IP "\(bu" 4
debug_joe
.
.br
Insert debug information into buffer
.
.br
.
.IP "\(bu" 4
math
.
.br
Calculator
.
.br
.
.IP "\(bu" 4
maths
.
.br
Secure Calculator (no way to run joe() macros)
.
.br
.
.IP "\(bu" 4
mode
.
.br
Mode prompt
.
.br
.
.IP "\(bu" 4
menu
.
.br
Menu prompt
.
.br
.
.IP "\(bu" 4
msg
.
.br
Display a message
.
.br
.
.IP "\(bu" 4
notmod
.
.br
Clear the modified flag
.
.br
.
.IP "\(bu" 4
retype
.
.br
Refresh screen
.
.br
.
.IP "\(bu" 4
shell
.
.br
Suspend process or execute a sub\-shell
.
.br
.
.IP "\(bu" 4
stat
.
.br
Display cursor position
.
.br
.
.IP "\(bu" 4
tag
.
.br
Tags file search
.
.br
.
.IP "\(bu" 4
tagjump
.
.br
Jump to next tags file search match (only if notagsmenu is set)
.
.br
.
.IP "\(bu" 4
timer
.
.br
Execute a macro periodically
.
.br
.
.IP "\(bu" 4
txt
.
.br
Insert text\. If first character is `, then text is assumed to be a format string (that is, the string used to define the status line for the rmsg and lmsg options) and is formatted before the insertion\.
.
.br
.
.IP "\(bu" 4
name
.
.br
Insert current file name
.
.br
.
.IP "\(bu" 4
language
.
.br
Insert current language
.
.br
.
.IP "\(bu" 4
charset
.
.br
Insert current character set
.
.br
.
.IP "\(bu" 4
keymap
.
.br
Switch to another keymap
.
.IP "" 0
.
.SS "Prompts"
.
.IP "\(bu" 4
complete
.
.br
Complete a file\-name in a prompt
.
.br
.
.IP "\(bu" 4
if
.
.br
Only run following cmds if expr is true (non\-zero)
.
.br
.
.IP "\(bu" 4
then
.
.br
Same as rtn but only works in prompt windows
.
.br
.
.IP "\(bu" 4
elsif
.
.br
Try a new condition
.
.br
.
.IP "\(bu" 4
else
.
.br
Toggle truth flag
.
.br
.
.IP "\(bu" 4
endif
.
.br
Start running cmds again
.
.br
.
.IP "" 0
.
.P
Here is an example \'if\' macro:
.
.P
if,"char==65",then,"it\'s an A",else,"it\'s not an A",endif __^[ q__
.
.P
When you hit __^[ q__, if the character under the cursor is an \'A\': "it\'s a A" is inserted into the buffer, otherwise "it\'s not an A" is inserted\.
.
.P
"if" creates a math prompt (like __Esc M__)\. "then" is like "rtn"\- it hits the return key for this prompt\.
.
.P
Within the math prompt, the following variables are available:
.
.IP "\(bu" 4
char
.
.br
ASCII value of character under cursor
.
.br
.
.IP "\(bu" 4
width
.
.br
Width of screen
.
.br
.
.IP "\(bu" 4
height
.
.br
Height of screen
.
.br
.
.IP "\(bu" 4
byte
.
.br
byte number
.
.br
.
.IP "\(bu" 4
col
.
.br
column number
.
.br
.
.IP "\(bu" 4
line
.
.br
line number
.
.br
.
.IP "\(bu" 4
lines
.
.br
no\. lines in file
.
.br
.
.IP "\(bu" 4
top
.
.br
line number of top line of window
.
.IP "" 0
.
.SS "Repeat"
.
.IP "\(bu" 4
arg
.
.br
Prompt for repeat argument
.
.br
.
.IP "\(bu" 4
uarg
.
.br
Universal argument
.
.IP "" 0
.
.SS "Scrolling"
.
.IP "\(bu" 4
crawll
.
.br
Pan screen left
.
.br
.
.IP "\(bu" 4
crawlr
.
.br
Pan screen right
.
.br
.
.IP "\(bu" 4
dnslide
.
.br
Scroll screen down 1 line
.
.br
.
.IP "\(bu" 4
pgdn
.
.br
Scroll screen down
.
.br
.
.IP "\(bu" 4
pgup
.
.br
Scroll screen up
.
.br
.
.IP "\(bu" 4
upslide
.
.br
Scroll up one line
.
.IP "" 0
.
.SS "Search and replace"
.
.IP "\(bu" 4
ffirst
.
.br
Find text
.
.br
.
.IP "\(bu" 4
fnext
.
.br
Repeat previous search
.
.br
.
.IP "\(bu" 4
isrch
.
.br
Incremental search forward
.
.br
.
.IP "\(bu" 4
qrepl
.
.br
Search and replace
.
.br
.
.IP "\(bu" 4
rfirst
.
.br
Search backwards for text
.
.br
.
.IP "\(bu" 4
rsrch
.
.br
Reverse incremental search
.
.IP "" 0
.
.SS "Windows"
.
.IP "\(bu" 4
explode
.
.br
Display one window or display all windows
.
.br
.
.IP "\(bu" 4
dupw
.
.br
Duplicate current window
.
.br
.
.IP "\(bu" 4
groww
.
.br
Increase size of window
.
.br
.
.IP "\(bu" 4
nextw
.
.br
Move cursor to next window
.
.br
.
.IP "\(bu" 4
prevw
.
.br
Go to previous window
.
.br
.
.IP "\(bu" 4
shrinkw
.
.br
Shrink window
.
.br
.
.IP "\(bu" 4
splitw
.
.br
Split window into two
.
.br
.
.IP "\(bu" 4
tw0
.
.br
Eliminate this window
.
.br
.
.IP "\(bu" 4
tw1
.
.br
Show only one window
.
.br
.
.IP "\(bu" 4
mwind
.
.br
Get error messages window on the screen and put cursor in it\.
.
.br
.
.IP "\(bu" 4
showlog
.
.br
Get startup log scratch buffer into window\.
.
.br
.
.IP "\(bu" 4
mfit
.
.br
Fit two windows on the screen: make current window 6 lines, and give rest of space to window above\. The window above is either the existing previous window, a newly created one if there wasn\'t one\.
.
.IP "" 0
.
.SS "Undo"
.
.IP "\(bu" 4
redo
.
.br
Re\-execute the latest undone change
.
.br
.
.IP "\(bu" 4
undo
.
.br
Undo last change
.
.IP "" 0
.
.SS "Mouse"
.
.IP "\(bu" 4
tomouse
.
.br
Move the cursor to where the mouse was clicked/dragged
.
.br
.
.IP "\(bu" 4
defmdown
.
.br
Default single\-click handler, usually bound to MDOWN\. Positions cursor to mouse and begins a region\.
.
.br
.
.IP "\(bu" 4
defmup
.
.br
Default single\-click release handler, usually bound to MUP\. Completes selection of a region\.
.
.br
.
.IP "\(bu" 4
defmdrag
.
.br
Default single\-click drag handler, usually bound to MDRAG\. Selects a region of text a character at a time\.
.
.br
.
.IP "\(bu" 4
defm2down
.
.br
Default double\-click handler, usually bound to M2DOWN\.
.
.br
.
.IP "\(bu" 4
defm2up
.
.br
Default double\-click release handler, usually bound to M2UP\.
.
.br
.
.IP "\(bu" 4
defm2drag
.
.br
Default double\-click drag handler, usually bound to M2DRAG\. Selects a region of text a word at a time\.
.
.br
.
.IP "\(bu" 4
defm3down
.
.br
Default triple\-click handler, usually bound to M3DOWN\.
.
.br
.
.IP "\(bu" 4
defm3up
.
.br
Default triple\-click release handler, usually bound to M3UP\.
.
.br
.
.IP "\(bu" 4
defm3drag
.
.br
Default triple\-click drag handler, usually bound to M3DRAG\. Selects a region of text a line at a time\.
.
.br
.IP "\(bu" 4
defmiddledown
.
.br
Default middle click handler, usually bound to MIDDLEDOWN. This inserts text\.
.
.br
.IP "\(bu" 4
defmiddleup
.
.br
Default middle click release handler, usually bound to MIDDLEUP\.
.
.br
.
.IP "\(bu" 4
xtmouse
.
.br
Handle xterm mouse events, usually bound to Esc [ M\. It parses the rest of the sequence and generates fake "keys" that can be bound to macros in the joerc file\. It uses a timer to detect double-click and triple-click\. The keys are: MUP, MDOWN, MDRAG, M2UP, M2DOWN, M2DRAG, M3UP, M3DOWN, M3DRAG, MWUP and MWDOWN\.
.
.br
.
.IP "\(bu" 4
extmouse
.
.br
Handle extended xterm mouse events, usually bound to Esc [ <.
.
.br
.
.IP "\(bu" 4
paste
.
.br
Insert base64 encoded text (for XTerm \-\-enable\-base64 option)\.
.
.br
.
.IP "\(bu" 4
brpaste
.
.br
Disable autoindent, wordwrap and spaces\. The idea is to bind this to \fBEsc [ 2 0 0 ~\fR so that when the terminal emulator sends a mouse paste, the text is inserted as\-is\.
.
.br
.
.IP "\(bu" 4
brpaste_done
.
.br
Restore autoindent, wordwrap and spaces modes to their original values before brpaste\. The idea is to bind this to \fBEsc [ 2 0 1 ~\fR so that these modes are restored after a mouse paste\.
.
.br
.
.IP "" 0
|