File: manual.html

package info (click to toggle)
elinks 0.12~pre6-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,808 kB
  • ctags: 11,372
  • sloc: ansic: 96,761; sh: 5,272; python: 3,878; perl: 2,175; makefile: 1,059; pascal: 924; yacc: 295; lisp: 125; ruby: 70; awk: 65
file content (4646 lines) | stat: -rw-r--r-- 189,724 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 7.1.2" />
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
  border: 1px solid red;
*/
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
}

strong {
  font-weight: bold;
}

tt {
  color: navy;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  font-family: sans-serif;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1 {
  border-bottom: 2px solid silver;
}
h2 {
  border-bottom: 2px solid silver;
  padding-top: 0.5em;
}

div.sectionbody {
  font-family: serif;
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

pre {
  padding: 0;
  margin: 0;
}

span#author {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 1.2em;
}
span#email {
}
span#revision {
  font-family: sans-serif;
}

div#footer {
  font-family: sans-serif;
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
div#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
div#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

div#preamble,
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-right: 10%;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.5em;
  margin-bottom: 2.5em;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  font-family: sans-serif;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock > div.content {
  padding-left: 2.0em;
}

div.attribution {
  text-align: right;
}
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 2px solid silver;
}

div.exampleblock > div.content {
  border-left: 2px solid silver;
  padding: 0.5em;
}

div.verseblock div.content {
  white-space: pre;
}

div.imageblock div.content { padding-left: 0; }
div.imageblock img { border: 1px solid silver; }
span.image img { border-style: none; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: italic;
}
dd > *:first-child {
  margin-top: 0;
}

ul, ol {
    list-style-position: outside;
}
ol.olist2 {
  list-style-type: lower-alpha;
}

div.tableblock > table {
  border: 3px solid #527bbd;
}
thead {
  font-family: sans-serif;
  font-weight: bold;
}
tfoot {
  font-weight: bold;
}

div.hlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
td.hlist1 {
  vertical-align: top;
  font-style: italic;
  padding-right: 0.8em;
}
td.hlist2 {
  vertical-align: top;
}

@media print {
  div#footer-badges { display: none; }
}
/* Workarounds for IE6's broken and incomplete CSS2. */

div.sidebar-content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}
div.sidebar-title, div.image-title {
  font-family: sans-serif;
  font-weight: bold;
  margin-top: 0.0em;
  margin-bottom: 0.5em;
}

div.listingblock div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock-content {
  padding-left: 2.0em;
}

div.exampleblock-content {
  border-left: 2px solid silver;
  padding-left: 0.5em;
}
</style>
<title>The ELinks Manual</title>
</head>
<body>
<div id="header">
<h1>The ELinks Manual</h1>
</div>
<h2>Preface</h2>
<div class="sectionbody">
<p>Welcome!  This is the entry point for the humble ELinks manual.  It is by no
means complete, it is not even very homogeneous and it should eventually be
superseded by a complete ELinks Book. Until this happens you may also find it
necessary to refer to the manual page for a very quick reference, or the
built-in documentation available via the --long-help and --config-help ELinks
command-line arguments. The built-in documentation is sure to be up-to-date.</p>
<p>There was a complete (or, for the most part complete) manual for Links 0.82 at
one time, and you can still find it at:</p>
<ul>
<li>
<p>
<a href="http://links.sourceforge.net/docs/manual-0.82-en/index.html">http://links.sourceforge.net/docs/manual-0.82-en/index.html</a>
</p>
</li>
</ul>
<p>While large parts of it do not apply anymore, you may still find some relevant
information there.</p>
<p>Authors:</p>
<ul>
<li>
<p>
Jonas Fonseca &lt;fonseca@diku.dk&gt;
</p>
</li>
<li>
<p>
Jose Luis Gonzalez Gonzalez &lt;jlg80@mi.madritel.es&gt;
</p>
</li>
<li>
<p>
Laurent Monin &lt;zas@norz.org&gt;
</p>
</li>
<li>
<p>
Miciah Dashiel Butler Masters &lt;miciah@myrealbox.com&gt;
</p>
</li>
<li>
<p>
Petr Baudis &lt;pasky@ucw.cz&gt;
</p>
</li>
<li>
<p>
Peter Wang
</p>
</li>
</ul>
<p>and others.</p>
<p>Hold blameless the authors.  Any lawful use is allowed.</p>
</div>
<h2>Getting ELinks up and running</h2>
<div class="sectionbody">
<p>Installing ELinks should be pretty easy on most systems. Below is described
the whole process of configuring the compilation, compiling and installing.</p>
<h3>Building and Installing ELinks</h3>
<p>The quick guide for the impatient. Issue the following commands from the
ELinks source directory:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ ./configure &amp;&amp; make &amp;&amp; make install</tt></pre>
</div></div>
<p>However you might consider to tweek a few compile time options before building
ELinks. You might also want to take a look at what libraries and programs are
required or recommended that you install.</p>
<h3>Requirements</h3>
<p>To successfully install ELinks all that is required is GNU make
(version 3.78 or later) and a C compiler. If you want to install
directly from GIT it is also required that automake and autoconf
is installed on your system.</p>
<h3>Recommended Libraries and Programs</h3>
<p>To make use of many of ELinks features you will need to have some external
libraries and utility programs installed on your system. It is recommended to
have the following libraries and programs installed:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="249" />
<col width="550" />
<thead>
  <tr>
    <th align="left">
    Dependency
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    Lua or Guile
    </td>
    <td align="left">
    Makes it possible to write scripting plugins.                               See <a href="#lua-scripting">the Elinks - Lua interface</a>                            for more info.
    </td>
  </tr>
  <tr>
    <td align="left">
    zlib 1.2.0.2 or later
    </td>
    <td align="left">
    For handling gzip or deflate compressed documents                            both locally and sent from server.
    </td>
  </tr>
  <tr>
    <td align="left">
    bzip2
    </td>
    <td align="left">
    Likewise, for bzip2 compressed documents.
    </td>
  </tr>
  <tr>
    <td align="left">
    LZMA Utils
    </td>
    <td align="left">
    Likewise, for LZMA compressed documents.                                     Version 4.32.5 should work.  XZ Utils does not work.
    </td>
  </tr>
  <tr>
    <td align="left">
    OpenSSL or GNU TLS
    </td>
    <td align="left">
    For handling secure HTTP browsing.
    </td>
  </tr>
  <tr>
    <td align="left">
    pkg-config
    </td>
    <td align="left">
    Needed for locating some libraries (at least                                GNU TLS and TRE)
    </td>
  </tr>
  <tr>
    <td align="left">
    GPM
    </td>
    <td align="left">
    <em>General Purpose Mouse</em> for mouse support.
    </td>
  </tr>
  <tr>
    <td align="left">
    expat
    </td>
    <td align="left">
    <em>XML Parser Toolkit</em> needed for XBEL support.
    </td>
  </tr>
  <tr>
    <td align="left">
    <a href="http://laurikari.net/tre/">TRE</a>
    </td>
    <td align="left">
    For regexp searching.  Version 0.7.5 works.
    </td>
  </tr>
  <tr>
    <td align="left">
    libsmbclient
    </td>
    <td align="left">
    Library needed for smb:// protocol support.
    </td>
  </tr>
  <tr>
    <td align="left">
    rxvt-unicode
    </td>
    <td align="left">
    For terminal emulator which supports 88 colors.
    </td>
  </tr>
  <tr>
    <td align="left">
    xterm with 256 colors
    </td>
    <td align="left">
    Program atleast patch level  179 or rxvt program                            from version 2.7.9 for support of 256 colors.                               Newer PuTTY also has 256 color support.
    </td>
  </tr>
  <tr>
    <td align="left">
    libidn
    </td>
    <td align="left">
    For internationalized domain names.
    </td>
  </tr>
  <tr>
    <td align="left">
    SpiderMonkey
    </td>
    <td align="left">
    Mozilla's JavaScript engine for getting                                     JavaScript/ECMAScript support in ELinks.                                    See also <a href="#ecmascript">notes on ECMAScript support</a>.
    </td>
  </tr>
</tbody>
</table>
</div>
<p>When compiling, you also need the header files for the libraries. Most OS
distributors put a given library's headers in a package separate from the
library itself; this package usually has <tt>-dev</tt> or similar appended to its
name.</p>
<h3>Further reading</h3>
<p>This installation guide is far from being complete. You are also advised to
read the <tt>README</tt> and the <tt>INSTALL</tt> files distributed with ELinks for further
up to date info on building and installing.</p>
<h3>Tips to obtain a very small static elinks binary</h3>
<p>Tips to obtain a very small static elinks binary suitable for mini
distributions</p>
<p>Remove config.cache (previous CC may be cached):</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ rm config.cache</tt></pre>
</div></div>
<p>Use dietlibc (http://www.fefe.de/dietlibc/) or similar stuff (uClibc, &#8230;):</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ export CC='diet -Os gcc'</tt></pre>
</div></div>
<p>Use compilers flags to optimize for size:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ export CFLAGS='-s -fno-inline -nostdinc -fomit-frame-pointer'</tt></pre>
</div></div>
<p>Note that if you don't use dietlibc, you definitively want to add <tt>-Os</tt> or
<tt>-O2</tt> to <tt>CFLAGS</tt>; GCC 2.95 does not know <tt>-Os</tt>, and some say <tt>-O2</tt> gives
smaller executables even for GCC 3.x.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Tip</div>
</td>
<td class="content">
<p>If you use these <tt>CFLAGS</tt> on Cygwin and you get unresolved symbols (<tt>htons</tt> and
suite in particular), try removing <tt>-fno-inline</tt> parameter.</p>
</td>
</tr></table>
</div>
<p>Disable some compile-time options:</p>
<div class="listingblock">
<div class="content">
<pre><tt>$ ./configure --disable-ipv6 --disable-backtrace --disable-nls \
  --enable-fastmem --without-zlib --without-bzlib --disable-xbel \
  --without-lua --without-gnutls --without-openssl --without-x \
  --enable-small --without-spidermonkey --without-gpm</tt></pre>
</div></div>
<p>You can disable bookmarks, globhist and more, too, if you want to.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Tip</div>
</td>
<td class="content">
<div class="title">Other configure options that can reduce the size</div>
<ul>
<li>
<p>
--disable-backtrace disables internal backtrace code.
</p>
</li>
<li>
<p>
--disable-nls disables i18n support.
</p>
</li>
<li>
<p>
--enable-fastmem disables internal <tt>malloc()</tt> debugging and use <tt>alloca()</tt>
   wherever possible.
</p>
</li>
<li>
<p>
--enable-small forces to remove some text descriptions in options and
   keybind stuff (regain 30Kb).
</p>
</li>
</ul>
</td>
</tr></table>
</div>
<p>Dependencies over external libs must be removed using the related configure
options:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="274" />
<col width="628" />
<thead>
  <tr>
    <th align="left">
    Option
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    --without-zlib
    </td>
    <td align="left">
    removes libz dependency (compression)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-bzlib
    </td>
    <td align="left">
    removes libbz2 dependency (compression)
    </td>
  </tr>
  <tr>
    <td align="left">
    --disable-xbel
    </td>
    <td align="left">
    removes expat dependency (XBEL bookmarks support)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-lua
    </td>
    <td align="left">
    removes liblua dependency (Lua scripting)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-gnutls
    </td>
    <td align="left">
    removes libtls dependency (SSL support)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-openssl
    </td>
    <td align="left">
    removes libssl dependency (SSL support)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-x
    </td>
    <td align="left">
    removes libx11 dependency (restoring terminal title)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-spidermonkey
    </td>
    <td align="left">
    removes libjs dependency (JavaScript)
    </td>
  </tr>
  <tr>
    <td align="left">
    --without-gpm
    </td>
    <td align="left">
    removes libgpm dependency (mouse/console)
    </td>
  </tr>
</tbody>
</table>
</div>
<p>It seems GCC 2.95.x do not generate as small binaries as GCC 3.2.x with same
flags.</p>
<p>You can use an executable compressor like UPX
<a href="http://upx.sourceforge.net/">http://upx.sourceforge.net/</a>.</p>
<p>Here are some results using gcc 2.95.3, dietlibc-0.23, and previous flags:</p>
<div class="literalblock">
<div class="content">
<pre><tt>me$ ls -l src/elinks
-rwxr-xr-x   1 zas      users      495100 Oct 20 15:53 src/elinks
me$ upx --best src/elinks
me$ ls -l src/elinks
-rwxr-xr-x   1 zas      users      217946 Oct 20 15:53 src/elinks</tt></pre>
</div></div>
<p>Whow ! Around 200kb :)</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="title">Details about the <tt>--enable-small</tt> configure option effects:</div>
<ul>
<li>
<p>
it disables long descriptions of options;
</p>
</li>
<li>
<p>
it disables textual descriptions of keybinding options;
</p>
</li>
<li>
<p>
it reduces size of some HTTP errors messages;
</p>
</li>
<li>
<p>
it disables fastfind feature, reducing performance, but also reducing a lot
  memory usage, and a bit the executable size.
