| 12
 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
 
 | @comment -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
@c Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation, Inc. 
@c See the file elisp.texi for copying conditions.
@c This file can also be used by an independent Edebug User 
@c Manual in which case the Edebug node below should be used 
@c with the following links to the Bugs section and to the top level:
@c , Bugs and Todo List, Top, Top
@node Edebug, Syntax Errors, Debugger, Debugging
@c @section Edebug
@section edebug
@c @cindex Edebug mode
@cindex edebug$B%b!<%I(B
@c @cindex Edebug
@cindex edebug
@c   Edebug is a source-level debugger for Emacs Lisp programs with which
@c you can:
edebug$B$O(BEmacs Lisp$B%W%m%0%i%`$N%=!<%9%l%Y%k%G%P%C%,$G$"$j!"(B
$B$D$.$N$3$H$r9T$($^$9!#(B
@itemize @bullet
@item
@c Step through evaluation, stopping before and after each expression.
$B3F<0$NA08e$GDd;_$7$FI>2A$r%9%F%C%W<B9T$9$k!#(B
@item
@c Set conditional or unconditional breakpoints.
$B>r7oIU$-%V%l!<%/%]%$%s%H!"L5>r7o%V%l!<%/%]%$%s%H$r@_Dj$9$k!#(B
@item
@c Stop when a specified condition is true (the global break event).
$B;XDj$7$?>r7o$,??$N>l9g$KDd;_$9$k!J%0%m!<%P%k%V%l!<%/%$%Y%s%H!K!#(B
@item
@c Trace slow or fast, stopping briefly at each stop point, or
@c at each breakpoint.
$B3FDd;_0LCV$d3F%V%l!<%/%]%$%s%H$GDd;_$7DcB.!?9bB.%H%l!<%9$9$k!#(B
@item
@c Display expression results and evaluate expressions as if outside of
@c Edebug.
edebug$B$N30B&$G$"$k$+$N$h$&$K!"<0$N7k2L$rI=<($7$?$j<0$rI>2A$9$k!#(B
@item 
@c Automatically re-evaluate a list of expressions and
@c display their results each time Edebug updates the display.
edebug$B$,I=<($r99?7$9$k$?$S$K!"(B
$B<+F0E*$K<0$NJB$S$r:FI>2A$7$=$N7k2L$rI=<($9$k!#(B
@item
@c Output trace info on function enter and exit.
$B4X?t$N=PF~$j$K4X$9$k%H%l!<%9>pJs$r=PNO$9$k!#(B
@item
@c Stop when an error occurs.
$B%(%i!<$,H/@8$9$k$HDd;_$9$k!#(B
@item
@c Display a backtrace, omitting Edebug's own frames.
edebug$B<+?H$N%U%l!<%`$r>J$$$F!"%P%C%/%H%l!<%9$rI=<($9$k!#(B
@item
@c Specify argument evaluation for macros and defining forms.
$B%^%/%m$dDj5A%U%)!<%`$KBP$7$F0z?t$NI>2A$r;XDj$9$k!#(B
@item
@c Obtain rudimentary coverage testing and frequency counts.
$B4pK\E*$J%+%P%l%C%8%F%9%H$dIQEY?t7WB,$r9T$&!#(B
@end itemize
@c The first three sections below should tell you enough about Edebug to
@c enable you to use it.
$B0J2<$N:G=i$N(B3$B$D$N@a$G$O!"(Bedebug$B$r;H$&$N$K==J,$J>pJs$rM?$($^$9!#(B
@menu
* Using Edebug::		Introduction to use of Edebug.
* Instrumenting::		You must instrument your code
				  in order to debug it with Edebug.
* Modes: Edebug Execution Modes. Execution modes, stopping more or less often.
* Jumping::			Commands to jump to a specified place.
* Misc: Edebug Misc.		Miscellaneous commands.
* Breakpoints::			Setting breakpoints to make the program stop.
* Trapping Errors::		trapping errors with Edebug.
* Views: Edebug Views.		Views inside and outside of Edebug.
* Eval: Edebug Eval.			Evaluating expressions within Edebug.
* Eval List::			Expressions whose values are displayed
				  each time you enter Edebug.
* Printing in Edebug::		Customization of printing.
* Trace Buffer::		How to produce trace output in a buffer.
* Coverage Testing::		How to test evaluation coverage.
* The Outside Context::		Data that Edebug saves and restores.
* Instrumenting Macro Calls::	Specifying how to handle macro calls.
* Options: Edebug Options.	Option variables for customizing Edebug.
@end menu
@node Using Edebug
@c @subsection Using Edebug
@subsection edebug$B$N;H$$J}(B
@c   To debug a Lisp program with Edebug, you must first @dfn{instrument}
@c the Lisp code that you want to debug.  A simple way to do this is to
@c first move point into the definition of a function or macro and then do
@c @kbd{C-u C-M-x} (@code{eval-defun} with a prefix argument).  See
@c @ref{Instrumenting}, for alternative ways to instrument code.
edebug$B$G(BLisp$B%W%m%0%i%`$r%G%P%C%0$9$k$K$O!"(B
$B%G%P%C%0$7$?$$(BLisp$B%3!<%I$r$^$:(B@dfn{$B=hCV(B}$B!J(Binstrument$B!K$7$F$*$/I,MW$,$"$j$^$9!#(B
$B$3$l$r9T$&4JC1$JJ}K!$O!"4X?t$d%^%/%m$NDj5A$K%]%$%s%H$r0\F0$7$F$+$i!"(B
@kbd{C-u C-M-x}$B!JA0CV0z?t$r;XDj$7$?(B@code{eval-defun}$B!K$r<B9T$7$^$9!#(B
$B%3!<%I$r=hCV$9$kJL$NJ}K!$K$D$$$F$O!"(B@xref{Instrumenting}$B!#(B
@c   Once a function is instrumented, any call to the function activates
@c Edebug.  Activating Edebug may stop execution and let you step through
@c the function, or it may update the display and continue execution while
@c checking for debugging commands, depending on which Edebug execution
@c mode you have selected.  The default execution mode is step, which does
@c stop execution.  @xref{Edebug Execution Modes}.
$B4X?t$r$$$C$?$s=hCV$7$F$*$1$P!"Ev3:4X?t$r8F$S=P$9$H(Bedebug$B$r3h@-$K$7$^$9!#(B
edebug$B$,3h@-$K$J$k$H<B9T$rDd;_$7!"(B
$BFI<T$,A*Br$7$?(Bedebug$B$N<B9T%b!<%I$K1~$8$F!"(B
$B4X?t$r%9%F%C%W<B9T$7$?$j%G%P%C%0%3%^%s%I$r8!::$7$J$,$i(B
$BI=<($r99?7$7$D$D<B9T$r7QB3$7$^$9!#(B
$B%G%U%)%k%H$N<B9T%b!<%I$O%9%F%C%W<B9T$G$"$j!"(B
$B$$$C$?$s<B9T$rDd;_$7$^$9!#(B
@xref{Edebug Execution Modes}$B!#(B
@c   Within Edebug, you normally view an Emacs buffer showing the source of
@c the Lisp code you are debugging.  This is referred to as the @dfn{source
@c code buffer}.  This buffer is temporarily read-only.
edebug$B$G$O!"%G%P%C%0Cf$N(BLisp$B%3!<%I$N%=!<%9$r(B
$BI=<($7$?(BEmacs$B%P%C%U%!$rFI<T$O8+$^$9!#(B
$B$3$N%P%C%U%!$r(B@dfn{$B%=!<%9%3!<%I%P%C%U%!(B}$B$H8F$S$^$9!#(B
$B$3$N%P%C%U%!$O0l;~E*$KFI$_=P$7@lMQ$G$9!#(B
@c   An arrow at the left margin indicates the line where the function is
@c executing.  Point initially shows where within the line the function is
@c executing, but this ceases to be true if you move point yourself.
$B:8C<$NLp0u$O!"4X?t$N<B9TCf$N9T$rI=$7$^$9!#(B
$B%]%$%s%H$N=i4|0LCV$O4X?t$N<B9TCf$N9T$K$"$j$^$9$,!"(B
$BFI<T<+?H$,%]%$%s%H$r0\F0$9$k$HJQ$o$j$^$9!#(B
@c   If you instrument the definition of @code{fac} (shown below) and then
@c execute @code{(fac 3)}, here is what you normally see.  Point is at the
@c open-parenthesis before @code{if}.
$B!J0J2<$N!K(B@code{fac}$B$NDj5A$r=hCV$7$F$+$i(B@code{(fac 3)}$B$r<B9T$7$?$H$9$k$H!"(B
$B$D$.$N$h$&$K$J$j$^$9!#(B
$B%]%$%s%H$O(B@code{if}$B$N$^$($N3+$-3g8L$K$"$j$^$9!#(B
@example
(defun fac (n)
=>@point{}(if (< 0 n)
      (* n (fac (1- n)))
    1))
@end example
@c @cindex stop points
@cindex $BDd;_0LCV(B
@c The places within a function where Edebug can stop execution are called
@c @dfn{stop points}.  These occur both before and after each subexpression
@c that is a list, and also after each variable reference.  
@c Here we show with periods the stop points found in the function
@c @code{fac}:
edebug$B$,4X?tFb$G<B9T$rDd;_$G$-$k2U=j$r(B@dfn{$BDd;_0LCV(B}$B!J(Bstop point$B!K$H8F$S$^$9!#(B
$B$3$l$i$O!"%j%9%H$G$"$k3FItJ,<0$NA08e$H3FJQ?t;2>H$N$&$7$m$K$"$j$^$9!#(B
$B4X?t(B@code{fac}$B$NCf$K$"$kDd;_0LCV$r%T%j%*%I$G<($7$^$9!#(B
@example
(defun fac (n)
  .(if .(< 0 n.).
      .(* n. .(fac (1- n.).).).
    1).)
@end example
@c The special commands of Edebug are available in the source code buffer
@c in addition to the commands of Emacs Lisp mode.  For example, you can
@c type the Edebug command @key{SPC} to execute until the next stop point.
@c If you type @key{SPC} once after entry to @code{fac}, here is the
@c display you will see:
$B%=!<%9%3!<%I%P%C%U%!$G$O!"(BEmacs$B$N(Blisp$B%b!<%I$N%3%^%s%I$K2C$($F(B
edebug$B$NFCJL$J%3%^%s%I$r;H$($^$9!#(B
$B$?$H$($P!"$D$.$NDd;_0LCV$^$G<B9T$9$k$K$O(B
edebug$B%3%^%s%I(B@key{SPC}$B$rBG$A$^$9!#(B
@code{fac}$B$KF~$C$?$"$H$G(B@key{SPC}$B$r(B1$B2sBG$D$H!"(B
$B$D$.$N$h$&$JI=<($K$J$j$^$9!#(B
@example
(defun fac (n)
=>(if @point{}(< 0 n)
      (* n (fac (1- n)))
    1))
@end example
@c When Edebug stops execution after an expression, it displays the
@c expression's value in the echo area. 
$B<0$N$&$7$m$G(Bedebug$B$,<B9T$rDd;_$9$k$H!"(B
$B<0$NCM$r%(%3!<NN0h$KCM$rI=<($7$^$9!#(B
@c Other frequently used commands are @kbd{b} to set a breakpoint at a stop
@c point, @kbd{g} to execute until a breakpoint is reached, and @kbd{q} to
@c exit Edebug and return to the top-level command loop.  Type @kbd{?} to
@c display a list of all Edebug commands.
$BB?MQ$5$l$kB>$N%3%^%s%I$K$O!"(B
$BDd;_0LCV$K%V%l!<%/%]%$%s%H$r@_Dj$9$k(B@kbd{b}$B!"(B
$B%V%l!<%/%]%$%s%H$KC#$9$k$^$G<B9T$9$k(B@kbd{g}$B!"(B
edebug$B$r=*N;$7$F%H%C%W%l%Y%k$N%3%^%s%I%k!<%W$XLa$k(B@kbd{q}$B$,$"$j$^$9!#(B
edebug$B$N%3%^%s%I0lMw$rI=<($9$k$K$O(B@kbd{?}$B$rBG$A$^$9!#(B
@node Instrumenting
@c @subsection Instrumenting for Edebug
@subsection edebug$B8~$1$N=hCV(B
@c   In order to use Edebug to debug Lisp code, you must first
@c @dfn{instrument} the code.  Instrumenting code inserts additional code
@c into it, to invoke Edebug at the proper places.
Lisp$B%3!<%I$N%G%P%C%0$K(Bedebug$B$r;H$&$?$a$K$O!"(B
$B%3!<%I$r$^$:(B@dfn{$B=hCV(B}$B$9$kI,MW$,$"$j$^$9!#(B
$B%3!<%I$r=hCV$9$k$H!"E,Ev$J2U=j$G(Bedebug$B$r5/F0$9$kDI2C$N%3!<%I$rA^F~$7$^$9!#(B
@kindex C-M-x
@c @findex eval-defun (Edebug)
@findex eval-defun @r{$B!J(Bedebug$B!K(B}
@c   Once you have loaded Edebug, the command @kbd{C-M-x}
@c (@code{eval-defun}) is redefined so that when invoked with a prefix
@c argument on a definition, it instruments the definition before
@c evaluating it.  (The source code itself is not modified.)  If the
@c variable @code{edebug-all-defs} is non-@code{nil}, that inverts the
@c meaning of the prefix argument: then @kbd{C-M-x} instruments the
@c definition @emph{unless} it has a prefix argument.  The default value of
@c @code{edebug-all-defs} is @code{nil}.  The command @kbd{M-x
@c edebug-all-defs} toggles the value of the variable
@c @code{edebug-all-defs}.
$B$$$C$?$s(Bedebug$B$r%m!<%I$9$k$H!"(B
$B%3%^%s%I(B@kbd{C-M-x}$B!J(B@code{eval-defun}$B!K$O:FDj5A$5$l$^$9!#(B
$BDj5AFb$GA0CV0z?t$r;XDj$7$F5/F0$9$k$H(B
$BDj5A$rI>2A$9$k$^$($K=hCV$9$k$h$&$K$J$j$^$9!#(B
$B!J%=!<%9%3!<%I<+BN$OJQ99$7$J$$!#!K(B
$BJQ?t(B@code{edebug-all-defs}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
$BA0CV0z?t$N0UL#$r5U$K$7$^$9!#(B
$B$D$^$j!"A0CV0z?t$r;XDj$7(B@emph{$B$J$$8B$j(B}$B!"(B
@kbd{C-M-x}$B$O4X?tDj5A$r=hCV$7$^$9!#(B
$BJQ?t(B@code{edebug-all-defs}$B$N%G%U%)%k%HCM$O(B@code{nil}$B$G$9!#(B
$B%3%^%s%I(B@kbd{M-x edebug-all-defs}$B$OJQ?t(B@code{edebug-all-defs}$B$NCM$r(B
$B%H%0%k$7$^$9!#(B
@c @findex eval-region @r{(Edebug)}
@c @findex eval-current-buffer @r{(Edebug)}
@findex eval-region @r{$B!J(Bedebug$B!K(B}
@findex eval-current-buffer @r{$B!J(Bedebug$B!K(B}
@c   If @code{edebug-all-defs} is non-@code{nil}, then the commands
@c @code{eval-region}, @code{eval-current-buffer}, and @code{eval-buffer}
@c also instrument any definitions they evaluate.  Similarly,
@c @code{edebug-all-forms} controls whether @code{eval-region} should
@c instrument @emph{any} form, even non-defining forms.  This doesn't apply
@c to loading or evaluations in the minibuffer.  The command @kbd{M-x
@c edebug-all-forms} toggles this option.
@code{edebug-all-defs}$B$,(B@code{nil}$B0J30$G$"$k$H!"(B
$B%3%^%s%I(B@code{eval-region}$B!"(B@code{eval-current-buffer}$B!"(B@code{eval-buffer}$B$b(B
$B$=$l$i$,I>2A$9$kDj5A$r=hCV$7$^$9!#(B
$BF1MM$K!"(B@code{edebug-all-forms}$B$O!"(B
$BDj5A0J30$N%U%)!<%`$G$"$C$F$b(B@code{eval-region}$B$,(B
@emph{$BG$0U(B}$B$N%U%)!<%`$r=hCV$9$k$+$I$&$+@)8f$7$^$9!#(B
$B$3$l$O!"%_%K%P%C%U%!$G$N%m!<%I$dI>2A$K$OE,MQ$5$l$^$;$s!#(B
$B%3%^%s%I(B@kbd{M-x edebug-all-forms}$B$O$3$N%*%W%7%g%s$r%H%0%k$7$^$9!#(B
@findex edebug-eval-top-level-form
@c   Another command, @kbd{M-x edebug-eval-top-level-form}, is available to
@c instrument any top-level form regardless of the values of
@c @code{edebug-all-defs} and @code{edebug-all-forms}.
$BJL$N%3%^%s%I(B@kbd{M-x edebug-eval-top-level-form}$B$O!"(B
@code{edebug-all-defs}$B$H(B@code{edebug-all-forms}$B$NCM$K4X$o$i$:(B
$BG$0U$N%H%C%W%l%Y%k$N%U%)!<%`$r=hCV$9$k$?$a$K;H$($^$9!#(B
@c   While Edebug is active, the command @kbd{I}
@c (@code{edebug-instrument-callee}) instruments the definition of the
@c function or macro called by the list form after point, if is not already
@c instrumented.  This is possible only if Edebug knows where to find the
@c source for that function; after loading Edebug, @code{eval-region}
@c records the position of every definition it evaluates, even if not
@c instrumenting it.  See also the @kbd{i} command (@pxref{Jumping}), which
@c steps into the call after instrumenting the function.
edebug$B$,F0:nCf$O!"(B
$B%3%^%s%I(B@kbd{I}$B!J(B@code{edebug-instrument-callee}$B!K$G!"(B
$B%]%$%s%H$N$&$7$m$N%U%)!<%`$+$i8F$P$l$k4X?t$d%^%/%m$NDj5A$r(B
$B=hCV:Q$_$G$J$1$l$P=hCV$G$-$^$9!#(B
$B$3$l$O!"(Bedebug$B$,Ev3:4X?t$N%=!<%9$rC5$;$k>l9g$K$N$_2DG=$G$9!#(B
edebug$B$r%m!<%I8e$K$O!"(B
@code{eval-region}$B$O!"=hCV$7$F$$$J$$$b$N$b4^$a$F!"(B
$BI>2A$7$?3FDj5A$N0LCV$r5-O?$7$F$$$^$9!#(B
$B4X?t$r=hCV8e$K8F$S=P$7$F%9%F%C%W<B9T$9$k(B
$B%3%^%s%I(B@kbd{i}$B!J(B@pxref{Jumping}$B!K$b;2>H$7$F$/$@$5$$!#(B
@c @cindex special forms (Edebug)
@c @cindex interactive commands (Edebug)
@c @cindex anonymous lambda expressions (Edebug)
@c @cindex Common Lisp (Edebug)
@c @pindex cl.el @r{(Edebug)}
@cindex $B%9%Z%7%c%k%U%)!<%`!J(Bedebug$B!K(B
@cindex $BBPOCE*%3%^%s%I!J(Bedebug$B!K(B
@cindex $BL5L>%i%`%@<0!J(Bedebug$B!K(B
@cindex Common Lisp$B!J(Bedebug$B!K(B
@pindex cl.el @r{$B!J(Bedebug$B!K(B}
@pindex cl-specs.el
@c   Edebug knows how to instrument all the standard special forms,
@c @code{interactive} forms with an expression argument, anonymous lambda
@c expressions, and other defining forms.  Edebug cannot know what a
@c user-defined macro will do with the arguments of a macro call, so you
@c must tell it; see @ref{Instrumenting Macro Calls}, for details.
edebug$B$O!"I8=`$N%9%Z%7%c%k%U%)!<%`$9$Y$F!"(B
$B<0$r0z?t$H$9$k(B@code{interactive}$B%U%)!<%`!"(B
$BL5L>%i%`%@<0!"B>$NDj5A%U%)!<%`$r$I$N$h$&$K=hCV$9$k$+$o$+$C$F$$$^$9!#(B
edebug$B$O!"%^%/%m8F$S=P$7$r0z?t$K;}$D%f!<%6!<Dj5A%^%/%m$r$I$N$h$&$K(B
$B=hCV$9$Y$-$+$o$+$j$^$;$s$+$i!"FI<T$,$=$l$r;X<($9$kI,MW$,$"$j$^$9!#(B
$B>\$7$/$O!"(B@xref{Instrumenting Macro Calls}$B!#(B
@c   When Edebug is about to instrument code for the first time in a
@c session, it runs the hook @code{edebug-setup-hook}, then sets it to
@c @code{nil}.  You can use this to arrange to load Edebug specifications
@c (@pxref{Instrumenting Macro Calls}) associated with a package you are
@c using, but actually load them only if you use Edebug.
edebug$B$O!"$"$k%;%C%7%g%s$G=i$a$F%3!<%I$r=hCV$9$k>l9g!"(B
$B%U%C%/(B@code{edebug-setup-hook}$B$r<B9T$7$F$+$i(B
$B$=$l$K(B@code{nil}$B$r@_Dj$7$^$9!#(B
$B$3$l$rMxMQ$9$k$H!"FI<T$,;HMQ$9$k%Q%C%1!<%8$KBP1~$7$?(B
edebug$BMQ;EMM!J(B@pxref{Instrumenting Macro Calls}$B!K$r(B
edebug$B$r;HMQ$9$k>l9g$K$N$_%m!<%I$9$k$h$&$K$G$-$^$9!#(B
@c @findex eval-expression @r{(Edebug)}
@findex eval-expression @r{$B!J(Bedebug$B!K(B}
@c   To remove instrumentation from a definition, simply re-evaluate its
@c definition in a way that does not instrument.  There are two ways of
@c evaluating forms that never instrument them: from a file with
@c @code{load}, and from the minibuffer with @code{eval-expression}
@c (@kbd{M-:}).
$BDj5A$+$i=hCV$r<h$j=|$/$K$O!"(B
$B=hCV$7$J$$$h$&$JJ}K!$G$=$NDj5A$rC1$K:FI>2A$9$k$@$1$G$9!#(B
$B$1$C$7$F=hCV$;$:$K%U%)!<%`$rI>2A$9$kJ}K!$O(B2$B$D$"$j$^$9!#(B
$B%U%!%$%k$r(B@code{load}$B$9$k$+!"(B
$B%_%K%P%C%U%!$G(B@code{eval-expression}$B!J(B@kbd{M-:}$B!K$r;H$$$^$9!#(B
@c   If Edebug detects a syntax error while instrumenting, it leaves point
@c at the erroneous code and signals an @code{invalid-read-syntax} error.
edebug$B$,=hCVCf$K9=J8%(%i!<$r8!=P$9$k$H!"(B
$B%3!<%I$N%(%i!<2U=j$K%]%$%s%H$rCV$$$F!"(B
$B%(%i!<(B@code{invalid-read-syntax}$B$rDLCN$7$^$9!#(B
@c   @xref{Edebug Eval}, for other evaluation functions available
@c inside of Edebug.
edebug$B$NFbB&$G;H$($kB>$NI>2A4X?t$K$D$$$F$O(B@xref{Edebug Eval}$B!#(B
@node Edebug Execution Modes
@c @subsection Edebug Execution Modes
@subsection edebug$B$N<B9T%b!<%I(B
@c @cindex Edebug execution modes
@cindex edebug$B$N<B9T%b!<%I(B
@c Edebug supports several execution modes for running the program you are
@c debugging.  We call these alternatives @dfn{Edebug execution modes}; do
@c not confuse them with major or minor modes.  The current Edebug execution mode
@c determines how far Edebug continues execution before stopping---whether
@c it stops at each stop point, or continues to the next breakpoint, for
@c example---and how much Edebug displays the progress of the evaluation
@c before it stops.
edebug$B$K$OFI<T$,%G%P%C%0$7$F$$$k%W%m%0%i%`$r<B9T$9$k$?$a$N(B
$B<B9T%b!<%I$,J#?t$"$j$^$9!#(B
$B$3$l$i$r(B@dfn{edebug$B$N<B9T%b!<%I(B}$B$H8F$S$^$9!#(B
$B$3$l$i$r%a%8%c!<%b!<%I$d%^%$%J%b!<%I$H:.F1$7$J$$$G$/$@$5$$!#(B
edebug$B$N<B9T%b!<%I$O!"Dd;_$9$k$^$G$K$I$NDxEY(Bedebug$B$,<B9T$r7QB3$9$k$+!"(B
$B$?$H$($P!"3FDd;_0LCV$GDd;_$9$k$N$+$D$.$N%V%l!<%/%]%$%s%H$^$G7QB3$9$k$N$+!"(B
$B$^$?!"Dd;_$9$k$^$G$KI>2A$N?J9T>u67$r$I$NDxEY(Bedebug$B$,I=<($9$k$N$+$r(B
$B7hDj$7$^$9!#(B
@c Normally, you specify the Edebug execution mode by typing a command to
@c continue the program in a certain mode.  Here is a table of these
@c commands.  All except for @kbd{S} resume execution of the program, at
@c least for a certain distance.
$BDL>o!"$"$k%b!<%I$K$*$$$F!"(B
$B%W%m%0%i%`$r7QB3$9$k%3%^%s%I$rBG$D$3$H$G(Bedebug$B$N<B9T%b!<%I$r;XDj$7$^$9!#(B
$B0J2<$K$=$l$i$N%3%^%s%I$N0lMw$r<($7$^$9!#(B
@kbd{S}$B$r=|$/$9$Y$F$N%3%^%s%I$O!"(B
$B>/$J$/$H$b$"$kDxEY%W%m%0%i%`$N<B9T$r:F3+$7$^$9!#(B
@table @kbd
@item S
@c Stop: don't execute any more of the program for now, just wait for more
@c Edebug commands (@code{edebug-stop}).
$BDd;_!'(B@code{ }$B%W%m%0%i%`$r$$$C$5$$<B9T$;$:$K!"(B
edebug$B%3%^%s%I$NF~NO$rBT$D!J(B@code{edebug-stop}$B!K!#(B
@item @key{SPC}
@c Step: stop at the next stop point encountered (@code{edebug-step-mode}).
$B%9%F%C%W<B9T!'(B@code{ }$B$D$.$K=P2q$&Dd;_0LCV$G;_$^$k!J(B@code{edebug-step-mode}$B!K!#(B
@item n
@c Next: stop at the next stop point encountered after an expression
@c (@code{edebug-next-mode}).  Also see @code{edebug-forward-sexp} in
@c @ref{Edebug Misc}.
$B$D$.!'(B@code{ }$B<0$N$&$7$m$G$D$.$K=P2q$&Dd;_0LCV$G;_$^$k(B
$B!J(B@code{edebug-next-mode}$B!K!#(B
@ref{Edebug Misc}$B$N(B@code{edebug-forward-sexp}$B$b;2>H!#(B
@item t
@c Trace: pause one second at each Edebug stop point (@code{edebug-trace-mode}).
$B%H%l!<%9!'(B@code{ }edebug$B$N3FDd;_0LCV$G(B1$BIC4V5Y;_$9$k(B
$B!J(B@code{edebug-trace-mode}$B!K!#(B
@item T
@c Rapid trace: update the display at each stop point, but don't actually
@c pause (@code{edebug-Trace-fast-mode}).
$B9bB.%H%l!<%9!'(B@code{ }$B3FDd;_0LCV$GI=<($r99?7$9$k$,5Y;_$7$J$$(B
$B!J(B@code{edebug-Trace-fast-mode}$B!K!#(B
@item g
@c Go: run until the next breakpoint (@code{edebug-go-mode}).  @xref{Breakpoints}.
$B<B9T!'(B@code{ }$B$D$.$N%V%l!<%/%]%$%s%H$^$G<B9T$9$k(B
$B!J(B@code{edebug-go-mode}$B!K!#(B
@pxref{Breakpoints}$B!#(B
@item c
@c Continue: pause one second at each breakpoint, and then continue
@c (@code{edebug-continue-mode}).
$B7QB3!'(B@code{ }$B3F%V%l!<%/%]%$%s%H$G(B1$BIC4V5Y;_$7$F$+$i7QB3$9$k(B
$B!J(B@code{edebug-continue-mode}$B!K!#(B
@item C
@c Rapid continue: move point to each breakpoint, but don't pause
@c (@code{edebug-Continue-fast-mode}).
$B9bB.7QB3!'(B@code{ }$B3F%V%l!<%/%]%$%s%H$X%]%$%s%H$r0\F0$9$k$,5Y;_$7$J$$(B
$B!J(B@code{edebug-Continue-fast-mode}$B!K!#(B
@item G
@c Go non-stop: ignore breakpoints (@code{edebug-Go-nonstop-mode}).  You
@c can still stop the program by typing @kbd{S}, or any editing command.
$BHsDd;_<B9T!'(B@code{ }$B%V%l!<%/%]%$%s%H$rL5;k$9$k(B
$B!J(B@code{edebug-Go-nonstop-mode}$B!K!#(B
@kbd{S}$B$dJT=8%3%^%s%I$rBG$F$PDd;_$G$-$k!#(B
@end table
@c In general, the execution modes earlier in the above list run the
@c program more slowly or stop sooner than the modes later in the list.
$B0lHL$K!">e5-0lMw$N>e$K$"$k<B9T%b!<%I$[$I2<$K$"$k$b$N$KHf$Y$k$H(B
$B%W%m%0%i%`$r$f$C$/$j<B9T!"$D$^$j!"Aa$/Dd;_$7$^$9!#(B
@c While executing or tracing, you can interrupt the execution by typing
@c any Edebug command.  Edebug stops the program at the next stop point and
@c then executes the command you typed.  For example, typing @kbd{t} during
@c execution switches to trace mode at the next stop point.  You can use
@c @kbd{S} to stop execution without doing anything else.
$B<B9TCf$d%H%l!<%9Cf$K$O!"(Bedebug$B%3%^%s%I$r$J$K$+BG$F$P<B9T$K3d$j9~$a$^$9!#(B
edebug$B$O$D$.$NDd;_0LCV$G%W%m%0%i%`$r;_$a!"(B
$BFI<T$,BG$C$?%3%^%s%I$r<B9T$7$^$9!#(B
$B$?$H$($P!"<B9TCf$K(B@kbd{t}$B$rBG$F$P!"$D$.$NDd;_0LCV$G%H%l!<%9%b!<%I$K(B
$B@Z$jBX$o$j$^$9!#(B
$BC1$K<B9T$rDd;_$9$k$K$O(B@kbd{S}$B$r;H$$$^$9!#(B
@c If your function happens to read input, a character you type intending
@c to interrupt execution may be read by the function instead.  You can
@c avoid such unintended results by paying attention to when your program
@c wants input.
$BFI<T$N4X?t$,F~NO$rFI$_<h$k>l9g!"<B9T$K3d$j9~$`$D$b$j$GBG$C$?J8;z$r(B
$B4X?t$,FI$_<h$C$F$7$^$&$+$b$7$l$^$;$s!#(B
$BFI<T$N%W%m%0%i%`$,$$$DF~NO$9$k$+$KCm0U$7$F$$$l$P!"(B
$B$3$N$h$&$J0U?^$7$J$$7k2L$rHr$1$k$3$H$,$G$-$^$9!#(B
@c @cindex keyboard macros (Edebug)
@cindex $B%-!<%\!<%I%^%/%m!J(Bedebug$B!K(B
@c Keyboard macros containing the commands in this section do not
@c completely work: exiting from Edebug, to resume the program, loses track
@c of the keyboard macro.  This is not easy to fix.  Also, defining or
@c executing a keyboard macro outside of Edebug does not affect commands
@c inside Edebug.  This is usually an advantage.  But see the
@c @code{edebug-continue-kbd-macro} option (@pxref{Edebug Options}).
$BK\@a$G=R$Y$?%3%^%s%I$r4^$`%-!<%\!<%I%^%/%m$OF0:n$7$^$;$s!#(B
$B$D$^$j!"%W%m%0%i%`$r:F3+$9$k$?$a$K(Bedebug$B$+$iH4$1$k$H(B
$B%-!<%\!<%I%^%/%m$N@)8f$r<:$C$F$7$^$$$^$9!#(B
$B$3$l$r=$@5$9$k$N$O4JC1$G$O$"$j$^$;$s!#(B
$B$^$?!"(Bedebug$B$N30B&$G%-!<%\!<%I%^%/%m$rDj5A$7$?$j<B9T$7$F$b!"(B
edebug$BFb$N%3%^%s%I$K$O$J$s$N1F6A$b$"$j$^$;$s!#(B
$B$3$l$OIaDL$OMxE@$G$9!#(B
$B$7$+$7!"%*%W%7%g%s(B@code{edebug-continue-kbd-macro}
$B!J(B@pxref{Edebug Options}$B!K$b;2>H$7$F$/$@$5$$!#(B
@c When you enter a new Edebug level, the initial execution mode comes from
@c the value of the variable @code{edebug-initial-mode}.  By default, this
@c specifies step mode.  Note that you may reenter the same Edebug level
@c several times if, for example, an instrumented function is called
@c several times from one command.
edebug$B$N?7$?$J%l%Y%k$KF~$k$H!"JQ?t(B@code{edebug-initial-mode}$B$NCM$r(B
$B<B9T%b!<%I$N=i4|CM$H$7$^$9!#(B
$B%G%U%)%k%H$G$O!"$3$l$O%9%F%C%W<B9T%b!<%I$r;XDj$7$^$9!#(B
$B=hCV$7$?4X?t$r(B1$B$D$N%3%^%s%I$+$iJ#?t2s8F$S=P$9$J$I$7$F(B
edebug$B$NF10l%l%Y%k$K:FEYF~$k$3$H$,$G$-$k$3$H$KCm0U$7$F$/$@$5$$!#(B
@node Jumping
@c @subsection Jumping
@subsection $B%8%c%s%W(B
@c   The commands described in this section execute until they reach a
@c specified location.  All except @kbd{i} make a temporary breakpoint to
@c establish the place to stop, then switch to go mode.  Any other
@c breakpoint reached before the intended stop point will also stop
@c execution.  @xref{Breakpoints}, for the details on breakpoints.
$BK\@a$G=R$Y$k%3%^%s%I$O!";XDj$7$?0LCV$KC#$9$k$^$G<B9T$7$^$9!#(B
@kbd{i}$B$r=|$/$9$Y$F$N$b$N$O!"Dd;_$9$k>l=j$K0l;~E*$J%V%l!<%/%]%$%s%H$r(B
$B@_Dj$7$F$+$i<B9T%b!<%I$K0\9T$7$^$9!#(B
$B0U?^$7$?%V%l!<%/%]%$%s%H$h$j@h$KJL$N%V%l!<%/%]%$%s%H$KC#$7$F$b(B
$B<B9T$rDd;_$7$^$9!#(B
$B%V%l!<%/%]%$%s%H$K$D$$$F>\$7$/$O(B@xref{Breakpoints}$B!#(B
@c   These commands may fail to work as expected in case of nonlocal exit,
@c because a nonlocal exit can bypass the temporary breakpoint where you
@c expected the program to stop.
$BHs%m!<%+%kC&=P$O!"FI<T$,0U?^$7$?%W%m%0%i%`$NDd;_$9$Y$-(B
$B0l;~E*$J%V%l!<%/%]%$%s%H$r1*2s$9$k$?$a!"(B
$B$3$l$i$N%3%^%s%I$OHs%m!<%+%kC&=P$,$"$k$H0U?^$7$?$h$&$KF0:n$7$^$;$s!#(B
@table @kbd
@item h
@c Proceed to the stop point near where point is (@code{edebug-goto-here}).
$B%]%$%s%H0LCVIU6a$NDd;_0LCV$^$G?J$`!J(B@code{edebug-goto-here}$B!K!#(B
@item f
@c Run the program forward over one expression
@c (@code{edebug-forward-sexp}).
$B%W%m%0%i%`$N<0(B1$B$DJ,@h$X?J$`!J(B@code{edebug-forward-sexp}$B!K!#(B
@item o
@c Run the program until the end of the containing sexp.
$B0O$s$G$$$k(BS$B<0$N=*$j$^$G%W%m%0%i%`$r<B9T$9$k!#(B
@item i
@c Step into the function or macro called by the form after point.
$B%]%$%s%H$N$"$H$N%U%)!<%`$+$i8F$P$l$k4X?t$d%^%/%m$X?J$`!#(B
@end table
@c The @kbd{h} command proceeds to the stop point near the current location
@c of point, using a temporary breakpoint.  See @ref{Breakpoints}, for more
@c information about breakpoints.
$B%3%^%s%I(B@kbd{h}$B$O!"0l;~E*$J%V%l!<%/%]%$%s%H$r;H$C$F!"(B
$B%]%$%s%H0LCVIU6a$NDd;_0LCV$^$G?J$_$^$9!#(B
$B%V%l!<%/%]%$%s%H$K$D$$$F>\$7$/$O(B@xref{Breakpoints}$B!#(B
@c The @kbd{f} command runs the program forward over one expression.  More
@c precisely, it sets a temporary breakpoint at the position that
@c @kbd{C-M-f} would reach, then executes in go mode so that the program
@c will stop at breakpoints.
$B%3%^%s%I(B@kbd{f}$B$O!"%W%m%0%i%`$N<0(B1$B$DJ,@h$X?J$_$^$9!#(B
$B$h$j@53N$K$O!"(B@kbd{C-M-f}$B$K$h$k0\F02U=j$X0l;~E*$J%V%l!<%/%]%$%s%H$r@_Dj$7!"(B
$B%W%m%0%i%`$,%V%l!<%/%]%$%s%H$GDd;_$9$k$h$&$J<B9T%b!<%I$G<B9T$7$^$9!#(B
@c With a prefix argument @var{n}, the temporary breakpoint is placed
@c @var{n} sexps beyond point.  If the containing list ends before @var{n}
@c more elements, then the place to stop is after the containing
@c expression.
$BA0CV0z?t(B@var{n}$B$r;XDj$9$k$H!"(B
$B%]%$%s%H0LCV$+$i(B@var{n}$B8D@h$N(BS$B<0$K0l;~E*$J%V%l!<%/%]%$%s%H$r@_Dj$7$^$9!#(B
$B0O$s$G$$$k%j%9%H$N;D$jMWAG?t$,(B@var{n}$B$h$j>/$J$1$l$P!"(B
$B0O$s$G$$$k<0$NKvHx$GDd;_$7$^$9!#(B
@c Be careful that the position @kbd{C-M-f} finds is a place that the
@c program will really get to; this may not be true in a
@c @code{cond}, for example.
@kbd{C-M-f}$B$N0\F0@h$O%W%m%0%i%`$,<B:]$KDd;_$9$k$G$"$m$&2U=j$G$9!#(B
$B$3$l$,@5$7$/$J$$>l9g$b$"$j!"$?$H$($P!"(B@code{cond}$B$G$O@5$7$/$"$j$^$;$s!#(B
@c The @kbd{f} command does @code{forward-sexp} starting at point, rather
@c than at the stop point, for flexibility.  If you want to execute one
@c expression @emph{from the current stop point}, type @kbd{w} first, to
@c move point there, and then type @kbd{f}.
$B%3%^%s%I(B@kbd{f}$B$O!"=@Fp@-$N$?$a$K!"(B
$BDd;_0LCV$G$O$J$/%]%$%s%H0LCV$G(B@code{forward-sexp}$B$r;H$$$^$9!#(B
@emph{$B8=:_$NDd;_0LCV$+$i(B}$B<0(B1$B$D$@$1<B9T$7$?$$>l9g$K$O!"(B
$B$^$:(B@kbd{w}$B$HBG$C$F%]%$%s%H$rDd;_0LCV$K0\F0$7$F$+$i(B@kbd{f}$B$rBG$A$^$9!#(B
@c The @kbd{o} command continues ``out of'' an expression.  It places a
@c temporary breakpoint at the end of the sexp containing point.  If the
@c containing sexp is a function definition itself, @kbd{o} continues until
@c just before the last sexp in the definition.  If that is where you are
@c now, it returns from the function and then stops.  In other words, this
@c command does not exit the currently executing function unless you are
@c positioned after the last sexp.
$B%3%^%s%I(B@kbd{o}$B$O<0$+$i!X=P$k!Y$^$G<B9T$7$^$9!#(B
$B%]%$%s%H$r4^$`(BS$B<0$NKvHx$K0l;~E*$J%V%l!<%/%]%$%s%H$rCV$-$^$9!#(B
$B$3$N(BS$B<0$,4X?tDj5A$=$N$b$N$G$"$k>l9g$K$O!"(B
@kbd{o}$B$ODj5A$N:G8e$N(BS$B<0$N<jA0$^$G<B9T$7$^$9!#(B
$B8=:_$3$N2U=j$K$$$?>l9g$K$O!"4X?t$+$iLa$C$F$+$iDd;_$7$^$9!#(B
$B$$$$$+$($l$P!":G8e$N(BS$B<0$N$"$H$K0LCV$7$F$$$J$$8B$j!"(B
$B$3$N%3%^%s%I$O8=:_<B9TCf$N4X?t$+$iH4$1$^$;$s!#(B
@c The @kbd{i} command steps into the function or macro called by the list
@c form after point, and stops at its first stop point.  Note that the form
@c need not be the one about to be evaluated.  But if the form is a
@c function call about to be evaluated, remember to use this command before
@c any of the arguments are evaluated, since otherwise it will be too late.
$B%3%^%s%I(B@kbd{i}$B$O!"(B
$B%]%$%s%H0LCV$N$"$H$K$"$k%j%9%H%U%)!<%`$+$i8F$P$l$k4X?t$d%^%/%m$X?J$_!"(B
$B:G=i$K=P2q$C$?Dd;_0LCV$G;_$^$j$^$9!#(B
$B$=$N%U%)!<%`$O$3$l$+$iI>2A$5$l$k%U%)!<%`$G$"$kI,MW$O$"$j$^$;$s!#(B
$B$7$+$7!"I>2A$5$l$k%U%)!<%`$,4X?t8F$S=P$7$G$"$k>l9g$K$O!"(B
$B0z?t$rI>2A$9$k$^$($K$3$N%3%^%s%I$r;H$&$3$H$r3P$($F$*$$$F$/$@$5$$!#(B
$B$5$b$J$$$H$3$N%3%^%s%I$r;H$&;~4|$,CY$9$.$^$9!#(B
@c The @kbd{i} command instruments the function or macro it's supposed to
@c step into, if it isn't instrumented already.  This is convenient, but keep
@c in mind that the function or macro remains instrumented unless you explicitly
@c arrange to deinstrument it.
$B%3%^%s%I(B@kbd{i}$B$O!"8F$S=P$94X?t$d%^%/%m$,=hCV$5$l$F$$$J$$$H(B
$B$=$l$i$r=hCV$7$^$9!#(B
$B$3$l$OJXMx$G$9$,!"$=$l$i$N4X?t$d%^%/%m$O!"L@<(E*$K=hCV$r<h$j=|$+$J$$8B$j!"(B
$B=hCV$7$?$^$^$K$J$j$^$9!#(B
@node Edebug Misc
@c @subsection Miscellaneous Edebug Commands
@subsection edebug$B$N$=$NB>$N%3%^%s%I(B
@c   Some miscellaneous Edebug commands are described here.
edebug$B$NB>$N%3%^%s%I$r0J2<$K<($7$^$9!#(B
@table @kbd
@item ?
@c Display the help message for Edebug (@code{edebug-help}).
edebug$B$N%X%k%W%a%C%;!<%8$rI=<($9$k!J(B@code{edebug-help}$B!K!#(B
@item C-]
@c Abort one level back to the previous command level
@c (@code{abort-recursive-edit}).
1$B$D$^$($N%l%Y%k$N%3%^%s%I%l%Y%k$XLa$k!J(B@code{abort-recursive-edit}$B!K!#(B
@item q
@c Return to the top level editor command loop (@code{top-level}).  This
@c exits all recursive editing levels, including all levels of Edebug
@c activity.  However, instrumented code protected with
@c @code{unwind-protect} or @code{condition-case} forms may resume
@c debugging.
$B%(%G%#%?$N%H%C%W%l%Y%k$N%3%^%s%I%k!<%W$XLa$k!J(B@code{top-level}$B!K!#(B
edebug$B$N$9$Y$F$NF0:nCf$N%l%Y%k$r4^$a$F!"$9$Y$F$N:F5"JT=8%l%Y%k$+$iH4$1$k!#(B
$B$7$+$7!"%U%)!<%`(B@code{unwind-protect}$B$d(B@code{condition-case}$B$GJ]8n$7$?(B
$B=hCV:Q$_$N%3!<%I$,$"$k$H%G%P%C%,$r:F3+$9$k!#(B
@item Q
@c Like @kbd{q} but don't stop even for protected code
@c (@code{top-level-nonstop}).
@kbd{q}$B$HF1MM$G$"$k$,J]8n$7$?%3!<%I$G$bDd;_$7$J$$(B
$B!J(B@code{top-level-nonstop}$B!K!#(B
@item r
@c Redisplay the most recently known expression result in the echo area
@c (@code{edebug-previous-result}).
$B$b$C$H$b:G6a$N<0$N4{CN$N7k2L$r%(%3!<NN0h$K:FI=<($9$k(B
$B!J(B@code{edebug-previous-result}$B!K!#(B
@item d
@c Display a backtrace, excluding Edebug's own functions for clarity
@c (@code{edebug-backtrace}).
$B$o$+$j$d$9$$$h$&$K(Bedebug$B<+BN$N4X?t$r=|30$7$F%P%C%/%H%l!<%9$rI=<($9$k(B
$B!J(B@code{edebug-backtrace}$B!K!#(B
@c You cannot use debugger commands in the backtrace buffer in Edebug as
@c you would in the standard debugger.
edebug$B$N%P%C%/%H%l!<%9%P%C%U%!$G$O!"(B
$BI8=`$N%G%P%C%,$N$h$&$K$O%G%P%C%,$N%3%^%s%I$r;H$($J$$!#(B
@c The backtrace buffer is killed automatically when you continue
@c execution.
$B<B9T$r7QB3$9$k$H%P%C%/%H%l!<%9%P%C%U%!$O<+F0E*$K:o=|$5$l$k!#(B
@end table
@c From the Edebug recursive edit, you may invoke commands that activate
@c Edebug again recursively.  Any time Edebug is active, you can quit to
@c the top level with @kbd{q} or abort one recursive edit level with
@c @kbd{C-]}.  You can display a backtrace of all the 
@c pending evaluations with @kbd{d}.
edebug$B$N:F5"JT=8$+$i!"(Bedebug$B$r:F5"E*$K3h@-$K$9$k%3%^%s%I$r5/F0$G$-$^$9!#(B
edebug$B$,3h@-$G$"$k$H$-$K$O$$$D$G$b(B@kbd{q}$B$G%H%C%W%l%Y%k$XLa$k$+!"(B
@kbd{C-]}$B$G(B1$B$D$N:F5"JT=8%l%Y%k$rH4$1$k$3$H$,$G$-$^$9!#(B
$BJ]N1$7$F$$$kI>2A$9$Y$F$N%P%C%/%H%l!<%9$O(B@kbd{d}$B$GI=<($G$-$^$9!#(B
@node Breakpoints
@c @subsection Breakpoints
@subsection $B%V%l!<%/%]%$%s%H(B
@c @cindex breakpoints
@cindex $B%V%l!<%/%]%$%s%H(B
@c Edebug's step mode stops execution at the next stop point reached.
@c There are three other ways to stop Edebug execution once it has started:
@c breakpoints, the global break condition, and source breakpoints.
edebug$B$N%9%F%C%W<B9T%b!<%I$O!"$D$.$NDd;_0LCV$KC#$9$k$H<B9T$rDd;_$7$^$9!#(B
edebug$B$,<B9T$r;_$a$kJ}K!$O(B3$B$D$"$j$^$9!#(B
$B%V%l!<%/%]%$%s%H!"%0%m!<%P%k%V%l!<%/>r7o!"%=!<%9$N%V%l!<%/%]%$%s%H$G$9!#(B
@c While using Edebug, you can specify @dfn{breakpoints} in the program you
@c are testing: points where execution should stop.  You can set a
@c breakpoint at any stop point, as defined in @ref{Using Edebug}.  For
@c setting and unsetting breakpoints, the stop point that is affected is
@c the first one at or after point in the source code buffer.  Here are the
@c Edebug commands for breakpoints:
edebug$B$r;HMQCf$K$O!"FI<T$,%F%9%HCf$N%W%m%0%i%`$K(B@dfn{$B%V%l!<%/%]%$%s%H(B}
$B!J(Bbreakpoint$B!K!"$D$^$j!"<B9T$rDd;_$9$Y$-2U=j$r@_Dj$G$-$^$9!#(B
@ref{Using Edebug}$B$GDj5A$7$?G$0U$NDd;_0LCV$K%V%l!<%/%]%$%s%H$r@_Dj$G$-$^$9!#(B
$B%V%l!<%/%]%$%s%H$N@_Dj$d2r=|$K$*$$$FBP>]$H$J$kDd;_0LCV$O!"(B
$B%=!<%9%3!<%I%P%C%U%!$N%]%$%s%H0LCV$+$=$N$"$H$K$"$kDd;_0LCV$G$9!#(B
$B%V%l!<%/%]%$%s%H$K4X$9$k(Bedebug$B%3%^%s%I$O$D$.$N$H$*$j$G$9!#(B
@table @kbd
@item b
@c Set a breakpoint at the stop point at or after point
@c (@code{edebug-set-breakpoint}).  If you use a prefix argument, the
@c breakpoint is temporary (it turns off the first time it stops the
@c program).
$B%]%$%s%H0LCV$+$=$N$&$7$m$K$"$kDd;_0LCV$K%V%l!<%/%]%$%s%H$r@_Dj$9$k(B
$B!J(B@code{edebug-set-breakpoint}$B!K!#(B
$BA0CV0z?t$r;XDj$9$k$H!"0l;~E*$J%V%l!<%/%]%$%s%H$K$J$k(B
$B!J$=$3$G%W%m%0%i%`$,Dd;_$9$k$H2r=|$5$l$k!K!#(B
@item u
@c Unset the breakpoint (if any) at the stop point at or after 
@c point (@code{edebug-unset-breakpoint}).
$B%]%$%s%H0LCV$+$=$N$&$7$m$K$"$kDd;_0LCV$N!J$"$l$P!K%V%l!<%/%]%$%s%H$r2r=|$9$k(B
$B!J(B@code{edebug-unset-breakpoint}$B!K!#(B
@item x @var{condition} @key{RET}
@c Set a conditional breakpoint which stops the program only if
@c @var{condition} evaluates to a non-@code{nil} value
@c (@code{edebug-set-conditional-breakpoint}).  With a prefix argument, the
@c breakpoint is temporary.
@var{condition}$B$,(B@code{nil}$B0J30$NCM$KI>2A$5$l$k>l9g$K$N$_(B
$B%W%m%0%i%`$rDd;_$9$k>r7oIU$-%V%l!<%/%]%$%s%H$r@_Dj$9$k(B
$B!J(B@code{edebug-set-conditional-breakpoint}$B!K!#(B
$BA0CV0z?t$r;XDj$9$k$H!"0l;~E*$J%V%l!<%/%]%$%s%H$K$J$k!#(B
@item B
@c Move point to the next breakpoint in the current definition
@c (@code{edebug-next-breakpoint}).
$B8=:_$NDj5AFb$K$"$k$D$.$N%V%l!<%/%]%$%s%H$K%]%$%s%H0LCV$r0\F0$9$k(B
$B!J(B@code{edebug-next-breakpoint}$B!K!#(B
@end table
@c While in Edebug, you can set a breakpoint with @kbd{b} and unset one
@c with @kbd{u}.  First move point to the Edebug stop point of your choice,
@c then type @kbd{b} or @kbd{u} to set or unset a breakpoint there.
@c Unsetting a breakpoint where none has been set has no effect.
edebug$BFb$G$O!"(B@kbd{b}$B$G%V%l!<%/%]%$%s%H$r@_Dj$7!"(B
@kbd{u}$B$G2r=|$G$-$^$9!#(B
$B$^$:L\E*$N(Bedegug$B$NDd;_0LCV$K%]%$%s%H0LCV$r0\F0$7!"(B
@kbd{b}$B$rBG$C$F$=$N2U=j$K%V%l!<%/%]%$%s%H$r@_Dj$7$?$j!"(B
@kbd{u}$B$rBG$C$F$=$N2U=j$N%V%l!<%/%]%$%s%H$r2r=|$7$^$9!#(B
$B@_Dj$5$l$F$$$J$$%V%l!<%/%]%$%s%H$r2r=|$7$F$b!"$J$K$b5/$3$j$^$;$s!#(B
@c Re-evaluating or reinstrumenting a definition forgets all its breakpoints.
$BDj5A$r:FI>2A$7$?$j:F=hCV$9$k$H!"$=$NCf$N%V%l!<%/%]%$%s%H$9$Y$F$r2r=|$7$^$9!#(B
@c A @dfn{conditional breakpoint} tests a condition each time the program
@c gets there.  Any errors that occur as a result of evaluating the
@c condition are ignored, as if the result were @code{nil}.  To set a
@c conditional breakpoint, use @kbd{x}, and specify the condition
@c expression in the minibuffer.  Setting a conditional breakpoint at a
@c stop point that has a previously established conditional breakpoint puts
@c the previous condition expression in the minibuffer so you can edit it.
@dfn{$B>r7oIU$-%V%l!<%/%]%$%s%H(B}$B!J(Bconditional breakpoint$B!K$O!"(B
$B%W%m%0%i%`$,$3$N2U=j$KC#$9$k$?$S$K>r7o$r8!::$7$^$9!#(B
$B>r7o$rI>2ACf$KH/@8$9$k$I$s$J%(%i!<$bL5;k$7!"(B
@code{nil}$B$H$7$F07$$$^$9!#(B
$B>r7oIU$-%V%l!<%/%]%$%s%H$r@_Dj$9$k$K$O(B@kbd{x}$B$r;H$$!"(B
$B>r7o<0$O%_%K%P%C%U%!$G;XDj$7$^$9!#(B
$B$9$G$K>r7oIU$-%V%l!<%/%]%$%s%H$r@_Dj$7$F$"$kDd;_0LCV$K(B
$B>r7oIU$-%V%l!<%/%]%$%s%H$r@_Dj$7D>$9$H!"(B
$B$=$l$^$G$N>r7o<0$,%_%K%P%C%U%!$KF~$k$N$GJT=8$G$-$^$9!#(B
@c You can make a conditional or unconditional breakpoint
@c @dfn{temporary} by using a prefix argument with the command to set the
@c breakpoint.  When a temporary breakpoint stops the program, it is
@c automatically unset.
$B%V%l!<%/%]%$%s%H$r@_Dj$9$k%3%^%s%I$KA0CV0z?t$r;XDj$9$k$H!"(B
$B>r7oIU$-!?L5>r7o%V%l!<%/%]%$%s%H$r(B@dfn{$B0l;~E*(B}$B$J$b$N$K$G$-$^$9!#(B
$B0l;~E*%V%l!<%/%]%$%s%H$G%W%m%0%i%`$,Dd;_$9$k$H!"(B
$B$=$N%V%l!<%/%]%$%s%H$O<+F0E*$K2r=|$5$l$^$9!#(B
@c Edebug always stops or pauses at a breakpoint except when the Edebug
@c mode is Go-nonstop.  In that mode, it ignores breakpoints entirely.
edebug$B$N%b!<%I$,HsDd;_<B9T$G$J$1$l$P!"(B
edebug$B$O%V%l!<%/%]%$%s%H$G$D$M$KDd;_$9$k$+5Y;_$7$^$9!#(B
$BHsDd;_<B9T%b!<%I$G$O!"%V%l!<%/%]%$%s%H$r40A4$KL5;k$7$^$9!#(B
@c To find out where your breakpoints are, use the @kbd{B} command, which
@c moves point to the next breakpoint following point, within the same
@c function, or to the first breakpoint if there are no following
@c breakpoints.  This command does not continue execution---it just moves
@c point in the buffer.
$B%V%l!<%/%]%$%s%H$N>l=j$r3NG'$9$k$K$O!"%3%^%s%I(B@kbd{B}$B$r;H$$$^$9!#(B
$BF1$84X?tFb$N%]%$%s%H2U=j$N$&$7$m$K$"$k%V%l!<%/%]%$%s%H$+!"(B
$B8eB3$N$b$N$,$J$1$l$P:G=i$N%V%l!<%/%]%$%s%H$K%]%$%s%H0LCV$r0\F0$7$^$9!#(B
$B$3$N%3%^%s%I$O<B9T$r7QB3$7$^$;$s!#(B
$B%P%C%U%!Fb$GC1$K%]%$%s%H$r0\F0$9$k$@$1$G$9!#(B
@menu
* Global Break Condition::	Breaking on an event. 
* Source Breakpoints::  	Embedding breakpoints in source code.
@end menu
@node Global Break Condition
@c @subsubsection Global Break Condition
@subsubsection $B%0%m!<%P%k%V%l!<%/>r7o(B
@c @cindex stopping on events
@c @cindex global break condition
@cindex $B%$%Y%s%H$K$h$kDd;_(B
@cindex $B%0%m!<%P%k%V%l!<%/>r7o(B
@c   A @dfn{global break condition} stops execution when a specified
@c condition is satisfied, no matter where that may occur.  Edebug
@c evaluates the global break condition at every stop point.  If it
@c evaluates to a non-@code{nil} value, then execution stops or pauses
@c depending on the execution mode, as if a breakpoint had been hit.  If
@c evaluating the condition gets an error, execution does not stop.
@dfn{$B%0%m!<%P%k%V%l!<%/>r7o(B}$B!J(Bglobal break condition$B!K$O!"(B
$B;XDj$7$?>r7o$,K~$?$5$l$k$H!"$=$N>l=j$K4X$o$i$:!"<B9T$rDd;_$5$;$^$9!#(B
edebug$B$O3FDd;_0LCV$K$*$$$F%0%m!<%P%k%V%l!<%/>r7o$rI>2A$7$^$9!#(B
$B$3$l$,(B@code{nil}$B0J30$NCM$G$"$k$H!"(B
$B%V%l!<%/%]%$%s%H$KC#$7$?$+$N$h$&$K!"(B
$B<B9T%b!<%I$K0MB8$7$F<B9T$rDd;_$9$k$+5Y;_$7$^$9!#(B
$B>r7o$NI>2ACf$K%(%i!<$,H/@8$7$F$b<B9T$ODd;_$7$^$;$s!#(B
@findex edebug-set-global-break-condition
@c   The condition expression is stored in
@c @code{edebug-global-break-condition}.  You can specify a new expression
@c using the @kbd{X} command (@code{edebug-set-global-break-condition}).
$B>r7o<0$O(B@code{edebug-global-break-condition}$B$KJ]B8$5$l$^$9!#(B
$B%3%^%s%I(B@kbd{X}$B$G?7$?$J>r7o<0$r;XDj$G$-$^$9(B
$B!J(B@code{edebug-set-global-break-condition}$B!K!#(B
@c   The global break condition is the simplest way to find where in your
@c code some event occurs, but it makes code run much more slowly.  So you
@c should reset the condition to @code{nil} when not using it.
$B%0%m!<%P%k%V%l!<%/>r7o$O!"FI<T$N%3!<%I$N$I$3$G%$%Y%s%H$,H/@8$9$k$+$r(B
$BD4$Y$k$b$C$H$b4JC1$JJ}K!$G$9$,!"%3!<%I$N<B9TB.EY$r$+$J$jCY$/$7$^$9!#(B
$B$G$9$+$i!";HMQ$7$J$$>l9g$K$O>r7o$r(B@code{nil}$B$K:F@_Dj$9$Y$-$G$9!#(B
@node Source Breakpoints
@c @subsubsection Source Breakpoints
@subsubsection $B%=!<%9>e$N%V%l!<%/%]%$%s%H(B
@findex edebug
@c @cindex source breakpoints
@cindex $B%=!<%9>e$N%V%l!<%/%]%$%s%H(B
@c   All breakpoints in a definition are forgotten each time you
@c reinstrument it.  To make a breakpoint that won't be forgotten, you can
@c write a @dfn{source breakpoint}, which is simply a call to the function
@c @code{edebug} in your source code.  You can, of course, make such a call
@c conditional.  For example, in the @code{fac} function, insert the first
@c line as shown below to stop when the argument reaches zero:
$BDj5AFb$N$9$Y$F$N%V%l!<%/%]%$%s%H$O!"Dj5A$r=hCV$7D>$9$?$S$K<:$o$l$^$9!#(B
$B%V%l!<%/%]%$%s%H$r<:$$$?$/$J$$>l9g$K$O!"(B
@dfn{$B%=!<%9>e$N%V%l!<%/%]%$%s%H(B}$B!J(Bsource breakpoint$B!K$r;XDj$G$-$^$9!#(B
$B$3$l$O%=!<%9%3!<%I>e$G4X?t(B@code{edebug}$B$r8F$S=P$9$@$1$G$9!#(B
$B$b$A$m$s!">r7oIU$1$7$F8F$S=P$;$^$9!#(B
$B$?$H$($P!"4X?t(B@code{fac}$B$K$*$$$F!"0z?t$,%<%m$N>l9g$KDd;_$9$k$K$O!"(B
$B0J2<$K<($9$h$&$K:G=i$N9T$rA^F~$7$^$9!#(B
@example
(defun fac (n)
  (if (= n 0) (edebug))
  (if (< 0 n)
      (* n (fac (1- n)))
    1))
@end example
@c   When the @code{fac} definition is instrumented and the function is
@c called, the call to @code{edebug} acts as a breakpoint.  Depending on
@c the execution mode, Edebug stops or pauses there.
$B4X?t(B@code{fac}$B$r=hCV$7$F$3$N4X?t$r8F$S=P$9$H!"(B
@code{edebug}$B$N8F$S=P$7$O%V%l!<%/%]%$%s%H$N$h$&$KF0:n$7$^$9!#(B
$B<B9T%b!<%I$K1~$8$F!"(Bedebug$B$O$=$N2U=j$GDd;_$9$k$+5Y;_$7$^$9!#(B
@c   If no instrumented code is being executed when @code{edebug} is called,
@c that function calls @code{debug}.
@c @c This may not be a good idea anymore.
@code{edebug}$B$r8F$S=P$7$?%3!<%I$,=hCV:Q$_$G$J$1$l$P!"(B
$B$3$N4X?t$O(B@code{debug}$B$r8F$S=P$7$^$9!#(B
@node Trapping Errors
@c @subsection Trapping Errors
@subsection $B%(%i!<$NJaB*(B
@c   Emacs normally displays an error message when an error is signaled and
@c not handled with @code{condition-case}.  While Edebug is active and
@c executing instrumented code, it normally responds to all unhandled
@c errors.  You can customize this with the options @code{edebug-on-error}
@c and @code{edebug-on-quit}; see @ref{Edebug Options}.
Emacs$B$O!"DL>o!"%(%i!<$,DLCN$5$l$F$b(B@code{condition-case}$B$G=hM}$5$l$J$+$C$?(B
$B>l9g!"%(%i!<%a%C%;!<%8$rI=<($7$^$9!#(B
edebug$B$,3h@-$G$"$j=hCV:Q$_$N%3!<%I$r<B9T$7$F$$$k$H!"(B
edebug$B$O=hM}$5$l$J$+$C$?%(%i!<$9$Y$F$KH?1~$7$^$9!#(B
$B$3$NF0:n$r(B@code{edebug-on-error}$B$H(B@code{edebug-on-quit}$B$G(B
$B%+%9%?%^%$%:$G$-$^$9!#(B
@xref{Edebug Options}$B!#(B
@c   When Edebug responds to an error, it shows the last stop point
@c encountered before the error.  This may be the location of a call to a
@c function which was not instrumented, within which the error actually
@c occurred.  For an unbound variable error, the last known stop point
@c might be quite distant from the offending variable reference.  In that
@c case you might want to display a full backtrace (@pxref{Edebug Misc}).
edebug$B$,%(%i!<$KH?1~$9$k$H!"(B
$B%(%i!<$r5/$3$9$^$(=P2q$C$?:G8e$NDd;_0LCV$rI=<($7$^$9!#(B
$B$3$N0LCV$O!"<B:]$K%(%i!<$r5/$3$7$?=hCV$7$F$J$$4X?t$N8F$S=P$70LCV$G$"$k(B
$B>l9g$b$"$j$^$9!#(B
$BL$B+G{$JJQ?t$N%(%i!<$G$O!":G8e$NDd;_0LCV$O!"(B
$BEv3:JQ?t$N;2>H0LCV$+$i$+$J$jN%$l$F$$$k>l9g$,$"$j$^$9!#(B
$B$=$N$h$&$J>l9g$K$O!"40A4$J%P%C%/%H%l!<%9$rI=<($7$?$$$G$7$g$&(B
$B!J(B@pxref{Edebug Misc}$B!K!#(B
@c @c Edebug should be changed for the following: -- dan
@c   If you change @code{debug-on-error} or @code{debug-on-quit} while
@c Edebug is active, these changes will be forgotten when Edebug becomes
@c inactive.  Furthermore, during Edebug's recursive edit, these variables
@c are bound to the values they had outside of Edebug.
edebug$B$,3h@-$J$H$-$K(B@code{debug-on-error}$B$d(B@code{debug-on-quit}$B$rJQ99$7$F$b!"(B
edebug$B$,IT3h@-$K$J$C$?$H$-$K$=$l$i$NJQ99$r<h$j>C$7$F$7$^$$$^$9!#(B
$B$5$i$K!"(Bedebug$B$N:F5"JT=8Cf$O!"$3$l$i$NJQ?t$O(Bedebug$B$N30B&$G$NCM$K(B
$BB+G{$5$l$^$9!#(B
@node Edebug Views
@c @subsection Edebug Views
@subsection edebug$B$N%S%e!<(B
@c   These Edebug commands let you view aspects of the buffer and window
@c status as they were before entry to Edebug.  The outside window
@c configuration is the collection of windows and contents that were in
@c effect outside of Edebug.
$B$3$l$i$N(Bedebug$B$N%3%^%s%I$O!"(Bedebug$B$KF~$k$^$($N%P%C%U%!$d%&%#%s%I%&$N(B
$B>uBV$rD4$Y$k$b$N$G$9!#(B
$B30It%&%#%s%I%&9=@.$O!"(Bedebug$B$N30B&$G$N%&%#%s%I%&$N=8$^$j$dFbMF$K(B
$B4X$9$k$b$N$G$9!#(B
@table @kbd
@item v
@c Temporarily view the outside window configuration
@c (@code{edebug-view-outside}).
$B30It%&%#%s%I%&9=@.$r0l;~E*$K8+$k(B
$B!J(B@code{edebug-view-outside}$B!K!#(B
@item p
@c Temporarily display the outside current buffer with point at its outside
@c position (@code{edebug-bounce-point}).  With a prefix argument @var{n},
@c pause for @var{n} seconds instead.
edebug$B$N30B&$G$N%+%l%s%H%P%C%U%!$H30B&$G$N%]%$%s%H0LCV$r(B
$B0l;~E*$KI=<($9$k!J(B@code{edebug-bounce-point}$B!K!#(B
$BA0CV0z?t(B@var{n}$B$O!"$+$o$j$K5Y;_IC?t$r;XDj$9$k!#(B
@item w
@c Move point back to the current stop point in the source code buffer
@c (@code{edebug-where}).
$B%=!<%9%3!<%I%P%C%U%!$G8=:_$NDd;_0LCV$K%]%$%s%H0LCV$rLa$9(B
$B!J(B@code{edebug-where}$B!K!#(B
@c If you use this command in a different window displaying the same
@c buffer, that window will be used instead to display the current
@c definition in the future.
$BF1$8%P%C%U%!$rI=<($7$F$$$kJL$N%&%#%s%I%&$G$3$N%3%^%s%I$r;H$&$H!"(B
$B$=$l0J8e!"$=$N%&%#%s%I%&$K8=:_$NDj5A$,I=<($5$l$k$h$&$K$J$k!#(B
@item W
@c @c Its function is not simply to forget the saved configuration -- dan
@c Toggle whether Edebug saves and restores the outside window
@c configuration (@code{edebug-toggle-save-windows}).
edebug$B$,30It%&%#%s%I%&9=@.$rJ]B8!?I|85$9$k$+$I$&$+$r%H%0%k$9$k(B
$B!J(B@code{edebug-toggle-save-windows}$B!K!#(B
@c With a prefix argument, @code{W} only toggles saving and restoring of
@c the selected window.  To specify a window that is not displaying the
@c source code buffer, you must use @kbd{C-x X W} from the global keymap.
$BA0CV0z?t$r;XDj$9$k$HA*Br$7$?%&%#%s%I%&$@$1$NJ]B8!?I|85$r%H%0%k$9$k!#(B
$B%=!<%9%3!<%I%P%C%U%!$rI=<($7$F$$$J$$%&%#%s%I%&$r;XDj$9$k$K$O!"(B
$B%0%m!<%P%k%-!<%^%C%W$N(B@kbd{C-x X W}$B$r;H$&I,MW$,$"$k!#(B
@end table
@c   You can view the outside window configuration with @kbd{v} or just
@c bounce to the point in the current buffer with @kbd{p}, even if
@c it is not normally displayed.  After moving point, you may wish to jump
@c back to the stop point with @kbd{w} from a source code buffer.
@kbd{v}$B$G30It%&%#%s%I%&9=@.$r8+$k$3$H$,$G$-$^$9!#(B
$B$"$k$$$O!"!J(Bedebug$B$N30B&$G$N!K%+%l%s%H%P%C%U%!$,I=<($5$l$F$$$J$/$F$b(B
@kbd{p}$B$G%+%l%s%H%P%C%U%!$N%]%$%s%H0LCV$r8+$k$3$H$,$G$-$^$9!#(B
$B%]%$%s%H0LCV$r0\F0$7$?$i!"(B
@kbd{w}$B$G%=!<%9%3!<%I%P%C%U%!$NDd;_0LCV$XLa$l$^$9!#(B
@c   Each time you use @kbd{W} to turn saving @emph{off}, Edebug forgets the
@c saved outside window configuration---so that even if you turn saving
@c back @emph{on}, the current window configuration remains unchanged when
@c you next exit Edebug (by continuing the program).  However, the
@c automatic redisplay of @samp{*edebug*} and @samp{*edebug-trace*} may
@c conflict with the buffers you wish to see unless you have enough windows
@c open.
$B30It%&%#%s%I%&9=@.$rJ]B8(B@emph{$B$7$J$$(B}$B$h$&$K(B@kbd{W}$B$r;H$&$?$S$K!"(B
edebug$B$OJ]B8$7$F$*$$$?30It%&%#%s%I%&9=@.$rGK4~$7$^$9!#(B
$B$=$N$?$a!"J]B8(B@emph{$B$9$k(B}$B$h$&$KLa$7$F$b!"(B
$B!J%W%m%0%i%`$rB39T$9$k$3$H$G!K(Bedebug$B$rH4$1$k$H!"(B
$B8=:_$N%&%#%s%I%&9=@.$OJQ99$5$l$^$;$s!#(B
$B$7$+$7!"(B@samp{*edebug*}$B$H(B@samp{*edebug-trace*}$B$N<+F0:FI=<($O!"(B
$B==J,$J%&%#%s%I%&$,3+$$$F$J$$$H!"(B
$BFI<T$,8+$?$$%P%C%U%!$H>WFM$9$k$+$b$7$l$^$;$s!#(B
@node Edebug Eval
@c @subsection Evaluation
@subsection $BI>2A(B
@c   While within Edebug, you can evaluate expressions ``as if'' Edebug were
@c not running.  Edebug tries to be invisible to the expression's
@c evaluation and printing.  Evaluation of expressions that cause side
@c effects will work as expected except for things that Edebug explicitly
@c saves and restores.  @xref{The Outside Context}, for details on this
@c process.
edebug$B$NFbB&$G$O!"(Bedebug$B$,F0:n$7$F$$$J$$$,$4$H$/<0$rI>2A$G$-$^$9!#(B
edebug$B$O!"<0$NI>2A$HI=<($KBP$7$F8+$($J$$$h$&$K$7$^$9!#(B
edebug$B$,L@<(E*$KJ]B8!?I|85$9$k>l9g$r=|$$$F!"(B
$BI{:nMQ$r;}$D<0$NI>2A$b4|BT$I$*$jF0:n$7$^$9!#(B
$B$3$N=hM}$K4X$7$F>\$7$/$O(B@xref{The Outside Context}$B!#(B
@table @kbd
@item e @var{exp} @key{RET}
@c Evaluate expression @var{exp} in the context outside of Edebug
@c (@code{edebug-eval-expression}).  That is, Edebug tries to minimize its
@c interference with the evaluation.
edebug$B$N30B&$NJ8L.$G<0(B@var{exp}$B$rI>2A$9$k(B
$B!J(B@code{edebug-eval-expression}$B!K!#(B
$B$D$^$j!"(Bedebug$B$OI>2A$X$N43>D$r:G>.8B$K$H$I$a$h$&$H$9$k!#(B
@item M-: @var{exp} @key{RET}
@c Evaluate expression @var{exp} in the context of Edebug itself.
edebug$B<+?H$NJ8L.$G<0(B@var{exp}$B$rI>2A$9$k!#(B
@item C-x C-e
@c Evaluate the expression before point, in the context outside of Edebug
@c (@code{edebug-eval-last-sexp}).
edebug$B$N30B&$NJ8L.$G%]%$%s%H0LCV$N$^$($N<0$rI>2A$9$k(B
$B!J(B@code{edebug-eval-last-sexp}$B!K!#(B
@end table
@c @cindex lexical binding (Edebug)
@cindex $B%l%-%7%+%k!J%F%-%9%H>e$N!KB+G{!J(Bedebug$B!K(B
@c   Edebug supports evaluation of expressions containing references to
@c lexically bound symbols created by the following constructs in
@c @file{cl.el} (version 2.03 or later): @code{lexical-let},
@c @code{macrolet}, and @code{symbol-macrolet}.
edebug$B$O(B@file{cl.el}$B!JHG(B2.03$B0J9_!KFb$N9=J8(B
@code{lexical-let}$B!"(B@code{macrolet}$B!"(B@code{symbol-macrolet}$B$G(B
$B:n@.$5$l$k%l%-%7%+%k!J%F%-%9%H>e$N!KB+G{$r;2>H$9$k<0$NI>2A$r07$($^$9!#(B
@node Eval List
@c @subsection Evaluation List Buffer
@subsection $BI>2A%j%9%H%P%C%U%!(B
@c   You can use the @dfn{evaluation list buffer}, called @samp{*edebug*}, to
@c evaluate expressions interactively.  You can also set up the
@c @dfn{evaluation list} of expressions to be evaluated automatically each
@c time Edebug updates the display.
@samp{*edebug*}$B$H8F$P$l$k(B@dfn{$BI>2A%j%9%H%P%C%U%!(B}$B$r;H$C$F!"(B
$B<0$rBPOCE*$KI>2A$G$-$^$9!#(B
$B$5$i$K!"(Bedebug$B$,I=<($r99?7$9$k$?$S$K<+F0E*$KI>2A$5$l$k(B
$B<0$N(B@dfn{$BI>2A%j%9%H(B}$B$r@_Dj$9$k$3$H$b$G$-$^$9!#(B
@table @kbd
@item E
@c Switch to the evaluation list buffer @samp{*edebug*}
@c (@code{edebug-visit-eval-list}).
$BI>2A%j%9%H%P%C%U%!(B@samp{*edebug*}$B$X@Z$jBX$($k(B
$B!J(B@code{edebug-visit-eval-list}$B!K!#(B
@end table
@c   In the @samp{*edebug*} buffer you can use the commands of Lisp
@c Interaction mode (@pxref{Lisp Interaction,,, emacs, The GNU Emacs
@c Manual}) as well as these special commands:
$B%P%C%U%!(B@samp{*edebug*}$B$G$O!"0J2<$NFCJL$J%3%^%s%I$K2C$($F(B
lisp$BBPOC%b!<%I(B
$B!J(B@pxref{Lisp Interaction,, lisp$BBPOC%P%C%U%!(B, emacs, GNU Emacs $B%^%K%e%"%k(B}$B!K(B
$B$N%3%^%s%I$b;H$($^$9!#(B
@table @kbd
@item C-j
@c Evaluate the expression before point, in the outside context, and insert
@c the value in the buffer (@code{edebug-eval-print-last-sexp}).
$B30B&$NJ8L.$G%]%$%s%H0LCV$N$^$($N<0$rI>2A$7!"(B
$B$=$NCM$r%P%C%U%!$KA^F~$9$k(B
$B!J(B@code{edebug-eval-print-last-sexp}$B!K!#(B
@item C-x C-e
@c Evaluate the expression before point, in the context outside of Edebug
@c (@code{edebug-eval-last-sexp}).
edebug$B$N30B&$NJ8L.$G%]%$%s%H0LCV$N$^$($N<0$rI>2A$9$k(B
$B!J(B@code{edebug-eval-last-sexp}$B!K!#(B
@item C-c C-u
@c Build a new evaluation list from the contents of the buffer
@c (@code{edebug-update-eval-list}).
$B%P%C%U%!$NFbMF$+$i?7$?$JI>2A%j%9%H$r9=C[$9$k(B
$B!J(B@code{edebug-update-eval-list}$B!K!#(B
@item C-c C-d
@c Delete the evaluation list group that point is in
@c (@code{edebug-delete-eval-item}).
$B%]%$%s%H0LCV$K$"$kI>2A%j%9%H%0%k!<%W$r:o=|$9$k(B
$B!J(B@code{edebug-delete-eval-item}$B!K!#(B
@item C-c C-w
@c Switch back to the source code buffer at the current stop point
@c (@code{edebug-where}).
$B%=!<%9%3!<%I%P%C%U%!$K@Z$jBX$(8=:_$NDd;_0LCV$KLa$k(B
$B!J(B@code{edebug-where}$B!K!#(B
@end table
@c   You can evaluate expressions in the evaluation list window with
@c @kbd{C-j} or @kbd{C-x C-e}, just as you would in @samp{*scratch*};
@c but they are evaluated in the context outside of Edebug.
@samp{*scratch*}$B$G9T$&$N$HF1MM$K!"(B
$BI>2A%j%9%H%&%#%s%I%&$G$O(B@kbd{C-j}$B$d(B@kbd{C-x C-e}$B$G<0$rI>2A$G$-$^$9$,!"(B
$B$=$l$i$O(Bedebug$B$N30B&$NJ8L.$GI>2A$5$l$^$9!#(B
@c   The expressions you enter interactively (and their results) are lost
@c when you continue execution; but you can set up an @dfn{evaluation list}
@c consisting of expressions to be evaluated each time execution stops. 
$B<B9T$r7QB3$9$k$H!"BPOCE*$KF~NO$7$?<0!J$d$=$N7k2L!K$OGK4~$5$l$^$9$,!"(B
$B<B9T$rDd;_$9$k$?$S$KI>2A$5$l$k<0$+$i@.$k(B@dfn{$BI>2A%j%9%H(B}$B!J(Bevaluation list$B!K(B
$B$r@_Dj$G$-$^$9!#(B
@c @cindex evaluation list group
@cindex $BI>2A%j%9%H%0%k!<%W(B
@c   To do this, write one or more @dfn{evaluation list groups} in the
@c evaluation list buffer.  An evaluation list group consists of one or
@c more Lisp expressions.  Groups are separated by comment lines.
$B$3$l$r9T$&$K$O!"I>2A%j%9%H%P%C%U%!$K$F!"(B
1$B$D0J>e$N(B@dfn{$BI>2A%j%9%H%0%k!<%W(B}$B!J(Bevaluation list group$B!K$r=q$-$^$9!#(B
$BI>2A%j%9%H%0%k!<%W$O!"(B1$B$D0J>e$N(BLisp$B<0$+$i@.$j$^$9!#(B
$B%0%k!<%W$O%3%a%s%H9T$G6h@Z$j$^$9!#(B
@c   The command @kbd{C-c C-u} (@code{edebug-update-eval-list}) rebuilds the
@c evaluation list, scanning the buffer and using the first expression of
@c each group.  (The idea is that the second expression of the group is the
@c value previously computed and displayed.)
$B%3%^%s%I(B@kbd{C-c C-u}$B!J(B@code{edebug-update-eval-list}$B!K$O!"(B
$B%P%C%U%!$rAv::$7$F3F%0%k!<%W$N:G=i$N<0$r;H$C$F(B
$BI>2A%j%9%H$r:F9=C[$7$^$9!#(B
$B!J3F%0%k!<%W$N(B2$BHVL\$N<0$O7W;;7k2L$rI=<($7$?CM$H$_$J$9!#!K(B
@c   Each entry to Edebug redisplays the evaluation list by inserting each
@c expression in the buffer, followed by its current value.  It also
@c inserts comment lines so that each expression becomes its own group.
@c Thus, if you type @kbd{C-c C-u} again without changing the buffer text,
@c the evaluation list is effectively unchanged.
edebug$B$KF~$k$?$S$K!"3F<0$KB3$1$F$=$N8=:_CM$r%P%C%U%!$KA^F~$9$k$3$H$G(B
$BI>2A%j%9%H$r:FI=<($7$^$9!#(B
$B$3$N$H$-!"3F<0$,$=$l$>$l%0%k!<%W$K$J$k$h$&$K%3%a%s%H9T$bA^F~$7$^$9!#(B
$B$7$?$,$C$F!"%P%C%U%!$N%F%-%9%H$rJQ99$;$:$K:FEY(B@kbd{C-c C-u}$B$HBG$D$H!"(B
$BI>2A%j%9%H$O<B<AE*$K$OJQ99$5$l$^$;$s!#(B
@c   If an error occurs during an evaluation from the evaluation list, the
@c error message is displayed in a string as if it were the result.
@c Therefore, expressions that use variables not currently valid do not
@c interrupt your debugging.
$BI>2A%j%9%H$NI>2ACf$K%(%i!<$,H/@8$9$k$H!"(B
$B%(%i!<%a%C%;!<%8$rI>2A7k2L$H$_$J$7$FJ8;zNs$GI=<($7$^$9!#(B
$B$7$?$,$C$F!"8=:_$NJ8L.$G$OIT@5$JJQ?t$r<0$K;H$C$F$b(B
$BFI<T$N%G%P%C%0$r<W$k$3$H$O$"$j$^$;$s!#(B
@c   Here is an example of what the evaluation list window looks like after
@c several expressions have been added to it:
$BI>2A%j%9%H%&%#%s%I%&$K?t8D$N<0$rDI2C$7$?$H$-$N$h$&$9$r0J2<$K<($7$^$9!#(B
@smallexample
(current-buffer)
#<buffer *scratch*>
;---------------------------------------------------------------
(selected-window)
#<window 16 on *scratch*>
;---------------------------------------------------------------
(point)
196
;---------------------------------------------------------------
bad-var
"Symbol's value as variable is void: bad-var"
;---------------------------------------------------------------
(recursion-depth)
0
;---------------------------------------------------------------
this-command
eval-last-sexp
;---------------------------------------------------------------
@end smallexample
@c To delete a group, move point into it and type @kbd{C-c C-d}, or simply
@c delete the text for the group and update the evaluation list with
@c @kbd{C-c C-u}.  To add a new expression to the evaluation list, insert
@c the expression at a suitable place, and insert a new comment line.  (You
@c need not insert dashes in the comment line---its contents don't matter.)
@c Then type @kbd{C-c C-u}.
$B%0%k!<%W$r:o=|$9$k$K$O!"$=$3$X%]%$%s%H$r0\F0$7$F(B@kbd{C-c C-d}$B$HBG$A$^$9!#(B
$B$"$k$$$O!"%0%k!<%W$N%F%-%9%H$rC1$K:o=|$7$F$+$i(B@kbd{C-c C-u}$B$G(B
$BI>2A%j%9%H$r99?7$7$^$9!#(B
$BI>2A%j%9%H$K?7$?$K<0$rDI2C$9$k$K$O!"(B
$BE,@Z$J0LCV$K<0$rA^F~$7!"?7$?$J%3%a%s%H9T$rA^F~$7$^$9!#(B
$B!J%3%a%s%H9T$K%^%$%J%95-9f$rA^F~$9$kI,MW$O$J$$!#(B
$B%3%a%s%H$NFbMF$O4X78$J$$!#!K(B
$B$=$7$F!"(B@kbd{C-c C-u}$B$HBG$A$^$9(B
@c After selecting @samp{*edebug*}, you can return to the source code
@c buffer with @kbd{C-c C-w}.  The @samp{*edebug*} buffer is killed when
@c you continue execution, and recreated next time it is needed.
@samp{*edebug*}$B$rA*Br$7$?$"$H$O!"(B
@kbd{C-c C-w}$B$G%=!<%9%3!<%I%P%C%U%!$XLa$l$^$9!#(B
$BFI<T$,<B9T$r7QB3$9$k$H%P%C%U%!(B@samp{*edebug*}$B$O:o=|$5$l!"(B
$B$D$.$KI,MW$J$H$-$K:FEY:n@.$5$l$^$9!#(B
@node Printing in Edebug
@c @subsection Printing in Edebug
@subsection edebug$B$G$N=PNO(B
@c @cindex printing (Edebug)
@c @cindex printing circular structures
@cindex $B=PNO!J(Bedebug$B!K(B
@cindex $B=[4D9=B$$N=PNO(B
@pindex cust-print
@c   If an expression in your program produces a value containing circular
@c list structure, you may get an error when Edebug attempts to print it.
$BFI<T$N%W%m%0%i%`$N<0$,=[4D$7$?%j%9%H9=B$$r4^$`CM$r:n$j=P$9>l9g!"(B
edebug$B$,$=$l$r=PNO$7$h$&$H$9$k$H%(%i!<$K$J$j$^$9!#(B
@c   One way to cope with circular structure is to set @code{print-length}
@c or @code{print-level} to truncate the printing.  Edebug does this for
@c you; it binds @code{print-length} and @code{print-level} to 50 if they
@c were @code{nil}.  (Actually, the variables @code{edebug-print-length}
@c and @code{edebug-print-level} specify the values to use within Edebug.)
@c @xref{Output Variables}.
$B=[4D9=B$$r07$&(B1$B$D$NJ}K!$O!"=PNO$r@Z$j5M$a$k$?$a$K(B
@code{print-length}$B$d(B@code{print-level}$B$r@_Dj$9$k$3$H$G$9!#(B
edebug$B$,FI<T$N$?$a$K$3$l$r9T$$$^$9!#(B
$B$=$l$i$,(B@code{nil}$B$G$"$k$H!"(B
edebug$B$O(B@code{print-length}$B$H(B@code{print-level}$B$r(B50$B$KB+G{$7$^$9!#(B
$B!J<B:]$O!"(Bedebug$B$,;H$&CM$O(B
@code{e-debug-print-length}$B$H(B@code{e-debug-print-level}$B$,;XDj$9$k!#!K(B
@xref{Output Variables}$B!#(B
@defopt edebug-print-length
@c If non-@code{nil}, bind @code{print-length} to this while printing
@c results in Edebug.  The default value is @code{50}.
@code{nil}$B0J30$G$"$k$H!"(Bedebug$B$,7k2L$r=PNO$9$k$H$-$K$O!"(B
$B$3$l$r(B@code{print-length}$B$KB+G{$9$k!#(B
$B%G%U%)%k%HCM$O(B@code{50}$B!#(B
@end defopt
@defopt edebug-print-level 
@c If non-@code{nil}, bind @code{print-level} to this while printing
@c results in Edebug.  The default value is @code{50}.
@code{nil}$B0J30$G$"$k$H!"(Bedebug$B$,7k2L$r=PNO$9$k$H$-$K$O!"(B
$B$3$l$r(B@code{print-level}$B$KB+G{$9$k!#(B
$B%G%U%)%k%HCM$O(B@code{50}$B!#(B
@end defopt
@c   You can also print circular structures and structures that share
@c elements more informatively by using the @file{cust-print} package.
$B%Q%C%1!<%8(B@file{cust-print}$B$r;H$($P!"(B
$B=[4D9=B$$dMWAG$r6&M-$9$k9=B$$r$h$jE*3N$K=PNO$9$k$3$H$b$G$-$^$9!#(B
@c   To load @file{cust-print} and activate custom printing only for
@c Edebug, simply use the command @kbd{M-x edebug-install-custom-print}.
@c To restore the standard print functions, use @kbd{M-x
@c edebug-uninstall-custom-print}.
@file{cust-print}$B$r%m!<%I$7$F(Bedebug$B$G$N$_$3$NFCJL$J=PNO$r;H$&$h$&$K$9$k$K$O!"(B
$BC1$K%3%^%s%I(B@kbd{M-x edebug-install-custom-print}$B$r;H$&$@$1$G$9!#(B
$BI8=`$N=PNO4X?t$KLa$9$K$O!"(B@kbd{M-x edebug-uninstall-custom-print}$B$r;H$$$^$9!#(B
@c   Here is an example of code that creates a circular structure:
$B=[4D9=B$$r:n$k%3!<%I$NNc$r<($7$^$9!#(B
@example
(setq a '(x y))
(setcar a a)
@end example
@noindent
@c Custom printing prints this as @samp{Result: #1=(#1# y)}.  The
@c @samp{#1=} notation labels the structure that follows it with the label
@c @samp{1}, and the @samp{#1#} notation references the previously labeled
@c structure.  This notation is used for any shared elements of lists or
@c vectors.
$BFCJL$J=PNO$G$O$3$l$r(B@samp{Result: #1=(#1# y)}$B$H=PNO$7$^$9!#(B
@samp{#1=}$B$N5-K!$O!"$3$l$KB3$/9=B$$K(B@samp{1}$B$H$$$&%i%Y%k$rIU$1$^$9!#(B
$B$^$?!"(B@samp{#1#}$B$N5-K!$O$9$G$K%i%Y%kIU$1$7$?9=B$$r;2>H$7$^$9!#(B
$B$3$N5-K!$O!"%j%9%H$d%Y%/%H%k$NG$0U$N6&M-$5$l$?MWAG$K;H$o$l$^$9!#(B
@defopt edebug-print-circle 
@c If non-@code{nil}, bind @code{print-circle} to this while printing
@c results in Edebug.  The default value is @code{nil}.
@code{nil}$B0J30$G$"$k$H!"(Bedebug$B$,7k2L$r=PNO$9$k$H$-$K$O!"(B
$B$3$l$r(B@code{print-circle}$B$KB+G{$9$k!#(B
$B%G%U%)%k%HCM$O(B@code{nil}$B!#(B
@end defopt
@c   Other programs can also use custom printing; see @file{cust-print.el}
@c for details.
$BB>$N%W%m%0%i%`$G$b$3$NFCJL$J=PNO$r;H$($^$9!#(B
$B>\$7$/$O!"(B@file{cust-print.el}$B$r;2>H$7$F$/$@$5$$!#(B
@node Trace Buffer
@c @subsection Trace Buffer
@subsection $B%H%l!<%9%P%C%U%!(B
@c @cindex trace buffer
@cindex $B%H%l!<%9%P%C%U%!(B
@c   Edebug can record an execution trace, storing it in a buffer named
@c @samp{*edebug-trace*}.  This is a log of function calls and returns,
@c showing the function names and their arguments and values.  To enable
@c trace recording, set @code{edebug-trace} to a non-@code{nil} value.
edebug$B$O!"<B9T%H%l!<%9$r(B@samp{*edebug-trace*}$B$H$$$&%P%C%U%!$KJ]B8$9$k$3$H$G(B
$B$=$l$i$r5-O?$G$-$^$9!#(B
$B$3$l$O!"4X?tL>$H$=$l$i$N0z?t!"La$jCM$+$i@.$k(B
$B4X?t8F$S=P$7$H$=$NLa$j$N5-O?$G$9!#(B
$B%H%l!<%95-O?$rM-8z$K$9$k$K$O!"(B
@code{edebug-trace}$B$K(B@code{nil}$B0J30$NCM$r@_Dj$7$^$9!#(B
@c   Making a trace buffer is not the same thing as using trace execution
@c mode (@pxref{Edebug Execution Modes}).
$B%H%l!<%9%P%C%U%!$r:n@.$9$k$3$H$H%H%l!<%9<B9T%b!<%I$H$O(B
$BF1$8$G$O$"$j$^$;$s!J(B@pxref{Edebug Execution Modes}$B!K!#(B
@c   When trace recording is enabled, each function entry and exit adds
@c lines to the trace buffer.  A function entry record looks like
@c @samp{::::@{} followed by the function name and argument values.  A
@c function exit record looks like @samp{::::@}} followed by the function
@c name and result of the function.
$B%H%l!<%95-O?$rM-8z$K$7$F$$$k$H!"(B
$B3F4X?t$XF~$k$H$-$H=P$k$H$-$K!"%H%l!<%9%P%C%U%!$K9T$,DI2C$5$l$^$9!#(B
$B4X?t$XF~$k$H$-$N5-O?$O!"(B@samp{::::@{}$B$K4X?tL>$H0z?tCM$,B3$-$^$9!#(B
$B4X?t$+$i=P$k$H$-$N5-O?$O!"(B@samp{::::@}}$B$K4X?tL>$H$=$N7k2L$,B3$-$^$9!#(B
@c   The number of @samp{:}s in an entry shows its recursion depth.  You
@c can use the braces in the trace buffer to find the matching beginning or
@c end of function calls.
$BF~$k$H$-$N(B@samp{:}$B$N8D?t$O!":F5"$N?<$5$rI=$7$^$9!#(B
$B4X?t8F$S=P$7$NBP1~$9$k3+;O$dBP1~$9$k=*N;$rC5$9$?$a$K(B
$B%H%l!<%9%P%C%U%!$G$OCf3g8L$r;H$($^$9!#(B
@findex edebug-print-trace-before
@findex edebug-print-trace-after
@c   You can customize trace recording for function entry and exit by
@c redefining the functions @code{edebug-print-trace-before} and
@c @code{edebug-print-trace-after}.
$B4X?t(B@code{edebug-print-trace-before}$B$H(B@code{edebug-print-trace-after}$B$r(B
$B:FDj5A$9$l$P!"4X?t$XF~$C$?$H$-$H=P$k$H$-$N%H%l!<%95-O?$r%+%9%?%^%$%:$G$-$^$9!#(B
@defmac edebug-tracing string body@dots{}
@c This macro requests additional trace information around the execution
@c of the @var{body} forms.  The argument @var{string} specifies text
@c to put in the trace buffer.  All the arguments are evaluated.
@c @code{edebug-tracing} returns the value of the last form in @var{body}.
$B$3$N%^%/%m$O%U%)!<%`(B@var{body}$B$N<~$j$K%H%l!<%9>pJs$rDI2C$9$k!#(B
$B0z?t(B@var{string}$B$O!"%H%l!<%9%P%C%U%!$KF~$l$k%F%-%9%H$r;XDj$9$k!#(B
$B$9$Y$F$N0z?t$rI>2A$9$k!#(B
@code{edebug-tracing}$B$O(B@var{body}$B$N:G8e$N%U%)!<%`$NCM$rJV$9!#(B
@end defmac
@defun edebug-trace format-string &rest format-args
@c This function inserts text in the trace buffer.  It computes the text
@c with @code{(apply 'format @var{format-string} @var{format-args})}.
@c It also appends a newline to separate entries.
$B$3$N4X?t$O%H%l!<%9%P%C%U%!$K%F%-%9%H$rA^F~$9$k!#(B
$B%F%-%9%H$O(B@code{(apply 'format @var{format-string} @var{format-args})}$B$G(B
$B7W;;$9$k!#(B
$B6h@Z$j$H$7$F2~9T$bA^F~$9$k!#(B
@end defun
@c   @code{edebug-tracing} and @code{edebug-trace} insert lines in the
@c trace buffer whenever they are called, even if Edebug is not active.
@c Adding text to the trace buffer also scrolls its window to show the last
@c lines inserted.
@code{edebug-tracing}$B$H(B@code{edebug-trace}$B$O!"(B
edebug$B$,3h@-$G$J$$>l9g$G$"$C$F$b8F$P$l$k$H%H%l!<%9%P%C%U%!$K9T$rA^F~$7$^$9!#(B
$B%H%l!<%9%P%C%U%!$K%F%-%9%H$rA^F~$9$k$H$-!"(B
$BA^F~$7$?:G8e$N9T$,8+$($k$h$&$K%&%#%s%I%&$r%9%/%m!<%k$7$^$9!#(B
@node Coverage Testing
@c @subsection Coverage Testing
@subsection $B%+%P%l%C%8%F%9%H(B
@c @cindex coverage testing
@c @cindex frequency counts
@c @cindex performance analysis
@cindex $B%+%P%l%C%8%F%9%H(B
@cindex $BIQEY?t7WB,(B
@cindex $B8zN(2r@O(B
@c Edebug provides rudimentary coverage testing and display of execution
@c frequency.
edebug$B$G$O!"=iJbE*$J%+%P%l%C%8%F%9%H$d<B9TIQEY$rI=<($G$-$^$9!#(B
@c   Coverage testing works by comparing the result of each expression with
@c the previous result; each form in the program is considered ``covered''
@c if it has returned two different values since you began testing coverage
@c in the current Emacs session.  Thus, to do coverage testing on your
@c program, execute it under various conditions and note whether it behaves
@c correctly; Edebug will tell you when you have tried enough different
@c conditions that each form has returned two different values.
$B%+%P%l%C%8%F%9%H$G$O!"3F<0$N7k2L$r0JA0$N7k2L$HHf3S$7$^$9!#(B
$B8=:_$N(BEmacs$B%;%C%7%g%s$G%+%P%l%C%8%F%9%H$r;O$a$F0J9_!"(B
$B%W%m%0%i%`$N3F%U%)!<%`$,0[$J$k(B2$B$D$NCM$rJV$;$P!"(B
$BEv3:%U%)!<%`$r!X%+%P!<$7$?!Y$H$_$J$7$^$9!#(B
$B$7$?$,$C$F!"FI<T$N%W%m%0%i%`$K$D$$$F%+%P%l%C%8%F%9%H$r9T$&$K$O!"(B
$B$5$^$6$^$J>r7o$G$=$l$r<B9T$7$F@5$7$/F0:n$7$F$$$k$+Cm0U$7$^$9!#(B
$BFI<T$,3F%U%)!<%`$,0[$J$k(B2$B$D$NCM$rJV$9$h$&$K;n9T$7=*$l$P!"(B
edebug$B$O$=$N$h$&$KDLCN$7$^$9!#(B
@c   Coverage testing makes execution slower, so it is only done if
@c @code{edebug-test-coverage} is non-@code{nil}.  Frequency counting is
@c performed for all execution of an instrumented function, even if the
@c execution mode is Go-nonstop, and regardless of whether coverage testing
@c is enabled.
$B%+%P%l%C%8%F%9%H$O<B9TB.EY$rCY$/$9$k$N$G!"(B
@code{edebug-test-coverage}$B$,(B@code{nil}$B0J30$N>l9g$K$N$_%F%9%H$7$^$9!#(B
$B$9$Y$F$N=hCV:Q$_4X?t$N<B9T$K4X$9$kIQEY?t7WB,$O!"(B
$BHsDd;_<B9T%b!<%I$G$"$C$F$b%+%P%l%C%8%F%9%H$N%*%s!?%*%U$K4X$o$i$:9T$$$^$9!#(B
@c   Use @kbd{M-x edebug-display-freq-count} to display both the
@c coverage information and the frequency counts for a definition.
$B$"$kDj5A$K4X$9$k%+%P%l%C%8%F%9%H$HIQEY?t7WB,$rI=<($9$k$K$O(B
@kbd{M-x edebug-display-freq-count}$B$r;H$$$^$9!#(B
@c @deffn Command edebug-display-freq-count
@deffn $B%3%^%s%I(B edebug-display-freq-count
@c This command displays the frequency count data for each line of the
@c current definition.
$B$3$N%3%^%s%I$O!"8=:_$NDj5A$N3F9T$K$D$$$FIQEY?t%G!<%?$rI=<($9$k!#(B
@c The frequency counts appear as comment lines after each line of code,
@c and you can undo all insertions with one @code{undo} command.  The
@c counts appear under the @samp{(} before an expression or the @samp{)}
@c after an expression, or on the last character of a variable.  To
@c simplify the display, a count is not shown if it is equal to the
@c count of an earlier expression on the same line.
$BIQEY?t$O!"%3!<%I$N3F9T$N$"$H$K%3%a%s%H9T$H$7$FI=<($5$l!"(B
$B%3%^%s%I(B@code{undo}$B$G$=$l$i$N%3%a%s%H9T$NA^F~$r%"%s%I%%$G$-$k!#(B
$BIQEY?t$O!"<0$N$^$($N(B@samp{(}$B$d<0$N$&$7$m$N(B@samp{)}$B$ND>2<!"(B
$B$"$k$$$O!"JQ?t$N:G8e$NJ8;z$KI=<($5$l$k!#(B
$BI=<($r4JAG$K$9$k$?$a$K!"IQEY?t$,F1$89T$N$^$($N$[$&$N<0$NIQEY?t$HF1$8$G$"$k$H(B
$BI=<($7$J$$!#(B
@c The character @samp{=} following the count for an expression says that
@c the expression has returned the same value each time it was evaluated.
@c In other words, it is not yet ``covered'' for coverage testing purposes.
$B<0$NIQEY?t$KB3$/J8;z(B@samp{=}$B$O!"(B
$B$=$N<0$rI>2A$9$k$?$S$KF1$8CM$rJV$7$?$3$H$r0UL#$9$k!#(B
$B$$$$$+$($l$P!"%+%P%l%C%8%F%9%H$H$7$F$O!"(B
$B$=$N<0$O$^$@!X%+%P!<$7$F!Y$$$J$$$3$H$K$J$k!#(B
@c To clear the frequency count and coverage data for a definition,
@c simply reinstrument it with @code{eval-defun}.
$B$"$kDj5A$K4X$9$kIQEY?t7WB,$H%+%P%l%C%8%G!<%?$r%/%j%"$9$k$K$O!"(B
@code{eval-defun}$B$GC1$K:F=hCV$9$l$P$h$$!#(B
@end deffn
@c For example, after evaluating @code{(fac 5)} with a source
@c breakpoint, and setting @code{edebug-test-coverage} to @code{t}, when
@c the breakpoint is reached, the frequency data looks like this:
$B$?$H$($P!"(B@code{edebug-test-coverage}$B$r(B@code{t}$B$H$7!"(B
$B%=!<%9>e$N%V%l!<%/%]%$%s%H$r@_Dj$7$F(B@code{(fac 5)}$B$rI>2A$9$k$H!"(B
$B%V%l!<%/%]%$%s%H$KC#$7$?$H$-$NIQEY?t%G!<%?$O$D$.$N$h$&$K$J$j$^$9!#(B
@example
(defun fac (n)
  (if (= n 0) (edebug))
;#6           1      0 =5 
  (if (< 0 n)
;#5         = 
      (* n (fac (1- n)))
;#    5               0  
    1))
;#   0 
@end example
@c The comment lines show that @code{fac} was called 6 times.  The
@c first @code{if} statement returned 5 times with the same result each
@c time; the same is true of the condition on the second @code{if}.
@c The recursive call of @code{fac} did not return at all.
$B%3%a%s%H9T$O!"(B@code{fac}$B$,(B6$B2s8F$P$l$?$3$H$rI=$7$^$9!#(B
$B:G=i$N(B@code{if}$BJ8$O!"(B5$B2s$H$bF1$87k2L$rJV$7$?$N$G$9!#(B
2$BHVL\$N(B@code{if}$B$K$D$$$F$bF1$8$G$9!#(B
@code{fac}$B$N:F5"8F$S=P$7$O(B1$BEY$bLa$C$F$$$^$;$s!#(B
@node The Outside Context
@c @subsection The Outside Context
@subsection $B30B&$NJ8L.(B
@c Edebug tries to be transparent to the program you are debugging, but it
@c does not succeed completely.  Edebug also tries to be transparent when
@c you evaluate expressions with @kbd{e} or with the evaluation list
@c buffer, by temporarily restoring the outside context.  This section
@c explains precisely what context Edebug restores, and how Edebug fails to
@c be completely transparent.
edebug$B$O!"FI<T$,%G%P%C%0Cf$N%W%m%0%i%`$KBP$7$F$OF)2a$G$"$k$h$&$KEX$a$^$9$,!"(B
$B40A4$K$&$^$/$$$/$H$O8B$j$^$;$s!#(B
$B$^$?!"(B@kbd{e}$B$GFI<T$,<0$rI>2A$9$k$H$-$dI>2A%j%9%H%P%C%U%!$G$b!"(B
$B30B&$NJ8L.$r0l;~E*$KI|85$7$FF)2a$G$"$k$h$&$KEX$a$^$9!#(B
$BK\@a$G$O!"(Bedebug$B$,I|85$9$kJ8L.$K$D$$$F@53N$K@bL@$7!"(B
edebug$B$,F)2a$K$J$i$J$$>l9g$K$D$$$F$b@bL@$7$^$9!#(B
@menu
* Checking Whether to Stop::	When Edebug decides what to do.
* Edebug Display Update::	When Edebug updates the display.
* Edebug Recursive Edit::	When Edebug stops execution.
@end menu
@node Checking Whether to Stop
@c @subsubsection Checking Whether to Stop
@subsubsection $BDd;_$9$Y$-$+$I$&$+$N8!::(B
@c Whenever Edebug is entered, it needs to save and restore certain data
@c before even deciding whether to make trace information or stop the
@c program.
edebug$B$KF~$k$H!"%H%l!<%9>pJs$r:n$k$N$+%W%m%0%i%`$rDd;_$9$k$N$+$r(B
$B7hDj$9$k$^$($G$"$C$F$b$"$k<o$N%G!<%?$rJ]B8!?I|85$9$kI,MW$,(B
$B$D$M$K$"$j$^$9!#(B
@itemize @bullet
@item 
@c @code{max-lisp-eval-depth} and @code{max-specpdl-size} are both
@c incremented once to reduce Edebug's impact on the stack.  You could,
@c however, still run out of stack space when using Edebug.
edebug$B$,%9%?%C%/$KM?$($k1F6A$r7Z8:$9$k$?$a$K!"(B
@code{max-lisp-eval-depth}$B$H(B@code{max-specpdl-size}$B$r0lEYA}2C$9$k!#(B
$B$7$+$7!"$3$&$7$F$b(Bedebug$B$r;H$&$H$-$K%9%?%C%/$r;H$$@Z$C$F$7$^$&$3$H$,$"$k!#(B
@item 
@c The state of keyboard macro execution is saved and restored.  While
@c Edebug is active, @code{executing-macro} is bound to
@c @code{edebug-continue-kbd-macro}.
$B%-!<%\!<%I%^%/%m$N<B9T>uBV$rJ]B8$7I|85$9$k!#(B
edebug$B$,3h@-$G$"$k$H!"(B@code{executing-macro}$B$O(B
@code{edebug-continue-kbd-macro}$B$KB+G{$5$l$k!#(B
@end itemize
@node Edebug Display Update
@c @subsubsection Edebug Display Update
@subsubsection edebug$B$NI=<($N99?7(B
@c @c This paragraph is not filled, because LaLiberte's conversion script
@c @c needs an xref to be on just one line.
@c When Edebug needs to display something (e.g., in trace mode), it saves
@c the current window configuration from ``outside'' Edebug 
@c (@pxref{Window Configurations}).  When you exit Edebug (by continuing
@c the program), it restores the previous window configuration.
edebug$B$,!J%H%l!<%9%b!<%I$J$I$G!K$J$K$+$rI=<($9$kI,MW$,$"$k$H!"(B
edebug$B$N!X30B&!Y$N8=:_$N%&%#%s%I%&9=@.$rJ]B8$7$^$9(B
$B!J(B@pxref{Window Configurations}$B!K!#(B
$B!J%W%m%0%i%`$rB39T$7$F!K(Bedebug$B$rH4$1$k$H$-$K$O!"(B
$B0JA0$N%&%#%s%I%&9=@.$rI|85$7$^$9(B
@c Emacs redisplays only when it pauses.  Usually, when you continue
@c execution, the program comes back into Edebug at a breakpoint or after
@c stepping without pausing or reading input in between.  In such cases,
@c Emacs never gets a chance to redisplay the ``outside'' configuration.
@c What you see is the same window configuration as the last time Edebug
@c was active, with no interruption.
Emacs$B$O5Y;_$9$k$H$-$K$N$_I=<($r99?7$7$^$9!#(B
$BDL>o!"%W%m%0%i%`$rB39T$7$F$b!"5Y;_$7$?$jF~NO$rFI$`$3$H$J$/(B
$B%V%l!<%/%]%$%s%H$d%9%F%C%W<B9T$K$h$j(Bedebug$B$XLa$j$^$9!#(B
$B$=$N$h$&$J>l9g!"(BEmacs$B$K$O!J(Bedebug$B$N!K!X30B&!Y$N$h$&$9$r:FI=<($9$k(B
$B5!2q$,M?$($i$l$^$;$s!#(B
$B8+$+$1>e!"%&%#%s%I%&$NI=<($OD>A0$K(Bedebug$B$,3h@-$G$"$C$?$H$-$HF1$8$K$J$j$^$9!#(B
@c Entry to Edebug for displaying something also saves and restores the
@c following data, but some of these are deliberately not restored if an
@c error or quit signal occurs.
$B$J$K$+$rI=<($9$k$?$a$K(Bedebug$B$KF~$C$F$b0J2<$N%G!<%?$rJ]B8!?I|85$7$^$9$,!"(B
$B%(%i!<$dCfCG$,5/$3$k$H!"8N0U$KI|85$7$J$$$b$N$b$"$j$^$9!#(B
@itemize @bullet
@item 
@c @cindex current buffer point and mark (Edebug)
@cindex $B%+%l%s%H%P%C%U%!$N%]%$%s%H$H%^!<%/!J(Bedebug$B!K(B
@c Which buffer is current, and the positions of point and the mark in the
@c current buffer, are saved and restored.
$B%+%l%s%H$G$"$k%P%C%U%!$H!"$=$N%P%C%U%!Fb$N%]%$%s%H$H%^!<%/$O(B
$BJ]B8!?I|85$5$l$k!#(B
@item 
@c @cindex window configuration (Edebug)
@cindex $B%&%#%s%I%&9=@.!J(Bedebug$B!K(B
@c The outside window configuration is saved and restored if
@c @code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Display Update}).
@code{edebug-save-windows}$B$,(B@code{nil}$B0J30$J$i$P!"(B
$B30B&$G$N%&%#%s%I%&9=@.$rJ]B8!?I|85$9$k(B
$B!J(B@pxref{Edebug Display Update}$B!K!#(B
@c The window configuration is not restored on error or quit, but the
@c outside selected window @emph{is} reselected even on error or quit in
@c case a @code{save-excursion} is active.  If the value of
@c @code{edebug-save-windows} is a list, only the listed windows are saved
@c and restored.
$B%(%i!<$dCfCG$,5/$3$k$H%&%#%s%I%&9=@.$OI|85$5$l$J$$!#(B
$B$7$+$7!"(B@code{save-excursion}$B$r;H$C$F$$$l$P!"(B
$B%(%i!<$dCfCG$,5/$3$C$F$b!"(B
$B30B&$GA*Br$7$F$$$?%&%#%s%I%&$OA*Br(B@emph{$B$5$l$k(B}$B!#(B
@code{edebug-save-windows}$B$NCM$,%j%9%H$G$"$k$H!"(B
$B%j%9%H$K;XDj$7$?%&%#%s%I%&$N$_$rJ]B8!?I|85$9$k!#(B
@c The window start and horizontal scrolling of the source code buffer are
@c not restored, however, so that the display remains coherent within Edebug.
$B%=!<%9%3!<%I%P%C%U%!$N%&%#%s%I%&3+;O0LCV$d%9%/%m!<%k$OI|85$7$J$$$,!"(B
$B$3$l$O!"(Bedebug$BFb$G$NI=<($,E}0l$5$l$k$h$&$K$9$k$?$a$G$"$k!#(B
@item
@c The value of point in each displayed buffer is saved and restored if
@c @code{edebug-save-displayed-buffer-points} is non-@code{nil}.
@code{edebug-save-displayed-buffer-points}$B$,(B@code{nil}$B0J30$G$"$l$P!"(B
$BI=<($5$l$F$$$k3F%P%C%U%!$N%]%$%s%H0LCV$NCM$rJ]B8!?I|85$9$k!#(B
@item
@c The variables @code{overlay-arrow-position} and
@c @code{overlay-arrow-string} are saved and restored.  So you can safely
@c invoke Edebug from the recursive edit elsewhere in the same buffer.
$BJQ?t(B@code{overlay-arrow-position}$B$H(B@code{overlay-arrow-string}$B$O!"(B
$BJ]B8!?I|85$5$l$k!#(B
$B$=$N$?$a!"F1$8%P%C%U%!$G:F5"JT=8$+$i(Bedebug$B$r5/F0$7$F$b0BA4$G$"$k!#(B
@item 
@c @code{cursor-in-echo-area} is locally bound to @code{nil} so that
@c the cursor shows up in the window.
$B%+!<%=%k$,%&%#%s%I%&$KI=<($5$l$k$h$&$K!"(B
@code{cursor-in-echo-area}$B$O(B@code{nil}$B$K%m!<%+%k$KB+G{$9$k!#(B
@end itemize
@node Edebug Recursive Edit
@c @subsubsection Edebug Recursive Edit
@subsubsection edebug$B$N:F5"JT=8(B
@c When Edebug is entered and actually reads commands from the user, it
@c saves (and later restores) these additional data:
edebug$B$KF~$C$F%f!<%6!<%3%^%s%I$rFI$_<h$k$H$-!"(B
$B0J2<$N%G!<%?$rJ]B8$7!J$N$A$KI|85$7!K$^$9!#(B
@itemize @bullet
@item
@c The current match data.  @xref{Match Data}.
$B%+%l%s%H%^%C%A%G!<%?!#(B
@pxref{Match Data}$B!#(B
@item
@c @code{last-command}, @code{this-command}, @code{last-command-char},
@c @code{last-input-char}, @code{last-input-event},
@c @code{last-command-event}, @code{last-event-frame},
@c @code{last-nonmenu-event}, and @code{track-mouse}.  Commands used within
@c Edebug do not affect these variables outside of Edebug.
@code{last-command}$B!"(B@code{this-command}$B!"(B@code{last-command-char}$B!"(B
@code{last-input-char}$B!"(B@code{last-input-event}$B!"(B
@code{last-command-event}$B!"(B@code{last-event-frame}$B!"(B
@code{last-nonmenu-event}$B!"(B@code{track-mouse}$B!#(B
edebug$BFb$G;H$C$?%3%^%s%I$O!"(Bedebug$B$N30B&$G$N$3$l$i$NJQ?t$K$O1F6A$7$J$$!#(B
@c The key sequence returned by @code{this-command-keys} is changed by
@c executing commands within Edebug and there is no way to reset
@c the key sequence from Lisp.
@code{this-command-keys}$B$,JV$9%-!<Ns$O(B
edebug$BFb$G%3%^%s%I$r<B9T$9$k$HJQ99$5$l$F$7$^$$!"(B
Lisp$B$+$i%-!<Ns$r@_Dj$7D>$9J}K!$O$J$$!#(B
@c Edebug cannot save and restore the value of
@c @code{unread-command-events}.  Entering Edebug while this variable has a
@c nontrivial value can interfere with execution of the program you are
@c debugging.
edebug$B$O(B@code{unread-command-events}$B$NCM$rJ]B8!?I|85$G$-$J$$!#(B
$B$3$NJQ?t$KJQ$JCM$,F~$C$F$$$k$H$-$K(Bedebug$B$KF~$k$H!"(B
$BFI<T$,%G%P%C%0$9$k%W%m%0%i%`$N<B9T$K43>D$9$k$3$H$,$"$k!#(B
@item
@c Complex commands executed while in Edebug are added to the variable
@c @code{command-history}.  In rare cases this can alter execution.
edebug$BFb$G<B9T$5$l$?J#;($J%3%^%s%I$O(B
$BJQ?t(B@code{command-history}$B$KDI2C$5$l$k!#(B
$B$3$l$K$h$j<B9T7k2L$rJQ99$9$k$3$H$O$[$H$s$I$J$$!#(B
@item
@c Within Edebug, the recursion depth appears one deeper than the recursion
@c depth outside Edebug.  This is not true of the automatically updated
@c evaluation list window.
edebug$BFb$G$N:F5"$N?<$5$O!"(Bedebug$B$N30B&$G$N?<$5$h$j(B1$B$@$1?<$$!#(B
$B<+F0E*$K99?7$5$l$kI>2A%j%9%H%&%#%s%I%&$G$O$=$&$G$O$J$$!#(B
@item
@c @code{standard-output} and @code{standard-input} are bound to @code{nil}
@c by the @code{recursive-edit}, but Edebug temporarily restores them during
@c evaluations.
@code{recursive-edit}$B$O(B
@code{standard-output}$B$H(B@code{standard-input}$B$r(B@code{nil}$B$KB+G{$9$k$,!"(B
edebug$B$OI>2ACf$K$O$=$l$i$r0l;~E*$KI|85$9$k!#(B
@item 
@c The state of keyboard macro definition is saved and restored.  While
@c Edebug is active, @code{defining-kbd-macro} is bound to
@c @code{edebug-continue-kbd-macro}.
$B%-!<%\!<%I%^%/%mDj5A$N>uBV$OJ]B8!?I|85$9$k!#(B
edebu$B$,3h@-$G$"$k$H!"(B@code{defining-kbd-macro}$B$O(B
@code{edebug-continue-kbd-macro}$B$KB+G{$5$l$k!#(B
@end itemize
@node Instrumenting Macro Calls
@c @subsection Instrumenting Macro Calls
@subsection $B%^%/%m8F$S=P$7$N=hCV(B
@c   When Edebug instruments an expression that calls a Lisp macro, it needs
@c additional information about the macro to do the job properly.  This is
@c because there is no a-priori way to tell which subexpressions of the
@c macro call are forms to be evaluated.  (Evaluation may occur explicitly
@c in the macro body, or when the resulting expansion is evaluated, or any
@c time later.)
edebug$B$,(BLisp$B%^%/%m$r8F$S=P$9<0$r=hCV$9$k$H$-!"(B
$B$=$l$r@5$7$/9T$&$K$O%^%/%m$K4X$9$kM>J,$J>pJs$rI,MW$H$7$^$9!#(B
$B%^%/%m8F$S=P$7$N$I$NItJ,<0$,I>2A$5$l$k%U%)!<%`$G$"$k$+$r(B
$BL@3N$KH=Dj$9$kJ}K!$,$J$$$+$i$G$9!#(B
$B!J%^%/%mK\BN$GL@<(E*$KI>2A$5$l$k$+!"(B
$B7k2L$NE83+7A$,I>2A$5$l$k$H$-$+!"$"$k$$$O!"$5$i$K$"$H!K(B
@c   Therefore, you must define an Edebug specification for each macro that
@c Edebug will encounter, to explain the format of calls to that macro.  To
@c do this, use @code{def-edebug-spec}.
$B$7$?$,$C$F!"(Bedebug$B$,=P2q$&3F%^%/%m$K$D$$$F!"(B
$BEv3:%^%/%m$N8F$S=P$77A<0$r5-=R$9$k(Bedebug$BMQ;EMM$rDj5A$9$kI,MW$,$"$j$^$9!#(B
$B$3$l$K$O!"(B@code{def-edebug-spec}$B$r;H$$$^$9!#(B
@c @deffn Macro def-edebug-spec macro specification
@deffn $B%^%/%m(B def-edebug-spec macro specification
@c Specify which expressions of a call to macro @var{macro} are forms to be
@c evaluated.  For simple macros, the @var{specification} often looks very
@c similar to the formal argument list of the macro definition, but
@c specifications are much more general than macro arguments.
$B%^%/%m(B@var{macro}$B$N8F$S=P$7$N$I$N<0$,I>2A$5$l$k$+$r;XDj$9$k!#(B
$BC1=c$J%^%/%m$G$O!"(B@var{specification}$B$O(B
$B%^%/%mDj5A$N2>0z?t%j%9%H$K;w$F$$$k$,!"(B
$B$=$N;XDj$O%^%/%m0z?t$h$j$bHFMQ@-$,$"$k!#(B
@c The @var{macro} argument can actually be any symbol, not just a macro
@c name.
$B0z?t(B@var{macro}$B$O%^%/%mL>$@$1$G$J$/G$0U$N%7%s%\%k$G$h$$!#(B
@end deffn
@c Here is a simple example that defines the specification for the
@c @code{for} example macro (@pxref{Argument Evaluation}), followed by an
@c alternative, equivalent specification.
$BNcBj%^%/%m(B@code{for}$B!J(B@pxref{Argument Evaluation}$B!K$N(B
edebug$BMQ;EMM$NEy2A$JDj5ANc(B2$B$D$r<($7$^$9!#(B
@example
(def-edebug-spec for
  (symbolp "from" form "to" form "do" &rest form))
(def-edebug-spec for
  (symbolp ['from form] ['to form] ['do body]))
@end example
@c Here is a table of the possibilities for @var{specification} and how each
@c directs processing of arguments.
@var{specification}$B$K;XDj$9$k$b$N$H$=$N0z?t$N=hM}J}K!$O<!I=$N$H$*$j$G$9!#(B
@table @asis
@item @code{t}
@c All arguments are instrumented for evaluation.
$B$9$Y$F$N0z?t$rI>2A$9$k$h$&$K=hCV$9$k!#(B
@item @code{0}
@c None of the arguments is instrumented.
$B0z?t$O$$$C$5$$=hCV$7$J$$!#(B
@c @item a symbol
@item $B%7%s%\%k(B
@c The symbol must have an Edebug specification which is used instead.
@c This indirection is repeated until another kind of specification is
@c found.  This allows you to inherit the specification from another macro.
edebug$BMQ;EMM$r;}$D%7%s%\%k$r$+$o$j$K;H$&!#(B
$B$3$N4V@\;2>H$OJL$N<oN`$N;EMM$rF@$k$^$G7+$jJV$9!#(B
$B$3$l$K$h$j!"JL$N%^%/%m$+$i;EMM$r7Q>5$G$-$k!#(B
@c @item a list
@item $B%j%9%H(B
@c The elements of the list describe the types of the arguments of a
@c calling form.  The possible elements of a specification list are
@c described in the following sections.
$B%j%9%H$N3FMWAG$O!"8F$S=P$7%U%)!<%`$N0z?t$N7?$r5-=R$9$k!#(B
$B;EMM%j%9%H$N3FMWAG$K$D$$$F$O<!@a$G=R$Y$k!#(B
@end table
@menu
* Specification List::		How to specify complex patterns of evaluation.
* Backtracking::		What Edebug does when matching fails.
* Specification Examples::	To help understand specifications.
@end menu
@node Specification List
@c @subsubsection Specification List
@subsubsection $B;EMM%j%9%H(B
@c @cindex Edebug specification list
@cindex edebug$BMQ;EMM%j%9%H(B
@c A @dfn{specification list} is required for an Edebug specification if
@c some arguments of a macro call are evaluated while others are not.  Some
@c elements in a specification list match one or more arguments, but others
@c modify the processing of all following elements.  The latter, called
@c @dfn{specification keywords}, are symbols beginning with @samp{&} (such
@c as @code{&optional}).
$B%^%/%m8F$S=P$7$N0z?t$N$"$k$b$N$OI>2A$7JL$N$b$N$OI>2A$7$J$$>l9g$K$O!"(B
edebug$BMQ;EMM$K(B@dfn{$B;EMM%j%9%H(B}$B!J(Bspecification list$B!K$,I,MW$K$J$j$^$9!#(B
$BJ#?t$N0z?t$K0lCW$9$k;EMM%j%9%H$NMWAG$b$"$j$^$9$,!"(B
$B8eB3$NMWAG$N=hM}$r=$>~$9$kMWAG$b$"$j$^$9!#(B
$B8e<T$O(B@dfn{$B;EMM%-!<%o!<%I(B}$B!J(Bspecification keyword$B!K$H8F$P$l!"(B
$B!J(B@code{&optional}$B$N$h$&$K!K(B@samp{&}$B$G;O$^$k%7%s%\%k$G$9!#(B
@c A specification list may contain sublists which match arguments that are
@c themselves lists, or it may contain vectors used for grouping.  Sublists
@c and groups thus subdivide the specification list into a hierarchy of
@c levels.  Specification keywords apply only to the remainder of the
@c sublist or group they are contained in.
$B;EMM%j%9%H$K$O!"$=$l<+BN$,%j%9%H$G$"$k0z?t$K0lCW$9$kItJ,%j%9%H$d(B
$B%0%k!<%W2=$K;H$&%Y%/%H%k$r4^$s$G$b$+$^$$$^$;$s!#(B
$BItJ,%j%9%H$d%0%k!<%W$O;EMM%j%9%H$r3,AX$KJ,$1$^$9!#(B
$B;EMM%-!<%o!<%I$O$=$l$i$r4^$`ItJ,%j%9%H$d%0%k!<%W$N;D$j$KE,MQ$5$l$^$9!#(B
@c When a specification list involves alternatives or repetition, matching
@c it against an actual macro call may require backtracking.
@c @xref{Backtracking}, for more details.
$B;EMM%j%9%H$KA*Br;h$d7+$jJV$7$,4^$^$l$k>l9g!"(B
$B<B:]$N%^%/%m8F$S=P$7$K0lCW$5$;$k$K$O%P%C%/%H%i%C%/$,I,MW$J>l9g$b$"$j$^$9!#(B
$B>\$7$/$O(B@xref{Backtracking}$B!#(B
@c Edebug specifications provide the power of regular expression matching,
@c plus some context-free grammar constructs: the matching of sublists with
@c balanced parentheses, recursive processing of forms, and recursion via
@c indirect specifications.
edebug$BMQ;EMM$G$O!"@55,I=8=$K$h$k0lCW$HJ8L.<+M3J8K!$N9=J8$r;H$($^$9!#(B
$BBP1~$7$?3g8L$K0O$^$l$?ItJ,%j%9%H!"%U%)!<%`$N:F5"E*=hM}!"(B
$B4V@\;EMM$K$h$k:F5"$G$9!#(B
@c Here's a table of the possible elements of a specification list, with
@c their meanings:
$B;EMM%j%9%H$NMWAG$K;XDj$G$-$k$b$N$H$=$l$i$N0UL#$r0J2<$K<($7$^$9!#(B
@table @code
@item sexp
@c A single unevaluated Lisp object, which is not instrumented.
@c @c an "expression" is not necessarily intended for evaluation.
$B=hCV$7$J$$I>2A$7$J$$(B1$B$D$N(BLisp$B%*%V%8%'%/%H!#(B
@item form
@c A single evaluated expression, which is instrumented.
$B=hCV$7$?I>2A$9$k(B1$B$D$N<0!#(B
@item place
@findex edebug-unwrap
@c A place to store a value, as in the Common Lisp @code{setf} construct.
Common Lisp$B$N(B@code{setf}$B9=J8$N$h$&$KCM$r3JG<$9$k>l=j!#(B
@item body
@c Short for @code{&rest form}.  See @code{&rest} below.
@code{&rest form}$B$N>JN,7A!#(B
$B0J2<$N(B@code{&rest}$B$r;2>H!#(B
@item function-form
@c A function form: either a quoted function symbol, a quoted lambda
@c expression, or a form (that should evaluate to a function symbol or
@c lambda expression).  This is useful when an argument that's a lambda
@c expression might be quoted with @code{quote} rather than
@c @code{function}, since it instruments the body of the lambda expression
@c either way.
$B4X?t%U%)!<%`!#(B
$B%/%)!<%H$7$?4X?t%7%s%\%k!"%/%)!<%H$7$?%i%`%@<0!"(B
$B$"$k$$$O!"!J4X?t%7%s%\%k$d%i%`%@<0$KI>2A$5$l$k!K%U%)!<%`!#(B
$B$3$l$O!"%i%`%@<0$G$"$k0z?t$,!"(B
@code{function}$B$G$O$J$/(B@code{quote}$B$G%/%)!<%H$5$l$k$H$-$KM-MQ$G$"$k!#(B
$B$H$$$&$N$O!"%i%`%@<0$NK\BN$r$$$:$l$+$NJ}K!$G=hCV$9$k$+$i$G$"$k!#(B
@item lambda-expr
@c A lambda expression with no quoting.
$B%/%)!<%H$7$F$$$J$$%i%`%@<0!#(B
@item &optional
@c @kindex &optional @r{(Edebug)}
@kindex &optional @r{$B!J(Bedebug$B!K(B}
@c All following elements in the specification list are optional; as soon
@c as one does not match, Edebug stops matching at this level.  
$B$3$N;EMM%j%9%HFb$N8eB3$NMWAG$9$Y$F$O>JN,2DG=!#(B
$B0lCW$7$J$$$H!"(Bedebug$B$O$?$@$A$K$3$N%l%Y%k$N0lCW$r;_$a$k!#(B
@c To make just a few elements optional followed by non-optional elements,
@c use @code{[&optional @var{specs}@dots{}]}.  To specify that several
@c elements must all match or none, use @code{&optional
@c [@var{specs}@dots{}]}.  See the @code{defun} example below.
$B?t8D$N>JN,2DG=$JMWAG$K>JN,IT2D$JMWAG$rB3$1$k$K$O!"(B
@code{[&optional @var{specs}@dots{}]}$B$r;H$&!#(B
$B?t8D$NMWAG$,$9$Y$F0lCW$9$k$+$^$C$?$/0lCW$7$J$$$3$H$r;XDj$9$k$K$O!"(B
@code{&optional [@var{specs}@dots{}]}$B$r;H$&!#(B
$B0J2<$N(B@code{defun}$B$NNc$r;2>H!#(B
@item &rest
@c @kindex &rest @r{(Edebug)}
@kindex &rest @r{$B!J(Bedebug$B!K(B}
@c All following elements in the specification list are repeated zero or
@c more times.  In the last repetition, however, it is not a problem if the
@c expression runs out before matching all of the elements of the
@c specification list.
$B$3$N;EMM%j%9%HFb$N8eB3$NMWAG$9$Y$F$r(B0$B2s0J>e7+$jJV$9!#(B
$B:G8e$N7+$jJV$7$G$O!";EMM%j%9%H$NMWAG$9$Y$F$K0lCW$9$k$^$($K(B
$B<0$r;H$$?T$/$7$F$bLdBj$K$O$J$i$J$$!#(B
@c To repeat only a few elements, use @code{[&rest @var{specs}@dots{}]}.
@c To specify several elements that must all match on every repetition, use
@c @code{&rest [@var{specs}@dots{}]}.
$B?t8D$NMWAG$N$_$r7+$jJV$9$K$O(B@code{[&rest @var{specs}@dots{}]}$B$r;H$&!#(B
$B3F7+$jJV$7$G$9$Y$F$,0lCW$9$k$h$&$J?t8D$NMWAG$r;XDj$9$k$K$O!"(B
@code{&rest [@var{specs}@dots{}]}$B$r;H$&!#(B
@item &or
@c @kindex &or @r{(Edebug)}
@kindex &or @r{$B!J(Bedebug$B!K(B}
@c Each of the following elements in the specification list is an
@c alternative.  One of the alternatives must match, or the @code{&or}
@c specification fails.
$B;EMM%j%9%HFb$N8eB3$N3F%j%9%H$OA*Br;h$rI=$9!#(B
$BA*Br;h$N(B1$B$D$K0lCW$7$J$1$l$P!";EMM(B@code{&or}$B$O<:GT!#(B
@c Each list element following @code{&or} is a single alternative.  To
@c group two or more list elements as a single alternative, enclose them in
@c @code{[@dots{}]}.
@code{&or}$B$KB3$/3FMWAG$O(B1$B$D$NA*Br;h$rI=$9!#(B
$BJ#?t$NMWAG$r(B1$B$D$NA*Br;h$H$7$F%0%k!<%W$K$^$H$a$k$K$O!"(B
$B$=$l$i$r(B@code{[@dots{}]}$B$G0O$`!#(B
@item ¬
@c @kindex ¬ @r{(Edebug)}
@kindex ¬ @r{$B!J(Bedebug$B!K(B}
@c Each of the following elements is matched as alternatives as if by using
@c @code{&or}, but if any of them match, the specification fails.  If none
@c of them match, nothing is matched, but the @code{¬} specification
@c succeeds.
@code{&or}$B$r;H$C$?$+$h$&$K8eB3$NMWAG$rA*Br;h$H$7$F0lCW$5$;$k$,!"(B
$B$I$l$+$,0lCW$9$k$H;EMM$O<:GT!#(B
$B$I$l$K$b0lCW$7$J$1$l$P!";EMM(B@code{¬}$B$O@.8y!#(B
@item &define 
@c @kindex &define @r{(Edebug)}
@kindex &define @r{$B!J(Bedebug$B!K(B}
@c Indicates that the specification is for a defining form.  The defining
@c form itself is not instrumented (that is, Edebug does not stop before and
@c after the defining form), but forms inside it typically will be
@c instrumented.  The @code{&define} keyword should be the first element in
@c a list specification.
$B;EMM$ODj5A%U%)!<%`$KBP$9$k$b$N$G$"$k$3$H$rI=$9!#(B
$BDj5A%U%)!<%`$=$N$b$N$O=hCV$7$J$$(B
$B!J$D$^$j!"(Bedbug$B$ODj5A%U%)!<%`$NA08e$GDd;_$7$J$$!K$,!"(B
$B$3$NFbB&$K$"$k%U%)!<%`$OE57?E*$K$O=hCV$5$l$k!#(B
$B%-!<%o!<%I(B@code{&define}$B$O%j%9%H;EMM$N:G=i$NMWAG$G$"$kI,MW$,$"$k!#(B
@item nil
@c This is successful when there are no more arguments to match at the
@c current argument list level; otherwise it fails.  See sublist
@c specifications and the backquote example below.
$B8=:_$N0z?t%j%9%H$N%l%Y%k$K$*$$$F0lCW$9$k0z?t$,$J$1$l$P@.8y$9$k!#(B
$B$5$b$J$1$l$P<:GT!#(B
$BItJ,%j%9%H;EMM$H0J2<$N%P%C%/%/%)!<%H$NNc$r;2>H!#(B
@item gate
@c @cindex preventing backtracking
@cindex $B%P%C%/%H%i%C%/$NAK;_(B
@c No argument is matched but backtracking through the gate is disabled
@c while matching the remainder of the specifications at this level.  This
@c is primarily used to generate more specific syntax error messages.  See
@c @ref{Backtracking}, for more details.  Also see the @code{let} example
@c below.
$B$$$+$J$k0z?t$H$b0lCW$7$J$$$,!"$3$N%2!<%H$rDL$k$H!"(B
$B$3$N%l%Y%k$N;EMM$N;D$j$NItJ,$H0lCW$rD4$Y$k:]$K$O(B
$B%P%C%/%H%i%C%/$r6X;_$9$k!#(B
$B$3$l$O<g$K$h$j>\$7$$9=J8%(%i!<%a%C%;!<%8$r@8@.$9$k$?$a$K;H$&!#(B
$B>\$7$/$O(B@ref{Backtracking}$B$r;2>H!#(B
$BNc$K$D$$$F$O0J2<$N(B@code{let}$B$r;2>H!#(B
@c @item @var{other-symbol}
@item @var{$B$=$NB>$N%7%s%\%k(B}
@c @cindex indirect specifications
@cindex $B4V@\;EMM(B
@c Any other symbol in a specification list may be a predicate or an
@c indirect specification.
$B;EMM%j%9%H$N$=$NB>$N%7%s%\%k$O=R8l$G$"$k$+4V@\;EMM$G$"$k!#(B
@c If the symbol has an Edebug specification, this @dfn{indirect
@c specification} should be either a list specification that is used in
@c place of the symbol, or a function that is called to process the
@c arguments.  The specification may be defined with @code{def-edebug-spec}
@c just as for macros. See the @code{defun} example below.
$B%7%s%\%k$K(Bedebug$BMQ;EMM$,$"$l$P!"(B
$B$3$N(B@dfn{$B4V@\;EMM(B}$B$O!"%7%s%\%k$N$+$o$j$K;H$o$l$k;EMM%j%9%H$G$"$k$+!"(B
$B0z?t$r=hM}$9$k$?$a$K8F$S=P$5$l$k4X?t$G$"$k$3$H!#(B
$B;EMM$O!"%^%/%m8~$1$K(B@code{def-edebug-spec}$B$GDj5A$7$?;EMM$G$"$C$F$b$h$$!#(B
$B0J2<$N(B@code{defun}$B$NNc$r;2>H!#(B
@c Otherwise, the symbol should be a predicate.  The predicate is called
@c with the argument and the specification fails if the predicate returns
@c @code{nil}.  In either case, that argument is not instrumented.
$B$5$b$J$1$l$P!"%7%s%\%k$O=R8l$G$"$k$3$H!#(B
$B=R8l$O0z?t$G8F$S=P$5$l!"=R8l$,(B@code{nil}$B$rJV$9$H;EMM$O<:GT$9$k!#(B
$B$$$:$l$N>l9g$G$b!"Ev3:0z?t$O=hCV$5$l$J$$!#(B
@c Some suitable predicates include @code{symbolp}, @code{integerp},
@c @code{stringp}, @code{vectorp}, and @code{atom}.
$BE,Ev$J=R8l$K$O!"(B@code{symbolp}$B!"(B@code{integerp}$B!"(B
@code{stringp}$B!"(B@code{vectorp}$B!"(B@code{atom}$B$,$"$k!#(B
@item [@var{elements}@dots{}]
@c @cindex [@dots{}] (Edebug)
@cindex [@dots{}]$B!J(Bedebug$B!K(B
@c A vector of elements groups the elements into a single @dfn{group
@c specification}.  Its meaning has nothing to do with vectors.
$BMWAG$N%Y%/%H%k$OMWAG72$rC10l$N(B@dfn{$B%0%k!<%W;EMM(B}$B$K$^$H$a$k!#(B
$B$3$N0UL#$O%Y%/%H%k$N0UL#$H$O4X78$J$$!#(B
@item "@var{string}"
@c The argument should be a symbol named @var{string}.  This specification
@c is equivalent to the quoted symbol, @code{'@var{symbol}}, where the name
@c of @var{symbol} is the @var{string}, but the string form is preferred.
$B0z?t$O(B@var{string}$B$H$$$&L>A0$N%7%s%\%k$G$"$k$3$H!#(B
$B$3$N;EMM$O!"(B@var{symbol}$B$NL>A0$,(B@var{string}$B$G$"$k(B
$B%/%)!<%H$H$7$?%7%s%\%k(B@code{'@var{symbol}}$B$HEy2A$G$"$k$,!"(B
$BJ8;zNs$N$[$&$,K>$^$7$$!#(B
@item (vector @var{elements}@dots{})
@c The argument should be a vector whose elements must match the
@c @var{elements} in the specification.  See the backquote example below.
$B0z?t$O!";EMMFb$N(B@var{elements}$B$K0lCW$9$k$b$N$rMWAG$H$9$k%Y%/%H%k$G$"$k$3$H!#(B
$B0J2<$N%P%C%/%/%)!<%H$NNc$r;2>H!#(B
@item (@var{elements}@dots{})
@c Any other list is a @dfn{sublist specification} and the argument must be
@c a list whose elements match the specification @var{elements}.
$B$=$NB>$N%j%9%H$O(B@dfn{$BItJ,%j%9%H;EMM(B}$B$G$"$j!"(B
$B0z?t$O;EMM(B@var{elements}$B$K0lCW$9$k$b$N$rMWAG$H$9$k%j%9%H$G$"$k$3$H!#(B
@c @cindex dotted lists (Edebug)
@cindex $B%I%C%HBP%j%9%H!J(Bedebug$B!K(B
@c A sublist specification may be a dotted list and the corresponding list
@c argument may then be a dotted list.  Alternatively, the last @sc{cdr} of a
@c dotted list specification may be another sublist specification (via a
@c grouping or an indirect specification, e.g., @code{(spec .  [(more
@c specs@dots{})])}) whose elements match the non-dotted list arguments.
@c This is useful in recursive specifications such as in the backquote
@c example below.  Also see the description of a @code{nil} specification
@c above for terminating such recursion.
$BItJ,%j%9%H;EMM$O%I%C%HBP%j%9%H$G$b$h$/!"$=$N>l9g!"(B
$BBP1~$9$k%j%9%H0z?t$O%I%C%HBP%j%9%H$G$"$k!#(B
$B$"$k$$$O!"%I%C%HBP%j%9%H;EMM$N:G8e$N(B@sc{cdr}$B$O(B
$B!J(B@code{(spec .  [(more specs@dots{})])}$B$J$I$N(B
$B%0%k!<%W$d4V@\;EMM$r2p$7$?!K(B
$BJL$NItJ,%j%9%H;EMM$G$"$C$F$b$h$$$,!"(B
$B$=$l$i$NMWAG$O%I%C%HBP$G$O$J$$%j%9%H0z?t$K0lCW$9$k!#(B
$B$3$l$O!"0J2<$N%P%C%/%/%)!<%H$NNc$N$h$&$J:F5";EMM$KM-MQ$G$"$k!#(B
$B$3$N$h$&$J:F5"$r=*$i$;$k$&$($N;EMM(B@code{nil}$B$b;2>H!#(B
@c Note that a sublist specification written as @code{(specs .  nil)}
@c is equivalent to @code{(specs)}, and @code{(specs .
@c (sublist-elements@dots{}))} is equivalent to @code{(specs
@c sublist-elements@dots{})}.
@code{(specs .  nil)}$B$d(B
@code{(specs . (sublist-elements@dots{}))}$B$N$h$&$JItJ,%j%9%H;EMM$O(B
@code{(specs sublist-elements@dots{})}$B$HEy2A$G$"$k$3$H$KCm0U!#(B
@end table
@c Need to document extensions with &symbol and :symbol
@c Here is a list of additional specifications that may appear only after
@c @code{&define}.  See the @code{defun} example below.
@code{&define}$B$N$&$7$m$KDI2C$G$-$k;EMM$N0lMw$r0J2<$K<($7$^$9!#(B
$B0J2<$N(B@code{defun}$B$NNc$r;2>H$7$F$/$@$5$$!#(B
@table @code
@item name
@c The argument, a symbol, is the name of the defining form. 
$B0z?t$O%7%s%\%k$G$"$j!"Dj5A%U%)!<%`$NL>A0$G$"$k!#(B
@c A defining form is not required to have a name field; and it may have
@c multiple name fields.
$BDj5A%U%)!<%`$K$OC10l$NL>A0%U%#!<%k%I$,$"$kI,MW$O$J$/!"(B
$BJ#?t$NL>A0%U%#!<%k%I$r;}$C$F$$$F$b$h$$!#(B
@item :name
@c This construct does not actually match an argument.  The element
@c following @code{:name} should be a symbol; it is used as an additional
@c name component for the definition.  You can use this to add a unique,
@c static component to the name of the definition.  It may be used more
@c than once.
$B$3$N9=B$$O0z?t$K$O<B:]$K$O0lCW$7$J$$!#(B
@code{:name}$B$KB3$/MWAG$O%7%s%\%k$G$"$k$3$H!#(B
$BDj5A$KBP$9$kDI2C$NL>A0MWAG$H$7$F;H$&!#(B
$BDj5A$NL>A0$K0l0U$G@EE*$JMWAG$rDI2C$9$k$?$a$K;H$&!#(B
$BJ#?t$"$C$F$b$h$$!#(B
@item arg
@c The argument, a symbol, is the name of an argument of the defining form.
@c However, lambda-list keywords (symbols starting with @samp{&})
@c are not allowed.
$B0z?t$O%7%s%\%k$G$"$j!"Dj5A%U%)!<%`$N0z?t$NL>A0$G$"$k!#(B
$B$7$+$7!"%i%`%@%j%9%H%-!<%o!<%I!J(B@samp{&}$B$G;O$^$k%7%s%\%k!K$O5v$5$l$J$$!#(B
@item lambda-list
@c @cindex lambda-list (Edebug)
@cindex $B%i%`%@%j%9%H!J(Bedebug$B!K(B
@c This matches a lambda list---the argument list of a lambda expression.
$B%i%`%@%j%9%H!"$9$J$o$A!"%i%`%@<0$N0z?t%j%9%H$K0lCW$9$k!#(B
@item def-body
@c The argument is the body of code in a definition.  This is like
@c @code{body}, described above, but a definition body must be instrumented
@c with a different Edebug call that looks up information associated with
@c the definition.  Use @code{def-body} for the highest level list of forms
@c within the definition.
$B0z?t$O!"Dj5AFb$N%3!<%IK\BN$G$"$k!#(B
$B$3$l$O!">e$K=R$Y$?(B@code{body}$B$K;w$F$$$k$,!"(B
$BDj5AK\BN$ODj5A$K4XO"$7$?>pJs$rD4$Y$k0[$J$k(Bedebug$B8F$S=P$7$G=hCV$9$kI,MW$,$"$k!#(B
$BDj5AFb$N%U%)!<%`$N:G>e0L%l%Y%k$N%j%9%H$K$O(B@code{def-body}$B$r;H$&!#(B
@item def-form
@c The argument is a single, highest-level form in a definition.  This is
@c like @code{def-body}, except use this to match a single form rather than
@c a list of forms.  As a special case, @code{def-form} also means that
@c tracing information is not output when the form is executed.  See the
@c @code{interactive} example below.
$B0z?t$O!"Dj5AFb$NC10l$N:G>e0L%l%Y%k$N%U%)!<%`$G$"$k!#(B
$B$3$l$O(B@code{def-body}$B$K;w$F$$$k$,!"(B
$B%U%)!<%`$N%j%9%H$G$O$J$/C10l$N%U%)!<%`$K0lCW$9$k$b$N$K;H$&!#(B
$BFCJL$J>l9g$H$7$F!"(B@code{def-form}$B$O(B
$B%U%)!<%`$r<B9T$7$?$H$-$K%H%l!<%9>pJs$r=PNO$7$J$$$3$H$r0UL#$9$k!#(B
$B0J2<$N(B@code{interactive}$B$NNc$r;2>H!#(B
@end table
@node Backtracking
@c @subsubsection Backtracking in Specifications
@subsubsection $B;EMMFb$G$N%P%C%/%H%i%C%/(B
@c @cindex backtracking
@c @cindex syntax error (Edebug)
@cindex $B%P%C%/%H%i%C%/(B
@cindex $B9=J8%(%i!<!J(Bedebug$B!K(B
@c If a specification fails to match at some point, this does not
@c necessarily mean a syntax error will be signaled; instead,
@c @dfn{backtracking} will take place until all alternatives have been
@c exhausted.  Eventually every element of the argument list must be
@c matched by some element in the specification, and every required element
@c in the specification must match some argument.
$B;EMM$N0lCW$,$"$k2U=j$G<:GT$7$F$b!"(B
$BI,$:$7$b9=J8%(%i!<$,DLCN$5$l$k$H$O8B$j$^$;$s!#(B
$B$=$N$+$o$j$K!"A*Br;h$9$Y$F$r;n$7?T$/$9$^$G(B@dfn{$B%P%C%/%H%i%C%/(B}$B$7$^$9!#(B
$B:G=*E*$K!"0z?t%j%9%H$N3FMWAG$O;EMMFb$N$$$:$l$+$NMWAG$K0lCW$9$kI,MW$,$"$j!"(B
$B;EMMFb$N3FI,?\MWAG$O$$$:$l$+$N0z?t$K0lCW$9$kI,MW$,$"$j$^$9!#(B
  
@c When a syntax error is detected, it might not be reported until much
@c later after higher-level alternatives have been exhausted, and with the
@c point positioned further from the real error.  But if backtracking is
@c disabled when an error occurs, it can be reported immediately.  Note
@c that backtracking is also reenabled automatically in several situations;
@c it is reenabled when a new alternative is established by
@c @code{&optional}, @code{&rest}, or @code{&or}, or at the start of
@c processing a sublist, group, or indirect specification.  The effect of
@c enabling or disabling backtracking is limited to the remainder of the
@c level currently being processed and lower levels.
$B9=J8%(%i!<$r8!=P$7$F$b!"$h$j9b$$%l%Y%k$NA*Br;h$r;H$$@Z$k$^$G$OJs9p$5$l$:!"(B
$B<B:]$N%(%i!<2U=j$+$iN%$l$?2U=j$K%]%$%s%H$,CV$+$l$^$9!#(B
$B$7$+$7!"%(%i!<H/@8;~$K%P%C%/%H%i%C%/$,6X;_$5$l$F$$$l$P!"(B
$B$?$@$A$K%(%i!<$,Js9p$5$l$^$9!#(B
$B$5$^$6$^$J>u67$G%P%C%/%H%i%C%/$,<+F0E*$K:F5v2D$5$l$k$3$H$KCm0U$7$F$/$@$5$$!#(B
@code{&optional}$B$d(B@code{&rest}$B$d(B@code{&or}$B$G?7$?$KA*Br;h$,;XDj$5$l$?$j!"(B
$BItJ,%j%9%H$d%0%k!<%W$d4V@\;EMM$r=hM}$7;O$a$k$H!"(B
$B<+F0E*$K:F5v2D$5$l$^$9!#(B
$B%P%C%/%H%i%C%/$N5v2D!?6X;_$N8z2L$O!"(B
$B8=:_=hM}$7$F$$$k%l%Y%k$d$=$l$h$jDc$$%l%Y%k$K8BDj$5$l$^$9!#(B
@c Backtracking is disabled while matching any of the
@c form specifications (that is, @code{form}, @code{body}, @code{def-form}, and
@c @code{def-body}).  These specifications will match any form so any error
@c must be in the form itself rather than at a higher level.
$BG$0U$N%U%)!<%`;EMM!J$D$^$j!"(B@code{form}$B!"(B@code{body}$B!"(B@code{def-form}$B!"(B
@code{def-body}$B!K$N0lCW=hM}Cf$K$O!"%P%C%/%H%i%C%/$r6X;_$7$^$9!#(B
$B$3$l$i$N;EMM$OG$0U$N%U%)!<%`$K0lCW$9$k$N$G!"(B
$B%(%i!<$O$h$j>e$N%l%Y%k$G$O$J$/%U%)!<%`<+?H$K$"$k$O$:$G$9!#(B
@c Backtracking is also disabled after successfully matching a quoted
@c symbol or string specification, since this usually indicates a
@c recognized construct.  But if you have a set of alternative constructs that
@c all begin with the same symbol, you can usually work around this
@c constraint by factoring the symbol out of the alternatives, e.g.,
@c @code{["foo" &or [first case] [second case] ...]}.
$B$^$?!"%/%)!<%H$7$?%7%s%\%k$dJ8;zNs$N;EMM$K0lCW$9$k$H(B
$B%P%C%/%H%i%C%/$r6X;_$7$^$9!#(B
$B$H$$$&$N$O!"DL>o!"$3$l$O9=B$$rG'<1$7$?$3$H$r0UL#$9$k$+$i$G$9!#(B
$B$7$+$7!"$9$Y$F$,F10l%7%s%\%k$G;O$^$kA*Br;h$r;XDj$9$k>l9g$K$O!"(B
@code{["foo" &or [first case] [second case] ...]}$B$N$h$&$K!"(B
$B$=$N%7%s%\%k$rA*Br;h$+$i3g$j=P$;$P%P%C%/%H%i%C%/$9$k$h$&$K$G$-$^$9!#(B
@c Most needs are satisfied by these two ways that bactracking is
@c automatically disabled, but occasionally it is useful to explicitly
@c disable backtracking by using the @code{gate} specification.  This is
@c useful when you know that no higher alternatives could apply.  See the
@c example of the @code{let} specification.
$BB?$/$N>l9g$G$O!"%P%C%/%H%i%C%/$r<+F0E*$K6X;_$9$k$3$l$i$N(B2$B$D$NJ}K!$G==J,$G$9$,!"(B
$B;EMM(B@code{gate}$B$r;H$C$F%P%C%/%H%i%C%/$rL@<(E*$K6X;_$9$k$HM-MQ$J>l9g$b$"$j$^$9!#(B
$B>e0L$NA*Br;h$,E,MQ$G$-$J$$$H$o$+$C$F$$$k>l9g$KM-MQ$G$9!#(B
$B;EMM(B@code{let}$B$NNc$r;2>H$7$F$/$@$5$$!#(B
@node Specification Examples
@c @subsubsection Specification Examples
@subsubsection $B;EMM$NNc(B
@c It may be easier to understand Edebug specifications by studying
@c the examples provided here.
$B0J2<$NNc$r;29M$K$9$k$H(Bedebug$BMQ;EMM$rM}2r$7$d$9$$$G$7$g$&!#(B
@c A @code{let} special form has a sequence of bindings and a body.  Each
@c of the bindings is either a symbol or a sublist with a symbol and
@c optional expression.  In the specification below, notice the @code{gate}
@c inside of the sublist to prevent backtracking once a sublist is found.
$B%9%Z%7%c%k%U%)!<%`(B@code{let}$B$K$OB+G{$HK\BN$NJB$S$,$"$j$^$9!#(B
$B3FB+G{$O!"%7%s%\%k!"$"$k$$$O!"%7%s%\%k$H>JN,2DG=$J<0$+$i@.$kItJ,%j%9%H$G$9!#(B
$B0J2<$N(Bedebug$BMQ;EMM$G$O!"ItJ,%j%9%H$NFbB&$K$"$k(B@code{gate}$B$G!"(B
$BItJ,%j%9%H$r0lEY$_$D$1$k$H%P%C%/%H%i%C%/$r6X;_$7$F$$$k$3$H$K(B
$BCm0U$7$F$/$@$5$$!#(B
@example
(def-edebug-spec let
  ((&rest
    &or symbolp (gate symbolp &optional form))
   body))
@end example
@c Edebug uses the following specifications for @code{defun} and
@c @code{defmacro} and the associated argument list and @code{interactive}
@c specifications.  It is necessary to handle interactive forms specially
@c since an expression argument it is actually evaluated outside of the
@c function body.
edebug$B$O!"(B@code{defun}$B$H(B@code{defmacro}$B!"(B
$B$*$h$S!"BP1~$9$k0z?t%j%9%H$H;EMM(B@code{interactive}$B$KBP$7$F$O!"(B
$B0J2<$N(Bedebug$BMQ;EMM$r;H$$$^$9!#(B
$B<0$N0z?t$O<B:]$K$O4X?tK\BN$N30B&$GI>2A$5$l$k$N$G!"(B
$BBPOC@k8@%U%)!<%`$rFCJL07$$$9$kI,MW$,$"$j$^$9!#(B
@smallexample
@c (def-edebug-spec defmacro defun) ; @r{Indirect ref to @code{defun} spec.}
(def-edebug-spec defmacro defun) ; @r{$B;EMM(B@code{defun}$B$N4V@\;2>H(B}
(def-edebug-spec defun 
  (&define name lambda-list 
@c            [&optional stringp]   ; @r{Match the doc string, if present.}
           [&optional stringp]   ; @r{$B$"$l$P!"@bL@J8;zNs$K0lCW$9$k(B}
           [&optional ("interactive" interactive)]
           def-body))
(def-edebug-spec lambda-list
  (([&rest arg]
    [&optional ["&optional" arg &rest arg]]
    &optional ["&rest" arg]
    )))
(def-edebug-spec interactive
@c   (&optional &or stringp def-form))    ; @r{Notice: @code{def-form}}
  (&optional &or stringp def-form))    ; @r{@code{def-form}$B$r;2>H(B}
@end smallexample
@c The specification for backquote below illustrates how to match
@c dotted lists and use @code{nil} to terminate recursion.  It also
@c illustrates how components of a vector may be matched.  (The actual
@c specification defined by Edebug does not support dotted lists because
@c doing so causes very deep recursion that could fail.)
$B0J2<$N%P%C%/%/%)!<%H$KBP$9$k;EMM$O!"(B
$B%I%C%HBP%j%9%H$N0lCW$N;EJ}$H:F5"$r=*$i$;$k(B@code{nil}$B$N;H$$J}$r<($7$^$9!#(B
$B$^$?!"%Y%/%H%k$NMWAG$N0lCW$N;EJ}$b<($7$^$9!#(B
$B!J(Bedebug$B$,<B:]$KDj5A$7$F$$$k;EMM$G$O!"(B
$B<:GT$N2DG=@-$,$"$kHs>o$K?<$$:F5"$r$b$?$i$9$?$a%I%C%HBP%j%9%H$r07$o$J$$!#!K(B
@smallexample
@c (def-edebug-spec ` (backquote-form))   ; @r{Alias just for clarity.}
(def-edebug-spec ` (backquote-form))   ; @r{$B$o$+$j$d$9$$$h$&$KJLL>$rIU$1$k(B}
(def-edebug-spec backquote-form
  (&or ([&or "," ",@@"] &or ("quote" backquote-form) form)
       (backquote-form . [&or nil backquote-form])
       (vector &rest backquote-form)
       sexp))
@end smallexample
@node Edebug Options
@c @subsection Edebug Options
@subsection edebug$B$N%*%W%7%g%s(B
@c   These options affect the behavior of Edebug:
$B0J2<$N%*%W%7%g%s$O(Bedebug$B$NF0:n$K1F6A$7$^$9!#(B
@defopt edebug-setup-hook
@c Functions to call before Edebug is used.  Each time it is set to a new
@c value, Edebug will call those functions once and then
@c @code{edebug-setup-hook} is reset to @code{nil}.  You could use this to
@c load up Edebug specifications associated with a package you are using
@c but only when you also use Edebug.
@c @xref{Instrumenting}.
edebug$B$r;H$&$^$($K8F$S=P$94X?t72!#(B
$B?7$?$JCM$K@_Dj$5$l$k$?$S$K!"(Bedebug$B$O$3$l$i$N4X?t$r8F$S=P$7!"(B
$B$=$N$"$H$G(B@code{edebug-setup-hook}$B$r(B@code{nil}$B$K:F@_Dj$9$k!#(B
$B$3$l$rMQ$$$F!"(Bedebug$B$r;HMQ$9$k>l9g$K$N$_!"(B
$B;HMQ$9$k%Q%C%1!<%8$KBP1~$9$k(Bedebug$BMQ;EMM$r%m!<%I$G$-$k!#(B
@pxref{Instrumenting}$B!#(B
@end defopt
@defopt edebug-all-defs
@c If this is non-@code{nil}, normal evaluation of defining forms such as
@c @code{defun} and @code{defmacro} instruments them for Edebug.  This
@c applies to @code{eval-defun}, @code{eval-region}, @code{eval-buffer},
@c and @code{eval-current-buffer}.
$B$3$l$,(B@code{nil}$B0J30$G$"$k$H!"(B
@code{defun}$B$d(B@code{defmacro}$B$N$h$&$JDj5A%U%)!<%`$rIaDL$KI>2A$9$k$H!"(B
edebug$BMQ$K$=$l$i$r=hCV$9$k!#(B
$B$3$l$O!"(B@code{eval-defun}$B!"(B@code{eval-region}$B!"(B@code{eval-buffer}$B!"(B
@code{eval-current-buffer}$B$K$bE,MQ$5$l$k!#(B
@c Use the command @kbd{M-x edebug-all-defs} to toggle the value of this
@c option.  @xref{Instrumenting}.
$B$3$N%*%W%7%g%s$NCM$r%H%0%k$9$k$K$O%3%^%s%I(B@kbd{M-x edebug-all-defs}$B$r;H$&!#(B
@pxref{Instrumenting}$B!#(B
@end defopt
@defopt edebug-all-forms
@c If this is non-@code{nil}, the commands @code{eval-defun},
@c @code{eval-region}, @code{eval-buffer}, and @code{eval-current-buffer}
@c instrument all forms, even those that don't define anything.
@c This doesn't apply to loading or evaluations in the minibuffer.
$B$3$l$,(Bcode{nil}$B0J30$G$"$k$H!"%3%^%s%I(B@code{eval-defun}$B!"(B
@code{eval-region}$B!"(B@code{eval-buffer}$B!"(B@code{eval-current-buffer}$B$O!"(B
$BDj5A$7$J$$%U%)!<%`$N>l9g$G$"$C$F$b$9$Y$F$N%U%)!<%`$r=hCV$9$k!#(B
$B$3$l$O!"%m!<%I$d%_%K%P%C%U%!$G$NI>2A$K$OE,MQ$5$l$J$$!#(B
@c Use the command @kbd{M-x edebug-all-forms} to toggle the value of this
@c option.  @xref{Instrumenting}.
$B$3$N%*%W%7%g%s$NCM$r%H%0%k$9$k$K$O%3%^%s%I(B@kbd{M-x edebug-all-forms}$B$r;H$&!#(B
@pxref{Instrumenting}$B!#(B
@end defopt
@defopt edebug-save-windows
@c If this is non-@code{nil}, Edebug saves and restores the window
@c configuration.  That takes some time, so if your program does not care
@c what happens to the window configurations, it is better to set this
@c variable to @code{nil}.
$B$3$l$,(B@code{nil}$B0J30$G$"$k$H!"(Bedebug$B$O%&%#%s%I%&9=@.$rJ]B8!?I|85$9$k!#(B
$B$3$l$K$O;~4V$,$+$+$k$N$G!"FI<T$N%W%m%0%i%`$,%&%#%s%I%&9=@.$K(B
$B0MB8$7$J$$$N$J$i$P!"$3$NJQ?t$O(B@code{nil}$B$K@_Dj$7$F$*$/$[$&$,$h$$!#(B
@c If the value is a list, only the listed windows are saved and
@c restored.  
$BCM$,%j%9%H$G$"$k$H!"%j%9%HFb$N%&%#%s%I%&$N$_$rJ]B8!?I|85$9$k!#(B
@c You can use the @kbd{W} command in Edebug to change this variable
@c interactively.  @xref{Edebug Display Update}.
edebug$B$N%3%^%s%I(B@kbd{W}$B$r;H$C$F$3$NJQ?t$rBPOCE*$KJQ99$G$-$k!#(B
@pxref{Edebug Display Update}$B!#(B
@end defopt
@defopt edebug-save-displayed-buffer-points
@c If this is non-@code{nil}, Edebug saves and restores point in all
@c displayed buffers.
$B$3$l$,(B@code{nil}$B0J30$G$"$k$H!"(Bedebug$B$OI=<($5$l$F$$$k$9$Y$F$N%P%C%U%!$N(B
$B%]%$%s%H$rJ]B8!?I|85$9$k!#(B
@c Saving and restoring point in other buffers is necessary if you are
@c debugging code that changes the point of a buffer which is displayed in
@c a non-selected window.  If Edebug or the user then selects the window,
@c point in that buffer will move to the window's value of point.
$BA*Br$7$F$$$J$$%&%#%s%I%&$KI=<($5$l$?%P%C%U%!$N%]%$%s%H$rJQ99$9$k(B
$B%3!<%I$r%G%P%C%0Cf$K$O!"JL$N%P%C%U%!$N%]%$%s%H$rJ]B8!?I|85$9$kI,MW$,$"$k!#(B
edebug$B$d%f!<%6!<$,Ev3:%&%#%s%I%&$rA*Br$9$k$H!"(B
$B$=$N%P%C%U%!$N%]%$%s%H$O%&%#%s%I%&$N%]%$%s%H0LCV$K0\F0$9$k!#(B
@c Saving and restoring point in all buffers is expensive, since it
@c requires selecting each window twice, so enable this only if you need
@c it.  @xref{Edebug Display Update}.
$B$9$Y$F$N%P%C%U%!$G%]%$%s%H$rJ]B8!?I|85$9$k$K$O(B
$B3F%&%#%s%I%&$r(B2$BEYA*Br$9$kI,MW$,$"$k$?$a<j4V$,$+$+$k!#(B
$B$=$N$?$a!"I,MW$J>l9g$K$N$_$3$N5!G=$rM-8z$K$9$k!#(B
@pxref{Edebug Display Update}$B!#(B
@end defopt
@defopt edebug-initial-mode
@c If this variable is non-@code{nil}, it specifies the initial execution
@c mode for Edebug when it is first activated.  Possible values are
@c @code{step}, @code{next}, @code{go}, @code{Go-nonstop}, @code{trace},
@c @code{Trace-fast}, @code{continue}, and @code{Continue-fast}.
$B$3$NJQ?t$,(B@code{nil}$B0J30$G$"$l$P!"(B
edebug$B$,=i$a$FF0:n$9$k$H$-$N=i4|$NF0:n%b!<%I$r;XDj$9$k!#(B
$B2DG=$JCM$O!"(B
@code{step}$B!"(B@code{next}$B!"(B@code{go}$B!"(B@code{Go-nonstop}, @code{trace}$B!"(B
@code{Trace-fast}$B!"(B@code{continue}$B!"(B@code{Continue-fast}$B!#(B
@c The default value is @code{step}.  
@c @xref{Edebug Execution Modes}.
$B%G%U%)%k%HCM$O(B@code{step}$B!#(B
@pxref{Edebug Execution Modes}$B!#(B
@end defopt
@defopt edebug-trace
@c Non-@code{nil} means display a trace of function entry and exit.
@c Tracing output is displayed in a buffer named @samp{*edebug-trace*}, one
@c function entry or exit per line, indented by the recursion level.  
@code{nil}$B0J30$G$"$k$H!"4X?t$XF~$k$H$-$H=P$k$H$-$N%H%l!<%9$rI=<($9$k$3$H$r(B
$B0UL#$9$k!#(B
$B%H%l!<%9=PNO$O!"(B@samp{*edebug-trace*}$B$H$$$&L>A0$N%P%C%U%!$K!"(B
$B4X?t$XF~$k$H$-$H=P$k$H$-$r3F9T$K:F5"$N?<$5$G;z2<$2$7$FI=<($9$k!#(B
@c The default value is @code{nil}.  
$B%G%U%)%k%HCM$O(B@code{nil}$B!#(B
@c Also see @code{edebug-tracing}, in @ref{Trace Buffer}.
@ref{Trace Buffer}$B$N(B@code{edebug-tracing}$B$b;2>H!#(B
@end defopt
@defopt edebug-test-coverage 
@c If non-@code{nil}, Edebug tests coverage of all expressions debugged.
@c @xref{Coverage Testing}.
@code{nil}$B0J30$G$"$l$P!"(Bedebug$B$O%G%P%C%0BP>]$N$9$Y$F$N<0$N%+%P%l%C%8(B
$B%F%9%H$r9T$&!#(B
@pxref{Coverage Testing}$B!#(B
@end defopt
@defopt edebug-continue-kbd-macro 
@c If non-@code{nil}, continue defining or executing any keyboard macro
@c that is executing outside of Edebug.   Use this with caution since it is not
@c debugged.
@c @xref{Edebug Execution Modes}.
@code{nil}$B0J30$G$"$l$P!"(B
edebug$B$N30B&$G<B9T$9$k%-!<%\!<%I%^%/%m$rDj5A$7$?$j<B9T$9$k!#(B
$B%G%P%C%0$7$J$$$N$GCm0U$7$F$3$N%*%W%7%g%s$r;H$&$3$H!#(B
@end defopt
@defopt edebug-on-error
@c Edebug binds @code{debug-on-error} to this value, if
@c @code{debug-on-error} was previously @code{nil}.  @xref{Trapping
@c Errors}.
@code{debug-on-error}$B$N0JA0$NCM$,(B@code{nil}$B$G$"$k$H!"(B
edebug$B$O(B@code{debug-on-error}$B$K$3$NCM$rB+G{$9$k!#(B
@pxref{Trapping Errors}$B!#(B
@end defopt
@defopt edebug-on-quit
@c Edebug binds @code{debug-on-quit} to this value, if
@c @code{debug-on-quit} was previously @code{nil}.  @xref{Trapping
@c Errors}.
@code{debug-on-quit}$B$N0JA0$NCM$,(B@code{nil}$B$G$"$k$H!"(B
edebug$B$O(B@code{debug-on-quit}$B$K$3$NCM$rB+G{$9$k!#(B
@pxref{Trapping Errors}$B!#(B
@end defopt
@c   If you change the values of @code{edebug-on-error} or
@c @code{edebug-on-quit} while Edebug is active, their values won't be used
@c until the @emph{next} time Edebug is invoked via a new command.
@c @c Not necessarily a deeper command level.
@c @c A new command is not precisely true, but that is close enough -- dan
edebug$B$,F0:nCf$K(B@code{edebug-on-error}$B$d(B@code{edebug-on-quit}$B$NCM$r(B
$BJQ99$7$F$b!"?7$?$J%3%^%s%I$G(Bedebug$B$r(B@emph{$B$D$.$K(B}$B5/F0$9$k$^$G$O(B
$B$3$l$i$NCM$O;HMQ$5$l$J$$!#(B
@defopt edebug-global-break-condition
@c If non-@code{nil}, an expression to test for at every stop point.
@c If the result is non-nil, then break.  Errors are ignored.
@c @xref{Global Break Condition}.
@code{nil}$B0J30$G$"$k$H!"3FDd;_0LCV$G8!::$5$l$k<0$G$"$k!#(B
$B7k2L$,(B@code{nil}$B0J30$G$"$k$H%V%l!<%/$9$k!#(B
$B%(%i!<$OL5;k$9$k!#(B
@pxref{Global Break Condition}$B!#(B
@end defopt
 |