File: defun.h

package info (click to toggle)
oleo 1.6-16
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,640 kB
  • ctags: 3,139
  • sloc: ansic: 39,221; yacc: 1,737; sh: 362; makefile: 88
file content (2282 lines) | stat: -rw-r--r-- 66,839 bytes parent folder | download | duplicates (3)
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

#if 0
DEFUN ("enter-string-in-cell",
       FDenter_string_in_cell, FAenter_string_in_cell, 0) /* fixme */
#ifdef FUNC_ARG_STRINGS
"sEnter string for %c? ",
#endif
#ifdef DOC_STRINGS
"Quote STRING appropriately and store it in the current cell.",
"Called interactively, this is a way to store a string in a cell without",
"having to enclose it in quotes.",
#endif
#endif /* NOT USED */

/* squeek squeek */
DEFUN_3 ("mouse-goto", FDmouse_goto, mouse_goto_cmd)
DEFUN_3 ("mouse-mark", FDmouse_mark, mouse_mark_cmd)
DEFUN_3 ("mouse-mark-and-goto",
	 FDmouse_mark_and_goto_cmd, mouse_mark_and_goto_cmd)

#if 0
DEFUN ("sort-region", "tj", sort_region_cmd)
#endif
    



DEFUN_3 ("exit-minibuffer", FDexit_minibuffer, exit_minibuffer)
#ifdef DOC_STRINGS
"Terminate this minibuffer argument.",
"If no valid argument has been given, an error is reported.",
#endif

DEFUN_3 ("break",  FDbreak, 0)
#ifdef DOC_STRINGS
"Abort the current complex command or incomplete keysequence.",
#endif


DEFUN_3 ("universal-argument", FDuniversal_argument, 0)
#ifdef DOC_STRINGS
"Begin a numeric argument for the following command.",
"Digits or minus sign following this command make up the numeric argument.",
"If no digits or minus sign follow, this by itself provides 4 as argument.",
"Used more than once, this command multiplies the argument by 4 each time.",
#endif


DEFUN ("kill-oleo", FDkill_oleo, FAkill_oleo, kill_oleo)
#ifdef FUNC_ARG_STRINGS
"MSpreadsheet modified.  Quit without saving? (yes or no) ",
#endif
#ifdef DOC_STRINGS
"Kill this Oleo.  This does NOT save any files.",
#endif

DEFUN_3 ("redraw-screen", FDredraw_screen, redraw_screen)
#ifdef DOC_STRINGS
"Center the cell cursor in the current window and redisplay the screen.",
#endif

DEFUN_3 ("suspend-oleo", FDsuspend_oleo, suspend_oleo)
#ifdef DOC_STRINGS
"Stop Oleo and return to it's superior process.  Oleo may be resumed.",
#endif


DEFUN ("recalculate", FDrecalculate, FArecalculate, recalculate)
#ifdef FUNC_ARG_STRINGS
"p?",
#endif
#ifdef DOC_STRINGS
"Recompute any cells that need it.  With a prefix arg, recompute all cells.",
#endif

DEFUN ("execute-command",
       FDexecute_command, FAexecute_command, execute_command)
#ifdef FUNC_ARG_STRINGS
"CM-x ",
#endif
#ifdef DOC_STRINGS
"Read command name, then read its arguments and call it.",
#endif

DEFUN ("with-keymap", FAwith_keymap, FDwith_keymap, with_keymap)
#ifdef FUNC_ARG_STRINGS
"SWith which keymap? ",
"m%0",
#endif
#ifdef DOC_STRINGS
"Create a user context in which KEYMAP is the top level keymap.",
"Commands will be read in the context until an exit-minibuffer or",
"break command is executed.",
#endif

DEFUN ("one-command-with-keymap", FAone_cmd_with_keymap,
       FDone_cmd_with_keymap, one_cmd_with_keymap)
#ifdef FUNC_ARG_STRINGS
"SWith which keymap? ",
"m'%0",
#endif
#ifdef DOC_STRINGS
"Create a user context in which KEYMAP is the top level keymap.",
"Commands will be read in the context until an exit-minibuffer or",
"break command is executed.",
#endif




  /* By convention, motion and scrolling commands take a magic number
   * as their first argument.  The number tells which direction to move.
   * 0 == up, 1 == down, etc.
   */