</p>
</li>
</ul>
</td>
</tr></table>
</div>
<h3><a id="ecmascript"></a>ECMAScript support?!</h3>
<p>Yes, there is some ECMAScript support in ELinks. There isn't anything we could
call complete, but some bits could help with the most common ECMAScript usage
cases - help you (and then us ;) get into your banking account, pass through
those ignorant page redirects done by JavaScript code snippets and so.</p>
<p>ELinks does not have own ECMAScript parser and compiler; instead it reuses
other people's work (this may eventually change, see the bottom of this file).
First we aimed at the NJS engine, which is easy to install, small and compact;
has nice naming scheme, horrible calling conventions and very lacking
documentation; is not actively developed; and generally looks broken and
extremely clumsy to work with. So we instead went the way of the SpiderMonkey
(SM) engine (property of Mozilla), which is hard to install, bigger (mind you,
it comes from Mozilla ;), has ugly naming scheme but nice calling conventions,
acceptable documentation, is actively developed and ought to work.</p>
<h4>Ok, so how to get the ECMAScript support working?</h4>
<p>Some systems come with either the SpiderMonkey installed or as an option. It
would be good to test if you can take the easy path and let the system take
care of installation through a package system. Below are listed instructions
on what package you need to install on various systems (please help improve
the list). If all goes well you can proceed to rebuilding ELinks.</p>
<p>On Debian testing (Etch) or unstable (SID), run the following:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ apt-get install libmozjs-dev</tt></pre>
</div></div>
<p>On Debian stable (Sarge), run the following:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ apt-get install libsmjs-dev</tt></pre>
</div></div>
<p>Installing the -dev package will automatically pull in the library package.</p>
<p>Once this is done, rebuild ELinks. The configure script should detect
the SpiderMonkey library&#8212;check for this line in the features summary:</p>
<div class="literalblock">
<div class="content">
<pre><tt>ECMAScript (JavaScript) ......... SpiderMonkey document scripting</tt></pre>
</div></div>
<p>After following these instructions on a Debian system, you are done and should
ignore the following directions.</p>
<p>The rest is only for non-Debian system.</p>
<p>Note that this procedure enables you to install SpiderMonkey, but in such a
way that it might not work with anything else but ELinks. It is unlikely that
anything else is ever going to use SpiderMonkey on your system, but if you
want to take the safe way, get SM and follow the instructions in
<tt>src/README.html</tt> instead. You will probably need to do some checkouting of
bits of the Mozilla CVS tree and so, have fun.</p>
<p>To get SpiderMonkey source, go at
<a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/">ftp://ftp.mozilla.org/pub/mozilla.org/js/</a> and fetch the newest <tt>js-</tt>
tarball there (<tt>js-1.5-rc6a.tar.gz</tt> at the time of writing this; you may try
the RPMs, but we didn't test them).</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ cd elinks
$ wget ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.5-rc6a.tar.gz
$ tar xvzf js-1.5-rc6a.tar.gz</tt></pre>
</div></div>
<p>Next, you need to patch it so that you will have any chance to install it as
you fetched it. Grab it in ELinks at <tt>contrib/js-1.5-rc6a+elinks.patch</tt> (if
you have a different version, still try to go ahead, you might have some
success), then go to the SpiderMonkey directory (called js) and apply it as</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ cd js
$ patch -p1 &lt;../contrib/js-1.5-rc6a+elinks.patch
$ cd src</tt></pre>
</div></div>
<p>Now, edit config.mk and adjust the <tt>$PREFIX</tt> variable - you probably won't
like the default value - ELinks will find it there, but your dynamic linker
likely won't.</p>
<p>E.g., for /usr/local installation:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ sed 's#^PREFIX = /opt/spidermonkey#PREFIX = /usr/local#' &lt; config.mk &gt; config.mk.t
$ mv -f config.mk.t config.mk</tt></pre>
</div></div>
<p>Now you can finally go for it:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ make -f Makefile.ref
$ make -f Makefile.ref export</tt></pre>
</div></div>
<p>Now install it:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ su -c 'make -f Makefile.ref install &amp;&amp; (ldconfig -v | grep libjs)'</tt></pre>
</div></div>
<p>Check for:</p>
<div class="literalblock">
<div class="content">
<pre><tt>libjs.so -&gt; libjs.so</tt></pre>
</div></div>
<p>If you don't get such result, check that the library's installation path
(e.g. /usr/local/lib) is present in /etc/ld.so.conf (man 8 ldconfig).</p>
<p>If all went well, you can proceed to rebuild ELinks now. If something broke,
see you on #elinks @ FreeNode or in the mailing list.
You may add your options to <tt>./configure</tt> as usual; SpiderMonkey should be
autodetected.</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ cd ../..
$ ./configure</tt></pre>
</div></div>
<p>Check for the following line in the features summary:</p>
<div class="literalblock">
<div class="content">
<pre><tt>ECMAScript (JavaScript) ......... SpiderMonkey document scripting</tt></pre>
</div></div>
<p>Then run:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ make
$ su -c 'make install'</tt></pre>
</div></div>
<p>Enjoy.</p>
<h4>The ECMAScript support is buggy! Shall I blame Mozilla people?</h4>
<p>Likely not. The ECMAScript engine provides only the language compiler and some
basic built-in objects, and it's more than likely that the problem is on our
side in the implementation of some of the HTML/DOM objects (perhaps we just
haven't bothered to implement it at all yet). So better tell us first, and if
we think it's not our fault we will tell you to go complain to Mozilla (better
yet if it does not work in the Mozilla browsers neither ;-).</p>
<h4>Now, I would still like NJS or a new JS engine from scratch&#8230;</h4>
<p>...and you don't fear some coding? That's fine then! ELinks is in no way tied
to SpiderMonkey, in fact the ECMAScript support was carefully implemented so
that there are no SpiderMonkey references outside of
<tt>src/ecmascript/spidermonkey.*</tt>. If you want to implement an alternative
ECMAScript backend, go ahead - you will just need to write an autoconf
detection for it and tie it to <tt>src/ecmascript/ecmascript.c</tt>, which should be
easy. We await your patches eagerly.</p>
<h3>Feature configuration file (<tt>features.conf</tt>)</h3>
<p>This file contains various compile-time configuration settings, which you can
adjust below. You can fine-tune the ELinks binary to include really only what
you want it to. It acts as a front-end to the configure script in the sense
that it is possible to control any features in this file by passing arguments
to the configure script. In fact any arguments given to the script will
overrule the values set in this file.</p>
<p>There are still some things which are to be adjusted only directly through the
configure script arguments though, so check ./configure --help out as well!</p>
<p>All dependency checking is done by the configure script so even though a
feature is enabled here it is possible that it will be disabled at compile
time if the dependencies are not met. Check the features.log file generated
by the configure script to make sure.</p>
<h4>Notes for users</h4>
<p>All features that can be controlled using this file are already set to their
default values. The syntax used is hopefully familiar to most people.</p>
<p><em>#</em> chars start a comment that runs until the end of the line.</p>
<p>The features are controlled by setting the various CONFIG_&lt;FEATURE&gt; variables
to either <em>yes</em> or <em>no</em> depending on whether it should be enabled or disabled.
So in order to disable bookmark support a line in this file should say:</p>
<div class="literalblock">
<div class="content">
<pre><tt>CONFIG_BOOKMARKS=no</tt></pre>
</div></div>
<p>It is also possible to simply comment out the line in order to disable it.
Therefore, if the default doesn't suit you, you can either comment it out or
set it to the value you desire.</p>
<h4><a id="CONFIG-BOOKMARKS"></a>Bookmarks (<tt>CONFIG_BOOKMARKS</tt>)</h4>
<p>ELinks has built-in hierarchic bookmarks support. Open the bookmarks manager
by pressing <em>s</em>. When bookmarks are enabled, also support for the internal
ELinks bookmarks format is always compiled in.</p>
<p>This is a favourite target for disabling in various embedded applications.
It all depends on your requirements.</p>
<p>Also read the &#8220;The Ultimate Bookmarks Guide&#8221; in doc/bookmarks.txt</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-XBEL-BOOKMARKS"></a>XBEL Bookmarks (<tt>CONFIG_XBEL_BOOKMARKS</tt>)</h4>
<p>ELinks also supports universal XML bookmarks format called XBEL, also
supported by e.g. Galeon, various "always-have-my-bookmarks" websites and
number of universal bookmark converters.</p>
<p>Frequently, you know you will not need it, then you can of course happily
forcibly remove support for it and save few bytes.</p>
<p><strong>Default:</strong>  enabled if libexpat is found and bookmarks are enabled</p>
<h4><a id="CONFIG-COOKIES"></a>Cookies (<tt>CONFIG_COOKIES</tt>)</h4>
<p>Support for HTTP cookies --- a data token which the server sends the client
once and then the client sends it back along each request to the server.  This
mechanism is crucial e.g. for keeping HTTP sessions (you "log in" to a site,
and from then on the site recognizes you usually because of the cookie), but
also for various banner systems, remembering values filled to various forms,
and so on. You can further tune the ELinks behaviour at runtime (whether to
accept/send cookies, ask for confirmation when accepting a cookie etc).</p>
<p>This functionality is usually quite important and you should not disable it
unless you really know what are you doing.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-FORMHIST"></a>Form History (<tt>CONFIG_FORMHIST</tt>)</h4>
<p>The famous Competing Browser has that annoying thing which pops up when you
submit a form, offering to remember it and pre-fill it the next time. And yes,
ELinks can do that too! You will still need to also enable this manually at
document.browse.forms.show_formhist.</p>
<p>Many people find it extremely annoying (including pasky), however some others
consider it extremely handy and will sacrifice almost anything to get it. It
will not do any harm to have this compiled-in as long as you will leave it
turned off (which is also the default configuration).</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-GLOBHIST"></a>Global History (<tt>CONFIG_GLOBHIST</tt>)</h4>
<p>This device records each and every page you visit (to a configurable limit).
You can browse through this history in the history manager (press <em>h</em>).  Do
not confuse this with the "session history", recording history of your
browsing in the frame of one session (session history is the thing you move
through when pressing <em>back</em> and <em>unback</em> or which you see in the
File::History menu).</p>
<p>Global history does not care about the order you visited the pages in, it just
records that you visited it, when did you do that and the title of the page.
Then, you can see when did you visit a link last time (and what was the title
of the target document at that time), links can be coloured as visited etc.</p>
<p>If you disable this feature, you will not lose any crucial functionality, just
some relatively minor convenience features, which can nevertheless prove
sometimes very practical.</p>
<p><strong>Default:</strong>  enabled</p>
<h4>MIME</h4>
<p>ELinks uses a MIME system for determining the content type of documents and
configuring programs for external handling. By default the option system can
be used to configure how media types are handled. More info about how to set
up the MIME handling using the option system can be found in the doc/mime.html
file.</p>
<p>Below are listed some additional ways to do it.</p>
<h4><a id="CONFIG-MAILCAP"></a>Mailcap (<tt>CONFIG_MAILCAP</tt>)</h4>
<p>Mailcap files describe what program - on the local system - can be used to
handle a media type. The file format is defined in RFC 1524 and more info
including examples can be found in the doc/mailcap.html file.</p>
<p>This is very useful especially for clean interoperability with other
MIME-aware applications and fitting nicely into the UNIX system, where this is
the standard way of specifying MIME handlers. If you are not interested in
that, you can still use the internal MIME associations system, though.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-MIMETYPES"></a>Mimetypes File (<tt>CONFIG_MIMETYPES</tt>)</h4>
<p>Mimetypes file can be used to specify the relation between media types and
file extensions.</p>
<p>Basically same thing applies here as for the mailcap support.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-GZIP"></a>Gzip and Deflate Decompression (<tt>CONFIG_GZIP</tt>)</h4>
<p>This makes ELinks send "Accept-Encoding: deflate, gzip" in HTTP
requests and decompress any documents received in those formats.
It works with local *.gz files as well.</p>
<p><strong>Default:</strong>  enabled if zlib is installed and new enough</p>
<h4><a id="CONFIG-BZIP2"></a>Bzip2 Decompression (<tt>CONFIG_BZIP2</tt>)</h4>
<p>This makes ELinks decompress local *.bz2 files.
Also, ELinks sends "Accept-Encoding: bzip2" in HTTP requests
and decompresses any documents received in that format,
but this encoding has not been registered at
<a href="http://www.iana.org/assignments/http-parameters">http://www.iana.org/assignments/http-parameters</a>,
so most servers probably won't use it.</p>
<p><strong>Default:</strong>  enabled if the library is installed</p>
<h4><a id="CONFIG-LZMA"></a>LZMA Decompression (<tt>CONFIG_LZMA</tt>)</h4>
<p>This makes ELinks decompress local *.lzma files.
Also, ELinks sends "Accept-Encoding: lzma" in HTTP requests
and decompresses any documents received in that format,
but this encoding has not been registered at
<a href="http://www.iana.org/assignments/http-parameters">http://www.iana.org/assignments/http-parameters</a>,
so most servers probably won't use it.</p>
<p>To use this, first install <a href="http://tukaani.org/lzma/">LZMA Utils</a>.
Version 4.32.5 works; 4.42.2alpha also works and understands a
newer LZMA file format.  This version of ELinks does not support
LZMA SDK from 7-Zip.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-IPV6"></a>IPv6 Protocol Support (<tt>CONFIG_IPV6</tt>)</h4>
<p>You know this thing that was designed to obsolete IPv4 but only pasky,
weirdos and projects supported with big funds really use. ;-)</p>
<p><strong>Default:</strong>  enabled if the system supports it</p>
<h4><a id="CONFIG-URI-REWRITE"></a>URI Rewriting (<tt>CONFIG_URI_REWRITE</tt>)</h4>
<p>The goto dialog through which new URIs can be entered is an essential part of
browsing in ELinks. This feature makes the dialog more powerful by making it
possible to extend how entered text is handled through a set of rewrite rules
(see protocol.rewrite options).</p>
<p>There are two types of rules: simple and smart ones.</p>
<p>Simple rewriting rules are basically URI abbreviations, making it possible to
map a word to the full URI. They can also be used for hierarchic navigation to
ease moving from some nested directory to the parent directory or doing other
stuff with the current URI. For example, when you type <em>gg</em> into the goto
dialog, you will be materialized at Google's homepage.</p>
<p>Smart rules can take arguments and therefore enable more advanced rewriting.
The arguments could be search words to google for or a lookup query for a
dictionary. Eg. type <em>gg:Petr Baudis king of ELinks cvs</em>.</p>
<p>This feature is also available in a more powerful form in the Lua and Guile
extensions, so if you plan to or already use those, you won't miss anything by
disabling this feature (besides easier and better integrated configuration).</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-BITTORRENT"></a>BitTorrent Protocol Support (<tt>CONFIG_BITTORRENT</tt>)</h4>
<p>The BitTorrent protocol is a protocol for distributing files in a peer-to-peer
(P2P) manner. It uses the HTTP protocol for communicating with a central
server and a peer-to-peer (P2P) protocol for exchanging file pieces betweens
peer downloaders. The integrity of file pieces downloaded from peers are
checked using cryptographic hashing (SHA1).</p>
<p>Downloads using BitTorrent are started by first downloading a .torrent file
with the MIME type "application/x-bittorrent". The file contains information
which enables ELinks to ask a central server, called a tracker, for
information about other downloading peers and start downloading from and
uploading to them.</p>
<p>At any time, an external handler can always be defined to take precedence of
the internal BitTorrent client and the internal client can always be forced
by prefixing the URI of the .torrent file with "bittorrent:"</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">The BitTorrent support is still experimental.</td>
</tr></table>
</div>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-CGI"></a>Local CGI Support (<tt>CONFIG_CGI</tt>)</h4>
<p>ELinks can (like w3m or lynx) execute certain executable files stored on the
local disks as CGIs, when you target it on them (through a URI of the <em>file</em>
scheme). ELinks emulates the complete CGI environment, like the program would
be executed by a web server. See the protocol.file.cgi options tree for
detailed runtime configuration.</p>
<p>Some people just write their bookmark management application as Perl CGI
script and then access it from the web browser using this feature, not needing
any web server or so. Therefore, this is a great possible way to extended the
browser capabilities.</p>
<p>Even when you compile this in, you need to enable this yet in the
configuration, and even then only CGI files passing certain user-defined
filters (path-based) will be allowed to be executed (and there are certain
other security barriers in place).</p>
<p><strong>Default:</strong>  disabled, available if setenv() or putenv() is found</p>
<h4><a id="CONFIG-DATA"></a>Data URI protocol (<tt>CONFIG_DATA</tt>)</h4>
<p>The data URI protocol is defined in RFC 2397 and allows inclusion of small
data items as "immediate" data, as if it had been included externally.</p>
<p>A data URL might be used for arbitrary types of data. The URI</p>
<div class="literalblock">
<div class="content">
<pre><tt>data:,A%20brief%20note</tt></pre>
</div></div>
<p>encodes the text/plain string "A brief note", which might be useful in a
footnote link.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-FINGER"></a>Finger User Information Protocol Support (<tt>CONFIG_FINGER</tt>)</h4>
<p>The finger protocol is a simple protocol defined in RFC 1288. The server
return a friendly, human-oriented status report on either the system at the
moment or a particular person in depth such as whether a user is currently
logged-on, e-mail address, full name etc. As well as standard user
information, it displays the contents of ".plan" file in the user's home
directory. Often this file (maintained by the user) contained either useful
information about the user's current activities, or alternatively all manner
of humor.</p>
<p>It is most often implemented on Unix or Unix-like systems however due to
security and privacy reasons it is usually disabled or only allowed locally on
the system.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-FSP"></a>File Service Protocol (<tt>CONFIG_FSP</tt>)</h4>
<p>File Service Protocol (FSP) is a very lightweight UDP based protocol for
transferring files. FSP has many benefits over FTP, mainly for running
anonymous archives. FSP protocol is valuable in all kinds of environments
because it is one of the only TCP/IP protocols that is not aggressive about
bandwidth, while still being sufficiently fault tolerant.</p>
<p>FSP is what anonymous FTP <strong>should</strong> be!</p>
<p>See http://fsp.sourceforge.net/ for more info.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-FTP"></a>File Transfer Protocol Support (<tt>CONFIG_FTP</tt>)</h4>
<p>The File Transfer Protocol (FTP) is a software standard for transferring
computer files between machines with widely different operating systems.</p>
<p>Many sites that run FTP servers enable so-called "anonymous ftp". Under
this arrangement, users do not need an account on the server. By default,
the account name for the anonymous access is <em>anonymous</em>. This account
does not need a password, but users are commonly asked to send their email
addresses as their passwords for authentication (protocol.ftp.anon_passwd),
but there is no verification.</p>
<p>See also http://en.wikipedia.org/wiki/Ftp .</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-GOPHER"></a>Gopher Protocol Support (<tt>CONFIG_GOPHER</tt>)</h4>
<p>Gopher is a distributed document search and retrieval network protocol
designed for the Internet in RFC 1436. The need for gopher arose in in the
early days of the hypertext Internet where the number of documents that were
being published in campus and research environments could not easily be
distributed using known protocols like FTP because these documents were stored
not in one place, but in many computers connected to the Internet.</p>
<p>The support works much like local file browsing with directories (aka. menus)
and various file types that can be downloaded and viewed.</p>
<p>It is still very experimental and the CSO phone-book protocol is not
implemented.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-NNTP"></a>NNTP Protocol Support (<tt>CONFIG_NNTP</tt>)</h4>
<p>Network news transport protocol support makes it possible to access nntp
and news servers and read postings. It is still very experimental and is
far from being considered a &#8220;news reader&#8221;.</p>
<p>It is possible to list news groups on a server, articles in a news group
and retrieve articles by their number or message-id.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-SMB"></a>SMB Protocol Support (<tt>CONFIG_SMB</tt>)</h4>
<p>ELinks supports browsing over the SMB protocol (URI <em>smb</em> scheme),
using the libsmbclient library as back-end.  Therefore, in order to
have this enabled, you will need to install Samba (or at least just
the libsmbclient part, if you can install it separately).</p>
<p>This use of libsmbclient is believed to be immune to the command
injection attacks (CVE-2006-5925, bug 841) from which earlier ELinks
releases (0.9.0 to 0.11.1) suffered.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-CSS"></a>Cascading Style Sheets (<tt>CONFIG_CSS</tt>)</h4>
<p>Simplistic CSS support. It is still very much in it's infancy so don't expect
too much. If you have use of background colors enabled more pages will have
the intended background color. Also quite a few additional text attributes are
applied. One example is highlighting of search words on Google's cached pages.</p>
<p>There are options to disable both imported style sheets to minimize network
traffic and whether to use CSS at all. Also a default style sheet can be
defined to control the basic layout in the HTML renderer.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-HTML-HIGHLIGHT"></a>HTML Highlighting (<tt>CONFIG_HTML_HIGHLIGHT</tt>)</h4>
<p>Makes it possible to view HTML source with the markup highlighted in colors
configurable using CSS. It also makes values of referencing attributes
accessible like the href="&lt;uri&gt;" attribute in &lt;a&gt; elements.</p>
<p>The HTML highlighting uses components of an experimental DOM implementation
still in progress so enabling this feature will add a considerable amount of
code to the compiled binary. On the other hand it will help to debug what will
hopefully evolve into the next generation document renderer.</p>
<p><strong>Default:</strong>  disabled, requires that CSS is enabled</p>
<h4><a id="CONFIG-SCRIPTING-SPIDERMONKEY"></a>ECMAScript (JavaScript) Browser Scripting (<tt>CONFIG_SCRIPTING_SPIDERMONKEY</tt>)</h4>
<p>By enabling this feature, certain parts of ELinks, such as the goto URL
dialog, may be extended using ECMAScript (aka. JavaScript) scripts. This can
be useful to optimise your usage of ELinks.</p>
<p>For example you can define shortcuts (or abbreviations) for URLs of sites you
often visit by having a goto URL hook expand them. This can also be achieved
with the URI rewrite feature (CONFIG_URI_REWRITE), however it is not as
powerful as doing it with scripting.</p>
<p><strong>Default:</strong>  enabled if Spidermonkey is found</p>
<h4><a id="CONFIG-MOUSE"></a>Mouse Support (<tt>CONFIG_MOUSE</tt>)</h4>
<p>ELinks may be controlled not only by keyboard, but also by mouse to quite some
extent. You can select links, menu items, scroll document, click at buttons
etc, and it should hopefully work. ELinks supports mouse control by GPM, xterm
mouse reporting and TWAIN's twterm mouse reporting.</p>
<p>It is generally nice convenience and doesn't cost too much. However, you can
do everything with keyboard as you can with mouse. Also note that the xterm
mouse reporting takes control over the terminal so that copy and pasting text
from and to ELinks has to be done by holding down the Shift key.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-88-COLORS"></a>88 Colors in Terminals (<tt>CONFIG_88_COLORS</tt>)</h4>
<p>Define to add support for using 88 colors in terminals. Note that this
requires a capable terminal emulator, such as:</p>
<ul>
<li>
<p>
Thomas Dickey's XTerm, version 111 or later (check which version you have
with xterm -version) compiled with --enable-88-color.
</p>
</li>
<li>
<p>
Rxvt, version 2.7.9 or later compiled with --enable-88-color.
</p>
</li>
</ul>
<p>You will still need to enable this at runtime for a given terminal in terminal
options, or set your $TERM variable to xterm-88color - then, ELinks will
automatically configure itself to make use of all the available terminal
features, while still acting sensibly when you happen to run it in an xterm
w/o the 88 colors support.</p>
<p>When enabled, the memory usage is somewhat increased even when running in mono
and 16 colors mode (the memory consumption can be especially remarkable when
rendering very large documents and/or using very large terminals).  However,
when you actually run it in the suitable terminal, it looks really impressive,
I'd say marvelous!</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-256-COLORS"></a>256 Colors in Terminals (<tt>CONFIG_256_COLORS</tt>)</h4>
<p>Define to add support for using 256 colors in terminals. Note that this
requires a capable terminal emulator, such as:</p>
<ul>
<li>
<p>
Thomas Dickey's XTerm, version 111 or later (check which version you have
with xterm -version) compiled with --enable-256-color.
</p>
</li>
<li>
<p>
Rxvt, version 2.7.9 or later compiled with --enable-256-color.
</p>
</li>
<li>
<p>
Recent versions of PuTTY also have some support for 256 colors.
</p>
</li>
</ul>
<p>You will still need to enable this at runtime for a given terminal in terminal
options, or set your $TERM variable to xterm-256color - then, ELinks will
automatically configure itself to make use of all the available terminal
features, while still acting sensibly when you happen to run it in an xterm
w/o the 256 colors support.</p>
<p>When enabled, the memory usage is somewhat increased even when running in mono
and 16 colors mode (the memory consumption can be especially remarkable when
rendering very large documents and/or using very large terminals).  However,
when you actually run it in the suitable terminal, it looks really impressive,
I'd say marvelous!</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-TRUE-COLOR"></a>True color (<tt>CONFIG_TRUE_COLOR</tt>)</h4>
<p>Define to add support for True color. Note that only terminal capable to show
it is konsole from kdebase-3.5.4. This mode eats a lot of memory.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-EXMODE"></a>Ex-mode Interface (<tt>CONFIG_EXMODE</tt>)</h4>
<p>The ex-mode interface makes a prompt available when pressing <em>:</em>. The prompt
can be used for entering actions like <em>:goto-url</em> and configuration file
commands.</p>
<p>The code is still very experimental and lacks much work such as tab
completion.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-LEDS"></a>LEDs (<tt>CONFIG_LEDS</tt>)</h4>
<p>These are the tiny LED-like indicators, shown at the bottom-right of the
screen as [-----]. They are used for indication of various states, e.g.
whether you are currently talking through a SSL-secured connection,
what is the current input mode (normal or insert), JavaScript errors etc.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-MARKS"></a>Document Marks (<tt>CONFIG_MARKS</tt>)</h4>
<p>Makes it possible to set marks in a document and then later jump to them kind
of like how fragments in URIs work. It is currently only possible to jump to
marks set in the current document.</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-DEBUG"></a>Debug mode (<tt>CONFIG_DEBUG</tt>)</h4>
<p>Assertions are evaluated and will core dump on failure. Some extra sanity
checks are done, and some errors will cause core dump instead of just a
message. Internal memory leak detection is activated (memory usage will grow),
and every allocation/reallocation/free operations will be slower due to extra
tests. Lists sanity checks are enabled, so list operations are slower. Hot-key
debugging is enabled, it highlights redundant hot-keys in a menu.</p>
<p>This option should be _always_ used by beta testers and developers, it helps
to detect many issues. Binary packages maintainers should not use this option
in normal situation.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-FASTMEM"></a>Fast mode (<tt>CONFIG_FASTMEM</tt>)</h4>
<p>This option provides a way to generate a faster and smaller binary of a
_stable_ version of ELinks. Please do not use it with unstable releases
(unless memory footprint, performance and/or binary size are major issues for
you).</p>
<p>It disables all assertion tests and sanity checks effectively reducing safety.
It disables internal memory allocation routines, directly calling libc
functions (so it's much faster, but memory allocation issues and memory leaks
will be not detected). It defines fmem_alloc(), and fmem_free() to be in fact
alloca() and nothing, providing much faster allocations in routines where they
are used</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-OWN-LIBC"></a>Own C library functions (<tt>CONFIG_OWN_LIBC</tt>)</h4>
<p>Enable this to use the various C library stub functions that is part of the
portability layer instead of those available in the C library on the system.</p>
<p>It will make the binary slightly bigger and should only be used for testing
the portability layer.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-SMALL"></a>Small binary (<tt>CONFIG_SMALL</tt>)</h4>
<p>Reduces the size of the binary but also disables a few memory consuming
optimizations to make the program much lighter when running.</p>
<p>Part of the size reduction is due to various help text not being compiled in
which will affect usability. Also the disabled optimization will make ELinks
run slower.</p>
<p>See doc/small.txt for more information about how to reduce the size of ELinks.</p>
<p><strong>Default:</strong>  disabled</p>
<h4><a id="CONFIG-UTF8"></a>Unicode UTF-8 support (<tt>CONFIG_UTF8</tt>)</h4>
<p>By enabling this option you get better Unicode support. At present only some
parts of ELinks are influenced with this. It includes DOM, plain, HTML
renderer and user interface. Beside normal Unicode characters there is
support for double-width characters (like Japanese, etc.).</p>
<p>Some features of Unicode are not handled at all. Combining characters is
most visible absence.
Some features are partially supported. Like line breaking between
double-width characters. There is no other detection for determining when to
break or not.
Character conversions are still incomplete for ECMAScript strings (bug 805),
local file names, and IRIs (RFC 3987).</p>
<p><strong>Default:</strong>  enabled</p>
<h4><a id="CONFIG-BACKTRACE"></a>Back-trace Printing (<tt>CONFIG_BACKTRACE</tt>)</h4>
<p>Once upon a time, a disaster happens and ELinks crashes. That is a very sad
event and it would be very nice to have some means how to diagnose it. In the
crash handler, ELinks prints out various helpful things, however the truly
important information is _where_ did it crash. Usually, users do not have gdb
installed and can't provide a back-trace. However, ELinks can print a
back-trace on its own, if the system supports it (currently, it is implemented
only for glibc). It is not always accurate, it is useless when the ELinks
binary is stripped and it still misses a lot of important information, but it
can be sometimes still an indispensable help for the developers.</p>
<p>You should keep this, unless you will strip your ELinks binary anyway, you
know you are not going to report back any failures and you care about each
single wasted bit.</p>
<p><strong>Default:</strong>  enabled if the libc supports it (only glibc)</p>
<h4><a id="CONFIG-NO-ROOT-EXEC"></a>Disable Root User (<tt>CONFIG_NO_ROOT_EXEC</tt>)</h4>
<p>Browsers are scary monsters used for traveling around in an even more scary
world where people indifferently throw garbage files at you and threaten your
perfect world. Altho' ELinks is a small monster compared to most browsers, it
can still bite your head off and some might consider running it as the root
user extremely dangerous. To prevent such usage simply enable this feature.</p>
<p><strong>Default:</strong>  disabled</p>
</div>
<h2>Frequently Asked Questions</h2>
<div class="sectionbody">
<p>This is an attempt to capture some of the questions that appear once in a
while on the mailing list or on IRC.</p>
<h3><a id="instances"></a>I rebuilt/upgraded/reconfigured ELinks and restarted it, but it looks like nothing has changed!</h3>
<p>ELinks instances connect together so that they share the cache, bookmarks,
cookies, configuration, etc.  Only the "master" ELinks instance does any real
work and any other ELinkses you run will only connect to this instance.  So when
you want to restart ELinks, make sure you have no other ELinks instances
running.</p>
<p>Alternatively, you can use the <tt>-no-connect</tt> parameter to make ELinks always run
standalone, or create a parallel group of ELinks instances with the
<tt>-session-ring N</tt> parameter (where <tt>N</tt> is a number larger than zero).  Be aware
of that in those cases ELinks won't touch any configuration, bookmark, cookies,
etc. files.  You can force that with the <tt>-touch-files</tt> parameter, but beware
that this can result in data loss!  (For example, when two master ELinks
instances try to save the bookmarks, and you add a bookmark to each of those,
only one of the bookmarks survives.)</p>
<h3><a id="cutnpaste"></a>How does cutting and pasting work?</h3>
<p>The reason why normal cut and paste does not work is that ELinks requests all
mouse event info even if it is compiled without GPM.  Therefore it is necessary
to hold down the Shift key when cutting or pasting text.  If you do not need to
use the mouse for navigation you can disable mouse support by passing
<tt>--disable-mouse</tt> to configure.</p>
<h3><a id="move"></a>How does the "Move" button on the bookmark manager work?</h3>
<p>First you need to mark all the bookmarks (or folders) you want to move.  This
can be done with the Insert key if you're using the default key-bindings.  An
asterisk will appear near all marked bookmarks.  Now move to where you want to
have the stuff moved to, and press the "Move" button.</p>
<h3><a id="navigation"></a>What's up with the navigation in the various managers?</h3>
<p>The managers use list boxes.  To navigate (assuming you're using a default
key-binding configuration) use Space to open and close the folders.</p>
<h3><a id="flavors"></a>Why are there so many Links flavors?</h3>
<p>Please refer to the <a href="http://elinks.cz/history.html">history page</a> to read
about the various flavors and the differences between them.</p>
<h3><a id="which-one"></a>Which one to use?</h3>
<p>If you want a fast, stable, and feature-thin text browser, use
<a href="http://artax.karlin.mff.cuni.cz/~mikulas/links">Links-0.99</a>.  Main drawbacks
include: No HTTP-auth support and no persistent cookies (i.e. they die when all
instances of Links are closed).</p>
<p>If you want additional features, including HTTP-auth, persistent cookies, and
on-the-fly compression, try ELinks.  (Note: links-0.9x and ELinks versions &gt;
0.3 do not share executable name or configuration files so you can safely run
these on the same machine.)</p>
<p>If you want the option of graphics mode, use
<a href="http://links.twibright.com">Links2</a> or
<a href="http://xray.sai.msu.ru/~karpov/links-hacked/">Hacked Links</a>.  Be aware that
some people have reported the latter as hard to configure/compile.  You cannot
run either of these with Links-0.9x on the same system without hacking the
compile-time configuration.</p>
<h3><a id="kibi-and-mebi"></a>What are the Ki (kibi) and Mi (mebi) units?</h3>
<p>They are binary units defined by
<a href="http://physics.nist.gov/cuu/Units/binary.html">the International System of Units</a>.
Examples:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="182" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Unit
    </th>
    <th align="left">
    Definition
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    One kibibit
    </td>
    <td align="left">
    1 Kibit = 2^10 bit = 1024 bit
    </td>
  </tr>
  <tr>
    <td align="left">
    One mebibyte
    </td>
    <td align="left">
    1 MiB = 2^20 B = 1 048 576 B
    </td>
  </tr>