DEFUN ("up-cell", FDup_cell, FAup_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#0",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor up ARG rows.",
#endif
DEFUN ("down-cell", FDdown_cell, FAdown_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#1",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor down ARG rows.",
#endif
DEFUN ("right-cell", FDright_cell, FAright_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#2",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor right ARG cols.",
#endif
DEFUN ("left-cell", FDleft_cell, FAleft_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#3",
"p",
#endif
#ifndef fnord
#define fnord	0
#endif
#ifdef DOC_STRINGS
"Move cursor left ARG cols.",
#endif
DEFUN ("upright-cell", FDupright_cell, FAupright_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#4",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor upright ARG rows and cols.",
#endif
DEFUN ("upleft-cell", FDupleft_cell, FAupleft_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#5",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor upleft ARG rows and cols.",
#endif
DEFUN ("downright-cell", FDdownright_cell, FAdownright_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#6",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor downright ARG rows and cols.",
#endif
DEFUN ("downleft-cell", FDdownleft_cell, FAdownleft_cell, shift_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#7",
"p",
#endif
#ifdef DOC_STRINGS
"Move cursor downleft ARG rows and cols.",
#endif



DEFUN ("goto-cell", FDgoto_cell, FAgoto_cell, goto_cell)
#ifdef FUNC_ARG_STRINGS
"RGoto cell? ",
#endif
#ifdef DOC_STRINGS
"Goto CELL by name.  If a region is given, the upper-left corner is used.",
#endif

DEFUN ("goto-region", FDgoto_region, FAgoto_region, goto_region)
#ifdef FUNC_ARG_STRINGS
"RGoto region? ",
#endif
#ifdef DOC_STRINGS
"Select REGION by name.",
"The cell cursor is moved to the upper left corner, and the mark is placed",
"at the lower right.",
#endif



/* Some interestingly extreme commands. */

DEFUN_3 ("upper-left", FDupper_left, upper_left)
#ifdef DOC_STRINGS
"Move the cell cursor to the first row and column.",
#endif

DEFUN_3 ("lower-left", FDlower_left, lower_left)
#ifdef DOC_STRINGS
"Move the cell cursor to the last filled row and first column.",
#endif

DEFUN_3 ("upper-right", FDupper_right, upper_right)
#ifdef DOC_STRINGS
"Move the cell cursor to the first row and rightmost filled column.",
#endif

DEFUN_3 ("lower-right", FDlower_right, lower_right)
#ifdef DOC_STRINGS
"Move the cell cursor to the last filled row and column.",
#endif

DEFUN ("exchange-point-and-mark", FDexchange_point_and_mark,
       FAexchange_point_and_mark, exchange_point_and_mark)
#ifdef FUNC_ARG_STRINGS
"p?",
#endif
#ifdef DOC_STRINGS
"Mark the current cell, but move the cell cursor to where the mark is now.",
"With a prefix argument, the mark is cleared the the cell curor remains where",
"it is.",
#endif

DEFUN ("mark-cell", FDmark_cell_cmd, FAmark_cell_cmd, mark_cell_cmd)
#ifdef FUNC_ARG_STRINGS
"p?",
#endif
#ifdef DOC_STRINGS
"Mark the current cell. With a prefix arg, pop the mark.",
#endif

DEFUN_3 ("clear-mark", FDclear_mark, unmark_cmd)
#ifdef DOC_STRINGS
"Unset the mark.",
#endif



DEFUN ("scroll-up", FDscroll_up, FAscroll_up, scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#0",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window up ARG rows; or near full screen if no ARG.",
#endif
DEFUN ("scroll-down", FDscroll_down, FAscroll_down, scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#1",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window down ARG rows; or near full screen if no ARG.",
#endif
DEFUN ("scroll-right", FDscroll_right, FAscroll_right, scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#2",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window right ARG cols; or near full screen if no ARG.",
#endif
DEFUN ("scroll-left", FDscroll_left, FAscroll_left, scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#3",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window left ARG cols; or near full screen if no ARG.",
#endif
DEFUN ("scroll-upright", FDscroll_upright, FAscroll_upright,
       scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#4",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window upright ARG row/cols; or a full screen if no ARG.",
#endif
DEFUN ("scroll-upleft", FDscroll_upleft, FAscroll_upleft, scroll_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#5",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window upleft ARG row/cols; or full screen if no ARG.",
#endif
DEFUN ("scroll-downright", FDscroll_downright, FAscroll_downright,
       scroll_cell_cursor) 
#ifdef FUNC_ARG_STRINGS
"+#6",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window downright ARG row/cols; or a full screen w/no ARG.",
#endif
DEFUN ("scroll-downleft", FDscroll_downleft, FAscroll_downleft,
       scroll_cell_cursor) 
#ifdef FUNC_ARG_STRINGS
"+#7",
"p",
#endif
#ifdef DOC_STRINGS
"Scroll the current window downleft ARG row/cols; or a full screen if no ARG.",
#endif


DEFUN ("scan-up", FDscan_up, FAscan_up, scan_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#0",
"p",
#endif
#ifdef DOC_STRINGS
"Move up to the next border between filled and empty cells.",
"With an argument, moves to the Nth border.",
#endif
DEFUN ("scan-down", FDscan_down, FAscan_down, scan_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#1",
"p",
#endif
#ifdef DOC_STRINGS
"Move down to the next border between filled and empty cells.",
"With an argument, moves to the Nth border.",
#endif
DEFUN ("scan-right", FDscan_right, FAscan_right, scan_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#2",
"p",
#endif
#ifdef DOC_STRINGS
"Move right to the next border between filled and empty cells.",
"With an argument, moves to the Nth border.",
#endif
DEFUN ("scan-left", FDscan_left, FAscan_left, scan_cell_cursor)
#ifdef FUNC_ARG_STRINGS
"+#3",
"p",
#endif
#ifdef DOC_STRINGS
"Move left to the next border between filled and empty cells.",
"With an argument, moves to the Nth border.",
#endif


DEFUN ("beginning-of-row",
       FDbeginning_of_row, FAbeginning_of_row, beginning_of_row)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move point to beginning of the current row.",
"With a prefix argument, move forward ARG - 1 rows first.",
#endif
DEFUN ("beginning-of-col",
       FDbeginning_of_col, FAbeginning_of_col, beginning_of_col)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move point to beginning of the current col.",
"With a prefix argument, move forward ARG - 1 cols first.",
#endif

DEFUN ("end-of-row", FDend_of_row, FAend_of_row, end_of_row)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move point to end of the current row.",
"With a prefix argument, move forward ARG - 1 rows first.",
#endif
DEFUN ("end-of-col", FDend_of_col, FAend_of_col, end_of_col)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move point to end of the current col.",
"With a prefix argument, move forward ARG - 1 cols first.",
#endif


  
DEFUN_3 ("start-entering-macro", FDstart_entering_macro, start_entering_macro)
#ifdef DOC_STRINGS
"Record subsequent keyboard input, defining a keyboard macro.",
"The commands are recorded even as they are executed.",
"Use [stop-entering-macro] to finish recording and make the macro available.",
"Use [store-last-macro] to record the macro in a spreadsheet cell.",
#if 0
Should support this:
Non-nil arg (prefix arg) means append to last macro defined;
This begins by re-executing that macro as if you typed it again.
#endif
#endif

DEFUN_3 ("stop-entering-macro", FDstop_entering_macro, stop_entering_macro)
#ifdef DOC_STRINGS
"Finish defining a keyboard macro.",
"The definition was started by [start-entering-macro]",
"The macro is now available for use via [call-last-kbd-macro]",
"or it can be given a name with [store-last-macro] and then invoked",
"by passing it's cell address to [execute-command].",
#if 0
"With numeric arg, repeat macro now that many times,",
"counting the definition just completed as the first repetition.",
#endif
#endif

DEFUN ("call-last-kbd-macro", FDcall_last_kbd_macro,
       FAcall_last_kbd_macro, call_last_kbd_macro)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Call the last keyboard macro that you defined with [start-entering-macro].",
"To make a macro permanent so you can call it even after",
"defining others, use [store-last-macro].",
#endif

DEFUN_3 ("end-macro", FDend_macro, end_macro)
#ifdef DOC_STRINGS
"This function is for internal use only.",
"Oleo executes this command as part of the process of executing a kbd  macro.",
#endif

DEFUN ("store-last-macro",
       FDstore_last_macro, FAstore_last_macro, store_last_macro) 
#ifdef FUNC_ARG_STRINGS
"rStore at? ",
#endif
#ifdef DOC_STRINGS
"Saves the most recently defined keyboard macro in a spreadsheet cell.",
"The sole argument is the cell address at which to store the macro.",
"Thereafter, that cell address is a valid argument to [execute-command].",
#endif

DEFUN ("run-string-as-macro",
       FDrun_string_as_macro, FArun_string_as_macro, run_string_as_macro)
#ifdef FUNC_ARG_STRINGS
"sRun macro string: ",
#endif
#ifdef DOC_STRINGS
"Execute STRING as a keyboard macro.",
#endif

DEFUN ("name-macro-string",
       FDname_macro_string, FAname_macro_string, name_macro_string)
#ifdef FUNC_ARG_STRINGS
"SName for macro? ",
"sMacro %s? ",
#endif
#ifdef DOC_STRINGS
"Assign NAME to MACRO.",
"The name functions like any interactive command name.",
"When invoked, the command executes the macro string, using the prefix",
"as a repeat count.",
#endif



DEFUN_3 ("show-options", FDshow_options, show_options)
#ifdef DOC_STRINGS
"Show the current state of all the spreadsheet options.",
"Also shows the current definitions for all the user-defined variables.",
#endif

DEFUN ("set-option", FDset_option, FAset_option, set_options)
#ifdef FUNC_ARG_STRINGS
"sSet option? ",
#endif
#ifdef DOC_STRINGS
"Change the value of a user-controlled option.",
"",
"Currently Supported Options:",
"",
"(no)a0		In a0 mode, Oleo uses cell-addresses like `A1'.",
"		In noa0 mode, Oleo uses `R1C1' style addresses.",
"",
"(no)auto	In auto mode, cells whose values may have chaged are",
"		automatically recalculated.  In noauto mode, cells are only",
"		recalculated when the recalculate command is used.",
"",
"(no)background	In background mode, automatic recalculation is done while",
"(no)bkgrnd	the spreadsheet waits for you to type a key (and stops while",
"		the key is being handled).  In nobackground mode, Oleo",
"		performs all its recalculation before listening for",
"		keystrokes.",
"",
"(no)backup	In backup mode, whenever the spreadsheet writes out a file,",
"		if the file already exists, a backup copy is made (similarly",
"		to Emacs).",
"",
"(no)bkup_copy	In nobackup mode bkup_copy is ignored.  In bkup_copy mode,",
"		backup files are made by copying the original file, instead",
"		of renaming it.",
"",
"ticks (number)	This value controls how often, in seconds, time-dependant",
"		formulas are reevaluated.",
"",
"print (number)	This is the width of the page for the print command.",
"		The default value is the width of the screen.",
"",
"file (format-name)  This sets format Oleo will use when reading and writing",
"		spreadsheet files.  Valid format names are:",
"		 oleo		- The default (and supported) format.",
"		 sylk		- A partial implementation of a std. format.",
"		 sc		- partial SC compatability.  This is buggy.",
"		 list		- An ascii (lines of fields) format.",
"				  This is not a complete file format",
"				  but may be useful for importing/exporting",
"				  data.",
"",
"list ch	Use the character CH to separate the cell values when using ",
"		the `list' file format.",
"",
"status (n)	This option controls which line on the screen is used for",
"		displaying the status of the current cell.  The number may be",
"		positive, (counting down from the top), negative (counting up",
"		from the bottom, or zero (disabling the status line).",
"",
"input (n)	This option controls which line on the screen is used for",
"		reading lines of text.  The number may be positive (counting",
"		down from the top), or negative (counting up from the",
"		bottom), but not zero.",
"",
"The following options affect the currently active window:",
"",
"(no)page	In page mode, whenever a paticular cell is",
"		displayed in the window, it will always be in the same",
"		location on the screen.  In page mode, the recenter command",
"		acts just like the redraw-screen command.",
"",
"(no)pageh	These options turns on or off page mode only in",
"(no)pagev	the horizontal or vertical axis.",
"",
"(no)lockh	These options prevent the cell cursor in the current window",
"(no)lockv	from moving in the horizontal or vertical direction, but only",
"		when the cell cursor is moved in a window that this one is",
"		linked.",
"",
"",
"(no)edges	In edges mode oleo displays Row and Column numbers at the top",
"		and left edges of the window.  Perhaps edges should be split",
"		into edgeh and edgev?",
"",
"(no)standout	In standout mode, the edges (see (no)edges) are drawn in",
"		standout mode (reverse video, usually).",
#endif



DEFUN ("show-variable", FDshow_variable, FAshow_variable, show_var)
#ifdef FUNC_ARG_STRINGS
"SShow Variable? ",
#endif
#ifdef DOC_STRINGS
"Report the current binding of a user-defined variable.",
"Variables can be defined using the [set-variable].",
#endif
      
DEFUN_3 ("show-all-variables", FDshow_all_variables, show_all_var)
#ifdef DOC_STRINGS
"Report the current bindings of all user-defined variables.",
"Variables can be defined using the [set-variable].",
#endif

DEFUN ("set-variable", FDset_var, FAset_var, set_var)
#ifdef FUNC_ARG_STRINGS
"SSet Variable? ",
"sSet %0 to? ",
#endif
#ifdef DOC_STRINGS
"Change the binding of a user-defined variable.",
"Variables can be bound to cells or ranges of cells, and then referenced",
"in formulas wherever a cell or range reference is allowed.",
"If no new binding is given, then the variable becomes unbound.",
#endif



DEFUN ("create-keymap", FDcreate_keymap, FAcreate_keymap, create_keymap)
#ifdef FUNC_ARG_STRINGS
"SCreate Kemap? ",
"S'Parent map? ",
#endif
#ifdef DOC_STRINGS
"Create a new keymap given it's NAME and PARENT.",
"",
"A keymap is a mapping from characters to commands and keymap.  As you type",
"characters to Oleo, keymaps are used to decide how to interpret your",
"keystrokes.  Emacs users are familiar with this concept, but should note",
"that Oleo keymaps do not behave quite like Emacs keymaps.",
"",
"Every keymap has a (unique) name.  That name is used, for example, as an",
"argument to the bind-key command.",
"",
"Every keymap has a parent map that is searched for bindings of keys that",
"are otherwise undefined.  In other words, every keymap inherits bindings",
"from some other keymap.  The keymap `universal' is at the root of the ",
"inheritence tree.",
#endif

DEFUN ("set-map-prompt", FDset_map_prompt, FAset_map_prompt, set_map_prompt)
#ifdef FUNC_ARG_STRINGS
"KSet prompt for keymap? ",
"sPrompt for %1? ", 
#endif
#ifdef DOC_STRINGS
"Set the prompt for KEYMAP to STRING.",
"When KEYMAP is the current keymap, the prompt is displayed in the input",
"area.",
#endif


DEFUN ("bind-key", FDbind_key, FAbind_key, bind_key)
#ifdef FUNC_ARG_STRINGS
"KKeymap? ",
"SCommand? ",
"cCharacter? ",
#endif
#ifdef DOC_STRINGS
"In KEYMAP, make COMMAND the binding of KEY.",
"COMMAND may be the name of an interactive function, the address of a macro,",
"or the name of another keymap.",
#endif

DEFUN ("bind-set", FDbind_set, FAbind_set, bind_set)
#ifdef FUNC_ARG_STRINGS
"KKeymap? ",
"SCommand? ",
"sCharacters? ",
#endif
#ifdef DOC_STRINGS
"In KEYMAP, make COMMAND the binding of all chars in KEYSET.",
"COMMAND may be the name of an interactive function, the address of a macro,",
"or the name of another keymap.  Keyset should be two characters, separated",
"by a `-', for example:",
"	bind-set main begin-edit a-z",
#endif

DEFUN ("bind-all-keys", FDbind_all_keys, FAbind_all_keys, bind_all_keys)
#ifdef FUNC_ARG_STRINGS
"KKeymap? ",
"SCommand? ",
#endif
#ifdef DOC_STRINGS
"In KEYMAP, bind every character to COMMAND.",
"COMMAND may be the name of an interactive function, the address of a macro,",
"or the name of another keymap.",
#endif

DEFUN ("write-keys", FDwrite_keys_cmd, FAwrite_keys_cmd, write_keys_cmd)
#ifdef FUNC_ARG_STRINGS
"fwWrite bindings to file? ",
#endif
#ifdef DOC_STRINGS
"Write a list of commands that recreate the current keybindings to FILE.",
"This command is of limited utility and will probably go away or be",
"changed considerably.  It is a way to generate a list of bindings, though.",
#endif




DEFUN ("write-variables",
       FDwrite_variables, FAwrite_variables, write_variables)
#ifdef FUNC_ARG_STRINGS
"fwWrite variables to file? ", 
#endif
#ifdef DOC_STRINGS
"Use variable names to construct a shell script to FILE.",
"This command looks for all variables that are bound to a single",
"cell (rather than to a range).  It writes a shell script that assigns",
"the value of that cell to a shell variable.  For example, if the",
"variable `w2_exemptions' is bound to cell R2C3, and that cell contains",
"the value `2', then the output of write-variables will include a line:",
"	w2_exemptions=2",
"",
"This command is of limited utility, but was implemented as part of a crude",
"system of forms generation.",
#endif

DEFUN ("read-variables", FDread_variables, FAread_variables, read_variables)
#ifdef FUNC_ARG_STRINGS
"frRead variables from file? ",
#endif
#ifdef DOC_STRINGS
"Read cell values from a FILE.",
"The syntax for the contents of FILE is <var>=<value>, e.g.:",
"	w2_exemptions=2",	
"For each assignment, if a variable with the given name is bound to a cell,",
"the value is assigned to that cell.  See also, write-variables.",
#endif



DEFUN ("read-commands", FDread_cmds_cmd, FAread_cmds_cmd, read_cmds_cmd)
#ifdef FUNC_ARG_STRINGS
"frRead commands from file? ",
#endif
#ifdef DOC_STRINGS
"Read Oleo commands from FILE.",
"The syntax for a command is a command name followed by a whitespace",
"separated list arguments.  For example: ",
"	bind-key main next-row ^n",
"Blank lines and lines that begin with `#' are ignored.",
"Lines may be continuted by preceeding the final newline with an",
"odd number of `\\' characters.  One backslash and the newline will",
"be discarded.",
#endif



DEFUN_5 ("save-spreadsheet", FDwrite_cmd, FAwrite_cmd, DFwrite_cmd, write_cmd)
#ifdef FUNC_ARG_STRINGS
"fwSave spreadsheet? ",
"=%0",
#endif
#ifdef FUNC_INIT_CODE
"{insert-current-filename}",
0,
#endif
#ifdef DOC_STRINGS
"Save the spreadsheet to FILENAME.",
#endif

DEFUN ("toggle-load-hooks",
       FDtoggle_load_hooks, FAtoggle_load_hooks, toggle_load_hooks)
#ifdef FUNC_ARG_STRINGS
"p?",
#endif
#ifdef DOC_STRINGS
"Change whether load-hooks are run when spreadsheets are loaded.",
"When active, the find-alternate-spreadsheet command looks for a variable",
"called `load_hooks' and executes the macro at that address.",
"With a positive prefix argument, turns load hooks on.  With a negative",
"argument, turns them off.  With no argument, acts as a toggle.",
#endif

DEFUN_5 ("find-alternate-spreadsheet",
	 FDread_cmd, FAread_cmd, DFread_cmd, read_cmd)
#ifdef FUNC_ARG_STRINGS
"frFind alternate spreadsheet? ",
"MSpreadsheet modified;  kill anyway? (yes or no) ",
"=%0",
#endif
#ifdef FUNC_INIT_CODE
"{insert-current-filename}",
0,
0,
#endif
#ifdef DOC_STRINGS
"Replace the currently loaded spreadsheet with the contents of FILE.",
#endif

DEFUN ("merge-spreadsheet",
       FDread_merge_cmd, FAread_merge_cmd, read_merge_cmd)
#ifdef FUNC_ARG_STRINGS
"frMerge spreadsheet? ",
"MSpreadsheet modified; merge anyway? (yes or no) ",
#endif
#ifdef DOC_STRINGS
"Combine the spreadsheet in FILE with the current spreadsheet.",
"This reads a new spreadsheet without clearing all cells first.",
#endif
    
DEFUN ("write-region-to-file",
       FDwrite_reg_cmd, FAwrite_reg_cmd, write_reg_cmd)
#ifdef FUNC_ARG_STRINGS
"rWrite region? ",
"fwWrite region to file? ",
#endif
#ifdef DOC_STRINGS
"Write the cells in RANGE to FILE using the current file format.",
"This command also writes all variables that with bindings entirely",
"inside of RANGE.",
#endif



DEFUN ("copy-region", FDcopy_region, FAcopy_region, copy_region)
#ifdef FUNC_ARG_STRINGS
"rCopy region? ",
"RCopy %0 to? ",
#endif
#ifdef DOC_STRINGS
"Copy the contents of SOURCE-RANGE to DEST-RANGE.",
"DEST-RANGE must be either a single cell (the upper-left corner of the",
"destination), or a range containing the same number of cells as the",
"source range.",
#endif
    
DEFUN ("copy-values-in-region",
       FDcopy_values_region, FAcopy_values_region, copy_values_region)
#ifdef FUNC_ARG_STRINGS
"rCopy values in region? ",
"RCopy values in %0 to:",
#endif
#ifdef DOC_STRINGS
"Copy the values of the cells in SOURCE-RANGE to DEST-RANGE.",
"DEST-RANGE must be either a single cell (the upper-left corner of the",
"destination), or a range containing the same number of cells as the",
"source range.",
#endif
    
DEFUN ("move-region",
       FDmove_region, FAmove_region, move_region)
#ifdef FUNC_ARG_STRINGS
"rMove region? ",
"RMove region %0 to? ",
#endif
#ifdef DOC_STRINGS
"Move the contents of SOURCE-RANGE to DEST-RANGE.",
"DEST-RANGE must be either a single cell (the upper-left corner of the",
"destination), or a range containing the same number of rows and columns",
"as the source range.",
"",
"This command makes adjustments to all formulas in the range as well as to",
"formulas and variable bindings that refer to the range.",
#endif
    
DEFUN ("insert-row", FDinsert_row, FAinsert_row, insert_row)
#ifdef FUNC_ARG_STRINGS
"+p",
#endif
#ifdef DOC_STRINGS
"Insert ARG empty rows.",
#endif

DEFUN ("insert-col", FDinsert_col, FAinsert_col, insert_col)
#ifdef FUNC_ARG_STRINGS
"+p",
#endif
#ifdef DOC_STRINGS
"Insert ARG empty cols.",
#endif

DEFUN ("delete-row", FDdelete_row, FAdelete_row, delete_row)
#ifdef FUNC_ARG_STRINGS
"+p",
#endif
#ifdef DOC_STRINGS
"Delete ARG rows.",
#endif

DEFUN ("delete-col", FDdelete_col, FAdelete_col, delete_col)
#ifdef FUNC_ARG_STRINGS
"+p",
#endif
#ifdef DOC_STRINGS
"Delete ARG cols.",
#endif



/* Commands for editing cells. */

DEFUN ("edit-cell", FDedit_cell, FAedit_cell, edit_cell)
#ifdef FUNC_ARG_STRINGS
"$Set %c to? ", 
#endif
#ifdef DOC_STRINGS
"Assign FORMULA to the current cell.",
#endif

DEFUN ("set-cell", FDset_cell, FAset_cell, edit_cell)
#ifdef FUNC_ARG_STRINGS
"$'Set %c to? ", 
#endif
#ifdef DOC_STRINGS
"Assign FORMULA to the current cell.",
#endif

DEFUN ("auto-move-up", FDauto_move_up, FAauto_move_up,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#0",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `up'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-down", FDauto_move_down, FAauto_move_down,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#1",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `down'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-left", FDauto_move_left, FAauto_move_left,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#3",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `left'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-right", FDauto_move_right, FAauto_move_right,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#2",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `right'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-up-left", FDauto_move_up_left, FAauto_move_up_left,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#5",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `up left'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-up-right", FDauto_move_up_right, FAauto_move_up_right,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#4",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `up right'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-down-left", FDauto_move_down_left, FAauto_move_down_left,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#7",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `down left'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-down-right", FDauto_move_down_right, FAauto_move_down_right,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#6",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `down right'.",
"This is the direction that will be used by the next-edit command.",
#endif


DEFUN ("auto-move-no-motion", FDauto_move_no_motion, FAauto_move_no_motion,
       set_auto_direction)
#ifdef FUNC_ARG_STRINGS
"#8",
#endif
#ifdef DOC_STRINGS
"Set the auto-move direction to `no motion'.",
"This is the direction that will be used by the next-edit command.",
#endif

DEFUN_3 ("auto-move", FDauto_move, auto_move)
#ifdef DOC_STRINGS
"Move one cell in the automatic motion direction.",
"The automatic motion direction is set using one of the commands: ",
"	[auto-move-up]  auto-move-up",
"	[auto-move-down]  auto-move-down",
"	[auto-move-left]  auto-move-left",
"	[auto-move-right]  auto-move-right",
"	[auto-move-up-left]  auto-move-up-left",
"	[auto-move-up-right]  auto-move-up-right",
"	[auto-move-down-left]  auto-move-down-left",
"	[auto-move-down-right]  auto-move-down-right",
#endif

DEFUN_3 ("auto-next-set", FDauto_next_set, auto_next_set)
#ifdef DOC_STRINGS
"Scan in the opposite direction of automatic motion, then move one cell.",
"The direction of the one-cell motion is down for left or right",
"automatic motion, and to the right otherwise.  See also, `auto-move'.",
#endif

DEFUN ("next-edit", FDnext_edit, FAnext_edit, run_string_as_macro)
#ifdef FUNC_ARG_STRINGS
"={exit-minibuffer}{auto-move}{edit-cell}",
#endif
#ifdef DOC_STRINGS
"Equivalent to: {exit-minibuffer}{auto-move}{edit-cell}",
"This command is used to terminate an edit-cell command, move to another",
"cell, and begin a second edit-cell command.  See also `auto-move'.",
#endif

DEFUN ("next-edit-set", FDnext_edit_set, FAnext_edit_set, run_string_as_macro)
#ifdef FUNC_ARG_STRINGS
"={exit-minibuffer}{auto-next-set}{edit-cell}",
#endif
#ifdef DOC_STRINGS
"Equivalent to: {exit-minibuffer}{auto-next-set}{edit-cell}",
"This command is used to terminate an edit-cell command, move to another",
"cell, and begin a second edit-cell command.  See also `auto-next-set'.",
#endif



DEFUN ("goto-edit-cell",
       FDgoto_edit_cell, FAgoto_edit_cell, goto_edit_cell)
#ifdef FUNC_ARG_STRINGS
"l",
#endif
#ifdef DOC_STRINGS
"Begin to edit the current cell's formula.",
"The last character used to invoke this command is reexecuted as a",
"formula editing command.",
#endif

DEFUN ("set-region-formula",
       FDset_region_formula, FAset_region_formula, set_region_formula)
#ifdef FUNC_ARG_STRINGS
"rSet region? ",
"$Set region %0 to? ",
#endif
#ifdef DOC_STRINGS
"Change the definition of all cells in RANGE to FORMULA.",
#endif

    


DEFUN_3 ("delete-cell", FDdelete_cell, kill_cell_cmd)
#ifdef DOC_STRINGS
"Erase the formula, font and format of the current cell.",
#endif

DEFUN ("delete-region", FDdelete_region, FAdelete_region, delete_region)
#ifdef FUNC_ARG_STRINGS
"rDelete region? ",
#endif
#ifdef DOC_STRINGS
"Erase the formulas, fonts and formats of the cells in RANGE.",
#endif

DEFUN ("clear-spreadsheet",
       FDclear_spreadsheet, FAclear_spreadsheet, kill_all_cmd) 
#ifdef FUNC_ARG_STRINGS
"MSpreadsheet modified;  clear anyway? (yes or no) ",
#endif
#ifdef DOC_STRINGS
"Erase all cells, reset all column widths and row heights.",
#endif



DEFUN ("print-region", FDprint_region, FAprint_region, print_region)
#ifdef FUNC_ARG_STRINGS
"rRegion? ",
"fwPrint to file? ",
#endif
#ifdef DOC_STRINGS
"Print (in ascii) the contents of REGION to FILE.",
#endif

DEFUN ("psprint-region",
       FDpsprint_region, FApsprint_region, psprint_region_cmd)
#ifdef FUNC_ARG_STRINGS
"rPrint region? ",
"fwWrite EPS to file? ",
#endif
#ifdef DOC_STRINGS
"Print the contents of REGION (in PostScript) to FILE.",
#endif

DEFUN ("set-page-size", FDset_page_size, FAset_page_size, set_page_size_cmd)
#ifdef FUNC_ARG_STRINGS
"sSet page size? ",
#endif
#ifdef DOC_STRINGS
"Use PAGESIZE when printing PostScript.",
"PAGESIZE may take the following forms:",
"	8.5x11		-- a page size in inches.",
"	22x28c		-- a page size in centimeters",
"	612x792p	-- a page size in points",
"or any of number of symbolic names? ",
"	letter		-- 8.5 x 11 in.",
"	landscape	-- 11 x 8.5 in.",
"	etc.",
"To see a complete list of availble names, see the Oleo source file",
"`print.c'.",
#endif

DEFUN ("set-default-ps-font",
       FDset_ps_font_cmd, FAset_ps_font_cmd, set_ps_font_cmd)
#ifdef FUNC_ARG_STRINGS
"sSet default postscript font? ",
#endif
#ifdef DOC_STRINGS
"Make FONT the default postscript font.",
"FONT should be a valid postscript font name (e.g. TimesRoman). That font",
"will be used to print all cells with no explicitly defined font.",
#endif
    


DEFUN ("set-default-x-font",
       FDset_default__x_font, FAset_default_x_font, set_x_default_font)
#ifdef FUNC_ARG_STRINGS
"sSet default X11 font? ",
#endif
#ifdef DOC_STRINGS
"Make FONT the default X11 font.",
"FONT should be a valid X11 font name, with the point size wildcarded.",
"For example: ",
"		*times-medium-r-*",
"",
"This will be used to display all cells with no explicitly defined font.",
#endif

#ifndef X_DISPLAY_MISSING
DEFUN ("set-default-point-size", FDset_x_default_point_size,
       FAset_x_default_point_size, set_x_default_point_size)
#ifdef FUNC_ARG_STRINGS
"NSet default point size? ",
#endif
#ifdef DOC_STRINGS
"Set the default point size of cell text under X11 to ARG.",
"Presuming that properly wildcarded font names have been used",
"This causes all other fonts to be scaled accordingly.",
#endif

#endif

DEFUN ("define-font", FDdefine_font, FAdefine_font, define_font)
#ifdef FUNC_ARG_STRINGS
"wDefine font name? ",
"wX11 name for %0? ",
"wPostscript name for %0? ",
#endif
#ifdef DOC_STRINGS
"Define the font OLEONAME to correspond to X11NAME and POSTSCRIPTNAME.",
"",
"The Oleo name of a font is used with commands like set-region-font.",
"It should be easy to type and to remember, for example: ",
"",
"		times",
"",
"To achieve the best results, the X11 font name should leave the",
"pointsize wild-carded.  For example: ",
"",
"		*times-medium-r-*",
"",
"The postscript name should be a font name acceptable to your printer.",
"For example:",
"",
"		TimesRoman",
"",
#endif




DEFUN ("set-x-default-font",
       FDset_x_def_font, FAset_x_def_font, set_x_default_font)
#ifdef FUNC_ARG_STRINGS
"sX11 font specification? ",
#endif
#ifdef DOC_STRINGS
"Set the X11 name of the default font.",
"The name should be a valid X11 font name, preferably with the point",
"size wild-carded, for example:",
"",
"		*times-medium-r-*",
#endif


DEFUN_5 ("set-cell-font", FDset_cell_font, FAset_cell_font,
	 DFset_cell_font, set_region_font)
#ifdef FUNC_ARG_STRINGS
".'",
"wSet %0 font to? ",
"dScale? (ratio to the default point size e.g. 1.3) ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 font}",
"{insert-cell-attr %0 font-scale}",
#endif
#ifdef DOC_STRINGS
"Set the current cell's font to NAME at SCALE",
"NAME should be a name defined with [define-font].",
"SCALE should be a floating point number, which will be interpreted",
"as a ratio to the default point size.  For example, if SCALE is 1.33",
"and the default point size is 12 then this cell will be drawn with",
"a point size of 16.",
"",
"Under X, this scaling behavior depends on having a wide variety of fonts",
"installed, and wildcarding point-sizes in x11 font names passed to ",
"define-font.",
#endif

DEFUN_5 ("set-region-font", FDset_region_font, FAset_region_font,
	 DFset_region_font, set_region_font)
#ifdef FUNC_ARG_STRINGS
"rSet font for what region? ",
"wSet %0 font to? ",
"dPoint size? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 font}",
"{insert-cell-attr %0 font-scale}",
#endif
#ifdef DOC_STRINGS
"Set the font of cells in REGION to NAME at SCALE",
"NAME should be a name defined with [define-font].",
"SCALE should be a floating point number, which will be interpreted",
"as a ratio to the default point size.  For example, if SCALE is 1.33",
"and the default point size is 12 then this cell will be drawn with",
"a point size of 16.",
"",
"Under X, this scaling behavior depends on having a wide variety of fonts",
"installed, and wildcarding point-sizes in x11 font names passed to ",
"define-font.",
#endif




DEFUN_3 ("recompile_spreadsheet",
	 FDrecompile_spreadsheet, recompile_spreadsheet)
#ifdef DOC_STRINGS
"Recompile alll cell formulas.",
#endif

DEFUN_3 ("recenter-window", FDrecenter_window, recenter_window)
#ifdef DOC_STRINGS
"Center the cell cursor in the current window.",
#endif

/* Window commands (basic.h) */
DEFUN ("open-window", FDopen_window, FAopen_window, open_window)
#ifdef FUNC_ARG_STRINGS
"sSplit command? ",
#endif
#ifdef DOC_STRINGS
"Split the window according to SPLIT.",
"The syntax of split is an orientation (`h' or `v') followed by",
"either a number of rows (cols) or a percentege of rows (cols).",
"For example: ",
"	h10",
"	v33%",
#endif

DEFUN_3 ("split-window-horizontally", FDhsplit_window, hsplit_window)
#ifdef DOC_STRINGS
"Divide the current window evenly into two windows side by side.",
#endif

DEFUN_3 ("split-window-vertically", FDvsplit_window, vsplit_window)
#ifdef DOC_STRINGS
"Divide the current window evenly into two stacked windows.",
#endif
    
DEFUN_3 ("delete-window", FDdelete_window, delete_window)
#ifdef DOC_STRINGS
"Remove the current window from the display.",
#endif

DEFUN_3 ("delete-other-windows", FDdelete_other_windows, delete_other_windows)
#ifdef DOC_STRINGS
"Remove all but the current window from the display.",
#endif

DEFUN ("close-window", FDclose_window, FAclose_window, close_window)
#ifdef FUNC_ARG_STRINGS
"NClose window number? ",
#endif
#ifdef DOC_STRINGS
"Remove the window ARG from the display.",
#endif
    
DEFUN ("goto-window", FDgoto_window, FAgoto_window, goto_window)
#ifdef FUNC_ARG_STRINGS
"NGoto window number? ",
#endif
#ifdef DOC_STRINGS
"Make the ARGth window the current window.",
#endif
    
DEFUN_3 ("goto-minibuffer", FDgoto_minibuffer, goto_minibuffer)
#ifdef DOC_STRINGS
"Select the input area as the current window.",
"An error is given if the input area is not active.",
#endif

DEFUN_3 ("other-window", FDother_window, other_window)
#ifdef FUNC_ARG_STRINGS
"+p",
#endif
#ifdef DOC_STRINGS
"Select the ARGth different window.",
#endif



DEFUN ("toggle-overwrite", FDtoggle_overwrite, FAtoggle_overwrite, toggle_overwrite)
#ifdef FUNC_ARG_STRINGS
"p?",
"p",
#endif
#ifdef DOC_STRINGS
"Toggle between insert and overwrite mode.",
"This command only applies when an argument is being edited.",
"",
"With a positive (non-0) prefix argument, turn overwrite mode on.",
"With a negative or 0 prefix argument, turn overwrite mode off.",
"With no prefix argument, toggle overwrite mode.",
#endif


DEFUN_3 ("beginning-of-line", FDbeginning_of_line, beginning_of_line)
#ifdef DOC_STRINGS
"Move point to beginning of input line.",
#endif

DEFUN_3 ("end-of-line", FDend_of_line, end_of_line)
#ifdef DOC_STRINGS
"Move point to end of input line.",
#endif

DEFUN ("backward-char", FDbackward_char, FAbackward_char, backward_char)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move point left ARG characters (right if ARG negative).",
"On attempt to pass beginning or end of buffer, report an error.",
#endif

DEFUN ("backward-word", FDbackward_word, FAbackward_word, backward_word)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move backward in the input area until encountering the end of a word.",
"With argument, do this that many times.",
#endif


DEFUN ("backward-delete-char", FDbackward_delete_char, FAbackward_delete_char, backward_delete_char)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Delete ARG characters backward.",
#endif

DEFUN ("backward-delete-word", FDbackward_delete_word, FAbackward_delete_word, backward_delete_word)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Kill characters backward until encountering the end of a word.",
"With prefix argument, do this that many times.",
#endif

DEFUN_3 ("delete-to-start", FDdelete_to_start, delete_to_start)
#ifdef DOC_STRINGS
"Delete the input line, upto the cursor position.",
#endif

DEFUN ("forward-char", FDforward_char, FAforward_char, forward_char)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move the input area cursor right ARG characters (left if ARG negative).",
"On reaching end of buffer, report an error.",
#endif

DEFUN ("forward-word", FDforward_word, FAforward_word, forward_word)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move the input area cursor forward ARG words (backward if ARG is negative).",
#endif

DEFUN ("delete-char", FDdelete_char, FAdelete_char, delete_char)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Delete ARG following characters in the input area.",
"Deletes backwards with negative arg.",
#endif

DEFUN ("delete-word", FDdelete_word, FAdelete_word, delete_word)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Kill characters forward until encountering the end of a word.",
"With argument, do this that many times.",
#endif


DEFUN_3 ("kill-line", FDkill_line, kill_line)
#ifdef DOC_STRINGS
"Delete the rest of the input line, beginning at the cursor position.",
#endif

DEFUN_3 ("insert-cell-expression",
         FDinsert_cell_expression, insert_cell_expression)
#ifdef DOC_STRINGS
"Insert the current cell's formula in the input area.",
#endif


DEFUN_3 ("insert-cell-value", FDinsert_cell_value, insert_cell_value)
#ifdef DOC_STRINGS
"Insert the current cell's value (not it's formula) in the input area.",
#endif

DEFUN_3 ("insert-rel-ref", FDinsert_rel_ref, insert_rel_ref)
#ifdef DOC_STRINGS
"Insert a relative reference in the input area.",
"This command can only be executed when a cell formula is being edited.",
"The inserted references is to the current cell, and is relative to the",
"cell being defined.",
#endif


DEFUN_3 ("insert-abs-ref", FDinsert_abs_ref, insert_abs_ref)
#ifdef DOC_STRINGS
"Insert an absolute reference to the current cell in the input area.",
#endif

DEFUN ("insert-cell-attr",
       FDinsert_cell_attr, FAinsert_cell_attr, insert_cell_attr)
#ifdef FUNC_ARG_STRINGS
"RInsert attribute of cell? ",
"SInsert %0 attribute? ", 
#endif
#ifdef DOC_STRINGS
"(Internal use -- probably not useful as a command.)",
"For the lr,lc cell in RNG, insert the name of its named ATTRIBUTE.",
"Supported ATTRIBUTEs are `width', `height', `font', `font-scale' and",
"`format'.",
#endif

DEFUN_3 ("insert-current-filename",
	 FDinsert_current_filename, insert_current_filename)
#ifdef DOC_STRINGS
"Insert the name of the current file (if any) in the input area.",
#endif

DEFUN_3 ("insert-context-word", FDinsert_context_word, insert_context_word)
#ifdef DOC_STRINGS
"(internal use)",
#endif

DEFUN ("insert-user-format-part",
       FDinsert_usr_fmt_part, FAinsert_usr_fmt_part, insert_usr_fmt_part)
#ifdef FUNC_ARG_STRINGS
"nInsert part of user format [1-16]? ",
"nInsert which part of user format %0 [1-9]? ",
#endif
#ifdef DOC_STRINGS
"(Internal use -- probably not useful as a command.)",
"For user format FMT, insert the Nth field.",
"The fields of a user format are numbered this way:",
"  1 - positive header",
"  2 - negative header",
"  3 - positive trailer",
"  4 - negative trailer",
"  5 - representation of zero",
"  6 - comma (as in 1,000,000.00)",
"  7 - decimal point",
"  8 - precision", 
"  9 - scale factor",
"",
"For more formation, see documentation for the comand define-user-format.",
#endif


DEFUN ("self-insert-command",
       FDself_insert_command, FAself_insert_command, self_insert_command)
#ifdef FUNC_ARG_STRINGS
"l",
"p",
#endif
#ifdef DOC_STRINGS
"Insert the last-typed character in the input area.",
"Prefix arg is a repeat-count.",
#endif

DEFUN ("self-map-command",
       FDself_map_command, FAself_map_command, self_map_command)
#ifdef FUNC_ARG_STRINGS
"l",
#endif
#ifdef DOC_STRINGS
"Map the last-typed character in the keysequence argument being edited.",
"This is used by the help system to prompt for the argument to describe-key and",
"describe-key-briefly.",
#endif

DEFUN ("exit-self-inserting",
       FDexit_self_inserting, FAexit_self_inserting, exit_self_inserting)
#ifdef FUNC_ARG_STRINGS
"l",
#endif
#ifdef DOC_STRINGS
"Insert the name of the last character typed and exit the minibuffer.",
"This is used to implement commands which prompt the user for a character.",
#endif



DEFUN ("pushback-keystroke",
       FApushback_keystroke, FDpushback_keystroke, pushback_keystroke)
#ifdef FUNC_ARG_STRINGS
"c'(any key continues) ",
#endif
#ifdef DOC_STRINGS
"(Internal use -- probably not useful as a command.)",
"Push the last keystroke back onto the input stream.",
#endif




DEFUN ("display-error-msg",
       FDdisplay_error_msg, FAdisplay_error_msg, display_error_msg)
#ifdef FUNC_ARG_STRINGS
"sMessage? ",
"c'%0",
#endif
#ifdef DOC_STRINGS
"Display an error message for the user.",
"The message vanishes as soon as the user types the next character of input",
"or after a brief timeout.",
#endif



/* Functions related to setting cell attributes. */
DEFUN_5 ("set-region-height", FDset_region_height, FAset_region_height,
	 DFset_region_height, set_region_height)
#ifdef FUNC_ARG_STRINGS
"rSet height for region? ",
"sSet height for %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 height}",
#endif
#ifdef DOC_STRINGS
"Set the height for rows in RANGE to HEIGHT.",
"HEIGHT may be a non-negative integer or `default', in which case the value",
"set with [set-default-height] is used.",
"",
"On the screen, a cell of height N is as tall as N lines of text in the",
"default cell font.",
#endif

DEFUN_5 ("set-region-width", FDset_region_width, FAset_region_width,
	 DFset_region_width, set_region_width)
#ifdef FUNC_ARG_STRINGS
"rSet width for region? ",
"sSet width for %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 width}",
#endif
#ifdef DOC_STRINGS
"Set the width of columns in RANGE to WIDTH.",
"WIDTH may be a non-negative integer or `default', in which case the value",
"set with [set-default-width] is used.",
"",
"On the screen, a cell of width N is as wide as N repitions of the character",
"`M' in the default cell font.",
#endif


DEFUN ("set-region-protection", FDset_region_protection,
       FAset_region_protection, set_region_protection)
#ifdef FUNC_ARG_STRINGS
"rSet protection for region? ",
"[dpu][D]efault  [P]rotect  [U]nprotect? ",
#endif
#ifdef DOC_STRINGS
"Set the protection for cells in a REGION to PROT.",
"PROT may be `d' for default, `p' - protected, or `u' - unprotected.",
#endif


DEFUN ("set-region-alignment", FDset_region_alignment,
       FAset_region_alignment, set_region_alignment)
#ifdef FUNC_ARG_STRINGS
"rSet alignment for region? ",
"[dlcr][D]efault  [L]eft  [C]enter  [R]ight? ",
#endif
#ifdef DOC_STRINGS
"Set the alignment for cells in a REGION to JST.",
"JST may be `d' for default, `l' - left, `r' - right, or `c' - center.",
#endif


DEFUN_5 ("set-region-format", FDset_region_format, FAset_region_format,
	 DFset_region_format, set_region_format)
#ifdef FUNC_ARG_STRINGS
"rSet format for region? ",
"FSet format of %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 format}",
#endif
#ifdef DOC_STRINGS
"Set the format for cells in REGION to FORMAT.",
"Oleo can display numbers in these formats:",
"",
"integer		The number is rounded to an integer before being displayed.",
"",
"float		The number is displayed in decimal notation, using",
"		whatever precision is needed (or fits).",
"",
"hidden		The number is not displayed.  This has no other effect on",
"		the cell (e.g. it is recalculated normally).",
"",
"",
"graph		The number is displayed as a small graph.  If the number is",
"		close to zero, it will be displayed as '0', If it is positive,",
"		a row of '+'-es is displayed.  If it is negative, a row of",
"		'-'-es is displayed.",
"",
"user-1 through	These are the sixteen user-defined formats.  ",
"user-16		c.f. set-user-format.",
"",
"The following formats require a precision.  The precision may be a number",
"from zero to 14, in which case that number of digits will always be displayed",
"after the decimal point (zero-padding or rounding the number as needed), or",
"the precision may be 'float', in which case oleo will use as many digits as",
"necessary.  As examples:",
"",
"	dollar.2			display like ``$1,769.00''",
"	general.float			    \"    \"    ``1769.00032''	",
"",
"general		This uses either normal or scientific notation, depending on",
"		the magnitude of the number and the width of the column.",
"",
"dollar		Positive values are preceeded by '$', (so 3 is displayed as",
"		'$3').  Negative values are parenthasized (so -3 is displayed",
"		as '($3)'), and all large values have a ',' every three",
"		digits (so 1000 is displayed as '$1,000'.",
"",
"comma		Positive numbers are not preceede by '$', but this is",
"		otherwise identical to 'dollar'.",
"",
"percent		The value is multiplied by 100, and is displayed with a",
"		trailing '%'.  Thus .01 displays as '1%', while 1 displays as",
"		'100%'.",
"",
"fixed		The number is displayed in normal, everyday notation, using",
"		the precision specified.  'fixed.float' is the same as",
"		'float'.  'fixed.0' is the same as 'integer'.",
"",
"exponent	The number is displayed in scientific notation.",
"",
#endif


DEFUN_5 ("set-cell-height", FDset_cell_height, FAset_cell_height,
	 DFset_cell_height, set_region_height)
#ifdef FUNC_ARG_STRINGS
".'",
"sSet height for %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 height}",
#endif
#ifdef DOC_STRINGS
"Set the height for ROW to HEIGHT.",
"HEIGHT may be a non-negative integer or `default', in which case the value",
"set with [set-default-height] is used.",
"",
"On the screen, a cell of height N is as tall as N lines of text in the",
"default cell font.",
#endif

DEFUN_5 ("set-cell-width", FDset_cell_width, FAset_cell_width,
	 DFset_cell_width, set_region_width)
#ifdef FUNC_ARG_STRINGS
".'",
"sSet width for %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 width}",
#endif
#ifdef DOC_STRINGS
"Set the width for COL to WIDTH.",
"WIDTH may be a non-negative integer or `default', in which case the value",
"set with [set-default-width] is used.",
"",
"On the screen, a cell of width N is as wide as N repitions of `M' in the",
"default cell font.",
#endif

DEFUN ("set-cell-protection",
       FDset_cell_protection, FAset_cell_protection, set_region_protection)
#ifdef FUNC_ARG_STRINGS
".'",
"[dpu][D]efault  [P]rotect  [U]nprotect? ",
#endif
#ifdef DOC_STRINGS
"Set the protection for CELL to PROT.",
"PROT may be `d' for default, `p' - protected, or `u' - unprotected.",
#endif

DEFUN ("set-cell-alignment",
       FDset_cell_alignment, FAset_cell_alignment, set_region_alignment)
#ifdef FUNC_ARG_STRINGS
".'",
"[dlcr][D]efault  [L]eft  [C]enter  [R]ight? ",
#endif
#ifdef DOC_STRINGS
"Set the alignment for CELL to JST.",
"JST may be `d' for default, `l' - left, `r' - right, or `c' - center.",
#endif

DEFUN_5 ("set-cell-format", FDset_cell_format, FAset_cell_format,
	 DFset_cell_format, set_region_format)
#ifdef FUNC_ARG_STRINGS
".'",
"FSet format of %0 to? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-cell-attr %0 format}",
#endif
#ifdef DOC_STRINGS
"Set the format for numeric display for CELL to FORMAT.",
"For a description of valid formats, see set-region-format.",
#endif


/* Defaults....*/

DEFUN ("set-default-height",
       FDset_def_height, FAset_def_height, set_def_height)
#ifdef FUNC_ARG_STRINGS
"sDefault height? ",
#endif
#ifdef DOC_STRINGS
"Set the default height of rows.",
"See set-region-height for more information.",
#endif


DEFUN ("set-default-width",
       FDset_def_width, FAset_def_width, set_def_width)
#ifdef FUNC_ARG_STRINGS
"sDefault width? ",
#endif
#ifdef DOC_STRINGS
"Set the default height of cols.",
"See set-region-width for more information.",
#endif

DEFUN ("set-user-scales",
       FDset_user_scales, FAset_user_scales, set_user_scales) 
#ifdef FUNC_ARG_STRINGS
"dScale row hights by? ",
"dScale column widths by? ",
#endif
#ifdef DOC_STRINGS
"Scale HEIGHT and WIDTH by the given floating point amounts.",
#endif


DEFUN ("set-default-protection", FDset_def_protection,
       FAset_def_protection, set_def_protection)
#ifdef FUNC_ARG_STRINGS
"[pu][U]nprotected  or  [P]rotected",
#endif
#ifdef DOC_STRINGS
"Set the default protection of cells.",
"A protection may be specified as `p' for protected, or `u' -- unprotected.",
#endif


DEFUN ("set-default-alignment",
       FDset_def_alignment, FAset_def_alignment, set_def_alignment)
#ifdef FUNC_ARG_STRINGS
"[dlcrDLCR][L]eft  [C]enter  [R]ight  [D]efault",
#endif
#ifdef DOC_STRINGS
"Set the default alignment of cells.",
"An allignment may be specified as `l' for left, `c' -- center, `r' -- right",
"or `d' -- default.",
#endif

DEFUN ("set-default-format",
       FDset_def_format, FAset_def_format, set_def_format)
#ifdef FUNC_ARG_STRINGS
"FDefault format? ",
#endif
#ifdef DOC_STRINGS
"Set the default format for numeric display to FORMAT.",
"See set-region-format for an explanation of formats.",
#endif

DEFUN ("set-default-font",
       FDset_default_font, FAset_default_font, set_default_font)
#ifdef FUNC_ARG_STRINGS
"wSet default font to? ",
"dPoint size? (e.g. 1.3) ",
#endif
#ifdef DOC_STRINGS
"Set the default font to NAME at SCALE",
"NAME should be a name defined with [define-font].",
"SCALE should be a floating point number, which will be interpreted",
"as a ratio to the default point size.  For example, if SCALE is 1.33",
"and the default point size is 12 then this cell will be drawn with",
"a point size of 16.",
"",
"Under X, this scaling behavior depends on having a wide variety of fonts",
"installed, and wildcarding point-sizes in x11 font names passed to ",
"define-font.",
#endif

DEFUN_5 ("define-user-format",
	 FDdefine_usr_fmt, FAdefine_usr_fmt, DFdefine_usr_fmt, define_usr_fmt)
#ifdef FUNC_ARG_STRINGS
"N[1,16]Define format [1-16]? ",
"wPositive header? ",
"wNegative header? ",
"wPositive trailer? ",
"wNegative trailer? ",
"wRepresentation of zero? ",
"wComma? ",
"wDecimal point? ",
"wPrecision [0-14 or `float']? ",
"wScale-factor? ",
#endif
#ifdef FUNC_INIT_CODE
0,
"{insert-user-format-part %0 1}",
"{insert-user-format-part %0 2}",
"{insert-user-format-part %0 3}",
"{insert-user-format-part %0 4}",
"{insert-user-format-part %0 5}",
"{insert-user-format-part %0 6}",
"{insert-user-format-part %0 7}",
"{insert-user-format-part %0 8}",
"{insert-user-format-part %0 9}",
#endif
#ifdef DOC_STRINGS
"Set the parameters of a user-defined numeric format.",
"",
"There are sixteen user-defined numeric formats (maned `user-1' ... `user-16').",
"Each format specifies a syntax for printing numbers.  They may be used ",
"inconjuction with the [set-cell-format] and [set-region-format] commands.",
"",
"Each format has these parameters (using the 'dollar' format for an example).",
"",
"Parameter Name		Example:	How it is used",
"",
"Positive header		$		before postive numbers.",
"Negative header		($		before negative numbers.",
"Positive trailer			after positive numbers.",
"Negative trailer	)		after negative numbers.",
"Zero			$0.00		if the number is 0.",
"Comma			,		between each three digits (1,000,000).",
"Decimal			.		as a decimal point.",
"Precision		2		The number of digits to print after the",
"					decimal point. This may be an integer",
"					in the range [0-14] or `float'.",
"					`float' means use however many digits",
"					are needed, or however many will fit,",
"					whichever is less.",
"Scale			1		What to multiply the value by before",
"					printing. Most often this will be one,",
"					but it might be 100 if you're printing",
"					percentages, or .000001 if you're",
"					printing in megabucks.  (Beware of",
"					overflow!)",
"",
"Do not use digits for the headers, trailers, the comma, or the decimal point",
"symbol.  Using digits will confuse the internal routines and produce",
"incomprehensible results.   (This is a bug that will be fixed.)",
#endif



/* help commands */

DEFUN ("describe-key-briefly",
       FDbrief_describe_key, FAbrief_describe_key, brief_describe_key)
#ifdef FUNC_ARG_STRINGS
"kDescribe key briefly? ",
#endif
#ifdef DOC_STRINGS
"Print the name of the function KEYSEQ invokes.",
#endif

DEFUN ("describe-key",
       FDdescribe_key, FAdescribe_key, describe_key)
#ifdef FUNC_ARG_STRINGS
"kDescribe key? ",
#endif
#ifdef DOC_STRINGS
"Display the full documentation of the function KEYSEQ invokes.",
#endif

DEFUN ("describe-function",
       FDdescribe_function, FAdescribe_function, describe_function)
#ifdef FUNC_ARG_STRINGS
"CDescribe function? ",
#endif
#ifdef DOC_STRINGS
"Display the full documentation of FUNCTION (a symbol).",
#endif

DEFUN_5 ("describe-formula", FDdescribe_formula, FAdescribe_formula,
	 DFdescribe_formula, view_info)
#ifdef FUNC_ARG_STRINGS
"SHelp with what formula function? ",
"mview-info", 
#endif
#ifdef FUNC_INIT_CODE
"{insert-context-word}",
"{builtin-help %0}",
#endif
#ifdef DOC_STRINGS
"Display the documentation for the given formula FUNCTION",
#endif

DEFUN_3 ("help-with-command", FAhelp_with_command, help_with_command)
#ifdef DOC_STRINGS
"Display help for the currently executing command.",
#endif


DEFUN ("where-is", FDwhere_is, FAwhere_is, where_is)
#ifdef FUNC_ARG_STRINGS
"SCommand or keymap? ",
#endif
#ifdef DOC_STRINGS
"Print message listing a key sequence that invokes a specified command.",
"Argument is a command name or keymap name.  If a keymap name is given,",
"then the output tells what prefix select that keymap.",
#endif

DEFUN ("builtin-help", FDbuiltin_help, FAbuiltin_help, builtin_help)
#ifdef FUNC_ARG_STRINGS
"SHelp for what symbol? ",
#endif
#ifdef DOC_STRINGS
"(Internal use -- probably not useful as a command.)",
"Make one of the help messages built-in to Oleo the current prompt-info.",
#endif

DEFUN ("write-info", FDwrite_info, FAwrite_info, write_info)
#ifdef FUNC_ARG_STRINGS
"SWrite what info buffer? ",
"fwWrite %0 to what file? ",
#endif
#ifdef DOC_STRINGS
"(internal use) Write the info buffer NAME to FILE.",
#endif


DEFUN_3 ("make-wallchart-info", FAmake_wallchart_info, make_wallchart_info)
#ifdef DOC_STRINGS
"(Internal use -- probably not useful as a command.)",
"Ensure the existence of an info buffer named `wallchart'.",
"The buffer will contain a categoricly organized list of keybindings.",
#endif





/* Temporary hacks for multi-line text display. */

DEFUN ("set-info", FDset_info, FAset_info, set_info)
#ifdef FUNC_ARG_STRINGS
"SDisplay what info? ",
#endif
#ifdef DOC_STRINGS
"(internal use -- probably not useful as an interactie command).",
"Display the info-buffer ARG instead of the cell windows.",
"Display-cells undoes this.",
#endif

DEFUN ("display-cells", FDdisplay_cells, FAdisplay_cells, set_info)
#ifdef FUNC_ARG_STRINGS
"#0",
#endif
#ifdef DOC_STRINGS
"(internal use -- probably not useful as an interactie command).",
"Display the cells windows instead of an info buffer. This is the",
"opposite of set-info.",
#endif

DEFUN_5 ("view-info", FDview_info, FAview_info, DFview_info, view_info)
#ifdef FUNC_ARG_STRINGS
"sInfo to view? ", 
"mview-info",
#endif
#ifdef FUNC_INIT_CODE
0,
"{set-info %0}",
#endif
#ifdef DOC_STRINGS
"(internal use only -- probably not useful as an interactive command).",
"Let the user page through the info buffer named ARG.",
#endif

DEFUN ("page-info", FDpage_info, FApage_info, page_info)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move forward a page in an info text.  With a prefix, move that many pages.",
#endif

DEFUN ("page-info-backwards",
       FDpage_info_backwards, FApage_info_backwards, page_info_backwards)
#ifdef FUNC_ARG_STRINGS
"p",
#endif
#ifdef DOC_STRINGS
"Move backward a page in an info text.  With a prefix, move that many pages.",
#endif



/* Graph commands */

DEFUN_3 ("graph-x11-mono", FDgraph_x11_mono, graph_x11_mono)
#ifdef DOC_STRINGS
"Specify that graphing should be done to an X11 window in black and white.",
#endif

DEFUN_3 ("graph-x11-color", FDgraph_x11_color, graph_x11_color)
#ifdef DOC_STRINGS
"Specify that graphing should be done to an X11 window in color.",
#endif

DEFUN ("graph-toggle-axis-logness",
       FDgraph_toggle_x_logness, FAgraph_toggle_x_logness, graph_set_logness)
#ifdef FUNC_ARG_STRINGS
"[xXyY]Which axis? (`x' or `y') ",
"p?",
"p",
#endif
#ifdef DOC_STRINGS
"Toggle whether AXIS (`x' or `y') is drawn to a logarithmic scale.",
"With a 0 or negative prefix, make the axis not be logarithmic.",
"With a positive prefix, make the axis logarithmic.",
#endif


DEFUN ("graph-postscript",
       FDgraph_postscript, FAgraph_postscript, graph_postscript)  
#ifdef FUNC_ARG_STRINGS
"fnWrite postscript graph to? ",
"[ledLED][L]andscape  [E]mbedded postscript  or [D]efault",
"[cCmM][C]olor  or [M]onochrome",
"sPostscript font? ", 
"nPoint size? ",
#endif
#ifdef DOC_STRINGS
"Specify that graphing should be done in postscript.",
"Arguments are:",
"  FILE - the output file for the postscript (may be a pipe, e.g.: `| lpr').",
"  KIND - [l]andscape, [e]mbedded postscript or [d]efault",
"  COLOR - [b]lack and white,  or [c]olor",
"  FONT - a font name (e.g.: TimesRoman)",
"  PTSIZ - point size for labels.",
#endif

DEFUN ("graph-set-axis-low",
       FDgraph_set_axis_low, FAgraph_set_axis_low, graph_set_axis_lo)
#ifdef FUNC_ARG_STRINGS
"[xXyY]Set range start for which axis? (`x' or `y') ",
"sBeginning of the %0 axis range [a number or `def']? ",
#endif
#ifdef DOC_STRINGS
"Set the beginning of the range graph on AXIS to LOW.",
"LOW may be either a real number, or `def' to invoke auto-scaling.",
#endif

DEFUN ("graph-set-axis-high",
       FDgraph_set_axis_high, FAgraph_set_axis_high, graph_set_axis_hi)
#ifdef FUNC_ARG_STRINGS
"[xXyY]Set range start for which axis? (`x' or `y') ",
"sEnd of the %0 axis range [a number or `def']? ",
#endif
#ifdef DOC_STRINGS
"Set the beginning of the range graph on AXIS to HIGH.",
"HIGH may be either a real number, or `def' to invoke auto-scaling.",
#endif

DEFUN ("graph-set-x-axis-symbolic", FDgraph_set_axis_symbolic,
       FAgraph_set_axis_symbolic, graph_set_axis_symbolic)
#ifdef FUNC_ARG_STRINGS
"c#x",
"rSymbols for the %0-axis in range? ",
"cRead rows or cols in %1? (`r' or `c') ",
#endif
#ifdef DOC_STRINGS
"Declare that the x-axis should range over the names in RANGE read in ORDER.",
"RANGE should be a set of cells containing the symbols for the x-axis.",
"The values in those cells correspond to positions in the range being",
"graphed (e.g.: the cells might contain the names of the months).",
"ORDER (either `r' or `c') says whether cells should be read row-wise",
"or column-wise.",
"",
"After this command, two kinds of data-sets can be plotted.",
"Datasets which are explicitly made up of pairs of cells should contain",
"X values that can be found in RANGE.  Datasets with an implicit X coordinate",
"will be be proviced with X coordinates from RANGE in the specified order.",
"",
"For non-symbolic ranges, use [graph-set-axis-low]",
"",
"For symbolic labels on a numeric range, use [graph-set-axis-labels]",
#endif

DEFUN ("graph-set-axis-labels", FDgraph_set_axis_labels,
       FAgraph_set_axis_labels, graph_set_axis_labels)
#ifdef FUNC_ARG_STRINGS
"[xXyY]Labels for which axis? (`x' or `y') ",
"rRead labels for the %0-axis from range? ",
"[hHvViI]Are position/label pairs [H]oriz, [V]ert, or [I]mplicit-position? ",
"[rRcC]Read labels from %0 row-wise or column-wise? (`r',or `c') ",
#endif
#ifdef DOC_STRINGS
"Read labels for AXIS from RNG as ORIENTATION pos/label pairs read in ORDER.",
"",
"AXIS may be either `x' or `y'.",
"",
"ORIENTATION may be:",
"	`h' - horizontal	if rc contains the position, then rc[1]",
"				contains the label.",
"	`v' - vertical		if rc contains the position, then r[1]c",
"				contains the label.",
"	`i' - implicit		every cell is a label; positions are assigned",
"				non-negative integer positions (0, 1, 2...)",
"",
"ORDER may be:",
"	`r' - rows		pairs are read row-wise",
"	`c' - columns		pairs are read column-wise",
"",
"This command does not effect what range will be graphed.  If labels are",
"assigned positions outside the visible range, they will not be drawn.",
"See also graph-set-x-symbolic.",
"This is undone by [graph-default-axis-labels]",
#endif

DEFUN ("graph-default-axis-labels", FAgraph_default_axis_labels,
       FDgraph_default_axis_labels, graph_default_axis_labels)
#ifdef FUNC_ARG_STRINGS
"[xXyY]Use default labels for which axis? (`x' or `y') ",
#endif
#ifdef DOC_STRINGS
"Reset the labels for AXIS to their defaults.",
"This undoes [graph-set-axis-labels]",
#endif


DEFUN ("graph-set-style",
       FDgraph_set_style, FAgraph_set_style, graph_set_style)
#ifdef FUNC_ARG_STRINGS
"N[0,9]Set style for which dataset? (0..9) ",
"sStyle for dataset %0? ",
#endif
#ifdef DOC_STRINGS
"Specify that dataset N should be graphed in STYLE.",
"STYLE may be any of the gnuplot graph types: ",
"	lines, points, linespoints, impulses, dots",
#endif

DEFUN ("graph-set-axis-title",
       FDgraph_set_axis_title, FAgraph_set_axis_title, graph_set_axis_title)
#ifdef FUNC_ARG_STRINGS
"[xyXY]Set title of which axis? (x or y) ",
"sTitle for the %0-axis? ",
#endif
#ifdef DOC_STRINGS
"When drawing graphs, label AXIS (`x' or `y') with TITLE.",
#endif

DEFUN ("graph-set-data", FDgraph_set_data, FAgraph_set_data, graph_set_data)
#ifdef FUNC_ARG_STRINGS
"N[0,9]Set which dataset? (0..9) ",
"rRead dataset %0 from what range? ",
"[hHvViI]Are X,Y pairs [H]oriz, [V]ert, or [I]mplicit-X? ",
"[rRcC]Read labels from %0 row-wise or column-wise? (`r',or `c') ",
#endif
#ifdef DOC_STRINGS
"Specify that dataset N is read from RNG as ORNT x,y pairs read in ORDER",
"",
"Datasets are numbered 0..9.",
"",
"ORIENTATION may be:",
"	`h' - horizontal	if rc contains x, then rc[1] contains y",
"	`v' - vertical		if rc    \"     x,   \"  r[1]c    \"     y",
"	`i' - implicit		every cell is a y value; x coordinates are",
"				non-negative integer positions (0, 1, 2...)",
"",
"ORDER may be:",
"	`r' - rows		pairs are read row-wise",
"	`c' - columns		pairs are read column-wise",
"",
#endif

DEFUN ("graph-set-data-title",
       FDgraph_set_data_title, FAgraph_set_data_title, graph_set_data_title)
#ifdef FUNC_ARG_STRINGS
"N[0,9]Set the title for which dataset? (0..9) ",
"sTitle for dataset %0? ",
#endif
#ifdef DOC_STRINGS
"Specify that dataset N should be called TITLE. ",
"The title will be printed in the key for the graph.",
#endif

DEFUN_3 ("graph-presets", FDgraph_presets, graph_presets)
#ifdef DOC_STRINGS
"Return graphing parameters to their default values.",
"This does not effect the datasets selected for graphing.",
#endif

DEFUN_3 ("graph-clear-datasets", FDgraph_clear_datasets, graph_clear_datasets)
#ifdef DOC_STRINGS
"Erase the settings of which datasets will be graphed.",
"This undoes the effects of all previous invocations of [graph-set-data].",
#endif

DEFUN_3 ("graph-make-info", FDgraph_make_info, graph_make_info)  
#ifdef DOC_STRINGS
"Update the info-buffer called `graphing-parameters'.",
"The new contents of the buffer will describe the current settings",
"of all graphing parameters",
#endif

DEFUN_3 ("graph-plot", FDgraph_plot, graph_plot)
#ifdef DOC_STRINGS
"Execute a graph.  The parameter of the graph are set using [graph-setup]",
#endif