</tbody>
</table>
</div>
<h3><a id="get-256-colours"></a>How can I get 256 colors?</h3>
<p>First, you must enable it in the <tt>feature.conf</tt> file before compiling.</p>
<p>Second, you must run ELinks on a terminal that supports 256 colours:</p>
<ul>
<li>
<p>
<a href="http://dickey.his.com/xterm/xterm.html">Thomas Dickey's XTerm</a>,
   revision 111. XTerm must be compiled with <tt>--enable-256-color</tt>.
</p>
</li>
<li>
<p>
Recent versions of
   <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>.
</p>
</li>
</ul>
<p>Third, you must set the <tt>TERM</tt> environmental variable to <tt>xterm-256color</tt>
before running ELinks.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="title">Only 16 colors on The Linux console</div>
<p>Although the Linux frame-buffer supports 256 (or more) colors, the Linux console
driver does not; therefore, console applications are still limited to 16
colors on the Linux console, frame-buffer or not.</p>
</td>
</tr></table>
</div>
<h3><a id="useragent"></a>What User-Agent header does ELinks send?</h3>
<p>The older ELinks versions (up to 0.4.3) send:</p>
<div class="literalblock">
<div class="content">
<pre><tt>ELinks ($version; $osinfo; $textmode_dimensions)</tt></pre>
</div></div>
<p>The new ELinks versions (from 0.9.0 on) send:</p>
<div class="literalblock">
<div class="content">
<pre><tt>ELinks/$version (textmode; $osinfo; $textmode_dimensions)</tt></pre>
</div></div>
<p>You should therefore check against something like /^ELinks[\/ ]/, since more
fields can be added inside the parenthesis in subsequent versions.  Note that
users can change their User-Agent through the options system.</p>
<h3><a id="droppings"></a>ELinks doesn't erase characters from the screen when it should!</h3>
<p>When you scroll a web page, you may see ELinks leave some characters
on the screen even though it should have erased them.  Pressing Ctrl+L
usually removes these droppings until you scroll again.  There are
a few possible reasons:</p>
<ul>
<li>
<p>
ELinks 0.11.* in a UTF-8 locale.  By default, ELinks guesses the
  charset of the terminal from the environment variables LANG,
  LC_CTYPE, and LC_ALL.  ELinks 0.11 versions do not support UTF-8
  as this charset.  To use ELinks 0.11 on a UTF-8 terminal, you
  should instead enable UTF-8 I/O via the Setup -&gt; Terminal options
  dialog box, and choose a charset from Setup -&gt; Character set.
  This limitation has been removed in ELinks 0.12pre1.
</p>
</li>
<li>
<p>
Web pages may use nonspacing combining characters or Unicode control
  characters that ELinks does not recognize as such.  This happens
  especially on <a href="http://en.wikipedia.org/wiki/Special:RecentChanges">http://en.wikipedia.org/wiki/Special:RecentChanges</a>,
  where the server generates U+200E LEFT-TO-RIGHT MARK characters.
  ELinks 0.13.GIT now has some support for these characters; see
  <a href="http://bugzilla.elinks.cz/show_bug.cgi?id=824">ELinks bug 824</a>.
</p>
</li>
<li>
<p>
Some versions of the Terminal application in Mac OS X appear to
  have a setting that makes line-drawing characters take up the
  space of two ASCII letters.  ELinks does not expect this.
  To avoid the incompatibility, either disable the setting in the
  Terminal application or select "No frames" in the Terminal options
  dialog box of ELinks.
</p>
</li>
</ul>
</div>
<h2>Introduction to the World of ELinks</h2>
<div class="sectionbody">
<p>The goal of this introduction is to explain the basic concepts in ELinks,
give an overview of how to get started and serve as an entry point to many
of the (undocumented) features of ELinks. It won't tell you all the
details, but should hopefully give you an idea of how things work and make
it possible for you to even figure out how to go further.</p>
<p>Although ELinks is text-based, the user interface has many of interaction
methods normally found in graphical environments. There are menus, dialogs
with buttons and hierarchic list boxes with folders. Care has been taken to
make the interaction between various dialogs consistent, so the controls
will quickly become familiar to new users.</p>
<p>The user interface can be controlled using both mouse and keyboard, but
currently it is only possible to configure keybindings. Looking back, the
key-controls have been more advanced than the mouse support, but during the
0.10 prereleases the mouse support has been much improved. You will now find
find stuff like contextual menus when right-clicking in different document
zones.</p>
<h3>Overview of the User Interface</h3>
<p>The main user interface of ELinks consists of the document view and dialog
bars displaying the information such as the title of the currently viewed
document, all opened tabs and the browsing status. The 3 bars are elaborated
further below.</p>
<p>The most important dialogs that you will meet include the Main, Link and Tab
menus and the different managers. The menus serve as entry points to the
actions available from different contexts, while the managers let you check
the state and control the various subsystems, such as loaded cookies and the
global history. The utility menus and the manager tools are investigated
further below.</p>
<p>The document viewer in ELinks provides a feature-rich set of ways to browse
documents. That is, multiple options exist for navigating, searching and
displaying documents and you will hopefully figure in time what works best
for you. The basic browsing possibilities are presented below.</p>
<p>ELinks is highly configurable, so if there is something that you would like
to change, it is most likely possible. The best overview of the many options
are given in the <tt>elinks.conf(5)</tt> man page.  Keybindings are discussed in the
<tt>elinkskeys(5)</tt> man page.  It is not always up-to-date, so you should also
check the keybinding manager and the overview of all the configured
keybindings given in the Help -&gt; Keys dialog. The Keys dialogs serves as a
good introduction to the most common keybindings.</p>
<h3>The Title, Tab and Status bar</h3>
<p>The title bars main purpose is to display the title of the current document.
Documents bigger than can be displayed with the current screen size are
divided into subpages. In this case the current document position is
indicated in the far right of the title bar as a suffix to the actual
document title.  The syntax is: ( current-subpage / total-subpages ), an
example is <tt>(4/9)</tt> that indicates the 4th subpage of 9 subpages.</p>
<p>The tab bar by default is only visible when 2 or more tabs are open. It is
divided into slots containing the trimmed title of the tabs' loaded
document. Between each tab is a separator. The current tab is highlighted
and all tabs that has not been viewed after being loaded are highlighted as
fresh. Tabs are explained in details in the tabs.txt file.</p>
<p>The status bar has multiple purposes. Most of the time it will contain the
URI (and title) of the currently selected link. If a link is followed,
connection information is shown in the status bar. When using cursor
routing, the status bar will show the coordinates of the cursor when a link
is not followed.</p>
<h3>The Main, Link and Tab Menus</h3>
<p>The Main Menu gives you access to many of the features of ELinks via
submenus and serves as a good entry point for performing actions on the
different objects of interest, such as links, documents and tabs. The Link
menu and Tab menus are more specialized and targeted to a specific context,
such as link handling or managing the tab bar. Actually, the Link Menu is
accessible from the Main Menu as a submenu.</p>
<p>Once you have familiarized yourself with the menus, you will have a good
chance at gradually learning the most common keybinding, since all the
configured keybindings are shown as right aligned text. Menu entries can
also be quickly accessed using hotkeys. Hotkeys appear highlighted in the
menu entry text. For example the key-combo "Alt-v i" will open the document
info dialog accessible from the View sub menu in the Main menu.</p>
<h3>The Managers</h3>
<p>The managers let you control the state of subsystems, such as cookies and
the global history. They are accessible from the Tools or Setup submenu in
the Main Menu. The managers consists of an area showing a hierarchic listbox
and buttons at the bottom. Below, a view of the cookie manager is shown.</p>
<div class="literalblock">
<div class="content">
<pre><tt>+------------------------- Cookie manager -------------------------+
|                                                                  |
|   [-]- bugzilla.elinks.cz                                        |
|    |    |-- BUGLIST                                              |
|    |    `-- LASTORDER                                            |
|   [+]- kerneltrap.org                                            |
|   [+]-*dictionary.reference.com                                  |
|   [+]-*bjork.com                                                 |
|   [-]- www.google.com                                            |
|         `-- PREF                                                 |
|                                                                  |
|                                                                  |
|                                                                  |
|                                                                  |
|   [ Info ]  [ Add ]  [ Edit ]  [ Delete ]  [ Save ]  [ Close ]   |
+------------------------------------------------------------------+</tt></pre>
</div></div>
<p>Each item is either a folder or a leaf. A folder is displayed with a <tt>[-]</tt>
or <tt>[+]</tt> before the name telling whether the folder is currently open or
closed. Nested items are displayed indented compared to the folder they are
nested in. In the cookie manager example above "bjork.com" is a folder and
"PREF" is a leaf.</p>
<p>Items can be "marked", which makes it possible to select a group of items
and perform an action on them, such as deleting all marked items. If any
item has been marked the currently selected item is ignored when performing
the action.  Marked items are displayed with an asterisk (<em>*</em>) prefixing the
name.</p>
<p>The buttons make it possible to perform actions either on selected or marked
items or on all items in the manager. Buttons named <em>Clear</em> and <em>Save</em> are
performed on all items; <em>Clear</em> will delete all items and <em>Save</em> will update
the runtime state file associated with the manager in the <tt>~/.elinks/</tt>
directory.  Most buttons presses will query you before completing the
action.</p>
<p>At any time, both the currently selected item and button are highlighted.
The same goes for marked items. Most manager dialogs also maintains the
state, so that when you reopen the manager later it will have the same items
selected and the same folders opened or closed.</p>
<p>The basic default controls for managers are the following:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="171" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Keys
    </th>
    <th align="left">
    Action
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    Up/Down
    </td>
    <td align="left">
    Select the item above/below.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>*</em>
    </td>
    <td align="left">
    Toggle marking of a item.
    </td>
  </tr>
  <tr>
    <td align="left">
    Space
    </td>
    <td align="left">
    Open and close folders.
    </td>
  </tr>
  <tr>
    <td align="left">
    Left/Right
    </td>
    <td align="left">
    Select the button to the left/right.
    </td>
  </tr>
  <tr>
    <td align="left">
    Home/End
    </td>
    <td align="left">
    Select the first/last item.
    </td>
  </tr>
  <tr>
    <td align="left">
    Enter
    </td>
    <td align="left">
    Press the currently selected button.
    </td>
  </tr>
  <tr>
    <td align="left">
    Esc
    </td>
    <td align="left">
    Close the manager dialog.
    </td>
  </tr>
</tbody>
</table>
</div>
<p>Some managers also supports searching, either by pressing the <em>Search</em>
button or by pressing <em>/</em>. By searching the empty string, all hidden items
from the previous search will be shown again.</p>
<h3>LED status indicators</h3>
<p>As an optional feature it is possible to have tiny LED-like status
indicators shown at the bottom-right of the screen. They are used for
displaying an overview of the current browsing state, ie.  whether you are
currently talking through a SSL-secured connection, what is the current
input mode (normal or insert), JavaScript errors etc.</p>
<p>An example display may look like: <tt>[SIJP&#8212;]</tt>. Each position in the LED
display is associated with the following state:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="171" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Symbol
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    <em>S</em>
    </td>
    <td align="left">
    Whether an SSL connection was used.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>i</em>/<em>I</em>
    </td>
    <td align="left">
    The state of insert mode for text-input form-fields: <em>i</em>                     means modeless, <em>I</em> means insert mode is on.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>J</em>
    </td>
    <td align="left">
    A JavaScript error has occurred.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>P</em>
    </td>
    <td align="left">
    A JavaScript pop-up window was blocked.
    </td>
  </tr>
  <tr>
    <td align="left">
    -
    </td>
    <td align="left">
    Unused.
    </td>
  </tr>
  <tr>
    <td align="left">
    -
    </td>
    <td align="left">
    Unused.
    </td>
  </tr>
</tbody>
</table>
</div>
<p><tt>-</tt> generally indicates that the LED is off.</p>
<p>The above information is also available in the LED dialog available by
either clicking on the LED display or via the Help menu.</p>
<h3>Navigation</h3>
<p>ELinks provides various ways to navigate documents. Depending on how
documents are structured, it can be a great help to change navigation style.
The navigation styles can roughly be divided into page-oriented,
link-oriented and screen-oriented. They overlap in many ways, so this
separation is mostly used as a mean to present them.</p>
<h4>Page-Oriented Navigation</h4>
<p>This involves scrolling documents horizontally and vertically.  Documents
can be scrolled page-wise, where the next or previous subpage will be
displayed. It is also possible to scroll documents in steps, either
line-wise (vertically) or column-wise (horizontally). The step size can be
configured and by default is 2 lines and 8 columns. Alternatively, whole
documents can be scrolled to the start or the end.</p>
<p>The basic default controls:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="171" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Keys
    </th>
    <th align="left">
    Action
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    Insert/Delete
    </td>
    <td align="left">
    Scroll up/down line-wise. (vertically)
    </td>
  </tr>
  <tr>
    <td align="left">
    PageUp/PageDown
    </td>
    <td align="left">
    Scroll up/down page-wise.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>[</em>/<em>]</em>
    </td>
    <td align="left">
    Scroll left/right column-wise. (horizontally)
    </td>
  </tr>
  <tr>
    <td align="left">
    Home/End
    </td>
    <td align="left">
    Scroll to the start/end of the document.
    </td>
  </tr>
</tbody>
</table>
</div>
<h4>Link-Oriented Navigation</h4>
<p>For hypertext documents, access to the links makes it more practical to
navigate by jumping between links in the document. There are two ways to do
this; either you can move between links relationally or by number. Using
relational link navigation it is possible to focus the next/previous link or
move in a directional manner to the link in a certain direction such as
left/right/up/down.</p>
<p>In order to navigate using link numbers, you have to first toggle link
numbering on; this will prefix all links with a number using the notation
[number]. <tt>[23]</tt> indicates link number 23. When link numbering is enabled,
pressing any number key will pop up a "Go to link"-dialog where the complete
link number can be entered. By pressing Enter the entered link number will
be focused, but only if it is a valid link number.</p>
<p>Note: it is also possible to jump to links by searching the link text; check
the documentation on searching.</p>
<p>The basic default controls:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="171" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Keys
    </th>
    <th align="left">
    Action
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    Up/Down
    </td>
    <td align="left">
    Move to the previous/next link.
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>.</em>
    </td>
    <td align="left">
    Toggle link numbering.
    </td>
  </tr>
  <tr>
    <td align="left">
    Enter/Right
    </td>
    <td align="left">
    Follow the current focused link.
    </td>
  </tr>
</tbody>
</table>
</div>
<p>No keys are by default configured for directional link navigation.</p>
<h4>Position-Oriented Navigation</h4>
<p>Positional navigation (sorry, bad word) uses the either the position of the
cursor or the mouse click to navigate the document. If you are familiar with
the w3m text-browser you will be familiar with cursor routing. Basically,
you move the cursor around &#8212; kind of like a mouse &#8212; in the document area
of the user interface. When the cursor is over a link, the link is
highlighted, and when the cursor moves outside the current document view, it
will cause the document view to scroll.</p>
<p>The possibilities when using the mouse to navigate the document depend on
what terminal you are using. In some terminals, it is possible to scroll by
using the mouse wheel. Scrolling is however also possible by clicking in the
edge areas of the document view. Highlighting links can be done by clicking
on a link but waiting to release the mouse button until the link is no
longer under the mouse pointer.</p>
<p>No keys are by default configured for cursor routing.</p>
<h4>Forms</h4>
<p>The status bar will indicate the type and name of the field.</p>
<dl>
<dt>
Input text/Password fields
</dt>
<dd>
<p>
        These will be displayed as <tt>________</tt>.
        Note that passwords will be obscured using <tt>*</tt> characters.
        Status bar will display something like "Text field, name q",
        or "Password field, name password" for password fields.
</p>
</dd>
<dt>
Textarea boxes
</dt>
<dd>
<p>
        These will be displayed as multiple lines consisting of <tt>_</tt>.
        Status bar will display something like "Text area, name comment"
</p>
</dd>
<dt>
Buttons
</dt>
<dd>
<p>
        These will be displayed as <tt>[ Go ]</tt>.
        Status bar will display something like "Submit form to &#8230;",
        "Post form to &#8230;" for submit buttons.
</p>
</dd>
<dt>
Checkboxes
</dt>
<dd>
<p>
        These will be displayed as <tt>[ ]</tt> or <tt>[X]</tt>.
        Status bar will display something like "Checkbox, name c, value 1".
        To set one just press ENTER on it.
</p>
</dd>
<dt>
Radio buttons
</dt>
<dd>
<p>
        These will be displayed as <tt>( )</tt> or <tt>(X)</tt>.
        Status bar will display something like "Radio button, name radio1".
        To set one, you may use ENTER.
</p>
</dd>
<dt>
Select lists
</dt>
<dd>
<p>
        These will be displayed as <tt>[first item____]</tt>.
        Note that if multiple attribute is used, these are displayed as a
        group of checkboxes instead.
        Status bar will display something like "Select field, name list"
        To select one entry, press ENTER, then navigate using UP/DOWN, then
        press ENTER again.
</p>
</dd>
</dl>
<h3>Searching</h3>
<p>Searching is by default available by pressing <em>/</em>. This will open a search
dialog with a input text field for entering the search terms and checkboxes
to control how searching is performed. You can indicate whether matching
should be case sensitive and whether regular expressions or normal searching
should be used.</p>
<p>It is also possible to make an incremental search, also called type-ahead
searching. You can search either the whole document text or only link text.
The latter can be useful if you see a link deep inside a page and want to
get to it quickly.</p>
<p>Matches of the search term will be high-lighted. After having performed
document text search all matches will be high-lighted.  To get rid of this
high-lighting you have to &#8220;search for the empty string&#8221;, that is open a
search dialog and just press Enter in the input field.</p>
<p>Previous search words are saved in the search history, so they can easily be
found and used later. Browsing the history will replace the current entered
search terms.</p>
<p>The basic default controls for searching are the following:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="171" />
<col width="720" />
<thead>
  <tr>
    <th align="left">
    Keys
    </th>
    <th align="left">
    Action
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    <em>/</em>
    </td>
    <td align="left">
    Open search dialog
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>?</em>
    </td>
    <td align="left">
    Open search dialog for backwards searching
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>#</em>
    </td>
    <td align="left">
    Start incremental link text search
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>#/</em>
    </td>
    <td align="left">
    Start incremental document search
    </td>
  </tr>
  <tr>
    <td align="left">
    <em>n</em>/<em>N</em>
    </td>
    <td align="left">
    Show next/previous match
    </td>
  </tr>
  <tr>
    <td align="left">
    Tab
    </td>
    <td align="left">
    Show next match (only for incremental searching)
    </td>
  </tr>
  <tr>
    <td align="left">
    Up/Down
    </td>
    <td align="left">
    Insert previous/next search word from history (only when the                 input field is selected)
    </td>
  </tr>
</tbody>
</table>
</div>
<h3>Hints and Odd Features</h3>
<p>Note: This is still a work in progress and from here on an below
everything is marked TODO!</p>
<ul>
<li>
<p>
Numerical action prefixes. Example: 3&lt;Down&gt; jumps down three links.
</p>
</li>
<li>
<p>
How to move forward in the document history (<em>u</em>).
</p>
</li>
<li>
<p>
Toggling color modes, plain/html and image link rendering.
</p>
</li>
<li>
<p>
Link numbering.
</p>
</li>
<li>
<p>
Insert mode in text-input form-fields.
</p>
</li>
<li>
<p>
Menu searching.
</p>
</li>
</ul>
</div>
<h2>The Ultimate Bookmarks Guide</h2>
<div class="sectionbody">
<p>Glad to see you again, mortal. Now, we are going to learn about bookmarks -
how to use them, how to maintain them, and also something more about the file
formats and maybe even about the code structure later. But don't fear, we
won't burden you with it, just stop reading when you already know enough.</p>
<p>In order to read this, you need some common sense, the ability to start ELinks
and some idea about what's a Web document, a URL address and knowledge like
that.</p>
<p>If we ever mention some keys here, please note that you can rebind almost any
action to another key which you like more - then you must obviously imagine
your own key in place of that. Below, we will list all actions, options and so
on related to bookmarks. We won't tell you how to rebind the keys, though;
another document will take on that.</p>
<p>Somewhat out-of-order, a very frequent FAQ: In order to move bookmarks around,
you need to mark them first - press <em>Insert</em> or <em>*</em> (if you use the default
keymap) to do that.</p>
<h3>The Bookmark Manager</h3>
<p>Basically, almost everything is going on in the so-called bookmark manager.
That's a special dialog window, which contains a listing of all the bookmarks
you ever told ELinks to remember and it lets you to do with them anything you
would ever want to do with them.</p>
<p>You launch the bookmark manager by pressing the <em>s</em> key in standby (standard)
mode. You should see a big empty space (bookmarks will slowly appear there as
you will add them) and couple of buttons shriveling at the bottom. So, as a
start, move with the right (or left; both will do) arrow to the button <strong>Add
bookmark</strong> and fill in the input fields it offers to you. I mean, you can type
something like "ELinks homepage" to the first field, then move down by e.g.
the down arrow and fill "http://elinks.cz/" to the second field. Then,
bravely press enter and watch the bookmark popping up at the top of the vast
area reserved for bookmarks.</p>
<p>Repeat this step few times. Now, you can move between bookmarks by the up and
down arrow, jump to the location any of them points to by the Goto button,
change it by the Edit button, delete it with the Delete button and so on. When
you'll become bored, press the escape button and you're free again!</p>
<h3>The Ancient Forests</h3>
<p>It's not very convenient to have all the bookmarks mixed up - soon, you will
get lost in them. Thus, in ELinks you can categorize them to various folders,
subfolders, subsubfolders and so on, then you can expand and back enfold them
and so on.</p>
<p>In order to create your first folder, use the button <strong>Add folder</strong> and fill the
first input field. You can safely ignore the URL field, ELinks will do the
same. <strong>POOF</strong> and you see it - it has that strange <tt>[+]</tt> or <tt>[-]</tt> thing there.
If it has <tt>[+]</tt> near, it's enfolded, while when it has <tt>[-]</tt> near, it is
expanded, while you can change that by pressing the spacebar.</p>
<p>In order to add a bookmark into a folder, move on the item of the folder (it
must be expanded) or onto any bookmark inside of the folder and simply do the
usual <strong>Add bookmark</strong> job. You can also move the bookmarks around, obviously.
Before pressing the <strong>Move</strong> button, you need to first mark all the bookmarks
(or even folders) you want to move using the <em>Insert</em> or <em>*</em> key&#8212;asterisk
will appear near of all marked bookmarks&#8212;and then move to where you want to
have the stuff moved to.</p>
<p>Separators can be inserted as well, using <strong>Add separator</strong> button, or by
entering a special bookmark with "-" as title and no url.</p>
<h3>Searching for a needle in the haystack</h3>
<p>Of course, you can search in the bookmarks. Just use the <strong>Find</strong> button  - for
convenience, you have the current document's URL and title pre-filled there,
and for convenience only up-up-enter-down-down sequence is enough to have the
playground clean. Then, just fill a substring of what you are looking for, and
the bookmarks will be filtered so that only the matching ones are shown.
(Actually, currently it will not be filtered but the cursor will only jump to
the first matching bookmark below the current cursor position - and it will
<strong>NOT</strong> wrap around. The exact behaviour changes time by time and hasn't been
stabilized yet.)</p>
<h3>File formats</h3>
<p>ELinks supports two bookmark formats: the native format and a generic bookmark
exchange format called XBEL. Each of those formats has its pros and cons,
which we shall discuss below. You can switch between then by changing the
option <em>bookmarks.file_format</em>.</p>
<p>However, first please note that ELinks <em>CANNOT</em> read Links bookmarks directly.
Importing Links-0.9x (or Links-1.x) bookmarks is easy - it is just matter of
changing all the <em>|</em> (pipe) characters to tabs.  There is a script for that in
the contrib/conv/ directory. Importing Links-2.xx bookmarks is not so easy; in
fact, the scribe knows of no way of doing that at the time of writing this, so
this is up to you to figure out (if you do, please tell us so that we can add
it here).  Perhaps you might find a way to convert Links2 bookmarks to the
XBEL format, which can then be loaded in ELinks.</p>
<h4>Native file format</h4>
<p>This is the preferred bookmarks format, which is also used by default.  The
bookmarks file is <tt>~/.elinks/bookmarks</tt>, in a simple format:</p>
<div class="literalblock">
<div class="content">
<pre><tt>&lt;name&gt; '\t' &lt;url&gt; [ '\t' &lt;depth&gt; ['\t' &lt;flags&gt;] ] '\n'</tt></pre>
</div></div>
<p><em>\t</em> represents a tab character, <em>\n</em> represents a newline character.  [Square
brackets] denote optional parts. The <em>&lt;name&gt;</em> and <em>&lt;url&gt;</em> fields should be
obvious.  <em>&lt;depth&gt;</em> contains the depth level of the entry - by that, ELinks
can unambiguously figure out the bookmarks hierarchy:</p>
<div class="literalblock">
<div class="content">
<pre><tt>Bookmarks structure:                                Depth:
 ,-- The Pasky's C Bestiary                         0
[-]- Wonderful things                               0
 |    |-- Christmas Carol in l33tsp34k by L.M.      1
 |   [-]- Beautiful Potato Camera Shots             1
 |   [-]- Gallery of Scary Images of Jonas Fonseca  1
 |         |-- Jonas torturing gdb                  2
 |        [-]- Urgh                                 2
 |         |    `-- Jonas consuming Tofu            3
 |         `-- Jonas with crashed ELinks            2
 |-- Slides from Witek's hack-patch show            0
 `-- Miciah's English Grammar Spellbook             0</tt></pre>
</div></div>
<p><em>&lt;flags&gt;</em> is a string of characters. Currently, two flags are supported:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="91" />
<col width="800" />
<thead>
  <tr>
    <th align="left">
    Flag
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    E
    </td>
    <td align="left">
    This folder is currently expanded. (No effect for non-folders.)
    </td>
  </tr>
  <tr>
    <td align="left">
    F
    </td>
    <td align="left">
    This entry is a folder. The &lt;url&gt; part is usually empty.
    </td>
  </tr>
</tbody>
</table>
</div>
<p>Separators: these are special bookmarks with "-" as title and no url.</p>
<dl>
<dt>
Pros
</dt>
<dd>
<p>
        Naturally, ELinks handles the native format the best, easiest and most
        reliably.
</p>
</dd>
<dt>
Cons
</dt>
<dd>
<p>
        It is unlikely that you could use the native format anywhere else than
        in ELinks.
</p>
</dd>
</dl>
<p>To use the native format, set <em>bookmarks.file_format</em> = 0.</p>
<h4>XBEL file format</h4>
<p>The XBEL file format support was added at some point during the 0.4
development by Fabio Boneli. It has never been complete and has plenty of
troubles, but generally, it works at the basic level. The bookmarks file is
<tt>~/.elinks/bookmarks.xbel</tt> (thanks to a different filename, you can have both
XBEL and native bookmarks saved in your <tt>~/.elinks</tt> directory).</p>
<p>We shall not describe the XBEL file format here,</p>
<div class="literalblock">
<div class="content">
<pre><tt>http://pyxml.sourceforge.net/topics/xbel/</tt></pre>
</div></div>
<p>is the authoritative resource on that. It also contains list of some of the
applications supporting the format.  Basically, you will be probably able to
convert from/to the XBEL format to/from most of the other widely used formats,
so this way you can import your bookmarks to ELinks from basically anything.</p>
<dl>
<dt>
Pros
</dt>
<dd>
<p>
        XBEL is the gateway to the rest of the bookmarks world.
</p>
</dd>
<dt>
Cons
</dt>
<dd>
<p>
        The support for XBEL is incomplete and there are known bugs.
        Especially, national character sets are basically not supported, so
        ELinks will most likely get it wrong if you have any non-ASCII
        characters in your bookmarks.  Generally, the XBEL support should be
        considered experimental and you shouldn't rely on it. It <strong>could</strong> trash
        your XBEL bookmarks file so make regular backups.
</p>
</dd>
</dl>
<p>To use the XBEL format, set <em>bookmarks.file_format</em> to 1.</p>
<h4>Usage hints</h4>
<p>As already noted above, probably the best usage pattern is to use XBEL for
importing/exporting your bookmarks to/from ELinks and the native format for
regular operation. Of course, if you want to synchronize your bookmarks in
ELinks and some other XBEL-supporting gadget and you are brave, you can use
XBEL as your exclusive bookmark format - the choice is upon you.</p>
<p>Regarding the bookmarks synchronization, there is one important note. ELinks
saves your bookmarks each time you added one through the <em>a</em> shortcut
(add-bookmark action) or when closing the bookmarks manager if you made any
changes or when quitting ELinks. However, ELinks reads your bookmarks only
<strong>ONCE</strong>, during the startup. This behaviour may change in the future (tell us
if you need a way for ELinks to re-read the bookmarks file), but this is how
it is done now.</p>
<p>Actually, you may now ask "So how do I convert bookmarks between the two
formats?".  It is quite easy.  ELinks simply follows the current value of
<em>bookmarks.file_format</em> whenever loading/saving the bookmarks.</p>
<p>So, e.g. if you normally use the native format but you want the bookmarks to
be saved in the XBEL format once, change <em>bookmarks.file_format</em> to 1, then
cause the bookmarks to be resaved (e.g. by doing some simple change, like
adding a trailing space to some bookmark's title or so), then change the
<em>bookmarks.file_format</em> value back to 0.</p>
<p>It is a little more complicated if you normally use the native format but you
want to import bookmarks from the XBEL format once. You again change
<em>bookmarks.file_format</em> to 1, then cause the bookmarks to be reloaded.  That
involves saving the configuration, quitting ELinks _completely_ (that means
closing/killing all instances of it you have running), then restarting it and
changing <em>bookmarks.file_format</em> to 0. Then save the configuration again and
cause ELinks to resave the bookmarks.</p>
<p>Agreed, this all strange dances are quite clumsy, likely some simple
wizard-like interface for switching the bookmarks formats will be introduced
in the future. So far, we have had no reports from our users that anyone wants
to switch their bookmarks format frequently, so this is not too high on our
TODO list. So be sure to tell us if you would like this process to be
simplified rather sooner than later.</p>
</div>
<h2>The Wonders of Tabbed Browsing</h2>
<div class="sectionbody">
<p>In this information age with our stream of consciousness constantly being
dispersed by links to different resources on the Net, it is a challenge to keep
track of where you are going.  The need for being able to access several pages
in parallel arises.  Tabbed browsing gives you an easy way to browse multiple
sites in parallel.</p>
<p>If you are not already familiar with the concept of tabbed browsing you can
think of a tab as a separate browsing context with its own history and various
other browsing state information, such as search word and document loading.
Whenever you stumble upon a link to a document that you want to follow without
leaving the current document, you can open it in a new tab.  This makes it
possible to more easily jump between pages on the Net and removes the need for
running more than one ELinks for that purpose.</p>
<p>Options related to tabs are located under &#8220;User Interface -&gt; Window Tabs&#8221; in
the option manager.  In the configuration file the naming prefix is &#8220;ui.tabs&#8221;.</p>
<p>Tabbed browsing has been supported since version 0.9.0 and is fairly complete.
The documentation on tabs is therefore divided into two chapters: a general
introduction and an introduction to advanced topics.</p>
<h3>Introduction to the basic actions involving tabs</h3>
<h4>The tab bar and the tab menu</h4>
<p>The current state of all opened tabs are displayed in the tab bar.  The tab bar
will, by default, become visible when more than one tab is open, but this is
configurable.  For each open tab, the document title will be shown, possibly
truncated.  The current tab is highlighted.  The tab bar will also display
a load meter for tabs that are loading documents.  Finally, any tab that has not
been selected since its document was loaded will be marked as &#8220;fresh&#8221; by using
a different coloring scheme.</p>
<p>The tab menu gives access to tab specific actions along with some other useful
document specific actions.  So even if you haven't configured keybindings for
all actions, chances are you will find it in the tab menu.  By default, it is
opened by pressing <em>e</em>.</p>
<h4>Creating new tabs</h4>
<p>When creating new tabs, it is possible to specify whether to create the tab and
make it the current active tab or if the tab is to be created &#8220;in the
background&#8221; &#8212; that is, without it taking over the focus.</p>
<p>Tabs can be created either with or without specifying a desired first document
to load.  That is, you can open links or submitted forms in a new tab or just
open a new tab.  Depending on your configuration, the latter will load the
configured homepage in the newly created tab or simply leave the tab blank with
no loaded document.</p>
<p>By default, <em>t</em> will open a new tab and <em>T</em> will open the current link in a new
backgrounded tab.  You can configure keybindings for opening a new tab in the
background and opening the current link as the active tab.</p>
<h4>Switching between tabs</h4>
<p>By default, it is possible to switch between tabs by using <em>&lt;</em> and <em>&gt;</em> to select
the previous and next tab, respectively.  When positioned at the leftmost tab,
and switching to the previous tab, the tab switching will perform a wrap-around
so that the rightmost tab will be selected.  The wrap-around behaviour is
configurable.</p>
<h4>Closing tabs</h4>
<p>Tabs can by default be closed by pressing <em>c</em>.  It is possible to optionally
have a confirmation dialog pop up when closing a tab to avoid accidental
closing.  To complement closing of the current tab, it is also possible to close
all tabs but the current one.  No key is by default configured for this; the tab
menu, however, provides this ability.</p>
<p>Note: downloads initiated from a tab are in no way tied to that tab, so tabs can
be closed and the download will not be affected.</p>
<h3>Advanced topics involving tabs</h3>
<h4>Moving tabs</h4>
<p>Newly created tabs are always positioned as the rightmost tab, but it is
possible to move the current tab either to the left or the right.  The default
keybindings have them bound to Alt-&lt; and Alt-&gt;. Note, however, that there are
problems recognizing those keybindings when using XTerm, so you might want to
rebind them.</p>
<h4>Saving and restoring tabs</h4>
<p>Several features use bookmarks to save tabs; they will create a folder and
bookmark therein the currently displayed document of each tab:</p>
<ul>
<li>
<p>
You can explicitly command all tabs to be bookmarked.  This will ask you for
  a folder name in which the tabs will be bookmarked.
</p>
</li>
<li>
<p>
At startup and shutdown tabs can automatically be bookmarked in order to save
  and restore the browsing state.  Note that when restoring, all history
  information will be gone.  It is possible to configure both tab saving and
  restoring via options in &#8220;UI -&gt; Sessions&#8221;.
</p>
</li>
<li>
<p>
As a mean of crash protection, tabs can periodically be saved so that it is
  later possible to reconstruct opened tabs.  In case of a clean shutdown
  periodically saved tabs will be removed.
</p>
</li>
</ul>
</div>
<h2>Marks (the lite edition)</h2>
<div class="sectionbody">
<p>So, were you ever reading this huge 300-pages specification heavily
cross-referencing itself, jumping around and getting a headache when looking
for the place where you stopped reading the last time?</p>
<p>Were you doing something similar in C code, but praising <strong>vi</strong> for document
marks?</p>
<p>ELinks can do them, too! For vim non-users:</p>
<h3>What it is?</h3>
<p>When you place a "document mark" (just "mark" from now on), you place an
_invisible_ anchor at the current position in the document. You can place
several such marks --- each mark is identified by a single character (any
reasonable character will do). Then, you can just happily browse around
aimlessly (but see below) and when in the same document again, you can
return to any of the marks in the file again. That will restore your
position in the file at the time of placing the mark.</p>
<p>You can place a mark by the "m" key followed by the mark character. You can
go to a mark by the "'" (apostrophe) key followed by the mark character.
E.g., you can place a mark named "a" in the file by pressing "ma", then
return to it anytime later by typing "'a". You can of course change those
shortcuts at any time to anything you wish in the keybindings manager.</p>
<p>Short summary: you can place a mark (e.g. <em>z</em>) in a document by pressing
"mz" and then go back to it anytime later by pressing "'z".</p>
<h3>Restrictions</h3>
<p>Currently, only A-Za-z characters are valid marks.</p>
<p>Only one mark named "a" (or anything else) may exist at a time, so if one
puts a mark "a" in a first document and set another mark "a" in a second
document, ELinks will simply replace the former one.</p>
<p>ALL the document marks are always local to the document. I.e. the vim text
editor has an extension that makes the capital-letter marks to be global to
the whole program and going to such a mark will make it to open the right
document. This is not implemented in ELinks _yet_.</p>
<p>Contrary to vim, ELinks doesn't support numbered marks (jumping to the last
n documents in history) nor the special "'" mark (jumping to the last mark).
Yet.</p>
<p>There is no way to get a listing of all marks set in a document.  Yet.</p>
<h3>Marks lifespan</h3>
<p>I already hinted something about another restriction regarding aimless
browsing. The lifespan of document marks depends on rather ill-defined and
(for an average mortal) mostly non-deterministic technical conditions.</p>
<p>Generally, marks _always_ survive when not moving away from the document or
when moving only in the session history (and unhistory). That means, if you
go back and the "unback" to the document, you will find your marks safely in
place. If you follow a link from the document (or typed an address to the
Goto URL dialog) and then go back (by pressing the right arrow or through
the File menu), your marks are safe too. These are in fact by far the most
common usage cases for the marks, so most of the time it will just work as
you expect.  That's a good news.</p>
<p>The bad news is that in all other cases, nothing is guaranteed.  It might
work if you get back to the document by any other means (by following some
link or typing its address to the Goto URL dialog), or it might not. It
might be possible to achieve two instances of the document inside a single
ELinks, each with its own set of marks. However, again, generally it will
work as expected - this paragraph serves only as a disclaimer in cases it
doesn't.  Don't rely on it.</p>
<p>Marks never survive over ELinks restarts. If you quit your ELinks completely
and run it again, the marks you placed will be no more. No exceptions. Well.
In some cases, it <strong>might</strong> appear that they survived, but that just means you
did not quit your ELinks _completely_ --- if you run multiple ELinks
instances under a single user on a single system, they "join" together and
you must quit (or kill) them all to get rid of the damn thing.  But that's a
different story.</p>
</div>
<h2>URL Shortcuts in ELinks</h2>
<div class="sectionbody">
<p>One extremely useful and convenient feature in ELinks, which may not be very
well known, is so-called URL rewriting.  If you give ELinks a URL (by passing it
on the command line, through the -remote magic device or, most frequently, by
typing it to the Goto URL dialog), it has the ability to mangle it in certain
ways before processing it.  This mangling is called URI rewriting.</p>
<h3>What it does</h3>
<p>The URI rewriting can expand certain URL shortcuts to complete URLs.  For
example, if you type <em>sd</em> to the Goto URL dialog, it will be rewritten to:</p>
<div class="literalblock">
<div class="content">
<pre><tt>http://www.slashdot.org/</tt></pre>
</div></div>
<p>first, and then loaded.  /.'s front page will be displayed.</p>
<p>Further, if you type <em>g elinks</em> to the Goto URL dialog, it will be rewritten to:</p>
<div class="literalblock">
<div class="content">
<pre><tt>http://www.google.com/search?q=elinks&amp;amp;btnG=Google+Search</tt></pre>
</div></div>
<p>and then loaded, therefore, a Google search for the keyword <em>elinks</em> will be
performed.  Note that you can separate the <em>g</em> by either a space or a colon, so
<em>g:elinks</em> will do the exact same thing.</p>
<p>A large number of those shortcuts are already defined for you.  You can browse
Protocols :: URI Rewriting :: Dumb/Smart prefixes in the Options Manager for
a complete listing of already defined shortcuts (press the [Info] button on
a shortcut to see what it will be rewritten to).  See below for details on how
to enable or disable this rewriting and how to define your own shortcuts.</p>
<h3>How it works</h3>
<p>All the URI rewriting can be controlled by options in the <em>protocol.rewrite</em>
option tree.</p>
<p>In the case of <em>sd</em>, a URI rewriting mechanism called <em>dumb prefixes</em> is used.
If protocol.rewrite.enable-dumb is true, ELinks looks at the contents of the
protocol.rewrite.dumb.* tree, and if it finds option protocol.rewrite.dumb.sd,
it will use its value as the target URI.</p>
<p>Therefore, more generally speaking, if ELinks looks at
protocol.rewrite.dumb.&lt;typed_string&gt;, and if it exists, will replace the
entered URI with it.  These dumb prefixes can be used as a kind of alternative
bookmark systen - if you want to have fast access to a certain site and you
don't want to spend a while navigating the bookmarks manager, you can just fire
up the Goto URL dialog, type the shortcut and there you go.</p>
<p>A dumb prefix can contain <em>%c</em>, which will be replaced by the URI of the current
document.  This is used, for example, in the <em>arc</em> dumb-prefix, which provides
a shortcut to the Wayback machine at archive.org.</p>
<p>In the case of <em>g</em>, a slightly different URI rewriting mechanism called <em>smart
prefixes</em> is used.  If protocol.rewrite.enable-smart is true, ELinks looks at
the contents of the protocol.rewrite.smart tree and, if it finds option
protocol.rewrite.smart.g, it will use its value as the target URI.</p>
<p>The difference is that the smart prefixes can take arguments and reference them
in the target URI.  As with dumb prefixes, <em>%c</em> in the URI means the current
address.  Additionally, <em>%s</em> will be substituted by the whole string following
the prefix (<em>elinks</em> in the <em>g</em> example above; <em>%s</em> is by far the most
frequently used expansion), while you can reference individual space-separated
arguments with the codes <em>%0</em> thru <em>%9</em>.  Finally, if you want a plain % to the
resulting URI, use <em>%%</em>.</p>
<p>Note that the prefix searched in the protocol.rewrite.smart tree is everything
in the typed address up to the first space or colon (so <em>bug:123</em> and <em>bug 123</em>
are identical).  These prefixes are generally useful for searching anything very
fast - be it Google (<em>g:foo</em>, <em>gi:foo</em>, <em>gr:foo</em>, &#8230;), ELinks Bugzilla bugs
(<em>bug:1234</em>), the RFC database (<em>cr:foo</em>), or the Czech-English dictionary
(<em>czen:foo</em>).  The only limit is your imagination.</p>
<h3>Alternative URI rewriting mechanisms</h3>
<p>In the past, before this was implemented, Lua scripting did the job.  And you
still have complete control over the URI in the internal scripting goto-url
hook.  The advantages are clear - you get complete control over the URI and you
can do many more interesting things with it.  For example, there are some very
advanced CVSweb and Debian package database URI prefixes implemented in the
sample Lua hooks file.  The one disadvantage to this is that you must have Lua
scripting enabled in order to make use of it, and many users don't have Lua
installed.</p>
</div>
<h2>The Terminal Setup</h2>
<div class="sectionbody">
<p>ELinks uses neither (n)curses nor termcap/terminfo, so unless you are using
a terminal that is known by ELinks and have a built-in configuration (see below
for a list), it might be required that you do a little configuring of how your
terminal should be handled.  The easiest way to do this is by using the Terminal
Options dialog located in the Setup submenu of the Main menu.</p>
<p>It is possible to have configurations for multiple terminals as long as the TERM
environment variable &#8212; used to distinguish terminals from one another &#8212; is set
to something different for each terminal.  So be sure to set TERM to different
values for two terminals that cannot share the same configuration.  For example,
always setting TERM to xterm-color can lead to problems if you run ELinks under
the Linux console.  This is because the Linux console does not support
underlining and ELinks will not know that underlined characters will have to be
color highlighted so they stand out.</p>
<p>In short, ELinks does not use termcap or terminfo.  ELinks uses $TERM, but only
to distinguish between terminals in its own configuration.  That is, you need
only configure your terminal within ELinks: Go to the Setup menu and select
Terminal Options.  If $TERM is set to <em>screen</em> when you configure ELinks'
terminal settings, ELinks will remember to use those settings when $TERM is
<em>screen</em>.</p>
<h3>Options</h3>
<p>Apart from the last charset option configurable through the Setup -&gt; Character
Set submenu in the Main menu, the rest can be configured using the Terminal
Options dialog.</p>
<h4>Terminal type</h4>
<p>It maps roughly to the terminal type, such as Linux console, XTerm, VT100 etc.
It matters mostly when drawing frames and borders around dialog windows.  As
already mentioned, it also turns on certain features which try to compensate for
&#8220;missing&#8221; terminal capabilities when drawing.  Special highlighting of
underlined text if underlining is not supported is one such thing.</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="274" />
<col width="617" />
<thead>
  <tr>
    <th align="left">
    Type
    </th>
    <th align="left">
    Notes
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    No frames
    </td>
    <td align="left">
    Dumb terminal type / ASCII art
    </td>
  </tr>
  <tr>
    <td align="left">
    VT 100 frames
    </td>
    <td align="left">
    Works in most terminals
    </td>
  </tr>
  <tr>
    <td align="left">
    Linux or OS/2 frames
    </td>
    <td align="left">
    Linux console / you get double frames and other goodies
    </td>
  </tr>
  <tr>
    <td align="left">
    KOI-8
    </td>
    <td align="left">
    
    </td>
  </tr>
  <tr>
    <td align="left">
    FreeBSD
    </td>
    <td align="left">
    FreeBSD console
    </td>
  </tr>
</tbody>
</table>
</div>
<p>The default is to assume dumb terminal/ASCII art.</p>
<h4>Color mode</h4>
<p>The color mode controls what colors are used and how they are output to the
terminal.  The available color modes are:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="274" />
<col width="617" />
<thead>
  <tr>
    <th align="left">
    Mode
    </th>
    <th align="left">
    Color codes
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    Mono mode
    </td>
    <td align="left">
    Only 2 colors are used
    </td>
  </tr>
  <tr>
    <td align="left">
    16 color mode
    </td>
    <td align="left">
    Uses the common ANSI colors
    </td>
  </tr>
  <tr>
    <td align="left">
    88 color mode
    </td>
    <td align="left">
    Uses XTerm RGB codes (if compiled in)
    </td>
  </tr>
  <tr>
    <td align="left">
    256 color mode
    </td>
    <td align="left">
    Uses XTerm RGB codes (if compiled in)
    </td>
  </tr>
</tbody>
</table>
</div>
<p>The default is to use mono mode.</p>
<h4>Switch fonts for line drawing (aka 11m hack)</h4>
<p>This is related to the drawing of frames and window borders controlled by the
option above.  It controls whether to switch fonts when drawing lines, enabling
both local characters and lines working at the same time.</p>
<p>This boolean option only makes sense with the Linux console.  Off by default.</p>
<h4>Restrict frames in cp850/852</h4>
<p>This is related to the drawing of frames and window borders controlled by the
option above.  If enabled, it restricts the characters used when drawing lines.</p>
<p>This boolean option only makes sense with the Linux console using the cp850/852
character sets.  Off by default.</p>
<h4>Block cursor</h4>
<p>Move cursor to the bottom right corner when done drawing, if possible.  This is
particularly useful when we have a block cursor, so that text colors are
displayed correctly.  If you are using a screen reader you do not want to enable
this since the cursor is strategically positioned near relevant text of selected
dialog elements.</p>
<p>This boolean option is off by default.</p>
<h4>Transparency</h4>
<p>Determines whether or not to set the background to black.  This is particularly
useful when using a terminal (typically in some windowing environment) with
a background image or a transparent background.  If this option is enabled the
background will be visible in ELinks as well.</p>
<p>Note that this boolean option makes sense only when colors are enabled.  On by
default.</p>
<h4>Text underlining capability</h4>
<p>This boolean option controls whether to underline text or instead, enhance the
color.</p>
<p>Note: not all terminals support text underlining, so it is off by default.</p>
<h4>UTF-8 I/O</h4>
<p>This boolean option controls outputting of I/O in UTF-8 for Unicode terminals.</p>
<p>Note that currently, only a subset of UTF-8 according to the terminal
codepage is used.  This is off by default.</p>
<h4>Character Set</h4>
<p>Codepage of the charset used for displaying content on terminal.</p>
<p>The value <em>System</em> (which is the default) will set the charset according to the
current locale.  The default is to use the charset of the current locale.</p>
<h3>Terminal Configurations</h3>
<p>Built-in configurations exists for the following terminals:</p>
<ul>
<li>
<p>
linux
</p>
</li>
<li>
<p>
vt100
</p>
</li>
<li>
<p>
vt110
</p>
</li>
<li>
<p>
xterm
</p>
</li>
<li>
<p>
xterm-color
</p>
</li>
<li>
<p>
xterm-88color
</p>
</li>
<li>
<p>
xterm-256color
</p>
</li>
</ul>
<p>The last two configurations requires that support for either 88 or 256 colors
is compiled in to xterm.</p>
<p>GNU Screen is VT100-compatible, so select <em>VT 100 frames</em>.  GNU Screen also
supports colors just fine, so select <em>16 colors</em>, or, if you are running Screen
within a terminal emulator that supports 256 colors and you have compiled both
Screen and ELinks to support it, choose <em>256 colors</em>.</p>
</div>
<h2><a id="mime"></a>Introduction to MIME handling</h2>
<div class="sectionbody">
<p>At some time along the 0.4 prereleases, ELinks replaced the old Links file
configuration system with its own one. Now, the configuration is stored in
elinks.conf, much more complete and featuring a new syntax. You can set most
options from the UI (so usually there is no need to deal with elinks.conf),
and that used to be true for setting MIME handlers and extensions as well; but
now the associations menu is gone temporarily, forcing you to set the handlers
from the configuration file.</p>
<p>The comments provided within elinks.conf for the MIME options are not much
helpful, and those options may seem a bit obscure or confusing at first.  This
document is a basic introduction to setting of MIME associations for ELinks.
If you want to know how to automatically launch a program to view some kind of
file (like images), then read on. Some basic knowledge of MIME is recommended.</p>
<h3>Handling MIME types, the ELinks way</h3>
<h4>What are MIME types and why may you want to use them?</h4>
<p>If, while browsing with ELinks, you need to display files that it can't show
(like images or PDF documents), then you will likely want to pass them to
other programs that are suitable for this task. While you may do it manually
(saving the file to disk, running the auxiliary program to show it and then
removing the file when finished), ELinks provides a method to do this
automatically using MIME types.</p>
<p>ELinks usually knows what the MIME type is for any file (which is a kind of
description of its format), thus you only need to specify how to manage the
MIME types for the files you want to open. If you don't tell ELinks how to
manage a given MIME type then it will show you on screen the contents of the
file (as if it was ASCII text) instead of calling an external program to show
them.</p>
<h4>Associating files to MIME types</h4>
<p>If the file is fetched from a web server then this web server should tell
ELinks what its MIME type is, so you should have generally no need to care
about it. However, the web server might send an incorrect type, or you may be
retrieving it by FTP or from your local filesystem, so sometimes ELinks needs
to guess it.</p>
<p>The easiest method to guess a MIME type for a file is to just look at its name
trusting it was given the right extension.  ELinks supports this, letting you
to specify a type for any given extension.</p>
<h4>Managing a given MIME type</h4>
<p>This usually means specifying programs to open files of this type and the
conditions in which those programs may be used. For instance, you may want to
use zgv (a popular svgalib image viewer) when you are using the text console,
but xli (a image viewer for X) when running the X window system.</p>
<h5>Binding it to a handler</h5>
<p>Instead of directly attaching a program to a MIME type, ELinks lets you
associate an abstract handler to each type. Then you can specify which
programs implement the handler and how are they used.</p>
<p>For instance, you may create an image_viewer handler and assign it to MIME
types image/jpeg, image/png and image/gif. Then you would associate to
image_viewer the programs you would like to use for viewing images and the
details on how to use them. This is less cumbersome than repeating all these
details for each MIME type.</p>
<h4>Specifying the details for a handler</h4>
<p>There are three issues to specify for a handler: the program associated to it,
whether you want confirmation before using it and whether you want the
terminal to be blocked while it is being used.</p>
<p>When specifying any of these issues, you must tell ELinks the situation in
which it gets applied, which is typically either the text console or the X
window system. So you can specify that you don't want confirmation before
running the program when running X, and that you want it otherwise.
Similarly, when you are attaching a program (name it foo) to this handler you
must tell if it's for X or not (you can attach a second program for the other
choice if you want).</p>
<dl>
<dt>
Attaching a program to it
</dt>
<dd>
<p>
        You must tell ELinks the exact command for running it (with any
        options you wish). In place of the filename you must enter %.
</p>
</dd>
<dt>
Choosing whether you want confirmation before applying it
</dt>
<dd>
<p>
        This is rather simple. If you choose not to do so, then the handler
        will be automatically called upon when you demand ELinks to show
        something attached to this handler. Otherwise, if you ask for
        confirmation, you will be prompted to open it with a external program,
        with additional choices that include cancelling the operation and
        viewing it with ELinks. E.g: you may use this option for programs
        written in C so that you may always choose if you want to read the
        source with ELinks, or if you want to save it, or if you want to use
        indent to display it with less.
</p>
</dd>
<dt>
Choosing whether to block the terminal
</dt>
<dd>
<p>
        If you don't want to allow going back to ELinks (or any other program
        from the same terminal) before the external program ends, then you
        should ask to block the terminal.
</p>
</dd>
</dl>
<h3>Setting up elinks.conf</h3>
<p>If you have old configuration files from old ELinks versions or from Links,
then you may use the conf-links2elinks.pl script (which is placed at
contrib/conv/ on the source distribution) to convert them to the new format.
If you don't use it you will need to edit the configuration file, and here you
will find how.</p>
<h4>Associating a file extension to a MIME type</h4>
<p>You can still do this with the UI, from the the Setup-&amp;gt;File Extensions
submenu.</p>
<p>If you want to do so from the configuration file, enter set mime.extension.ext
= "type", replacing ext with the appropriate file extension, and type with its
MIME type. E.g. you may want to have set mime.extension.jpg = "image/jpeg".</p>
<h4>Defining a handler</h4>
<p>For each handler you must define three items, specifying in what context the
value of the item should be applied. You must enter set
mime.handler.handler-name.item.context = value, replacing handler-name with
the name for the handler you are defining, item with the item you are defining
for this handler, context with the context this item value is to be applied,
and value with the value you want to assign to the item. You must do so for
each of the available items: program, ask and block.</p>
<p>The value for program is a string with the exact command you want to be issued
to view the file, placing % were you would put the file name. The values for
ask and block are either 0 (no) or 1 (yes). Available contexts include unix
and unix-xwin, which mean UNIX text terminal and X respectively (others can be
os2, win32, beos, riscos, &#8230;). The latter does not mean you are running
ELinks from X, just that the DISPLAY variable is set so that ELinks may run an
X program.</p>
<p>To illustrate it, here is an example. Suppose you want to define the
image_viewer handler which should be used to view images.  The configuration
file may look like this:</p>
<div class="listingblock">
<div class="content">
<pre><tt>set mime.handler.image_viewer.unix.ask = 1
set mime.handler.image_viewer.unix-xwin.ask = 0

set mime.handler.image_viewer.unix.block = 1
set mime.handler.image_viewer.unix-xwin.block = 0

set mime.handler.image_viewer.unix.program = "zgv %"
set mime.handler.image_viewer.unix-xwin.program = "xli %"</tt></pre>
</div></div>
<p>In this example the image_viewer handler uses the svgalib image viewer zgv
when X is not available, and the X image viewer xli when it is. The terminal
would be blocked when X is not available and it would not be when it's
available. Finally, ELinks would ask for confirmation before using the handler
only with X not available.</p>
<h4>Associating a MIME type to a handler</h4>
<p>Just enter set mime.type.class.name = "handler", replacing class with the
class for the mime type, name with the specific name within that class, and
handler with the name for the handler you want to assign to the MIME type.
E.g. you may want to have set mime.type.image.jpeg = "image_viewer".</p>
</div>
<h2>Managing External Viewers with Mailcap</h2>
<div class="sectionbody">
<p>This document describes the support for Mailcap (RFC 1524) in ELinks. It does
not describe the mailcap format. There are plenty of documents on the Web that
does this. Google and thou wilt find. ;)</p>
<h3>A Short Intro to Mailcap</h3>
<p>Mailcap is a file format defined in RFC 1524. Its purpose is to inform
multiple mail reading user agent (MUA) programs about the locally-installed
facilities for handling mail in various formats. It is designed to work with
the Multipurpose Internet Mail Extensions, known as MIME.</p>
<p>ELinks allows MIME handlers to be defined using its own configuration system,
so why support mailcap? It can be seen as an alternative or simply as a
supplement for setting up MIME handlers in ELinks.  Mailcap files are present
on most UNIX systems&#8212;usually in /etc/mailcap&#8212;so this makes it possible for
ELinks to know how to handle a great variety of file formats with little
configuration. To be able to use mailcap, it has to be compiled into ELinks.
This is the default. If you don't need mailcap support, just configure ELinks
with the flag: --disable-mailcap.</p>
<h3>Parameters to Mailcap Entries</h3>
<p>The code has been ported from Mutt and thereby inherits some of its various
features and limitation.</p>
<p>The following parameters are supported:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="182" />
<col width="708" />
<thead>
  <tr>
    <th align="left">
    Parameter
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    %s
    </td>
    <td align="left">
    The filename that contains the data.
    </td>
  </tr>
  <tr>
    <td align="left">
    %f
    </td>
    <td align="left">
    The content type, like <em>text/plain</em>.
    </td>
  </tr>
</tbody>
</table>
</div>
<p>The following parameters are not supported, since they do not really make much
sense for a non-MUA program:</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="182" />
<col width="708" />
<thead>
  <tr>
    <th align="left">
    Parameter
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    %n
    </td>
    <td align="left">
    The integer number of sub-parts in the multipart
    </td>
  </tr>
  <tr>
    <td align="left">
    %F
    </td>
    <td align="left">
    The "content-type filename" repeated for each sub-part
    </td>
  </tr>
  <tr>
    <td align="left">
    %{ parameter}
    </td>
    <td align="left">
    The "parameter" value from the content-type field
    </td>
  </tr>
</tbody>
</table>
</div>
<h3>Reading of Mailcap Files</h3>
<p>Mailcap files will be read when starting ELinks. The mailcap files to use will
be found from the mailcap path, a colon separated list of files similar to the
$PATH environment variable. The mailcap path will be determined in the
following way:</p>
<ul>
<li>
<p>
From the value of the mime.mailcap.path option in elinks.conf; for example:
</p>
<div class="literalblock">
<div class="content">
<pre><tt>set mime.mailcap.path = "~/.mailcap:/usr/local/etc/mailcap"</tt></pre>
</div></div>
</li>
<li>
<p>
From MAILCAP environment variable.
</p>
</li>
<li>
<p>
If non of the above is defined, the mailcap path defaults to
   <tt>~/.mailcap:/etc/mailcap</tt>.
</p>
</li>
</ul>
<h3>Fields</h3>
<p>Since mailcap handling is primarily for displaying of resources, all fields
like edit, print, compose etc. are ignored.</p>
<p>Note: Test commands are supported, but unfortunately, it's not possible to
provide the file when running the test. So any test that requires a file will
be considered failed and the handler will not be used.</p>
<p>Unfortunately, there are no <em>native</em> support for the copiousoutput field.  The
field basically mean <em>needs pager</em>. So it is handled by appending a pipe and a
pager program to the command. The pager program will be read from the <tt>PAGER</tt>
environment variable. If this fails, test are made for common pager programs
(<tt>/usr/bin/pager</tt>, <tt>/usr/bin/less</tt> and <tt>/usr/bin/more</tt> in that order). So if you
define png2ascii as your handler for image/png and specify copiousoutput then
the executed command will be "<tt>png2ascii |/usr/bin/less</tt>" if less is your pager
or present on your system.</p>
<h3>Mailcap Configuration</h3>
<p>Apart from the mime.mailcap.path option, you can configure if mailcap support
should be disabled. The default being that it is enabled. To disable it just
put:</p>
<div class="literalblock">
<div class="content">
<pre><tt>set mime.mailcap.enable = 0</tt></pre>
</div></div>
<p>in elinks.conf.</p>
<p>It is also possible to control whether ELinks should ask you before opening a
file. The option is a boolean and can be set like this:</p>
<div class="literalblock">
<div class="content">
<pre><tt>set mime.mailcap.ask = 1</tt></pre>
</div></div>
<p>if you would like to be asked before opening a file.</p>
<h3>Some Sample Mailcap Entries</h3>
<p>Below are examples of how to specify external viewers:</p>
<div class="listingblock">
<div class="content">
<pre><tt># Use xv if X is running
image/*;                xv %s ; test=test -n "$DISPLAY";

text/x-csrc;            view %s; needsterminal

# Various multimedia files
audio/mpeg;             xmms '%s'; test=test -n "$DISPLAY";
application/pdf;        xpdf '%s'; test=test -n "$DISPLAY";
application/postscript; ps2ascii %s ; copiousoutput</tt></pre>
</div></div>
</div>
<h2>Managing remote ELinks instances</h2>
<div class="sectionbody">
<p>Some programs provide the ability to pass URIs to external programs.  When
stumbling upon a reference to a page you want to see, it is sometimes a kludge
to copy and paste it into ELinks.  This is where -remote can be a nifty
solution.</p>
<p>When invoking ELinks with the -remote argument, it does not start a new
instance, but instead connects to an already running ELinks, making it
possible to control that ELinks instance. The -remote command line switch
takes a command consisting of the action to invoke and any parameters to the
action. Commands must begin with a nonempty sequence of ASCII alphabetic
characters followed by optional whitespace and an opening parenthesis. They
must end with a closing parenthesis optionally followed by whitespace. Here is
an example for opening freshmeat.net in a new tab:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ elinks -remote "openURL(http://freshmeat.net/, new-tab)"</tt></pre>
</div></div>
<p>When running this command in a terminal, you will see a small delay before
ELinks returns. If no running instance was found, it will return with the
error message:</p>
<div class="literalblock">
<div class="content">
<pre><tt>ELinks: No remote session to connect to.</tt></pre>
</div></div>
<p>All URLs passed to the openURL() commands can be URL prefixes, so the command
above could have simply used &#8220;openURL(fm, new-tab)&#8221;.</p>
<h3>Limitations and outstanding issues</h3>
<p>Remote control is implemented using the intercommunication socket created in
~/.elinks/, so the command has to be run on the same machine as the instance
you want to control; or put differently: the two ELinkses need to share a file
system that supports socket files, which rules out usage of -remote over NFS.
This also implies that the ELinks instance you want to control should be
started without passing -no-home nor -no-connect.</p>
<p>The built-in -remote support is to some degree compatible with the one Mozilla
provides (http://www.mozilla.org/unix/remote.html), but with some homebrew
extensions added and few unsupported features. All the supported actions are
documented below.</p>
<p>Under some circumstances, use of the -remote control can cause ELinks to
become unresponsive. This is cause by the current key press and mouse focus
being redirected to new tabs or dialogs opened by the -remote action.</p>
<h3>Remote Actions</h3>
<p>The command syntax is case-insensitive. For readability, we use the casing in
the listing of supported commands.</p>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<caption class="title">Table: Mozilla <tt>-remote</tt> compatible commands.</caption>
<col width="365" />
<col width="537" />
<thead>
  <tr>
    <th align="left">
    Command
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    ping()
    </td>
    <td align="left">
    Checks for existence of a remote instance.                                    Makes it possible for scripts to query if                                     remote controlling is possible.
    </td>
  </tr>
  <tr>
    <td align="left">
    openURL()
    </td>
    <td align="left">
    Prompts for a URL in current tab by opening                                   the Goto dialog.
    </td>
  </tr>
  <tr>
    <td align="left">
    openURL(URL)
    </td>
    <td align="left">
    Open the passed URL in current tab.
    </td>
  </tr>
  <tr>
    <td align="left">
    openURL(URL, new-tab)
    </td>
    <td align="left">
    Opens the passed URL in new tab.
    </td>
  </tr>
  <tr>
    <td align="left">
    openURL(URL, new-window)
    </td>
    <td align="left">
    Opens the passed URL in new window.
    </td>
  </tr>
  <tr>
    <td align="left">
    xfeDoCommand(openBrowser)
    </td>
    <td align="left">
    Opens an ELinks instance in a new window.                                     This ELinks instance will connect to the                                      already running one.
    </td>
  </tr>
</tbody>
</table>
</div>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<caption class="title">Table: ELinks extensions.</caption>
<col width="365" />
<col width="537" />
<thead>
  <tr>
    <th align="left">
    Command
    </th>
    <th align="left">
    Description
    </th>
  </tr>
</thead>
<tbody valign="top">
  <tr>
    <td align="left">
    addBookmark(URL)
    </td>
    <td align="left">
    Bookmarks the passed URL.
    </td>
  </tr>
  <tr>
    <td align="left">
    infoBox(text)
    </td>
    <td align="left">
    Show text in a message box.
    </td>
  </tr>
</tbody>
</table>
</div>
<p><tt>-remote</tt> can also take a list of URLs without an explicit action, in which case
the URL arguments will be opened in new tabs in the remote instance. For
example, by running:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ elinks -remote slashdot.org fm g:elinks</tt></pre>
</div></div>
<p>new tabs containing <tt>slashdot.org</tt>, <tt>freshmeat.net</tt> and a Google search of elinks
will be opened.</p>
</div>
<h2>The tale of ex-mode</h2>
<div class="sectionbody">
<p>Are you a vim-controls nerd who wants to see them everywhere?  Welcome.</p>
<p>Actually ELinks doesn't shine in this area yet very much. Heck, the famous
hjkl foursome is still occupied by some feeble managers in the default keymap
(we have that in our monumental TODO lists). Still, if you know what to touch
during the compilation (<tt>--enable-exmode</tt>), you can get at least some familiar
reply to the mighty &#8220;:&#8221; (colon) grip.</p>
<h3>What it is</h3>
<p>Ex-mode gives you some (still very rough and only marginally complete) access
to advanced ELinks commands, to be invoked anywhere anytime, straight and
fast.</p>
<p>When you activate the ex-mode (named after the equivalent gadget in the vi
text editor flavours), a command line appears at the bottom of the screen for
you to type the commands.</p>
<p>Only two kinds of commands are supported so far. First, (almost?) anything
that can appear in the configuration file can be used in ex-mode. Second, you
can invoke (almost) any action from the ex-mode.</p>
<h3>Configuration directives in exmode</h3>
<p>There aren't many of these, so we can skim through them fast.</p>
<p>If you want to flip an option you know by name and refuse to engage with the
option manager visuals, you can just drop in to the ex-mode and type <em>set
the.option = 1234</em>. See man elinks.conf (5) or the options manager for the
list of options; you can also get a complete options tree saved to elinks.conf
if you set <em>config.saving_style</em> = 2 (but do <strong>NOT</strong> keep that setting unless
you know what are you doing; if we change a default value of some option in
future releases, we (generally) know what are we doing - this change won't
propagate to you during an upgrade if you already have the original default
value saved in your configuration file, though).</p>
<p>It's the same story with keybindings. You can use <em>bind "main" "h" =
"move-cursor-left"</em>. It's not the same story with keybindings documentation.
There is the elinkskeys (5) manual page but it's horribly obsolete, so don't
rely on it. You can refer to the keybindings manager for names of actions and
even their short descriptions. Also, all the <em>bind</em> commands are saved to the
configuration file if you set config.saving_style = 2 (but see above).</p>
<p>You can also use <em>include my.conf</em>, which will read my.conf as an ELinks
configuration file.</p>
<p>Actually, ELinks would eat <em>#blahblah blah</em> too, if you see a point in feeding
it that kind of stuff.</p>
<h3>Actions in exmode - or exmode in action?</h3>
<p>There is too many of these, so we should better skim through them fast.</p>
<p>Actually, we already talked about them. It's the last argument to the <em>bind</em>
command. So, they are those listed in the keybinding manager. So if you enter
<em>move-cursor-left</em> command, it will move your cursor left - by a single
character, making this a little awkward, but it's useful if you sometimes want
to easily invoke an action and you don't want to waste a key for it.</p>
<p>Actually, actions could theoretically take arguments too. This is currently
implemented only for the <em>goto-url</em> action, which can take the location it
should go at as a parameter (otherwise it opens the standard well-known dialog
as if you pressed <em>g</em> in the default keymap).</p>
<p>Regarding the mysterious "(almost)" hinted above, you can never invoke the
"quit" action from the exmode - if you type it there, "really-quit" is invoked
instead.</p>
<h3>How to use it</h3>
<p>It's simple. You press <em>:</em> (without the apostrophes, of course) and type in
the command, then you press enter.  E.g., <em>:set config.saving_style = 3</em> (this
is a good thing), <em>:quit</em> (and the game is over). The standard line-editing
facility is present (cursor keys and so), and the ex-mode input line has own
history.</p>
<h3>The "but"s</h3>
<p>The biggest usability hurdle so far is that there is no tab-completion. This
is why the ex-mode support is not enabled by default and part of the reason
why its practical usage is somewhat limited yet - if you don't remember
exactly what do you want to invoke, tough beans. Someone shall address this
issue in the future.</p>
<p>Also, perhaps wider scale of commands should be implemented in ex-mode. The
code is extremely flexible and it is very trivial to make another ex-mode
command handler, it's just that no one has done it yet ;-). Also, more actions
should be able to take arguments.</p>
</div>
<h2>ELinks BitTorrent Client</h2>
<div class="sectionbody">
<p>This chapter provides a small manual for using the implemented
BitTorrent client. The BitTorrent client is provided as an optional
add-on for ELinks, and needs to be enabled at compile time.  To build
ELinks with BitTorrent support be sure to either pass
<tt>--enable-bittorrent</tt> to <tt>./configure</tt> or change the value of
<tt>CONFIG_BITTORRENT</tt> to <tt>yes</tt> in <tt>features.conf</tt>.</p>
<h3>Using the BitTorrent Client</h3>
<p>To start the client, first go to a site which offers metainfo files. In
the following, we will use the site <a href="http://www.legaltorrents.com/">http://www.legaltorrents.com/</a>.
Direct ELinks to this site by issuing the command:</p>
<div class="literalblock">
<div class="content">
<pre><tt>$ elinks http://www.legaltorrents.com/</tt></pre>
</div></div>
<p>Use the arrow keys to move between links on the page. Find a link,
which points to a metainfo file (a file having the extension
<tt>.torrent</tt>). This is indicated in the status bar in the bottom line.
Once a metainfo file has been located, press the Return key. This
should present you with the following dialog, querying whether the
client should start to download the torrent:</p>
<div class="literalblock">
<div class="content">
<pre><tt>+--------------------------- What to do? ----------------------------+
|                                                                    |
|  What would you like to do with the file 'go-open-vol-2.torrent'?  |
|  Information about the torrent:                                    |
|  Size: 739 MiB (2959 * 262144 + 161542)                            |
|  Info hash: d85ef7b05288dc49203a7de97545e6c132834011               |
|  Announce URI: http://www.legaltorrents.com:7070/announce          |
|  Creation date: Jun 26 08:04                                       |
|  Directory: go-open-vol-2                                          |
|                                                                    |
|  [X] 105 MiB go-open-episode-07.mp4                                |
|  [X] 105 MiB go-open-episode-08.mp4                                |
|  [X] 105 MiB go-open-episode-09.mp4                                |
|  [X] 104 MiB go-open-episode-10.mp4                                |
|  [X] 105 MiB go-open-episode-11.mp4                                |
|  [X] 107 MiB go-open-episode-12.mp4                                |
|  [X] 106 MiB go-open-episode-13.mp4                                |
|  [X]  22 KiB go-open-vol-2.txt                                     |
|                                                                    |
|  [ Download ]  [ Save ]  [ Display ]  [ Show header ]  [ Cancel ]  |
+--------------------------------------------------------------------+</tt></pre>
</div></div>
<p>Press the <tt>[ Download ]</tt> button to open the download dialog and start
downloading.</p>
<p>Downloaded files can be found in the directory specified by the option
<tt>document.download.directory</tt>.  There is currently no way to change
that.</p>
<h3>The Resume Dialog</h3>
<p>If you start downloading a torrent which was previously active, the
client will first try to resume downloaded data from the disk. The
resume progress is shown in the resume dialog, depicted below:</p>
<div class="literalblock">
<div class="content">
<pre><tt>+--------------------------------------- Download ---------------------------------------+
|                                                                                        |
| bittorrent:http://www.legaltorrents.com/bit/blue-a-short-film.torrent                  |
|                                                                                        |
| [||||||||||||||||||||||||||               26%                                        ] |
|                                                                                        |
| Resuming                                                                               |
|                                                                                        |
| [ Background ] [ Background with notify ] [ Info ] [ Abort ] [ Abort and delete file ] |
+----------------------------------------------------------------------------------------+</tt></pre>
</div></div>
<p>Wait until the resume completes. It will automatically launch the
download dialog.</p>
<h3>The Download Dialog</h3>
<p>The download dialog gives an overview of the state of the download,
such as progress, and a summary of which places in the torrent pieces
have been downloaded from. A view of the download dialog along with
highlights of the most important parts of the dialog is given below:</p>
<div class="literalblock">
<div class="content">
<pre><tt>+--------------------------------------- Download ---------------------------------------+
|                                                                                        |
|  bittorrent:http://www.legaltorrents.com/bit/best-of-webbed-hand-vol-1.torrent         |
|                                                                                        |
|  [|||||||||                                9%                                       ]  |
|                                                                                        |
|  [| |||||||||||||||||||  |  |                                                    |  ]  |
|                                                                                        |
|  Received 65 MiB of 681 MiB                                                            |
|  Average speed 269 KiB/s, current speed 291 KiB/s                                      |
|  Elapsed time 4:08, estimated time 38:58                                               |
|                                                                                        |
|  Status: downloading (rarest first)                                                    |
|  Peers: 7 connections, 5 seeders, 0 available                                          |
|  Upload: 816 KiB, 3.2 KiB/s, 3.2 KiB/s average, 1:1 in 5:36:06                         |
|  Sharing: 0.012 (816 KiB uploaded / 65 MiB downloaded)                                 |
|  Pieces: 242 completed, 22 in progress, 2485 remaining                                 |
|  Statistics: 9 in memory                                                               |
|                                                                                        |
| [ Background ] [ Background with notify ] [ Info ] [ Abort ] [ Abort and delete file ] |
+----------------------------------------------------------------------------------------+</tt></pre>
</div></div>
<p>The first bar shows the overall progress of the download along with a
percentage of how much data has been downloaded. The second bar
provides an overview of the piece completion progress, such as where
in the torrent pieces has been downloaded from.</p>
<p>Below the information about download speed and time estimations,
several lines about the internal state of the client and its view of
the swarm is displayed. For example the <tt>Status</tt> line shows which
connection mode the client has entered along with the piece selection
strategy if any. Here you will also find information about upload
speed and sharing rates. Finally, the <tt>Pieces</tt> and <tt>Statistics</tt> lines
display information from the piece cache. This includes the number of
pieces which are currently held in memory, and the number of pieces
currently being downloaded.</p>
</div>
<h2><a id="lua-scripting"></a>Scripting ELinks with Lua</h2>
<div class="sectionbody">
<p>This file documents the Lua scripting interface of the ELinks web browser.</p>
<h3>Introduction</h3>
<h4>What is it</h4>
<p>Lua scripting capabilities permit users to customize the ELinks behaviour to
unusual degree - they allow automatic rewriting of HTML code of the received
documents, rewriting of the URLs entered by user etc. You can even write your
own bookmarks system with Lua. See also contrib/lua/ for some examples of the
possibilities of ELinks Lua support.</p>
<p>Please do not confuse Lua scripting with JavaScript, EcmaScript, VBScript and
similar. Those are embedded in page, allowing per-document scripting related
to its presentation and providing some degree of interactivity etc. On the
contrary, the current Lua support permits scripts to be embedded to the
browser directly, changing the behaviour of the browser, not the document.</p>
<p>The original Lua support (in the form of Links-Lua fork of original Links) was
written by Peter Wang and Cliff Cunnington.  There are some rough edges
remaining, but is suitable for everyday use (I have been using it every day
for a year).</p>
<h4>Where to get it</h4>
<p>The Lua scripting support comes with the stock ELinks distribution, no
additional patches and tweaks should be needed.</p>
<p>The web site of the original Links-Lua is at
<a href="http://links.sourceforge.net/links-lua/">http://links.sourceforge.net/links-lua/</a>. Some older patches against
regular Links are available at
<a href="http://www.sourceforge.net/projects/links/">http://www.sourceforge.net/projects/links/</a>, but they are not being
maintained.</p>
<p>Lua can be found at <a href="http://www.lua.org/">http://www.lua.org/</a>.</p>
<h4>What it runs on</h4>
<p>The Lua support has only been tested under Linux, although it <strong>should</strong>
work under other platforms that ELinks and Lua support (perhaps with some
changes to source code?).</p>
<p>Also, note that many of the scripts given here assume a Unix system.
Your mileage will definitely vary on other platforms.</p>
<h3>Installing</h3>
<h4>Installing Lua</h4>
<p>Before you can compile ELinks with Lua support, you must compile and install
Lua.  The following instructions are for a Linux system.  People on other
systems should try to enable <tt>popen</tt> support, but this is not necessary
(you will lose a bit of functionality though).</p>
<ol>
<li>
<p>
Download and unpack the Lua <tt>tar.gz</tt> or <tt>zip</tt> somewhere.
</p>
</li>
<li>
<p>
<tt>cd</tt> into the <tt>lua</tt> directory.
</p>
</li>
<li>
<p>
Open <tt>config</tt> in a text editor and uncomment the <tt>POPEN</tt> line.
</p>
</li>
<li>
<p>
Optionally, change the `INSTALL_ROOT line.
</p>
</li>
<li>
<p>
Run <tt>make; make so; make sobin; make install</tt>.
</p>
</li>
</ol>
<p>On systems without shared object support, simply run <tt>make; make install</tt>
instead.</p>
<p>Since ELinks 0.11.0, only version 5.0 of Lua is supported.
Future versions of ELinks will probably support Lua 5.1 too;
see <a href="http://bugzilla.elinks.cz/show_bug.cgi?id=742">bug 742</a>.</p>
<h4>Installing ELinks</h4>
<p>Follow the instructions for building ELinks (it is the standard
<tt>./configure; make; make install</tt> procedure).  During the configure
step make sure that Lua has been detected on your system.</p>
<h4>Running ELinks with Lua</h4>
<p>Simply start ELinks as you normally would.  To check you have Lua support
compiled in, open up the "Help | About" dialog box.  It should list
"Scripting (Lua)" under "Features".
If not, make sure you do not have other copies of ELinks
running, or start ELinks again with the "-no-connect" option on the
command-line.</p>
<h3>Using ELinks with Lua</h3>
<p>Out of the box, ELinks with Lua will do nothing different from regular ELinks.
You need to write some scripts.</p>
<h4>ELinks Lua additions</h4>
<p>The Lua support is based on the idea of <strong>hooks</strong>.  A hook is a function that
gets called at a particular point during the execution of ELinks.  To make
ELinks do what you want, you can add and edit such hooks.</p>
<p>The Lua support also adds an extra dialog box, which you can open while in
ELinks with the comma (<tt>,</tt>) key.  Here you can enter Lua expressions for
evaluation, or override it to do something different.</p>
<p>And finally, you can bind keystrokes to Lua functions.  These keystrokes
won't let you do any more than is possible with the Lua Console, but
they're more convenient.</p>
<p>Note that this document assumes you have some knowledge of programming in Lua.
For that, you should refer to the Lua reference manual
(<a href="http://www.lua.org/docs.html">http://www.lua.org/docs.html</a>). In fact, the language is relatively
trivial, though. You could already do wonders with simply refactoring the
example scripts.</p>
<h4>Config file</h4>
<p>On startup, ELinks reads in two Lua scripts.  Firstly, a system-wide
configuration file called <tt>/etc/elinks/hooks.lua</tt>, then a file in your home
directory called <tt>~/.elinks/hooks.lua</tt>.  From these files, you can include
other Lua files with <tt>dofile</tt>, if necessary.</p>
<p>To see what kind of things you should put in here, look at
<tt>contrib/lua/hooks.lua</tt>.</p>
<h4>Hooks</h4>
<p>The following hooks are available.</p>
<dl>
<dt>
goto_url_hook (url, current_url)
</dt>
<dd>
<p>
        This hook is called when the user enters a string into the "Go to URL"
        dialog box.  It is given the string entered, and the current URL
        (which may be <tt>nil</tt>).  It should return a string, which is the URL
        that ELinks should follow, or <tt>nil</tt> to cancel the operation.
</p>
</dd>
<dt>
follow_url_hook (url)
</dt>
<dd>
<p>
        This hook is passed the URL that ELinks is about to follow.  It should
        return a string (the URL modified or unmodified), or <tt>nil</tt> to stop
        ELinks following the URL
</p>
</dd>
<dt>
pre_format_html_hook (url, html)
</dt>
<dd>
<p>
        This hook gets called just before the final time an HTML document is
        formatted, i.e. it only gets called once, after the entire document is
        downloaded.  It will be passed the URL and HTML text as strings, and
        should return the modified HTML text, or <tt>nil</tt> if there were no
        modifications.
</p>
</dd>
<dt>
proxy_for_hook (url)
</dt>
<dd>
<p>
        This hook is called when ELinks is about to load a resource
        from a URL.  It should return "PROXY:PORT" (e.g. "localhost:8080")
        to use the specified proxy, "" to contact the origin server
        directly, or <tt>nil</tt> to use the default proxy of the protocol.
</p>
</dd>
<dt>
lua_console_hook (string)
</dt>
<dd>
<p>
        This hook is passed the string that the user entered into the "Lua
        Console" dialog box.  It should return two values: the type of action
        to take (<tt>run</tt>, <tt>eval</tt>, <tt>goto-url</tt> or <tt>nil</tt>), and
        a second argument, which is the shell command to run or the Lua
        expression to evaluate. Examples:
</p>
<ul>
<li>
<p>
<tt>return "run", "someprogram"</tt> will attempt to run the program
           <tt>someprogram</tt>.
</p>
</li>
<li>
<p>
<tt>return "eval", "somefunction(1+2)"</tt> will attempt to call the Lua
           function <tt>somefunction</tt> with an argument, 3.
</p>
</li>
<li>
<p>
<tt>return "goto_url", "http://www.bogus.com"</tt> will ask ELinks to visit
           the URL "http://www.bogus.com".
</p>
</li>
<li>
<p>
<tt>return nil</tt> will do nothing.
</p>
</li>
</ul>
</dd>
<dt>
quit_hook ()
</dt>
<dd>
<p>
        This hook is run just before ELinks quits.  It is useful for cleaning
        up things, such as temporary files you have created.
</p>
</dd>
</dl>
<h4>Functions</h4>
<p>As well as providing hooks, ELinks provides some functions in addition to the
standard Lua functions.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">The standard Lua function <tt>os.setlocale</tt> affects ELinks' idea of
the system locale, which ELinks uses for the "System" charset, for the
"System" language, and for formatting dates.  This may however have to
be changed in a future version of ELinks, in order to properly support
terminal-specific system locales.</td>
</tr></table>
</div>
<dl>
<dt>
current_url ()
</dt>
<dd>
<p>
        Returns the URL of the current page being shown (in the ELinks session
        that invoked the function).
</p>
</dd>
<dt>
current_link ()
</dt>
<dd>
<p>
        Returns the URL of the currently selected link, or <tt>nil</tt> if none is
        selected.
</p>
</dd>
<dt>
current_title ()
</dt>
<dd>
<p>
        Returns the title of the current page, or <tt>nil</tt> if none.
</p>
</dd>
<dt>
current_document ()
</dt>
<dd>
<p>
        Returns the current document as a string, unformatted.
</p>
</dd>
<dt>
current_document_formatted ([width])
</dt>
<dd>
<p>
        Returns the current document, formatted for the specified screen
        width.  If the width is not specified, then the document is formatted
        for the current screen width (i.e. what you see on screen).  Note that
        this function does <strong>not</strong> guarantee all lines will be shorter than
        <tt>width</tt>, just as some lines may be wider than the screen when
        viewing documents online.
</p>
</dd>
<dt>
pipe_read (command)
</dt>
<dd>
<p>
        Executes <tt>command</tt> and reads in all the data from stdout, until there
        is no more.  This is a hack, because for some reason the standard Lua
        function <tt>file:read</tt> seems to crash ELinks when used in pipe-reading
        mode.
</p>
</dd>
<dt>
execute (string)
</dt>
<dd>
<p>
        Executes shell commands <tt>string</tt> without waiting for it to exit.  Beware
        that you must not read or write to stdin and stdout.  And unlike the
        standard Lua function <tt>os.execute</tt>, the return value is meaningless.
</p>
</dd>
<dt>
tmpname ()
</dt>
<dd>
<p>
        Returns a unique name for a temporary file, or <tt>nil</tt> if no
        such name is available.  The returned string includes the
        directory name.  Unlike the standard Lua function
        <tt>os.tmpname</tt>, this one generates ELinks-related names
        (currently with "elinks" at the beginning of the name).
</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Warning</div>
</td>
<td class="content">The <tt>tmpname</tt> function does not create the file and does not
        guarantee exclusive access to it: the caller must handle the
        possibility that another process creates the file and begins
        using it while this function is returning.  Failing to do this
        may expose you to symlink attacks by other users.  To avoid
        the risk, use <tt>io.tmpfile</tt> instead; unfortunately, it does not
        tell you the name of the file.</td>
</tr></table>
</div>
</dd>
<dt>
bind_key (keymap, keystroke, function)
</dt>
<dd>
<p>
        Currently, <tt>keymap</tt> must be the string <tt>"main"</tt>.  Keystroke is a
        keystroke as you would write it in the ELinks config file
        <tt>~/.elinks/elinks.conf</tt>.  The function <tt>function</tt> should take no
        arguments, and should return the same values as <tt>lua_console_hook</tt>.
</p>
</dd>
<dt>
edit_bookmark_dialog (cat, name, url, function)
</dt>
<dd>
<p>
        Displays a dialog for editing a bookmark, and returns without
        waiting for the user to close the dialog.  The return value is
        <tt>1</tt> if successful, <tt>nil</tt> if arguments are invalid, or nothing
        at all if out of memory.  The first three arguments
        must be strings, and the user can then edit them in input
        fields.  There are also <em>OK</em> and <em>Cancel</em> buttons in the
        dialog.  If the user presses <em>OK</em>, ELinks calls <tt>function</tt>
        with the three edited strings as arguments, and it should
        return similar values as in <tt>lua_console_hook</tt>.
</p>
</dd>
<dt>
xdialog (string [, more strings&#8230;], function)
</dt>
<dd>
<p>
        Displays a generic dialog for editing multiple strings, and
        returns without waiting for the user to close the dialog.
        The return value is <tt>1</tt> if successful, <tt>nil</tt> if arguments are
        invalid, or nothing at all if out of memory.  All arguments
        except the last one must be strings, and ELinks places them
        in input fields in the dialog.  There can be at most 5 such
        strings.  There are also <em>OK</em> and <em>Cancel</em> buttons in the
        dialog.  If the user presses <em>OK</em>, ELinks calls <tt>function</tt>
        with the edited strings as arguments, and it should return
        similar values as in <tt>lua_console_hook</tt>.
</p>
</dd>
<dt>
set_option (option, value)
</dt>
<dd>
<p>
        Sets an ELinks option.  The first argument <tt>option</tt> must be
        the name of the option as a string.  ELinks then tries to
        convert the second argument <tt>value</tt> to match the type of the
        option.  If successful, <tt>set_option</tt> returns <tt>value</tt>, else
        <tt>nil</tt>.
</p>
</dd>
<dt>
get_option (option)
</dt>
<dd>
<p>
        Returns the value of an ELinks option.  The argument <tt>option</tt>
        must be the name of the option as a string.  If the option
        does not exist, <tt>get_option</tt> returns <tt>nil</tt>.
</p>
</dd>
</dl>
<h4>Variables</h4>
<dl>
<dt>
elinks_home
</dt>
<dd>
<p>
        The name of the ELinks home directory, as a string.  Typically
        this is the .elinks subdirectory of the user's home directory.
</p>
</dd>
</dl>
<h4>User protocol</h4>
<p>There is one more little thing which Links-Lua adds, which will not be
described in detail here.  It is the fake "user:" protocol, which can be used
when writing your own addons.  It allows you to generate web pages containing
links to "user://blahblah", which can be intercepted by the <tt>follow_url_hook</tt>
(among other things) to perform unusual actions.  For a concrete example, see
the bookmark addon.</p>
<h3>Example recipes</h3>
<p>This chapter contains some example scripts that you can use.  All of them come
from <tt>contrib/lua/hooks.lua</tt>.  I really recommend you to see it directly
instead of copying code out of this document.  Also, not everything in there is
covered here.</p>
<p>If you would like to contribute scripts, that would be great!  Please send
them to me at <a href="mailto:tjaden@users.sourceforge.net">tjaden@users.sourceforge.net</a>.  Cliff and I plan to
start a script repository, provided we get some contributions.  As for script
ideas, you'll just have to be a little creative :-)</p>
<p>Also take a look at the <tt>contrib/lua/</tt> directory in the ELinks distribution.
Note that Peter and Cliff don't maintain the Lua support intensively anymore,
thus it would be probably nice to Cc me (<a href="mailto:pasky@ucw.cz">pasky@ucw.cz</a>) if you want
to contribute some patch, so that I would be able to add it to the ELinks
distribution.</p>
<h4>Go to URL on steroids</h4>
<p>There are some web sites that I visit often.  Bookmarks are okay, but they are
separate from the "Go to URL" dialog box, so I keep forgetting to use them.
Also, when I visit a search engine home page, all I really want to do is enter
a search term.</p>
<p>The following script allows me to type certain strings into the "Go to URL"
dialog box, and it will convert them to the URL I actually want to visit.  As
a bonus, it allows me perform some searches on sites like Google without
loading up the front page first.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Tip</div>
</td>
<td class="content">The &#8220;URI rewriting&#8221; feature of ELinks handles many of the same
tasks as the Lua hook shown here, and you can conveniently configure
it via the option manager.  It is not quite as versatile, though.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content">
<pre><tt>function match (prefix, url)
    return string.sub (url, 1, string.len (prefix)) == prefix
end

function strip (str)
    return string.gsub (str, "^%s*(.-)%s*$", "%1")
end

function plusify (str)
    return string.gsub (str, "%s", "+")
end

function goto_url_hook (url, current_url)
    -- Google search (e.g. ,gg unix browsers).
    if match (",gg", url) then
        url = plusify (strip (string.sub (url, 4)))
        return "http://www.google.com/search?q="..url.."&amp;btnG=Google+Search"

    -- Freshmeat search.
    elseif match (",fm", url) then
        url = plusify (strip (string.sub (url, 4)))
        return "http://www.freshmeat.net/search/?q="..url

    -- Dictionary.com search (e.g. ,dict congenial).
    elseif match (",dict", url) then
        url = plusify (strip (string.sub (url, 6)))
        return "http://www.dictionary.com/cgi-bin/dict.pl?db=%2A&amp;term="..url

    -- RPM search (e.g. ,rpm links).
    elseif match (",rpm", url) then
        url = plusify (strip (string.sub (url, 5)))
        return "http://www.rpmfind.net/linux/rpm2html/search.php?query="
                ..url.."&amp;submit=Search+..."

    -- Netcraft.com search (e.g. ,whatis www.google.com).
    elseif match (",whatis", url) then
        url = plusify (strip (string.sub (url, 8)))
        return "http://uptime.netcraft.com/up/graph/?host="..url

    -- LinuxToday home page.
    elseif match (",lt", url) then
        return "http://linuxtoday.com/"

    -- Weather forecast for Melbourne, Australia.
    elseif match (",forecast", url) then
        return "http://www.bom.gov.au/cgi-bin/wrap_fwo.pl?IDV10450.txt"

    -- Unmatched
    else
        return url
    end
end</tt></pre>
</div></div>
<h4>Expanding ~ (tilde)</h4>
<p>By adding an extra snippet of code to the previous example, we can make ELinks
expand pathnames such as <tt>~/foo/bar</tt>
and <tt>~user/zappo</tt>, like in the shell
and other Unix programs.</p>
<div class="listingblock">
<div class="content">
<pre><tt>function goto_url_hook (url, current_url)
                .
                .

    -- Expand ~ to home directories.
    elseif match ("~", url) then
        if string.sub(url, 2, 2) == "/" then    -- ~/foo
            return os.getenv ("HOME")..string.sub(url, 2)
        else                                    -- ~foo/bar
            return "/home/"..string.sub(url, 2)
        end

                .
                .</tt></pre>
</div></div>
<h4>Filtering crap</h4>
<p>Many web pages nowadays have columns to the left and right of the text, which
are utterly useless.  If you happen to be viewing the page in a 80x25 screen,
the text you want to read ends up crammed into a tiny space in the centre.  We
use ELinks Lua support to manipulate the HTML before it reaches the parser.</p>
<h5>linuxtoday.com</h5>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">This recipe is out of date for the web site.</td>
</tr></table>
</div>
<p>Linux Today has two problems when viewed in ELinks: the useless columns on the
left and the right and all the text appears in cyan.  Here is a quick recipe
to fix that:</p>
<div class="listingblock">
<div class="content">
<pre><tt>-- Plain string.find (no metacharacters)
function sstrfind (s, pattern)
    return string.find (s, pattern, 1, true)
end

function pre_format_html_hook (url, html)
    -- Strip the left and right columns from Linux Today pages
    -- and change the font colour to white.
    if sstrfind (url, "linuxtoday.com") then
        if sstrfind (url, "news_story") then
            html = string.gsub (html, '&lt;TABLE CELLSPACING="0".-&lt;/TABLE&gt;', '', 1)
            html = string.gsub (html, '&lt;TR BGCOLOR="#FFF.-&lt;/TR&gt;&lt;/TABLE&gt;', '', 1)
        else
            html = string.gsub (html, 'WIDTH="120"&gt;\n&lt;TR.+&lt;/TABLE&gt;&lt;/TD&gt;', '&gt;', 1)
        end
        html = string.gsub (html, '&lt;A HREF="http://www.internet.com.-&lt;/A&gt;', '')
        html = string.gsub (html, "&lt;IFRAME.-&lt;/IFRAME&gt;", "")
        -- emphasis in text is lost
        return string.gsub (html, 'text="#002244"', 'text="#001133"', 1)
    end

    return nil
end</tt></pre>
</div></div>
<h5>linuxgames.com</h5>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">This recipe is out of date for the web site.</td>
</tr></table>
</div>
<p>Here is a simpler example, for <a href="http://www.linuxgames.com/">http://www.linuxgames.com/</a>.</p>
<div class="listingblock">
<div class="content">
<pre><tt>function pre_format_html_hook (url, html)
                .
                .

    elseif string.find (url, "linuxgames.com", 1, true) then
        return string.gsub (html, "&lt;CENTER&gt;.-&lt;/center&gt;", "", 1)

                .
                .</tt></pre>
</div></div>
<h4>Reading gzipped files</h4>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">ELinks already supports gzipped files natively.</td>
</tr></table>
</div>
<p>Sometimes documents come gzipped in order to save space, but then you need to
uncompress them to read them with ELinks.  Here is a recipe to handle gzipped
files on a Unix system.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Warning</div>
</td>
<td class="content">This recipe opens a temporary file insecurely.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content">
<pre><tt>function pre_format_html_hook (url, html)
                .
                .

    -- Handle gzip'd files within reasonable size.
    if string.find (url, "%.gz$") and string.len (html) &lt; 65536 then
        local name = tmpname ()
        local file = io.open (name, "wb")
        file:write (html)
        file:close ()
        html = pipe_read ("(gzip -dc "..name.." || cat "..name..") 2&gt;/dev/null")
        os.remove (name)
        return html
    end

                .
                .</tt></pre>
</div></div>
<h4>Printing</h4>
<p>Printing a web page with ELinks usually involves quite a few steps: Save the
current document onto disk.  Run it through ELinks on the command-line (so it
fits into 80 columns) to generate a plain text version.  Remove the 80th
column from the text version, as it will make printers wrap down to the next
line.  Finally, run the processed file through `lpr', then delete it.</p>
<p>The following functions allow you to print web pages directly from ELinks,
using <tt>lpr' or `enscript'.  Type `lpr()</tt> or <tt>enscript()</tt> in the Lua Console to
run them.  (In the <tt>hooks.lua</tt>, I have also made it so you can just type <tt>lpr</tt>
or <tt>enscript</tt>.)</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">The <tt>io.popen</tt> function is not available on all platforms.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content">
<pre><tt>function pipe_formatted_to (program)
    local lp, errmsg = io.popen (program, "w")
    if lp == nil then
        error (errmsg)
    else
        lp:write (current_document_formatted (79))
        lp:close ()
    end
end

-- Send the current document to `lpr'.
function lpr ()
    pipe_formatted_to ("lpr")
end

-- Send the current document to `enscript'.
function enscript ()
    pipe_formatted_to ("enscript -fCourier8")
end</tt></pre>
</div></div>
<h4>Deferring to Netscape</h4>
<p>If you come across a brain-dead web page that is totally unreadable with
ELinks, you'd probably want to open it with a graphical browser.  The
following function opens the current document in Netscape.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Tip</div>
</td>
<td class="content">You can also use the built-in &#8220;URI passing&#8221; feature for this.</td>
</tr></table>
</div>
<div class="listingblock">
<div class="content">
<pre><tt>-- When starting Netscape: Set to `nil' if you do not want
-- to open a new window for each document.
netscape_new_window = 1

-- Open current document in Netscape.
function netscape ()
    local new = netscape_new_window and ",new_window" or ""
    execute ("( netscape -remote 'openURL("..current_url ()..new..")'"
             .." || netscape '"..current_url ().."' ) 2&gt;/dev/null &amp;")
end</tt></pre>
</div></div>
<h4>Alternative bookmark system</h4>
<p>Many people would like to have a bookmark system with categories (note that
ELinks already supports that, marketing name Hierarchical bookmarks), and also
to be able to view them and search for them in an HTML page.  I have written
an alternative bookmark system (for ELinks), which some people may like better
than the standard bookmark system.</p>
<h4>More ideas</h4>
<ul>
<li>
<p>
The Lua interface needs to be redesigned to provide more flexible, coherent
   and usable interface to the scripts.
</p>
</li>
<li>
<p>
Cliff Cunnington had a neat idea of clipping text that you see in web pages
   (you enter a regexp that will match the start and end of the text you want
   to clip), and saving the text to disk, along with the URL and timestamp.
   This would help if you find that you can't ever remember where you had seen
   a piece of text, or if you want to keep a piece of information but don't
   need to save the entire page.
</p>
</li>
<li>
<p>
People who use download management programs could write a function to send
   the current link to their favourite downloading program.
</p>
</li>
<li>
<p>
If you wrote a small C program to put text into the X11 selection
   clipboard, you could pass the current link or URL to that program, to make
   it easier to paste URLs into other windows.  It might be possible to do the
   same with GPM, or the KDE/GNOME equivalents.
</p>
</li>
<li>
<p>
Send the current page to Babelfish for translation.
</p>
</li>
<li>
<p>
Look for stupid JavaScript URLs and convert them to something usable.
</p>
</li>
<li>
<p>
More things are possible, I'm sure.  If you have an idea that requires
   another hook or function, contact me (Peter Wang) and I'll see what I can
   do.
</p>
</li>
</ul>
</div>
<h2><a id="smjs-scripting"></a>Scripting ELinks with ECMAScript</h2>
<div class="sectionbody">
<p>As a user of ELinks, you can control its behaviour by writing scripts
in ECMAScript.  Unlike <a href="#ecmascript">scripts in SCRIPT elements of HTML</a>, these user scripts run with all the permissions of your user
account, the same as with <a href="#lua-scripting">Lua</a>.  The object model is
very different too.</p>
<p>Support for ECMAScript user scripts was first added in ELinks 0.11.0.
The <tt>configure</tt> script enables it by default if the required SpiderMonkey
library has been installed, but you can disable it with <tt>configure
--disable-sm-scripting</tt> or by <a href="#CONFIG-SCRIPTING-SPIDERMONKEY">editing features.conf</a>.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Warning</div>
</td>
<td class="content">ECMAScript scripting is still a bit experimental: there seem to be
ways to crash ELinks with it, and the object model may change.  However, if
you don't have a <tt>hooks.js</tt> file, there is not much risk in enabling the
feature at compile time.</td>
</tr></table>
</div>
<p>When ELinks starts up, it evaluates the ECMAScript file <tt>hooks.js</tt> in
your ELinks configuration directory (thus normally <tt>~/.elinks/hooks.js</tt>
on Unix-like systems), or if the file does not exist there, then in
the system-wide ELinks configuration directory (the location depends
on how ELinks was built, but <tt>/etc/elinks/hooks.js</tt> is typical).</p>
<p>In the ELinks source tree, the <tt>contrib/smjs</tt> directory contains some
examples about scripting ELinks with ECMAScript.  Please see the
<tt>README</tt> file in that directory for details.</p>
<h3><a id="smjs-global-object"></a>Global Object</h3>
<p>The global object provided to ECMAScript user scripts contains the standard
ECMAScript classes, as well as the following:</p>
<h4><a id="smjs-global-methods"></a>Global Object Methods</h4>
<dl>
<dt>
<a id="smjs-global.do_file"></a> do_file(path)
</dt>
<dd>
<p>
        Load and evaluate the file with the given path (string). For example:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>do_file("/home/me/.elinks/hooks.js");</tt></pre>
</div></div>
<p>will reload your hooks file.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
</dl>
<h4><a id="smjs-global-properties"></a>Global Object Properties</h4>
<dl>
<dt>
<a id="smjs-global.elinks"></a> elinks (elinks)
</dt>
<dd>
<p>
        A reference to the <a href="#smjs-elinks-object">ELinks object</a>.
</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
</dl>
<h3><a id="smjs-elinks-object"></a>ELinks Object</h3>
<p>The global <a href="#smjs-global.elinks"><em>elinks</em></a> property refers to this object.</p>
<h4><a id="smjs-elinks-methods"></a>ELinks Object Methods</h4>
<dl>
<dt>
<a id="smjs-elinks.alert"></a> elinks.alert(message)
</dt>
<dd>
<p>
        Display the given message (string) in a message box. For example:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.alert("Hello, world!");</tt></pre>
</div></div>
<p>will display a friendly greeting.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
<dt>
<a id="smjs-elinks.execute"></a> elinks.execute(command)
</dt>
<dd>
<p>
        Execute the given command (string) on the current terminal.
        For example:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>var quoted_uri = "'" + elinks.location.replace(/'/g, "'\\''") + "'";
elinks.execute("firefox " + quoted_uri);</tt></pre>
</div></div>
<p>will run Firefox with the URI of the current document.</p>
<p><strong>Compatibility:</strong> ELinks 0.12pre1</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Warning</div>
</td>
<td class="content">One must be very careful with <em>elinks.execute</em>, because depending
on the OS, the command may be subject to interpretation by a command
shell language. When constructing the command string, be sure to quote
any dubious parts (such as the URI of the current document, as above).</td>
</tr></table>
</div>
</dd>
<dt>
<a id="smjs-elinks.load_uri"></a> elinks.load_uri(uri, callback)
</dt>
<dd>
<p>
        Load the given URI (string). When the URI completes loading, ELinks
        calls the given callback (function). The callback is passed the
        <a href="#smjs-cache_entry-object">cache object</a> that corresponds to the URI.
        For example:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.load_uri("http://www.eldar.org/cgi-bin/fortune.pl?text_format=yes",
                function (cached) { elinks.alert(cached.content); });</tt></pre>
</div></div>
<p>displays a fortune.</p>
<p>The <a href="#smjs-cache_entry-object">cache object</a> will not expire until after the
callback returns.</p>
<p><strong>Compatibility:</strong> ELinks 0.12pre1</p>
</dd>
</dl>
<h4><a id="smjs-elinks-properties"></a>ELinks Object Properties</h4>
<dl>
<dt>
<a id="smjs-elinks.home"></a> elinks.home (string)
</dt>
<dd>
<p>
        ELinks's &#8220;home&#8221; directory, where it stores its configuration files.
        Read-only. For example,
</p>
<div class="listingblock">
<div class="content">
<pre><tt>do_file(elinks.home + "hooks.js");</tt></pre>
</div></div>
<p>will reload your hooks file.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
<dt>
<a id="smjs-elinks.location"></a> elinks.location (string)
</dt>
<dd>
<p>
        The URI of the currently open document. This can be read to get a
        string with the URI or set to load a different document.
        For example,
</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.location = elinks.location + "/..";</tt></pre>
</div></div>
<p>will go up a directory (if the URI doesn't end in a file).</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
<dt>
<a id="smjs-elinks.bookmarks"></a> elinks.bookmarks (hash)
</dt>
<dd>
<p>
        This is a hash, the elements of which correspond to the bookmarks.
        One can delve into the bookmarks hierarchy in a reasonably nifty
        fashion, just by using standard ECMAScript syntax:
</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.bookmarks.x.children.y.children.z.children.foo.title</tt></pre>
</div></div>
<p>gets the title of the bookmark titled &#8220;foo&#8221; under the folder &#8220;z&#8221;,
which is a subfolder of &#8220;y&#8221;, which is a subfolder of &#8220;x&#8221;.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
<p><a id="smjs-bookmark-properties"></a>A bookmark object has these properties:</p>
<dl>
<dt>
<a id="smjs-bookmark.title"></a> item.title (string)
</dt>
<dd>
<p>
        This is the title of the bookmark. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-bookmark.url"></a> item.url (string)
</dt>
<dd>
<p>
        This is the URI of the bookmark. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-bookmark.children"></a> item.children (hash)
</dt>
<dd>
<p>
        This is a hash, the elements of which are the bookmarks that
        are children to the item. It is read-only.
</p>
</dd>
</dl>
</dd>
<dt>
<a id="smjs-elinks.globhist"></a> elinks.globhist (hash)
</dt>
<dd>
<p>
        This is a hash, the elements of which correspond to entries in ELinks's
        global history. The hash is indexed by URI. For example,
</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.globhist["file:///"]</tt></pre>
</div></div>
<p>will get you the history item for your root directory.</p>
<p><strong>Compatibility:</strong> ELinks 0.12pre1</p>
<p><a id="smjs-global_history_item-properties"></a>A history item has these properties:</p>
<dl>
<dt>
<a id="smjs-global_history_item.title"></a> item.title (string)
</dt>
<dd>
<p>
        This is the title of the history item. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-global_history_item.url"></a> item.url (string)
</dt>
<dd>
<p>
        This is the URI of the history item. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-global_history_item.last_visit"></a> item.last_visit (number)
</dt>
<dd>
<p>
        This is the UNIX time of the last visit time for the item. UNIX time
        is the number of seconds that have passed between the UNIX epoch
        (which is 1970-01-01 00:00:00 UTC) and the represented time. Note that
        this is <em>seconds</em> since the epoch, whereas ECMAScript likes to use
        <em>milliseconds</em> since the epoch. This property can be set or read.
</p>
</dd>
</dl>
</dd>
<dt>
<a id="smjs-elinks.action"></a> elinks.action (hash)
</dt>
<dd>
<p>
        This hash lets you call the built-in actions of ELinks.  For example,
        you can call <tt>elinks.action.auth_manager()</tt> to open the authentication
        manager.  The names of the actions are the same as in elinks.conf or
        in the keybinding manager, except they have underscores instead of
        dashes in order to make them valid ECMAScript identifiers.
</p>
<p><strong>Compatibility:</strong> ELinks 0.12pre1</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">When you read an action function from this hash, ELinks binds it to the
current tab; any later calls to the function throw errors if that tab no
longer has the focus (in its terminal).  This may be changed in a future
version.  It is safest to call the function right away, rather than save it
in a variable and call it later.</td>
</tr></table>
</div>
</dd>
<dt>
<a id="smjs-elinks.keymaps"></a> elinks.keymaps (hash)
</dt>
<dd>
<p>
        This is a hash, the elements of which correspond to ELinks's keymaps.
        Currently, there are three: <em>elinks.keymaps.main</em>, <em>elinks.keymaps.edit</em>,
        and <em>elinks.keymaps.menu</em>. These elements are also hashes, the elements of
        which correspond to bindings. For example, <tt>elinks.keymaps.main["q"]</tt> is
        the binding to the &#8220;q&#8221; key in the main map. These bindings can be read,
        to get the name of the action to which the key is bound, or set to one of:
</p>
<ul>
<li>
<p>
A string with the name of the ELinks action.
</p>
</li>
<li>
<p>
A function, which will thenceforth be called when the key is pressed.
</p>
</li>
<li>
<p>
The string <tt>"none"</tt>, to unbind the key.  You can also use the <tt>null</tt>
  value for this purpose, but that crashes ELinks 0.11.4 and 0.12pre1
  (<a href="http://bugzilla.elinks.cz/show_bug.cgi?id=1027">bug 1027</a>),
  so it may be best to use the string for now.
</p>
</li>
</ul>
<p>For example,</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.keymaps.main["!"] = function () { elinks.alert("Hello!"); }</tt></pre>
</div></div>
<p>binds the &#8220;!&#8221; key in the main map to a function that displays a friendly
alert.</p>
<div class="listingblock">
<div class="content">
<pre><tt>elinks.keymaps.main["/"] = "search-typeahead-text";</tt></pre>
</div></div>
<p>changes the &#8220;/&#8221; key to use the nice typeahead search function instead of
opening that ugly old search dialogue box.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0, unless you use <tt>null</tt>.</p>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">Do not read a function from <a href="#smjs-elinks.action"><em>elinks.action</em></a>,
e.g. <tt>elinks.action.search_typeahead_text</tt>, and place it in a keymap.
ELinks binds such functions to the current tab when the script reads
them from <em>elinks.action</em>, so they will not work right in other tabs.
Use the name of the action instead.</td>
</tr></table>
</div>
</dd>
<dt>
<a id="smjs-elinks.vs"></a> elinks.vs (view_state)
</dt>
<dd>
<p>
        This property refers to the <a href="#smjs-view_state-object">view-state         object</a> for the current document, if any.
</p>
<p><strong>Compatibility:</strong> ELinks 0.12pre1</p>
</dd>
</dl>
<h4><a id="smjs-elinks-hooks"></a>ELinks Object Hooks</h4>
<p>These are actually properties, but a special case: one assigns functions
to them, which functions are called at certain events.</p>
<p>In the ELinks source tree, <tt>contrib/smjs/hooks.js</tt> provides a mechanism
with which multiple scripts can add their functions to the same hooks.
Please see <tt>contrib/smjs/README</tt> for details.</p>
<dl>
<dt>
<a id="smjs-elinks.preformat_html"></a> elinks.preformat_html(cached, vs)
</dt>
<dd>
<p>
        This function is called every time a document is loaded, before the
        document is actually rendered, to give scripts the opportunity to
        modify it. The first parameter is the <a href="#smjs-cache_entry-object">cache         object</a> and the second is the <a href="#smjs-view_state-object">view-state         object</a>.
</p>
<p>The <a href="#smjs-cache_entry-object">cache object</a> will not expire until after this
function returns.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.1 as described.  ELinks 0.11.0 did not provide
the <em>vs</em> argument.</p>
</dd>
<dt>
<a id="smjs-elinks.goto_url_hook"></a> elinks.goto_url_hook(url)
</dt>
<dd>
<p>
        This function is called every time the user enters something in the
        <em>Go to URL</em> box. The url (string) can be modified or not, and the
        returned string is substituted for what the user entered.  If the
        value <tt>false</tt> is returned, the URL is not changed and further hooks
        in ELinks are not run.
</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
<dt>
<a id="smjs-elinks.follow_url_hook"></a> elinks.follow_url_hook(url)
</dt>
<dd>
<p>
        This function is called every time the user tries to load a document,
        whether by following a link, by entering a URI in the Go to URL box,
        by setting <a href="#smjs-elinks.location"><em>elinks.location</em></a>, or whatever.
        It behaves the same as <a href="#smjs-elinks.goto_url_hook"><em>elinks.goto_url_hook</em></a>
        above.
</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
</dd>
</dl>
<h3><a id="smjs-cache_entry-object"></a>Cache Object</h3>
<p>The cache object mentioned in the descriptions of
<a href="#smjs-elinks.load_uri"><em>elinks.load_uri</em></a> and
<a href="#smjs-elinks.preformat_html"><em>elinks.preformat_html</em></a> is a wrapper for the
internal ELinks cache object.  ELinks passes the ECMAScript cache object as an
argument to your ECMAScript function, and keeps the corresponding document in
the cache until the function returns.  After that, ELinks may remove the
document from the cache, even if the function has saved the cache object to
some global variable.  Such an expired cache object does not work but it does
not crash ELinks either.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.0</p>
<h4><a id="smjs-cache_entry-properties"></a>Cache Object Properties</h4>
<dl>
<dt>
<a id="smjs-cache_entry.content"></a> cached.content (string)
</dt>
<dd>
<p>
        This is the content received from the server. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-cache_entry.type"></a> cached.type (string)
</dt>
<dd>
<p>
        This is the MIME type of the cache entry. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-cache_entry.length"></a> cached.length (number)
</dt>
<dd>
<p>
        This is the length of cached.content. It is read-only.
</p>
</dd>
<dt>
<a id="smjs-cache_entry.head"></a> cached.head (string)
</dt>
<dd>
<p>
        This is the header received from the server. It can be read and set.
</p>
</dd>
<dt>
<a id="smjs-cache_entry.uri"></a> cached.uri (string)
</dt>
<dd>
<p>
        This is the URI of the cache entry. It is read-only.
</p>
</dd>
</dl>
<h3><a id="smjs-view_state-object"></a>View-state Object</h3>
<p>The view-state object mentioned in the descriptions of
<a href="#smjs-elinks.preformat_html"><em>elinks.preformat_html</em></a> and
<a href="#smjs-elinks.vs"><em>elinks.vs</em></a> is a wrapper for the internal ELinks view_state
object.  The view state holds information on how the current document is being
displayed.</p>
<p><strong>Compatibility:</strong> ELinks 0.11.1</p>
<h4><a id="smjs-view_state-properties"></a>View-state Object Properties</h4>
<dl>
<dt>
<a id="smjs.view_state.plain"></a> vs.plain (boolean)
</dt>
<dd>
<p>
        Whether the current document is rendered as HTML or displayed
        as plaintext. This can be read and set.
</p>
</dd>
<dt>
<a id="smjs.view_state.uri"></a> vs.uri (string)
</dt>
<dd>
<p>
        This is the URI of the current document. It is read-only.
</p>
</dd>
</dl>
</div>
<div id="footer">
<div id="footer-text">
Last updated 28-Oct-2012 15:02:00 EEST
</div>
</div>
</body>
</html>