File: trouble.texi

package info (click to toggle)
emacs-manual-ja 20.5-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,964 kB
  • ctags: 12
  • sloc: lisp: 119; ansic: 69; makefile: 43; sh: 28
file content (1728 lines) | stat: -rw-r--r-- 89,021 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
@c =============================================================
@c = $B85(B $BK](B $BLu(B: $B5WLnLw!wBgDM(B.$BC^GHBg3X(B
@c = $B2CI.=$@5(B: $BBgLZFXM:!wBgDM(B.$BC^GHBg3X(B = 1998/11/25
@c = 20.4$B2~D{(B: $BBgLZFXM:!wBgDM(B.$BC^GHBg3X(B = 1999/09/12
@c =============================================================
@c This is part of the Emacs manual.
@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@iftex
@c @chapter Dealing with Common Problems
@chapter $B$h$/$"$kLdBj$X$NBP=h(B

@c   If you type an Emacs command you did not intend, the results are often
@c mysterious.  This chapter tells what you can do to cancel your mistake or
@c recover from a mysterious situation.  Emacs bugs and system crashes are
@c also considered.
$B0U?^$7$F$J$$(BEmacs$B%3%^%s%I$rBG$D$H!"(B
$B$=$N7k2L$O$o$1$N$o$+$i$J$$$b$N$K$J$j$,$A$G$9!#(B
$BK\>O$G$O!"$^$A$,$$$r<h$j>C$7$?$j!"(B
$B$o$1$N$o$+$i$J$$>u67$+$iI|5"$9$k<jCJ$K$D$$$F@bL@$7$^$9!#(B
$B$^$?!"(BEmacs$B$N%P%0$d%7%9%F%`%/%i%C%7%e$K$D$$$F$b@bL@$7$^$9!#(B
@end iftex

@node Quitting, Lossage, Customization, Top
@c @section Quitting and Aborting
@c @cindex quitting
@section $BCfCG$H%"%\!<%H(B
@cindex $BCfCG(B

@table @kbd
@item C-g
@c @itemx C-@key{BREAK} (MS-DOS)
@itemx C-@key{BREAK}$B!J(BMS-DOS$B!K(B
@c Quit.  Cancel running or partially typed command.
$BCfCG$9$k!#(B
$BF0:nCf$N%3%^%s%I$dBG80ESCf$N%3%^%s%I$r<h$j>C$9!#(B
@item C-]
@c Abort innermost recursive editing level and cancel the command which
@c invoked it (@code{abort-recursive-edit}).
$B%"%\!<%H$9$k!#(B
$B$$$A$P$sFbB&$N:F5"JT=8%l%Y%k$r6/@)E*$K=*N;$7!"(B
$B$=$N:F5"JT=8%l%Y%k$r5/F0$7$?%3%^%s%I$r<h$j>C$9(B
$B!J(B@code{abort-recursive-edit}$B!K!#(B
@item @key{ESC} @key{ESC} @key{ESC}
@c Either quit or abort, whichever makes sense (@code{keyboard-escape-quit}).
$BCfCG$+%"%\!<%H$N$$$:$l$+0UL#$N$"$k$[$&$r<B9T$9$k(B
$B!J(B@code{keyboard-escape-quit}$B!K!#(B
@item M-x top-level
@c Abort all recursive editing levels that are currently executing.
$B8=:_<B9TCf$N$9$Y$F$N:F5"JT=8%l%Y%k$r6/@)E*$K=*N;$9$k!#(B
@item C-x u
@c Cancel a previously made change in the buffer contents (@code{undo}).
$B%P%C%U%!$NFbMF$KBP$7$F9T$C$?D>A0$NJQ99$r<h$j>C$9!J(B@code{undo}$B!K!#(B
@end table

@c   There are two ways of canceling commands which are not finished
@c executing: @dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with
@c @kbd{C-]} or @kbd{M-x top-level}.  Quitting cancels a partially typed
@c command or one which is already running.  Aborting exits a recursive
@c editing level and cancels the command that invoked the recursive edit.
@c (@xref{Recursive Edit}.)
$B<B9T$r40N;$7$F$$$J$$%3%^%s%I$r<h$j>C$9$K$O!"(B2$B$D$NJ}K!$,$"$j$^$9!#(B 
1$B$D$O(B@kbd{C-g}$B$G(B@dfn{$BCfCG(B}$B$9$k$3$H!"(B
$B$b$&(B1$B$D$O(B@kbd{C-]}$B$d(B@kbd{M-x top-level}$B$G(B
@dfn{$B%"%\!<%H(B}$B$9$k$3$H$G$9!#(B
$BCfCG$H$O!"BG80ESCf$N%3%^%s%I$dF0:nCf$N%3%^%s%I$r<h$j>C$9$3$H$r$$$$$^$9!#(B
$B%"%\!<%H$H$O!":F5"JT=8%l%Y%k$+$iH4$1=P$7!"$+$D!"(B
$B$=$N:F5"JT=8%l%Y%k$r5/F0$7$?%3%^%s%I$r<h$j>C$9$3$H$r$$$$$^$9(B
$B!J(B@pxref{Recursive Edit}$B!K!#(B

@c @cindex quitting
@cindex $BCfCG(B
@kindex C-g
@c   Quitting with @kbd{C-g} is used for getting rid of a partially typed
@c command, or a numeric argument that you don't want.  It also stops a
@c running command in the middle in a relatively safe way, so you can use
@c it if you accidentally give a command which takes a long time.  In
@c particular, it is safe to quit out of killing; either your text will
@c @emph{all} still be in the buffer, or it will @emph{all} be in the kill
@c ring (or maybe both).  Quitting an incremental search does special
@c things documented under searching; in general, it may take two
@c successive @kbd{C-g} characters to get out of a search
@c (@pxref{Incremental Search}).
@kbd{C-g}$B$G$NCfCG$O!"BG80ESCf$N%3%^%s%I$d(B
$BITMW$J?t0z?t$rBG$C$F$7$^$C$?$H$-$K$H$j$d$a$k$N$K;H$$$^$9!#(B
$B$^$?!"<B9TESCf$N%3%^%s%I$rHf3SE*0BA4$JJ}K!$G;_$a$^$9$+$i!"(B
$BD9;~4V$+$+$k%3%^%s%I$r$&$C$+$j;O$a$F$7$^$C$?$H$-$K$b;H$($^$9!#(B
$BFC$K!"%-%kA`:n$rCfCG$7$F$b0BA4$G$9!#(B
$B%F%-%9%H$O!"$^$@(B@emph{$B$9$Y$F(B}$B%P%C%U%!Fb$K$"$k$+!"(B
$B$^$?$O!"(B@emph{$B$9$Y$F(B}$B%-%k%j%s%0$KF~$C$F$$$k(B
$B!J$"$k$$$O!"$=$NN>J}$KF~$C$F$$$k!K$+$i$G$9!#(B
$B$J$*!"%$%s%/%j%a%s%?%k%5!<%A$rCfCG$9$k>l9g$K$O!"(B
$BJ8;zNsC5:w$N$H$3$m$G@bL@$7$F$"$k$h$&$K!"FCJL$JF0:n$r9T$$$^$9!#(B
$B0lHL$K$O!"%5!<%A$+$iH4$1=P$9$K$O(B@kbd{C-g}$B$r(B2$B2sO"BG$9$kI,MW$,$"$j$^$9(B
$B!J(B@pxref{Incremental Search}$B!K!#(B

@c   On MS-DOS, the character @kbd{C-@key{BREAK}} serves as a quit character
@c like @kbd{C-g}.  The reason is that it is not feasible, on MS-DOS, to
@c recognize @kbd{C-g} while a command is running, between interactions
@c with the user.  By contrast, it @emph{is} feasible to recognize
@c @kbd{C-@key{BREAK}} at all times.  @xref{MS-DOS Input}.
MS-DOS$B$G$O!"(B@kbd{C-@key{BREAK}}$B$O(B@kbd{C-g}$B$HF1MM$KCfCG$H$7$FF/$-$^$9!#(B
MS-DOS$B$G$O!"%3%^%s%I$N<B9TCf$K%f!<%6!<$H$N$d$j$H$j$r9T$&>uBV$K$J$$$H$-$K$O!"(B
@kbd{C-g}$B$r8!=P$G$-$J$$$+$i$G$9!#(B
$B$3$l$KBP$7$F!"(B@kbd{C-@key{BREAK}}$B$O$D$M$KG'<1(B@emph{$B$G$-(B}$B$^$9!#(B
@xref{MS-DOS Input}$B!#(B

@c   @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
@c the instant @kbd{C-g} is typed; Emacs Lisp checks this variable
@c frequently and quits if it is non-@code{nil}.  @kbd{C-g} is only
@c actually executed as a command if you type it while Emacs is waiting for
@c input.
@kbd{C-g}$B$O$D$.$N$h$&$KF0:n$7$^$9!#(B
@kbd{C-g}$B$,BG80$5$l$k$HJQ?t(B@code{quit-flag}$B$K(B@code{t}$B$,@_Dj$5$l$^$9!#(B
Emacs Lisp$B$O$3$NJQ?t$rIQHK$KD4$Y!"CM$,(B@code{nil}$B0J30$@$HCfCG=hM}$r9T$$$^$9!#(B
@kbd{C-g}$B$,<B:]$K%3%^%s%I$H$7$F<B9T$5$l$k$N$O!"(B
Emacs$B$,F~NOBT$A>uBV$K$"$k$H$-$K(B@kbd{C-g}$B$rBG$C$?>l9g$@$1$G$9!#(B

@c   If you quit with @kbd{C-g} a second time before the first @kbd{C-g} is
@c recognized, you activate the ``emergency escape'' feature and return to
@c the shell.  @xref{Emergency Escape}.
$B:G=i$N(B@kbd{C-g}$B$,G'<1$5$l$J$$$&$A$K(B2$B$D$a$N(B@kbd{C-g}$B$rBG$C$FCfCG$9$k$H!"(B
$B!X6[5^C&=P!Y5!G=$rH/F0$7$?$3$H$K$J$j%7%'%k$KLa$j$^$9!#(B
@xref{Emergency Escape}$B!#(B

@c @cindex NFS and quitting
@cindex NFS$B$HCfCG(B
@c   There may be times when you cannot quit.  When Emacs is waiting for
@c the operating system to do something, quitting is impossible unless
@c special pains are taken for the particular system call within Emacs
@c where the waiting occurs.  We have done this for the system calls that
@c users are likely to want to quit from, but it's possible you will find
@c another.  In one very common case---waiting for file input or output
@c using NFS---Emacs itself knows how to quit, but most NFS implementations
@c simply do not allow user programs to stop waiting for NFS when the NFS
@c server is hung.
$BCfCG$G$-$J$$>l9g$b$"$j$($^$9!#(B
Emacs$B$,%*%Z%l!<%F%#%s%0%7%9%F%`$K2?$+$rMj$s$GBT$C$F$$$k$H$-$K$O!"(B
$BBT$A>uBV$r5/$3$7$?%7%9%F%`%3!<%k$r;H$C$?(BEmacs$BB&$GFCJL$J<jEv$F$r$7$J$$8B$j(B
$BCfCG$G$-$^$;$s!#(B
Emacs$B$G$O!"%f!<%6!<$,CfCG$7$=$&$J%7%9%F%`%3!<%k$K$O(B
$B<jEv$F$r;\$7$F$"$j$^$9$,!"<jEv$F$7$F$$$J$$>l=j$rC!$/2DG=@-$O$"$j$^$9!#(B
$B$h$/$"$k$N$O!"(BNFS$B7PM3$NF~=PNO$rBT$C$F$$$k$H$-$G$9!#(B
Emacs$BB&$G$O$3$l$rCfCG$9$kJ}K!$O$o$+$C$F$$$k$N$G$9$,!"(B
$BB?$/$N(BNFS$B$N<BAu$G$O!"(BNFS$B%5!<%P!<$,8G$^$C$?$H$-$K%f!<%6!<%W%m%0%i%`$,(B
NFS$B$NBT$A$rCfCG$9$k$3$H$r5v$7$F$$$J$$$N$G$9!#(B

@c @cindex aborting recursive edit
@cindex $B:F5"JT=8$r%"%\!<%H$9$k(B
@findex abort-recursive-edit
@kindex C-]
@c   Aborting with @kbd{C-]} (@code{abort-recursive-edit}) is used to get
@c out of a recursive editing level and cancel the command which invoked
@c it.  Quitting with @kbd{C-g} does not do this, and could not do this,
@c because it is used to cancel a partially typed command @emph{within} the
@c recursive editing level.  Both operations are useful.  For example, if
@c you are in a recursive edit and type @kbd{C-u 8} to enter a numeric
@c argument, you can cancel that argument with @kbd{C-g} and remain in the
@c recursive edit.
@kbd{C-]}$B$K$h$k%"%\!<%H!J(B@code{abort-recursive-edit}$B!K$O!"(B
$B:F5"JT=8%l%Y%k$+$iC&=P$7!"$+$D!"$=$N:F5"JT=8%l%Y%k$r(B
$B5/F0$7$?%3%^%s%I$r<h$j>C$9$N$K;H$$$^$9!#(B
@kbd{C-g}$B$K$h$kCfCG$O$3$N$h$&$JL\E*$K$O;H$($^$;$s$7!"(B
$B$3$N$h$&$J$3$H$O$G$-$^$;$s!#(B
$B$H$$$&$N$O!"(B@kbd{C-g}$B$O!"$"$k:F5"JT=8%l%Y%k$N(B@emph{$BCf$G(B}
$BBG$A$+$1$?%3%^%s%I$r<h$j>C$9$N$K;H$&$+$i$G$9!#(B
$B$I$A$i$NA`:n$bI,MW$J$b$N$G$9!#(B
$B$?$H$($P!":F5"JT=8Cf$K?t0z?t$rF~NO$7$h$&$H$7$F(B@kbd{C-u 8}$B$HBG80$7$?>l9g!"(B
@kbd{C-g}$B$G?t0z?t$r<h$j>C$7$F$b:F5"JT=8$KN1$^$C$?$^$^$G$9!#(B

@findex keyboard-escape-quit
@kindex ESC ESC ESC
@c   The command @kbd{@key{ESC} @key{ESC} @key{ESC}}
@c (@code{keyboard-escape-quit}) can either quit or abort.  This key was
@c defined because @key{ESC} is used to ``get out'' in many PC programs.
@c It can cancel a prefix argument, clear a selected region, or get out of
@c a Query Replace, like @kbd{C-g}.  It can get out of the minibuffer or a
@c recursive edit, like @kbd{C-]}.  It can also get out of splitting the
@c frame into multiple windows, like @kbd{C-x 1}.  One thing it cannot do,
@c however, is stop a command that is running.  That's because it executes
@c as an ordinary command, and Emacs doesn't notice it until it is ready
@c for a command.
$B%3%^%s%I(B@kbd{@key{ESC} @key{ESC} @key{ESC}}
$B!J(B@code{keyboard-escape-quit}$B!K$O!"CfCG$+%"%\!<%H$N$$$:$l$+$r9T$$$^$9!#(B
$B$3$N%-!<$r;H$&$N$O!"B?$/$N(BPC$B$N%=%U%H$G(B@key{ESC}$B$,(B
$B!XH4$1=P$9!Y$N0UL#$K;H$o$l$F$$$k$+$i$G$9!#(B
@kbd{C-g}$B$HF1MM$K!"?t0z?t$r<h$j>C$7$?$j!"(B
$BA*Br$7$?%j!<%8%g%s$r%/%j%"$7$?$j!"Ld$$9g$o$;7?CV49A`:n$+$iH4$1=P$7$^$9!#(B
@kbd{C-]}$B$HF1MM$K!"%_%K%P%C%U%!$d:F5"JT=8$+$iH4$1=P$7$^$9!#(B
$B$^$?!"(B@kbd{C-x 1}$B$N$h$&$K!"%U%l!<%`$rJ#?t%&%#%s%I%&$KJ,3d$7$F$$$k$N$r(B
$B$d$a$k$3$H$b$G$-$^$9!#(B
$B$7$+$7$J$,$i!"<B9TCf$N%3%^%s%I$r;_$a$k$3$H$O$G$-$^$;$s!#(B
$B$J$<$J$i!"$3$N%3%^%s%I$OIaDL$N%3%^%s%I$H$7$F<B9T$5$l$k$N$G!"(B
Emacs$B$,%3%^%s%I$rFI$_9~$`>uBV$K$J$i$J$$$H$3$N%3%^%s%I$rG'<1$7$J$$$+$i$G$9!#(B

@findex top-level
@c   The command @kbd{M-x top-level} is equivalent to ``enough'' @kbd{C-]}
@c commands to get you out of all the levels of recursive edits that you
@c are in.  @kbd{C-]} gets you out one level at a time, but @kbd{M-x
@c top-level} goes out all levels at once.  Both @kbd{C-]} and @kbd{M-x
@c top-level} are like all other commands, and unlike @kbd{C-g}, in that
@c they take effect only when Emacs is ready for a command.  @kbd{C-]} is
@c an ordinary key and has its meaning only because of its binding in the
@c keymap.  @xref{Recursive Edit}.
$B%3%^%s%I(B@kbd{M-x top-level}$B$O!"8=:_F~$C$F$$$k$9$Y$F$N:F5"JT=8%l%Y%k$+$i(B
$BH4$1=P$9$N$K!X==J,$J!Y?t$N(B@kbd{C-]}$B$HF1Ey$G$9!#(B
@kbd{C-]}$B$O0lEY$K(B1$B%l%Y%k$@$1H4$1=P$9$N$KBP$7!"(B
@kbd{M-x top-level}$B$O$9$Y$F$N%l%Y%k$r0l5$$KH4$1=P$7$^$9!#(B
@kbd{C-]}$B$b(B@kbd{M-x top-level}$B$bB>$N%3%^%s%I$HF1MM$NIaDL$N%3%^%s%I$G$9$+$i!"(B
@kbd{C-g}$B$H$O0c$C$F!"(BEmacs$B$,%3%^%s%I$r<u$1IU$1$k>uBV$N$H$-$@$1F0:n$7$^$9!#(B
@kbd{C-]}$B$OIaDL$N%-!<$G$"$j!"%-!<%^%C%W$K$=$N%P%$%s%G%#%s%0$,$"$k$N$G(B
$B$=$N$h$&$KF0:n$9$k$N$G$9!#(B
@xref{Recursive Edit}$B!#(B

@c   @kbd{C-x u} (@code{undo}) is not strictly speaking a way of canceling
@c a command, but you can think of it as canceling a command that already
@c finished executing.  @xref{Undo}.
@kbd{C-x u}$B!J(B@code{undo}$B!K$O!"@53N$K$$$($P%3%^%s%I$r(B
$B<h$j>C$9$o$1$G$O$"$j$^$;$s$,!"(B
$BF0:n$r40N;$7$F$7$^$C$?%3%^%s%I$r<h$j>C$9$b$N$H9M$($k$3$H$,$G$-$^$9!#(B
@xref{Undo}$B!#(B

@node Lossage, Bugs, Quitting, Top
@c @section Dealing with Emacs Trouble
@section Emacs$B$N%H%i%V%k$KBP$9$kBP=h(B

@c   This section describes various conditions in which Emacs fails to work
@c normally, and how to recognize them and correct them.
$BK\@a$G$O!"(BEmacs$B$,@5>o$KF0:n$7B;$J$&$5$^$6$^$J>r7o$H!"$=$l$i$N8+J,$1J}!"(B
$BD>$7J}$K$D$$$F@bL@$7$^$9!#(B

@menu
* DEL Gets Help::       What to do if @key{DEL} doesn't delete.
* Stuck Recursive::     `[...]' in mode line around the parentheses.
* Screen Garbled::      Garbage on the screen.
* Text Garbled::        Garbage in the text.
* Unasked-for Search::  Spontaneous entry to incremental search.
* Memory Full::         How to cope when you run out of memory.
* After a Crash::       Recovering editing in an Emacs session that crashed.
* Emergency Escape::    Emergency escape---
                          What to do if Emacs stops responding.
* Total Frustration::   When you are at your wits' end.
@end menu

@node DEL Gets Help
@c @subsection If @key{DEL} Fails to Delete
@subsection @key{DEL}$B$G:o=|$G$-$J$$(B

@c   If you find that @key{DEL} enters Help like @kbd{Control-h} instead of
@c deleting a character, your terminal is sending the wrong code for
@c @key{DEL}.  You can work around this problem by changing the keyboard
@c translation table (@pxref{Keyboard Translations}).
@key{DEL}$B$,J8;z$r:o=|$9$k$+$o$j$K(B@kbd{Control-h}$B$N$h$&$K(B
$B%X%k%W$KF~$C$F$7$^$&>l9g$K$O!"(B
$B;H$C$F$$$kC<Kv$,(B@key{DEL}$B$KBP$7$F$^$A$,$C$?J8;z%3!<%I$rAw=P$7$F$$$^$9!#(B
$B$3$NLdBj$KBP=h$9$k$K$O!"%-!<%\!<%IJQ49I=$rJQ99$7$^$9(B
$B!J(B@pxref{Keyboard Translations}$B!K!#(B

@node Stuck Recursive
@c @subsection Recursive Editing Levels
@subsection $B:F5"JT=8%l%Y%k(B

@c   Recursive editing levels are important and useful features of Emacs, but
@c they can seem like malfunctions to the user who does not understand them.
$B:F5"JT=8%l%Y%k$O(BEmacs$B$N=EMW$GM-MQ$J5!G=$G$9$,!"(B
$B$=$l$K$D$$$FM}2r$7$F$$$J$$?M$K$H$C$F$O!"8mF0:n$K8+$($k2DG=@-$,$"$j$^$9!#(B

@c   If the mode line has square brackets @samp{[@dots{}]} around the parentheses
@c that contain the names of the major and minor modes, you have entered a
@c recursive editing level.  If you did not do this on purpose, or if you
@c don't understand what that means, you should just get out of the recursive
@c editing level.  To do so, type @kbd{M-x top-level}.  This is called getting
@c back to top level.  @xref{Recursive Edit}.
$B%b!<%I9T$N%a%8%c!<!?%^%$%J%b!<%IL>$r0O$`4]3g8L$N<~0O$KCf3g8L(B
@samp{[@dots{}]}$B$,I=<($5$l$F$$$k$H$-$O!":F5"JT=8%l%Y%k$KF~$C$F$$$^$9!#(B
$B0U?^$7$F$=$&$7$?$N$G$J$+$C$?$j!"(B
$B:F5"JT=8%l%Y%k$N0UL#$rM}2r$7$F$$$J$$$N$G$"$l$P!"(B
$B:F5"JT=8%l%Y%k$+$iH4$1=P$9$Y$-$G$9!#(B
$B$=$l$K$O(B@kbd{M-x top-level}$B$HBG$A$^$9!#(B
$B$3$l$r%H%C%W%l%Y%k$X$NH4$1=P$7$H8F$S$^$9!#(B
@xref{Recursive Edit}$B!#(B

@node Screen Garbled
@c @subsection Garbage on the Screen
@subsection $B2hLL>e$N%4%_(B

@c   If the data on the screen looks wrong, the first thing to do is see
@c whether the text is really wrong.  Type @kbd{C-l}, to redisplay the
@c entire screen.  If the screen appears correct after this, the problem
@c was entirely in the previous screen update.  (Otherwise, see @ref{Text
@c Garbled}.)
$B2hLL>e$N%G!<%?$,$^$A$,$C$F$$$k$h$&$K8+$($?$i!"$^$::G=i$K$9$Y$-$3$H$O!"(B
$B%F%-%9%H$,K\Ev$K$^$A$,$C$F$$$k$N$+$I$&$+D4$Y$k$3$H$G$9!#(B
@kbd{C-l}$B$HBG$C$F2hLLA4BN$r:FIA2h$7$^$9!#(B
$B$3$l$G2hLL$,@5$7$=$&$K$J$k$N$J$i!"LdBj$O2hLL99?7$K$"$C$?$N$G$9!#(B
$B!J$=$&$G$J$$>l9g$O!"(B@pxref{Text Garbled}$B!K!#(B

@c   Display updating problems often result from an incorrect termcap entry
@c for the terminal you are using.  The file @file{etc/TERMS} in the Emacs
@c distribution gives the fixes for known problems of this sort.
@c @file{INSTALL} contains general advice for these problems in one of its
@c sections.  Very likely there is simply insufficient padding for certain
@c display operations.  To investigate the possibility that you have this sort
@c of problem, try Emacs on another terminal made by a different manufacturer.
@c If problems happen frequently on one kind of terminal but not another kind,
@c it is likely to be a bad termcap entry, though it could also be due to a
@c bug in Emacs that appears for terminals that have or that lack specific
@c features.
$B2hLL99?7$NLdBj$O!"(B
$B;H$C$F$$$kC<Kv$KBP1~$9$k(Btermcap$B$NDj5A$,$^$A$,$C$F$$$k>l9g$,B?$$$G$9!#(B
Emacs$B$NG[I[$K4^$^$l$k%U%!%$%k(B@file{etc/TERMS}$B$K$O!"(B
$B$3$N<o$NLdBj$G4{CN$N$b$N$KBP$9$k=$@5$,F~$C$F$$$^$9!#(B
$B%U%!%$%k(B@file{INSTALL}$B$K$O!"(B
$B$3$N<o$NLdBj$KBP$9$k0lHLE*$J%"%I%P%$%9$N@a$,$"$j$^$9!#(B
$B$$$A$P$s$"$j$,$A$J$N$O!"(B
$B$"$k<o$N2hLLA`:n$KBP$9$k%Q%G%#%s%0(B
@footnote{$B!ZLuCm![C<Kv$K$H$C$F$OL50UL#$GL532$JJ8;z$r!"(B
$B!JF0:n$,40N;$9$k$^$G$N!K;~4V2T$.$N$?$a$KAw=P$9$k$3$H!#(B}
$B$,ITB-$7$F$$$k>l9g$G$9!#(B
$B$3$N<o$NLdBj$,$"$k$+$I$&$+D4$Y$k$K$O!"(B
$BB>$N%a!<%+@=$NJL$NC<Kv$G(BEmacs$B$rF0$+$7$F$_$F$/$@$5$$!#(B
$B$"$k5!<o$NC<Kv$G$OIQHK$KLdBj$,5/$-$k$N$KJL$N5!<o$NC<Kv$G$OLdBj$,$J$$$J$i!"(B
termcap$B$NDj5A$,$^$A$,$C$F$$$k2DG=@-$,$"$j$^$9!#(B
$B$7$+$7!"$"$k<o$N5!G=$rM-$9$k$+7gG!$7$F$$$kC<Kv$G8=$l$k(B
Emacs$B$N%P%0$G$"$k2DG=@-$b$"$j$^$9!#(B

@node Text Garbled
@c @subsection Garbage in the Text
@subsection $B%F%-%9%HFb$N%4%_(B

@c   If @kbd{C-l} shows that the text is wrong, try undoing the changes to it
@c using @kbd{C-x u} until it gets back to a state you consider correct.  Also
@c try @kbd{C-h l} to find out what command you typed to produce the observed
@c results.
@kbd{C-l}$B$r<B9T$7$F$b%F%-%9%H$,JQ$J$i$P!"(B
$B@5$7$$$H;W$o$l$k>uBV$K$J$k$^$G!"(B
@kbd{C-x u}$B$r;H$C$FJQ99$r$b$H$KLa$7$F$_$F$/$@$5$$!#(B
$B$^$?!"$I$N%3%^%s%I$GJQ$K$J$C$?$N$+D4$Y$k$?$a$K!"(B
@kbd{C-h l}$B$r;n$7$F$_$F$/$@$5$$!#(B

@c   If a large portion of text appears to be missing at the beginning or
@c end of the buffer, check for the word @samp{Narrow} in the mode line.
@c If it appears, the text you don't see is probably still present, but
@c temporarily off-limits.  To make it accessible again, type @kbd{C-x n
@c w}.  @xref{Narrowing}.
$B%P%C%U%!$N@hF,$dKvHx$GBgNL$N%F%-%9%H$,<:$o$l$F$$$k$h$&$J$i!"(B
$B%b!<%I9T$KC18l(B@samp{Narrow}$B$,I=<($5$l$F$$$J$$$+3NG'$7$F$/$@$5$$!#(B
$B$b$7$=$&$J$i!"$*$=$i$/%F%-%9%H$O<:$o$l$F$$$k$N$G$O$J$/!"(B
$B0l;~E*$K8+$($J$/$J$C$F$$$k$N$G$7$g$&!#(B
$B8+$($k$h$&$K$9$k$K$O!"(B@kbd{C-x n w}$B$HBG$C$F$/$@$5$$!#(B
@xref{Narrowing}$B!#(B

@node Unasked-for Search
@c @subsection Spontaneous Entry to Incremental Search
@subsection $B<+H/E*$J%$%s%/%j%a%s%?%k%5!<%A$N3+;O(B

@c   If Emacs spontaneously displays @samp{I-search:} at the bottom of the
@c screen, it means that the terminal is sending @kbd{C-s} and @kbd{C-q}
@c according to the poorly designed xon/xoff ``flow control'' protocol.
Emacs$B$,2hLL$N:G2<9T$K<+H/E*$K(B@samp{I-search:}$B$HI=<($9$k$h$&$J$i!"(B
$BNt0-$J(Bxon/xoff$B$N!X%U%m!<@)8f%W%m%H%3%k!Y$K=>$C$F(B
$BC<Kv$,(B@kbd{C-s}$B$H(B@kbd{C-q}$B$rAw$C$F$$$k$?$a$G$7$g$&!#(B

@c   If this happens to you, your best recourse is to put the terminal in a
@c mode where it will not use flow control, or give it so much padding that
@c it will never send a @kbd{C-s}.  (One way to increase the amount of
@c padding is to set the variable @code{baud-rate} to a larger value.  Its
@c value is the terminal output speed, measured in the conventional units
@c of baud.)
$B$b$7$3$N>uBV$,5/$-$?$i!"$b$C$H$b$h$$$N$OC<Kv$r%U%m!<@)8f$J$7$K@_Dj$9$k$+!"(B
$B$^$?$O!"%Q%G%#%s%0$r==J,$KA}$d$7$FC<Kv$,$1$C$7$F(B@kbd{C-s}$B$r(B
$BAw$i$J$$$h$&$K$9$k$3$H$G$9!#(B
$B!J%Q%G%#%s%0$rA}$d$9(B1$B$D$NJ}K!$O!"(B
$B$h$jBg$-$$CM$rJQ?t(B@code{baud-rate}$B$K@_Dj$9$k$3$H!#(B
$B$3$NCM$O%\!<$H$$$&C10L$GI=$7$?C<Kv$N=PNOB.EY!#!K(B

@c @cindex flow control
@cindex $B%U%m!<@)8f(B
@cindex xon-xoff
@findex enable-flow-control
@c   If you don't succeed in turning off flow control, the next best thing
@c is to tell Emacs to cope with it.  To do this, call the function
@c @code{enable-flow-control}.
$B%U%m!<@)8f$r;_$a$i$l$J$$>l9g$N<!A1$N:v$O!"(B
Emacs$B$K%U%m!<@)8f$r=hM}$5$;$k$3$H$G$9!#(B
$B$=$l$K$O!"4X?t(B@code{enable-flow-control}$B$r8F$S=P$7$F$/$@$5$$!#(B

@findex enable-flow-control-on
@c   Typically there are particular terminal types with which you must use
@c flow control.  You can conveniently ask for flow control on those
@c terminal types only, using @code{enable-flow-control-on}.  For example,
@c if you find you must use flow control on VT-100 and H19 terminals, put
@c the following in your @file{.emacs} file:
$BE57?E*$J>l9g!"(B
$B$"$k<o$NC<Kv%?%$%W$K8B$C$F%U%m!<@)8f$r;H$&I,MW$,$"$j$^$9!#(B
@code{enable-flow-control-on}$B$r;H$C$F!"(B
$B$=$N$h$&$J<oN`$NC<Kv$K8B$C$F%U%m!<@)8f$r9T$&$h$&$K$G$-$^$9!#(B
$B$?$H$($P!"(BVT-100$BC<Kv$H(BH19$BC<Kv$K$O%U%m!<@)8f$r9T$&I,MW$,$"$k$N$J$i!"(B
$B%U%!%$%k(B@file{.emacs}$B$K$D$.$N$b$N$rF~$l$^$9!#(B

@example
(enable-flow-control-on "vt100" "h19")
@end example

@c   When flow control is enabled, you must type @kbd{C-\} to get the
@c effect of a @kbd{C-s}, and type @kbd{C-^} to get the effect of a
@c @kbd{C-q}.  (These aliases work by means of keyboard translations; see
@c @ref{Keyboard Translations}.)
$B%U%m!<@)8f$r;H$C$F$$$k>l9g$K$O!"(B@kbd{C-s}$B$N$+$o$j$K(B@kbd{C-\}$B!"(B
@kbd{C-q}$B$N$+$o$j$K(B@kbd{C-^}$B$r;H$&I,MW$,$"$j$^$9!#(B
$B!J$3$l$i$N3d$jEv$F$O%-!<%\!<%IJQ49$K$h$C$F9T$o$l$k!#(B
@pxref{Keyboard Translations}$B!#!K(B

@node Memory Full
@c @subsection Running out of Memory
@c @cindex memory full
@c @cindex out of memory
@subsection $B%a%b%jITB-(B
@cindex $B%a%b%jITB-(B

@c   If you get the error message @samp{Virtual memory exceeded}, save your
@c modified buffers with @kbd{C-x s}.  This method of saving them has the
@c smallest need for additional memory.  Emacs keeps a reserve of memory
@c which it makes available when this error happens; that should be enough
@c to enable @kbd{C-x s} to complete its work.
@samp{Virtual memory exceeded}$B$H$$$&%(%i!<%a%C%;!<%8$,=P$?$i!"(B
$BJQ99$7$?%P%C%U%!$r(B@kbd{C-x s}$B$GJ]B8$7$F$/$@$5$$!#(B
$B$3$NJ}K!$GJ]B8$9$k>l9g!"I,MW$J%a%b%j$O:G>.8B$G$9$_$^$9!#(B
Emacs$B$O>e5-$N%(%i!<$,5/$-$?$H$-$G$b;H$($kM=Hw$N%a%b%j$r3NJ]$7$F$$$^$9$+$i!"(B
@kbd{C-x s}$B$r40N;$9$k$N$K$O==J,$J$O$:$G$9!#(B

@c   Once you have saved your modified buffers, you can exit this Emacs job
@c and start another, or you can use @kbd{M-x kill-some-buffers} to free
@c space in the current Emacs job.  If you kill buffers containing a
@c substantial amount of text, you can safely go on editing.  Emacs refills
@c its memory reserve automatically when it sees sufficient free space
@c available, in case you run out of memory another time.
$BJQ99:Q$_$N%P%C%U%!$rJ]B8$7$?$i!"(B
Emacs$B$r=*N;$7$FJL$N(BEmacs$B$r5/F0$7$F$b$h$$$G$9$7!"(B
@kbd{M-x kill-some-buffer}$B$r;H$C$F(B
$B8=:_F0$$$F$$$k(BEmacs$B$N%a%b%j$r2rJ|$7$F$b$h$$$G$9!#(B
$BBgNL$N%F%-%9%H$,F~$C$F$$$k%P%C%U%!$r>C$;$P!"(B
$B0BA4$KJT=8$rB39T$G$-$^$9!#(B
$B6u$-%a%b%j$,==J,$JNL$K$J$k$HM=Hw$N%a%b%j$r<+F0E*$K3NJ]$7D>$7!"(B
$B:FEY%a%b%jITB-$K$J$C$?$H$-$KHw$($^$9!#(B

@c   Do not use @kbd{M-x buffer-menu} to save or kill buffers when you run
@c out of memory, because the buffer menu needs a fair amount memory
@c itself, and the reserve supply may not be enough.
$B%a%b%jITB-$K$J$C$?$H$-$K$O!"(B@kbd{M-x buffer-menu}$B$r;H$C$F(B
$B%P%C%U%!$rJ]B8$7$?$j>C$7$?$j$7$J$$$G$/$@$5$$!#(B
$B$3$N%3%^%s%I$O$1$C$3$&%a%b%j$rI,MW$H$9$k$N$G!"(B
$B3NJ]$7$?M=Hw$N%a%b%j$@$1$G$O==J,$G$J$$2DG=@-$,$"$k$+$i$G$9!#(B

@node After a Crash
@c @subsection Recovery After a Crash
@subsection $B%/%i%C%7%e$+$i$N2sI|(B

@c   If Emacs or the computer crashes, you can recover the files you were
@c editing at the time of the crash from their auto-save files.  To do
@c this, start Emacs again and type the command @kbd{M-x recover-session}.
Emacs$B$d%3%s%T%e!<%?$,%/%i%C%7%e$7$F$b!"(B
$B%/%i%C%7%e;~$KJT=8$7$F$$$?%U%!%$%k$O<+F0J]B8%U%!%$%k$+$i2sI|$G$-$^$9!#(B
$B$=$l$K$O!"(BEmacs$B$r:FEY5/F0$7$F$+$i!"%3%^%s%I(B@kbd{M-x recover-session}$B$r(B
$BF~NO$7$F$/$@$5$$!#(B

@c   This command initially displays a buffer which lists interrupted
@c session files, each with its date.  You must choose which session to
@c recover from.  Typically the one you want is the most recent one.  Move
@c point to the one you choose, and type @kbd{C-c C-c}.
$B$3$N%3%^%s%I$O!"$^$:!"CfCG$5$l$?%;%C%7%g%s%U%!%$%k$N0lMw$rF|IU$H$H$b$K(B
$B%P%C%U%!$KI=<($7$^$9!#(B
$B$=$NCf$+$i$I$N%;%C%7%g%s$r2sI|$9$k$+A*$s$G$/$@$5$$!#(B
$BDL>o$O!":G?7$N%;%C%7%g%s$rA*$Y$P$h$$$G$7$g$&!#(B
$BK>$_$N%;%C%7%g%s$N9T$K%]%$%s%H$rF0$+$7$F!"(B@kbd{C-c C-c}$B$HBG$A$^$9!#(B

@c   Then @code{recover-session} asks about each of the files that you were
@c editing during that session; it asks whether to recover that file.  If
@c you answer @kbd{y} for a file, it shows the dates of that file and its
@c auto-save file, then asks once again whether to recover that file.  For
@c the second question, you must confirm with @kbd{yes}.  If you do, Emacs
@c visits the file but gets the text from the auto-save file.
$B$9$k$H!"(B@code{recover-session}$B$O!"$=$N%;%C%7%g%s$GJT=8Cf$@$C$?(B
$B3F%U%!%$%k$K$D$$$F2sI|$9$k$+$I$&$+Ld$$9g$o$;$F$-$^$9!#(B
@kbd{y}$B$HEz$($k$H!"$=$N%U%!%$%k$H<+F0J]B8%U%!%$%k$NF|IU$rI=<($7$F$+$i!"(B
$B2sI|$9$k$+$I$&$+:FEYLd$$9g$o$;$F$-$^$9!#(B
$B:FLd$$9g$o$;$KBP$7$F$O(B@kbd{yes}$B$GEz$($kI,MW$,$"$j$^$9!#(B
$B$=$&$9$k$H!"(BEmacs$B$O$=$N%U%!%$%k$rK,$l$^$9$,!"(B
$B%F%-%9%H$O<+F0J]B8%U%!%$%k$+$i;}$C$F$-$^$9!#(B

@c   When @code{recover-session} is done, the files you've chosen to
@c recover are present in Emacs buffers.  You should then save them.  Only
@c this---saving them---updates the files themselves.
@code{recover-session}$B$,40N;$9$k$H!"(B
$B2sI|$r;XDj$7$?%U%!%$%k$O(BEmacs$B%P%C%U%!$KF~$C$F$$$^$9!#(B
$B$=$&$7$?$i$3$l$i$N%P%C%U%!$rJ]B8$7$F$/$@$5$$!#(B
$BJ]B8$7$F;O$a$F$b$H$N%U%!%$%k$,99?7$5$l$^$9!#(B

@node Emergency Escape
@c @subsection Emergency Escape
@subsection $B6[5^C&=P(B

@c   Because at times there have been bugs causing Emacs to loop without
@c checking @code{quit-flag}, a special feature causes Emacs to be suspended
@c immediately if you type a second @kbd{C-g} while the flag is already set,
@c so you can always get out of GNU Emacs.  Normally Emacs recognizes and
@c clears @code{quit-flag} (and quits!) quickly enough to prevent this from
@c happening.  (On MS-DOS and compatible systems, type @kbd{C-@key{BREAK}}
@c twice.)
$B%P%0$N$?$a$K!"(BEmacs$B$,(B@code{quit-flag}$B$r8!::$7$J$$%k!<%W$KF~$C$F$7$^$&$3$H$b(B
$B$"$j$($^$9!#(B
$B$3$N$?$a!"$3$N%U%i%0$,@_Dj$5$l$F$$$k>uBV$G:FEY(B@kbd{C-g}$B$,BG$?$l$k$H(B
$B$?$@$A$K<B9T$r5Y;_$9$kFCJL$J5!G=$,(BEmacs$B$K$O$"$j!"(B
$B$$$D$G$b(BGNU Emacs$B$+$iH4$1=P$9$3$H$,$G$-$^$9!#(B
$BDL>o!"(BEmacs$B$O$9$_$d$+$K(B@code{quit-flag}$B$rG'<1$7!JCfCG$7!K$^$9$+$i!"(B
$B$3$NFCJL$J5!G=$,;H$o$l$k$3$H$O$^$:$"$j$^$;$s!#(B
$B!J(BMS-DOS$B$d8_49%7%9%F%`$G$O!"(B@kbd{C-@key{BREAK}}$B$r(B2$B2sO"BG$9$k!#!K(B

@c   When you resume Emacs after a suspension caused by multiple @kbd{C-g}, it
@c asks two questions before going back to what it had been doing:
@kbd{C-g}$B$NO"BG$K$h$C$F5Y;_$7$?(BEmacs$B$r:F3+$9$k$H!"(B
Emacs$B$O5Y;_D>A0$K<B9T$7$F$$$?F0:n$KLa$k$^$($K!"(B
$B$D$.$N(B2$B$D$N<ALd$r$7$F$-$^$9!#(B

@example
Auto-save? (y or n)
Abort (and dump core)? (y or n)
@end example

@noindent
@c Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}.
$B$=$l$>$l$N<ALd$KBP$7!"(B@kbd{y}$B$+(B@kbd{n}$B$KB3$1$F(B@key{RET}$B$GEz$($F$/$@$5$$!#(B

@c   Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of all
@c modified buffers in which auto-saving is enabled.
@samp{Auto-save?}$B$K(B@kbd{y}$B$HEz$($k$H!"(B
$B<+F0J]B8$r9T$&@_Dj$K$J$C$F$$$kJQ99$5$l$?%P%C%U%!$9$Y$F$KBP$7$F(B
$B$?$@$A$K<+F0J]B8$r<B9T$7$^$9!#(B

@c   Saying @kbd{y} to @samp{Abort (and dump core)?} causes an illegal instruction to be
@c executed, dumping core.  This is to enable a wizard to figure out why Emacs
@c was failing to quit in the first place.  Execution does not continue
@c after a core dump.  If you answer @kbd{n}, execution does continue.  With
@c luck, GNU Emacs will ultimately check @code{quit-flag} and quit normally.
@c If not, and you type another @kbd{C-g}, it is suspended again.
@samp{Abort (and dump core)?}$B$K(B@kbd{y}$B$HEz$($k$H!"(B
Emacs$B$OIT@5L?Na$r<B9T$7$F%3%"%@%s%W$r:n$j$^$9!#(B
$B%3%"%@%s%W$,$"$k$H!"(BEmacs$B$,CfCG$G$-$J$+$C$?M}M3$r%&%#%6!<%I(B
@footnote{$B!ZLuCm![!VL>?M!"=ON}<T!"Kb=Q;U!W$N0UL#$@$,!"(B
$BFCDj$N%3%s%T%e!<%?$d!JFC$K!K%=%U%H%&%'%"$K@:DL$7$??M$r;X$9!#(B}
$B$,DI5f$G$-$^$9!#(B
$B%3%"%@%s%W$r:n$j=*$($k$H(BEmacs$B$N<B9T$O=*N;$7$^$9!#(B
@kbd{n}$B$HEz$($k$H<B9T$O7QB3$7$^$9!#(B
$B1?$,$h$1$l$P!"(BEmacs$B$,:G=*E*$K$O(B@code{quit-flag}$B$r8!::$7$F(B
$B@5>o$KCfCG$G$-$k$G$7$g$&!#(B
$B1?$,0-$1$l$P!"$^$?%k!<%W$KF~$C$?$^$^$K$J$j$^$9$+$i!"(B
$B:FEY(B@kbd{C-g}$B$rBG$C$F(BEmacs$B$r$^$?5Y;_$7$^$9!#(B

@c   If Emacs is not really hung, just slow, you may invoke the double
@c @kbd{C-g} feature without really meaning to.  Then just resume and answer
@c @kbd{n} to both questions, and you will arrive at your former state.
@c Presumably the quit you requested will happen soon.
$BK\Ev$O(BEmacs$B$,8G$^$C$?$N$G$O$J$/C1$KCY$$$@$1$N>l9g$K$O!"(B
$B0U?^$;$:$K(B@kbd{C-g}$B$rO"BG$7$F$7$^$&$3$H$,$"$j$^$9!#(B
$B$=$N>l9g$K$O!":F3+$7$F(B2$B$D$N<ALd$K(B@kbd{n}$B$HEz$($l$P$b$H$N>uBV$KLa$l$^$9!#(B
$BCfCGMW5a$O$9$0$K<u$1IU$1$i$l$k$G$7$g$&!#(B

@c   The double-@kbd{C-g} feature is turned off when Emacs is running under
@c the X Window System, since you can use the window manager to kill Emacs
@c or to create another window and run another program.
X$B%&%#%s%I%&%7%9%F%`$N$b$H$G(BEmacs$B$,F0:n$7$F$$$k>l9g$K$O!"(B
@kbd{C-g}$BO"BG$N5!G=$O@Z$C$F$"$j$^$9!#(B
$B$H$$$&$N$O!"%&%#%s%I%&%^%M!<%8%c$r;H$C$F(BEmacs$B$r=*N;$5$;$?$j!"(B
$BJL$N%&%#%s%I%&$r3+$$$FJL$N%W%m%0%i%`$rF0$+$;$k$+$i$G$9!#(B

@c   On MS-DOS and compatible systems, the emergency escape feature is
@c sometimes unavailable, even if you press @kbd{C-@key{BREAK}} twice, when
@c some system call (MS-DOS or BIOS) hangs, or when Emacs is stuck in a
@c very tight endless loop (in C code, @strong{not} in Lisp code).
MS-DOS$B$d8_49%7%9%F%`$G$O!"(B
$B!J(BMS-DOS$B$d(BBIOS$B$N!K%7%9%F%`%3!<%k$,8G$^$C$F$$$k>l9g$d(B
Emacs$B$,Hs>o$K$-$D$$!J(BLisp$B%3!<%I$G$O(B@strong{$B$J$/(B}C$B$N%3!<%I$G!K(B
$BL58B%k!<%W$KF~$C$F$$$k>l9g$K$O!"(B
@kbd{C-@key{BREAK}}$B$r(B2$B2sBG$C$F$b6[5^C&=P$N5!G=$r;H$($J$$>l9g$,$"$j$^$9!#(B

@node Total Frustration
@c @subsection Help for Total Frustration
@subsection $B$$$i$$$i$7$?$i!D(B
@cindex Eliza
@cindex doctor

@c   If using Emacs (or something else) becomes terribly frustrating and none
@c of the techniques described above solve the problem, Emacs can still help
@c you.
Emacs$B$r;H$&$3$H!J$d!"$=$NB>$N$3$H!K$,$-$o$a$FITL{2w$K$J$C$?$j!"(B
$B$3$3$^$G$K$"$2$?$I$NJ}K!$G$bLdBj$,2r7h$7$J$$>l9g$G$b!"(B
Emacs$B$O$^$@<j=u$1$,$G$-$^$9!#(B

@c   First, if the Emacs you are using is not responding to commands, type
@c @kbd{C-g C-g} to get out of it and then start a new one.
$B$^$:!"(BEmacs$B$,%3%^%s%I$K1~Ez$7$J$$$h$&$J$i!"(B
@kbd{C-g C-g}$B$HBG$C$F(BEmacs$B$+$iH4$1=P$7!"(B
$B?7$?$KJL$N(BEmacs$B$r5/F0$7$F$/$@$5$$!#(B

@findex doctor
@c   Second, type @kbd{M-x doctor @key{RET}}.
$B$D$.$K!"(B@kbd{M-x doctor @key{RET}}$B$HBG$C$F$/$@$5$$!#(B

@c   The doctor will help you feel better.  Each time you say something to
@c the doctor, you must end it by typing @key{RET} @key{RET}.  This lets
@c the doctor know you are finished.
doctor$B%W%m%0%i%`$,$"$J$?$N$$$i$$$i$rDC$a$F$/$l$k$G$7$g$&!#(B
doctor$B$K2?$+$rOC$9$H$-$K$O!"(B@key{RET} @key{RET}$B$HBG$C$F$$$$=*$($k(B
$BI,MW$,$"$j$^$9!#(B
$B$3$&$9$k$H!"(Bdoctor$B$O45<T$,OC$7=*$($?$3$H$rG'<1$7$^$9!#(B

@node Bugs, Contributing, Lossage, Top
@c @section Reporting Bugs
@section $B%P%0$NJs9p(B

@c @cindex bugs
@cindex $B%P%0(B
@c   Sometimes you will encounter a bug in Emacs.  Although we cannot
@c promise we can or will fix the bug, and we might not even agree that it
@c is a bug, we want to hear about problems you encounter.  Often we agree
@c they are bugs and want to fix them.
Emacs$B$N%P%0$K=P2q$&$3$H$b$"$k$G$7$g$&!#(B
$B%P%0$r=$@5$9$k!?$G$-$k$H$OLsB+$G$-$^$;$s$7!"(B
$B$=$b$=$b%P%0$@$HG'$a$J$$$+$b$7$l$^$;$s$,!"(B
$BFI<T$,Ax6x$7$?LdBj$K$D$$$F$OCN$i$;$F$[$7$$$H9M$($F$$$^$9!#(B
$B$?$7$+$K$=$l$r%P%0$@$HG'$a$F=$@5$7$h$&$H$$$&$3$H$K$J$k>l9g$bB?$$$N$G$9!#(B

@c   To make it possible for us to fix a bug, you must report it.  In order
@c to do so effectively, you must know when and how to do it.
$B%P%0$r=$@5$9$k$K$O!"$^$:!"Js9p$7$F$b$i$&I,MW$,$"$j$^$9!#(B
$B8z2LE*$KJs9p$7$F$b$i$&$?$a$K$O!"Js9p$N;EJ}$rCN$C$F$$$?$@$/I,MW$,$"$j$^$9!#(B

@menu
* Criteria:  Bug Criteria.	 Have you really found a bug?
* Understanding Bug Reporting::	 How to report a bug effectively.
* Checklist::			 Steps to follow for a good bug report.
* Sending Patches::		 How to send a patch for GNU Emacs.
@end menu

@node Bug Criteria
@c @subsection When Is There a Bug
@subsection $B%P%0$NH/@8;~4|(B

@c   If Emacs executes an illegal instruction, or dies with an operating
@c system error message that indicates a problem in the program (as opposed to
@c something like ``disk full''), then it is certainly a bug.
Emacs$B$,IT@5L?Na$r<B9T$7$?$j!"(B
$B!J!X%G%#%9%/$,K~GU!Y$J$I$N30It$NLdBj$G$O$J$/!K%W%m%0%i%`$KLdBj$,(B
$B$"$k$H$$$&%*%Z%l!<%F%#%s%0%7%9%F%`$N%a%C%;!<%8$rI=<($7$F;_$^$C$?>l9g$K$O!"(B
$B$?$7$+$K%P%0$,$"$k$H$$$($^$9!#(B

@c   If Emacs updates the display in a way that does not correspond to what is
@c in the buffer, then it is certainly a bug.  If a command seems to do the
@c wrong thing but the problem corrects itself if you type @kbd{C-l}, it is a
@c case of incorrect display updating.
Emacs$B$N2hLL$N99?77k2L$,%P%C%U%!$NFbMF$KBP1~$7$F$$$J$$$J$i!"(B
$B$=$l$b$?$7$+$K%P%0$G$9!#(B
$B%3%^%s%I$N<B9T$,;W$o$7$/$J$/$F$b(B@kbd{C-l}$B$G:FI=<($5$;$k$H@5$7$/$J$k>l9g$K$O!"(B
$B2hLL99?7$,$^$A$,$C$F$$$k$N$G$9!#(B

@c   Taking forever to complete a command can be a bug, but you must make
@c certain that it was really Emacs's fault.  Some commands simply take a
@c long time.  Type @kbd{C-g} (@kbd{C-@key{BREAK}} on MS-DOS) and then @kbd{C-h l}
@c to see whether the input Emacs received was what you intended to type;
@c if the input was such that you @emph{know} it should have been processed
@c quickly, report a bug.  If you don't know whether the command should
@c take a long time, find out by looking in the manual or by asking for
@c assistance.
$B$"$k%3%^%s%I$r<B9T$9$k$N$KL58B$K;~4V$,$+$+$k$H$$$&$N$O%P%0$N2DG=@-$,(B
$B$"$j$^$9$,!"$?$7$+$K(BEmacs$B$N@UG$$+$I$&$+$r3NG'$9$kI,MW$,$"$j$^$9!#(B
$B%3%^%s%I$K$h$C$F$O$H$F$b;~4V$,$+$+$k$b$N$b$"$j$^$9!#(B
@kbd{C-g}$B!J(BMS-DOS$B$G$O(B@kbd{C-@key{BREAK}}$B!K$rBG$C$F$+$i(B
@kbd{C-h l}$B$rBG$D$3$H$G!"(BEmacs$B$,<u$1IU$1$?F~NO$,$?$7$+$K(B
$BFI<T$,0U?^$7$?$b$N$@$C$?$+$I$&$+3NG'$G$-$^$9!#(B
$B$9$0$K=hM}$5$l$k%3%^%s%I$@$H$$$&(B@emph{$B3N?.(B}$B$,$"$k$J$i!"(B
$B%P%0$rJs9p$7$F$/$@$5$$!#(B
$B$=$N%3%^%s%I$,$9$4$/;~4V$N$+$+$k$b$N$+$I$&$+$o$+$i$J$$$J$i!"(B
$B%^%K%e%"%k$GD4$Y$k$+CN$C$F$$$k?M$KJ9$$$F$/$@$5$$!#(B

@c   If a command you are familiar with causes an Emacs error message in a
@c case where its usual definition ought to be reasonable, it is probably a
@c bug.
$B$h$/CN$C$F$$$k%3%^%s%I$G$"$C$F!"IaDL$J$iLdBj$J$/7k2L$,F@$i$l$k$O$:$J$N$K!"(B
$B$+$o$j$K(BEmacs$B$,%(%i!<%a%C%;!<%8$r=P$9$h$&$J$i!"62$i$/$=$l$O%P%0$G$7$g$&!#(B

@c   If a command does the wrong thing, that is a bug.  But be sure you know
@c for certain what it ought to have done.  If you aren't familiar with the
@c command, or don't know for certain how the command is supposed to work,
@c then it might actually be working right.  Rather than jumping to
@c conclusions, show the problem to someone who knows for certain.
$B%3%^%s%I$,@5$7$/$J$$F0:n$r$9$k$N$J$i!"$=$l$O%P%0$G$9!#(B
$B$?$@$7!"%3%^%s%I$,K\Ev$O2?$r$9$k$N$,@5$7$$$+3NG'$7$F$/$@$5$$!#(B
$B$=$N%3%^%s%I$KFk@w$_$,$J$$$H$+!"(B
$B$=$N%3%^%s%I$,$I$&F0:n$9$k$O$:$J$N$+3N?.$,;}$F$J$$>l9g$O!"(B
$B%3%^%s%I$O<B:]$K$O@5$7$/F0:n$7$F$$$k$N$+$b$7$l$^$;$s!#(B
$B%P%0$H$$$&7kO@$KHt$S$D$/$^$($K!"$h$/CN$C$F$$$k?M$K8+$F$b$i$C$F$/$@$5$$!#(B

@c   Finally, a command's intended definition may not be best for editing
@c with.  This is a very important sort of problem, but it is also a matter of
@c judgment.  Also, it is easy to come to such a conclusion out of ignorance
@c of some of the existing features.  It is probably best not to complain
@c about such a problem until you have checked the documentation in the usual
@c ways, feel confident that you understand it, and know for certain that what
@c you want is not available.  If you are not sure what the command is
@c supposed to do after a careful reading of the manual, check the index and
@c glossary for any terms that may be unclear.
$B:G8e$K!"%3%^%s%I$N0U?^$5$l$?Dj5A$,JT=8A`:n$KBP$7$F:GNI$G$J$$2DG=@-$,$"$j$^$9!#(B
$B$3$l$O=EMW$JLdBj$G$O$"$j$^$9$,!"%f!<%6!<$,$I$&H=CG$9$k$+$NLdBj$G$b$"$j$^$9!#(B
$B4{B8$N5!G=$K$D$$$FL5CN$J$?$a$K!"(B
$B$^$A$,$C$F$$$k$H7kO@$r=P$7$F$7$^$&$N$b4JC1$G$9!#(B
$B$^$:%I%-%e%a%s%H$r$R$H$H$*$jD4$Y$F!"==J,$KG<F@$7!"(B
$B$=$l$G$b$J$*<+J,$K$H$C$FI,MW$J5!G=$,$J$$!"$HCG8@$G$-$k$^$G$O!"(B
$B%3%^%s%I$NDj5A$,0-$$$J$I$H$O$$$o$J$$$[$&$,$h$$$G$7$g$&!#(B
$B%^%K%e%"%k$r=OFI$7$F$b%3%^%s%I$,2?$r$9$k$N$+$h$/$o$+$i$J$1$l$P!"(B
$B:w0z$dMQ8l=8$r3hMQ$7$F$h$/$o$+$i$J$$C18l$K$D$$$FD4$Y$^$7$g$&!#(B

@c   If after careful rereading of the manual you still do not understand
@c what the command should do, that indicates a bug in the manual, which
@c you should report.  The manual's job is to make everything clear to
@c people who are not Emacs experts---including you.  It is just as
@c important to report documentation bugs as program bugs.
$B==J,=OFI$7$F$b!"$J$*%3%^%s%I$,2?$r$9$k$N$+$o$+$i$J$$$J$i!"(B
$B$=$l$O!V%^%K%e%"%k$N%P%0!W$H$7$FJs9p$9$Y$-$G$7$g$&!#(B
$B%^%K%e%"%k$O!"FI<T$r4^$a$F!"(BEmacs$B$N@lLg2H$G$J$$?M$,FI$s$G$b(B
$B$9$Y$F$N$3$H$,L@$i$+$K$J$k$h$&$J$b$N$G$"$k$Y$-$G$9!#(B
$B%I%-%e%a%s%H$N%P%0$rJs9p$9$k$3$H$b!"(B
$B%W%m%0%i%`$N%P%0$rJs9p$9$k$3$H$HF1$8$/$i$$=EMW$J$3$H$G$9!#(B

@c   If the on-line documentation string of a function or variable disagrees
@c with the manual, one of them must be wrong; that is a bug.
$B4X?t$dJQ?t$N%*%s%i%$%s$N@bL@J8$,%^%K%e%"%k$H0lCW$7$J$$>l9g$O!"(B
$B$I$A$i$+$,$^$A$,$C$F$$$^$9$+$i!"$3$l$b%P%0$G$9!#(B

@node Understanding Bug Reporting
@c @subsection Understanding Bug Reporting
@subsection $B%P%0$NJs9p$H$O(B

@findex emacs-version
@c   When you decide that there is a bug, it is important to report it and to
@c report it in a way which is useful.  What is most useful is an exact
@c description of what commands you type, starting with the shell command to
@c run Emacs, until the problem happens.
$B%P%0$,$"$k$H3N?.$7$?$i!"$=$l$rJs9p$9$k$3$H!"(B
$B$7$+$b!"LrN)$D7A$GJs9p$9$k$3$H$,=EMW$G$9!#(B
$B$b$C$H$bM-MQ$J$N$O!"$I$N$h$&$J%3%^%s%I$rBG$A9~$s$@$+$r!"(B
Emacs$B$r5/F0$9$k%7%'%k$N%3%^%s%I$+$i;O$a$F(B
$BLdBj$,5/$-$k$H$3$m$^$G$9$Y$F@53N$K5-=R$9$k$3$H$G$9!#(B

@c   The most important principle in reporting a bug is to report
@c @emph{facts}.  Hypotheses and verbal descriptions are no substitute for
@c the detailed raw data.  Reporting the facts is straightforward, but many
@c people strain to posit explanations and report them instead of the
@c facts.  If the explanations are based on guesses about how Emacs is
@c implemented, they will be useless; meanwhile, lacking the facts, we will
@c have no real information about the bug.
$B%P%0$rJs9p$9$k$H$-$b$C$H$b=EMW$J$3$H$O(B@emph{$B;v<B(B}$B$rJs9p$9$k$3$H$G$9!#(B
$B2>@b$d8}F,@bL@$O!">\:Y$J@8%G!<%?$N$+$o$j$K$O$J$j$^$;$s!#(B
$B;v<B$rJs9p$9$k$3$H$OC1=c$J$O$:$J$N$K!"(B
$BB?$/$N?M$O$+$o$j$K@bL@$r$G$C$A$"$2$F$=$l$rJs9p$7$?$,$j$^$9!#(B
$B$=$N@bL@$,(BEmacs$B$N<BAuJ}<0$NA[A|$K4p$E$$$?$b$N$G$"$k$J$i$P!"(B
$B$=$N@bL@$O$^$C$?$/Lr$KN)$?$J$$$G$7$g$&!#(B
$B;v<B$,7g$1$F$$$?$i%P%0$K4X$9$k??$N>pJs$rF@$i$l$^$;$s!#(B

@c   For example, suppose that you type @kbd{C-x C-f /glorp/baz.ugh
@c @key{RET}}, visiting a file which (you know) happens to be rather large,
@c and Emacs displayed @samp{I feel pretty today}.  The best way to report
@c the bug is with a sentence like the preceding one, because it gives all
@c the facts.
$B$?$H$($P!"%f!<%6!<$,$H$F$bBg$-$J%U%!%$%k$rK,$l$k$?$a$K(B
@kbd{C-x C-f /glorp/baz.ugh @key{RET}}$B$HBG$A9~$s$@$i!"(B
Emacs$B$,(B@samp{I feel pretty today}$B$HI=<($7$?$H$7$^$7$g$&!#(B
$B$b$C$H$b$h$$%P%0%l%]!<%H$O!"$^$5$K$3$NJ8$N$h$&$KJs9p$9$k$3$H$G$9!#(B
$B$9$Y$F$N;v<B$@$1$rJs9p$G$-$k$+$i$G$9!#(B

@c   A bad way would be to assume that the problem is due to the size of
@c the file and say, ``I visited a large file, and Emacs displayed @samp{I
@c feel pretty today}.''  This is what we mean by ``guessing
@c explanations.''  The problem is just as likely to be due to the fact
@c that there is a @samp{z} in the file name.  If this is so, then when we
@c got your report, we would try out the problem with some ``large file,''
@c probably with no @samp{z} in its name, and not see any problem.  There
@c is no way in the world that we could guess that we should try visiting a
@c file with a @samp{z} in its name.
$BLdBj$O%U%!%$%k$NBg$-$5$K$"$k$H2>Dj$7$F!"(B
$B!VBg$-$J%U%!%$%k$rK,Ld$7$?$i!"(BEmacs$B$,(B@samp{I feel pretty today}$B$HI=<($7$?!W(B
$B$J$I$H=q$$$F$O$$$1$^$;$s!#(B
$B$3$l$,!X@bL@$r$G$C$A$"$2$?!YJs9p$G$9!#(B
$BLdBj$O%U%!%$%kL>$K(B@samp{z}$B$,4^$^$l$F$$$?$?$a$K@8$8$?$N$+$b$7$l$J$$$N$G$9!#(B
$B$b$7$=$&$@$H$7$?$i!"Js9p$K4p$E$$$FE,Ev$J!VBg$-$J%U%!%$%k!W$rK,Ld$7$F$_$F$b!"(B
$B$=$N%U%!%$%kL>$K(B@samp{z}$B$,4^$^$l$F$$$J$1$l$P2?$b0-$$$H$3$m$,(B
$B$_$D$+$i$J$$$G$7$g$&!#(B
$BJs9p$NJ8LL$+$i$O!"L>A0$K(B@samp{z}$B$r4^$s$@%U%!%$%k$r(B
$B;n$7$KK,Ld$7$F$_$k$Y$-$@$H$O$o$+$j$^$;$s!#(B

@c   Alternatively, the problem might be due to the fact that the file starts
@c with exactly 25 spaces.  For this reason, you should make sure that you
@c inform us of the exact contents of any file that is needed to reproduce the
@c bug.  What if the problem only occurs when you have typed the @kbd{C-x C-a}
@c command previously?  This is why we ask you to give the exact sequence of
@c characters you typed since starting the Emacs session.
$B$"$k$$$O!"%U%!%$%k$,$A$g$&$I(B25$B8D$N6uGrJ8;z$G;O$^$C$F$$$k$?$a$K(B
$BLdBj$,5/$-$?$N$+$b$7$l$^$;$s!#(B
$B$G$9$+$i!"Js9p$K:]$7$F$O!"$=$N%P%0$r:F8=$5$;$k$N$KI,MW$J%U%!%$%k$,$"$l$P!"(B
$B$=$l$i$N%U%!%$%k$N@53N$JFbMF$b65$($F$/$@$5$$!#(B
$B$=$NLdBj$O!"$?$^$?$^!"(B@kbd{C-x C-a}$B$HBG$C$?D>8e$K$N$_(B
$BH/@8$9$k$N$@$H$7$?$i$I$&$G$7$g$&!)(B@code{ }
$B$G$9$+$i!"(BEmacs$B$r5/F0$7$F$+$iLdBj$KAx6x$9$k$^$G$K(B
$BBG$A9~$s$@$b$N$9$Y$F$r65$($F$[$7$$$N$G$9!#(B

@c   You should not even say ``visit a file'' instead of @kbd{C-x C-f} unless
@c you @emph{know} that it makes no difference which visiting command is used.
@c Similarly, rather than saying ``if I have three characters on the line,''
@c say ``after I type @kbd{@key{RET} A B C @key{RET} C-p},'' if that is
@c the way you entered the text.@refill
$B$I$NK,Ld%3%^%s%I$r;H$C$F$bF1$8$h$&$KLdBj$,H/@8$9$k$H(B@emph{$BCN$C$F$$$k(B}
$B$N$G$J$$8B$j!"(B@kbd{C-x C-f}$B$HBG$C$?$HJs9p$9$k$+$o$j$K(B
$B!V%U%!%$%k$rK,Ld$7$?!W$H$$$&$N$5$($$$1$^$;$s!#(B
$BF1MM$K!"!V(B1$B9T$K(B3$BJ8;zF~$C$F$$$k$H$-!W$G$O$J$/!"(B
$B!V(B@kbd{@key{RET} A B C @key{RET} C-p}$B$HBG$A9~$s$@$"$H$G!W$N$h$&$K!"(B
$B$"$J$?$,%F%-%9%H$rF~$l$?$d$jJ}$=$N$b$N$rJs9p$7$F$/$@$5$$!#(B

@c   So please don't guess any explanations when you report a bug.  If you
@c want to actually @emph{debug} the problem, and report explanations that
@c are more than guesses, that is useful---but please include the facts as
@c well.
$B$3$N$h$&$K!"%P%0$rJs9p$9$k$H$-$K$O!"$$$+$J$k@bL@$b?dB,$7$J$$$G$/$@$5$$!#(B
$BLdBj$r<B:]$K(B@emph{$B%G%P%C%0(B}$B$7$F21B,$G$O$J$$@bL@$rJs9p$7$F$b$i$($k$J$i!"(B
$B$=$l$OM-1W$G$9$,!";v<B$b4^$a$F$/$@$5$$!#(B

@node Checklist
@c @subsection Checklist for Bug Reports
@subsection $B%P%0%l%]!<%H$N%A%'%C%/%j%9%H(B

@c @cindex reporting bugs
@cindex $B%P%0$rJs9p$9$k(B
@c   The best way to send a bug report is to mail it electronically to the
@c Emacs maintainers at @samp{bug-gnu-emacs@@gnu.org}.  (If you
@c want to suggest a change as an improvement, use the same address.)
$B%P%0%l%]!<%H$rAw$k:GNI$NJ}K!$O!"EE;R%a%$%k$G(BEmacs$BJ]<i%A!<%`(B
@samp{bug-gnu-emacs@@gnu.org}$B$KAw$k$3$H$G$9!#(B
$B!J=EMW$J2~NI$NDs0F$J$I$b$3$3$KAw$C$F$/$@$5$$!K!#(B

@c   If you'd like to read the bug reports, you can find them on the
@c newsgroup @samp{gnu.emacs.bug}; keep in mind, however, that as a
@c spectator you should not criticize anything about what you see there.
@c The purpose of bug reports is to give information to the Emacs
@c maintainers.  Spectators are welcome only as long as they do not
@c interfere with this.  In particular, some bug reports contain large
@c amounts of data; spectators should not complain about this.
$BB>$+$i=P$5$l$?%P%0%l%]!<%H$,FI$_$?$1$l$P!"(B
$B%K%e!<%9%0%k!<%W(B@samp{gnu.emacs.bug}$B$GFI$a$^$9!#(B
$B$?$@$7!"K54Q<T$H$7$F8+$k>l9g$K$O!"8+$?$b$N$K$D$$$FHcH=$9$k$Y$-$G$O$J$$!"(B
$B$H$$$&$3$H$r>5CN$7$F$*$$$F$/$@$5$$!#(B
$B%P%0%l%]!<%H$NL\E*$O(BEmacs$BJ]<i%A!<%`$K>pJs$rDs6!$9$k$3$H$G$9!#(B
$BK54Q<T$O!"$3$NL\E*$K43>D$7$J$$8B$j$O!"4?7^$7$^$9!#(B
$BFC$K!"BgNL$N%G!<%?$,E:IU$5$l$F$$$k%P%0%l%]!<%H$b$"$j$^$9$N$G!"(B
$BK54Q<T$O$=$N$3$H$rHsFq$9$Y$-$G$O$"$j$^$;$s!#(B

@c   Please do not post bug reports using netnews; mail is more reliable
@c than netnews about reporting your correct address, which we may need in
@c order to ask you for more information.
$B%M%C%H%K%e!<%97PM3$G%P%0%l%]!<%H$rEj9F$7$J$$$G$/$@$5$$!#(B
$B%M%C%H%K%e!<%9$h$j$b%a%$%k$N$[$&$,Aw$j<j$N%a%$%k%"%I%l%9$,3N<B$K$o$+$j(B
$B?.Mj$G$-$^$9!#(B
$B$b$C$H>pJs$,I,MW$J$H$-$K$O!"%a%$%k$GLd$$9g$o$;$kI,MW$,$"$k$+$bCN$l$^$;$s!#(B

@c   If you can't send electronic mail, then mail the bug report on paper
@c or machine-readable media to this address:
$BEE;R%a%$%k$rAw$l$J$$>l9g$K$O!"(B
$B;f$dB>$N5!3#2DFI$JG^BN$G2<5-$XAw$C$F$/$@$5$$!#(B

@format
GNU Emacs Bugs
Free Software Foundation
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA
@end format

@c   We do not promise to fix the bug; but if the bug is serious,
@c or ugly, or easy to fix, chances are we will want to.
$B%P%0$r=$@5$9$k$H$OLsB+$G$-$^$;$s!#(B
$B$7$+$7!"=EBg$J%P%0$d!"=9$$%P%0$d!"4JC1$KD>$;$k%P%0$J$i!"D>$7$?$$$H;W$$$^$9!#(B

@findex report-emacs-bug
@c   A convenient way to send a bug report for Emacs is to use the command
@c @kbd{M-x report-emacs-bug}.  This sets up a mail buffer (@pxref{Sending
@c Mail}) and automatically inserts @emph{some} of the essential
@c information.  However, it cannot supply all the necessary information;
@c you should still read and follow the guidelines below, so you can enter
@c the other crucial information by hand before you send the message.
Emacs$B$N%P%0%l%]!<%H$rAw$k$N$KJXMx$JJ}K!$N(B1$B$D$O!"(B
$B%3%^%s%I(B@kbd{M-x report-emacs-bugs}$B$r;H$&$3$H$G$9!#(B
$B$3$N%3%^%s%I$O%a%$%k%P%C%U%!!J(B@pxref{Sending Mail}$B!K$r3+$$$F!"(B
$B<+F0E*$K=EMW$J>pJs(B@emph{$B$N0lIt(B}$B$r=q$-9~$_$^$9!#(B
$B$7$+$7!"I,MW$J>pJs$r$9$Y$FF~$l$i$l$k$o$1$G$O$"$j$^$;$s$+$i!"(B
$B0J2<$N;X?K$rFI$s$G$=$l$K=>$$!"(B
$B%a%C%;!<%8$rAw$k$^$($K=EMW$J>pJs$r<+J,$GBG$A9~$s$G$/$@$5$$!#(B

@c   To enable maintainers to investigate a bug, your report
@c should include all these things:
$BJ]<i%A!<%`$,%P%0$ND4::$r3+;O$9$k$?$a$K$O!"(B
$B0J2<$N$9$Y$F$,%P%0%l%]!<%H$K4^$^$l$F$$$kI,MW$,$"$j$^$9!#(B

@itemize @bullet
@item
@c The version number of Emacs.  Without this, we won't know whether there
@c is any point in looking for the bug in the current version of GNU
@c Emacs.
Emacs$B$N%P!<%8%g%sHV9f!#(B
$B$3$l$,$J$$$H!"(BGNU Emacs$B$N:G?7HG$G%P%0$rC5$9$Y$-$+$I$&$+H=CG$G$-$J$$!#(B

@c You can get the version number by typing @kbd{M-x emacs-version
@c @key{RET}}.  If that command does not work, you probably have something
@c other than GNU Emacs, so you will have to report the bug somewhere
@c else.
$B%P!<%8%g%sHV9f$rD4$Y$k$K$O!"(B@kbd{M-x emacs-version @key{RET}}$B$HBG$D!#(B
$B$3$N%3%^%s%I$,F0:n$7$J$$$h$&$J$i!"(B
GNU Emacs$B$G$O$J$$%(%G%#%?$r;H$C$F$$$k$h$&$J$N$G!"(B
$B$I$3$+JL$N$H$3$m$X%P%0$rJs9p$9$k!#(B

@item
@c The type of machine you are using, and the operating system name and
@c version number.  @kbd{M-x emacs-version @key{RET}} provides this
@c information too.  Copy its output from the @samp{*Messages*} buffer, so
@c that you get it all and get it accurately.
$B;H$C$F$$$k%^%7%s$N<oN`!"%*%Z%l!<%F%#%s%0%7%9%F%`$NL>A0$H%P!<%8%g%s!#(B
@kbd{M-x emacs-version @key{RET}}$B$G$3$l$i$N>pJs$bI=<($5$l$k!#(B
@samp{*Messages*}$B%P%C%U%!$+$i$=$N=PNO$r%3%T!<$9$l$P!"(B
$B$9$Y$F$N>pJs$r$^$A$,$$$J$/Aw$l$k!#(B

@item
@c The operands given to the @code{configure} command when Emacs was
@c installed.
Emacs$B$r%$%s%9%H!<%k$7$?$H$-$N(B@code{configure}$B%3%^%s%I$N0z?t!#(B

@item
@c A complete list of any modifications you have made to the Emacs source.
@c (We may not have time to investigate the bug unless it happens in an
@c unmodified Emacs.  But if you've made modifications and you don't tell
@c us, you are sending us on a wild goose chase.)
Emacs$B%=!<%9$KJQ99$r2C$($?>l9g$O!"$=$N$9$Y$F$N%j%9%H!#(B
$B!J%=!<%9$r=$@5$7$?(BEmacs$B$G5/$-$?%P%0$^$G$bD4::$9$k;~4V$O$J$$!#(B
$B$7$+$7!"=$@5$r2C$($?$N$K$=$l$r65$($F$/$l$J$1$l$P!"(B
$BLq2p$4$H$rB>?M$K2!$7IU$1$F$$$k$@$1!#!K(B

@c Be precise about these changes.  A description in English is not
@c enough---send a context diff for them.
$B$3$l$i$NJQ99$K$D$$$F$O@53N$K5-$7$F$[$7$$!#(B
$B1Q8l$G$N@bL@$G$OIT==J,!#(B
$B%=!<%9$N%3%s%F%-%9%H(Bdiff$B$rAw$k$3$H!#(B

@c Adding files of your own, or porting to another machine, is a
@c modification of the source.
$BFH<+$N%U%!%$%k$rDI2C$7$?$j!"JL$N%^%7%s$K0\?"$9$k$N$b!"(B
$B%=!<%9$NJQ99$K$"$?$k!#(B

@item
@c Details of any other deviations from the standard procedure for installing
@c GNU Emacs.
$B$=$NB>!"(BGNU Emacs$B$NI8=`$N%$%s%9%H!<%k<j=g$H0c$C$F$$$k$H$3$m$,$"$l$P!"(B
$B$9$Y$F>\$7$/5-=R$9$k!#(B

@item
@c The complete text of any files needed to reproduce the bug.
$B$=$N%P%0$r:F8=$9$k$?$a$KI,MW$J$9$Y$F$N%U%!%$%k$NFbMF!#(B

@c   If you can tell us a way to cause the problem without visiting any files,
@c please do so.  This makes it much easier to debug.  If you do need files,
@c make sure you arrange for us to see their exact contents.  For example, it
@c can often matter whether there are spaces at the ends of lines, or a
@c newline after the last line in the buffer (nothing ought to care whether
@c the last line is terminated, but try telling the bugs that).
$B%U%!%$%k$r$^$C$?$/K,Ld$;$:$KLdBj$,:F8=2DG=$J$i!"$<$R65$($F$[$7$$!#(B
$B$=$N$[$&$,%G%P%C%0$,$:$C$H3Z$K$J$k!#(B
$B$I$&$7$F$b%U%!%$%k$,I,MW$J$i!"I,$:$=$NFbMF$,@53N$K$o$+$k$h$&$K$9$k$3$H!#(B
$B$?$H$($P!"9TKv$K6uGrJ8;z$,IU$$$F$$$k$+$I$&$+$H$+!"(B
$B%P%C%U%!$N:G=*9T$K2~9TJ8;z$,$"$k$+$I$&$+$,(B
$BLdBj$K$J$k$3$H$OIQHK$K$"$k(B
$B!J:G=*9T$K2~9T$,$"$k$+$I$&$+$G2?$+0c$$$,$"$k$Y$-$G$O$J$$$N$@$,!"(B
$B$b$70c$$$,@8$8$k$h$&$J$i$=$l$b%P%0$H$$$($k!K!#(B

@item
@c The precise commands we need to type to reproduce the bug.
$B%P%0$r:F8=$5$;$k$?$a$KBG$A9~$`@53N$J%3%^%s%INs!#(B

@findex open-dribble-file
@c @cindex dribble file
@cindex $B%I%j%V%k%U%!%$%k(B
@c   The easy way to record the input to Emacs precisely is to write a
@c dribble file.  To start the file, execute the Lisp expression
Emacs$B$X$NF~NO$r@53N$K5-O?$9$k4JC1$JJ}K!$O!"(B
$B%I%j%V%k%U%!%$%k$K=q$/$3$H$G$"$k!#(B
$B%I%j%V%k%U%!%$%k$r3+;O$9$k$K$O!"(B
Emacs$B$r<B9T3+;O$7$?D>8e$K!"(B@kbd{M-:}$B$+(B
$B%P%C%U%!(B@samp{*scratch*}$B$G$D$.$N(BLisp$B<0$r<B9T$9$k!#(B

@example
(open-dribble-file "~/dribble")
@end example

@noindent
@c using @kbd{M-:} or from the @samp{*scratch*} buffer just after
@c starting Emacs.  From then on, Emacs copies all your input to the
@c specified dribble file until the Emacs process is killed.
$B$=$l0J9_$O(BEmacs$B%W%m%;%9$,=*N;$9$k$^$G!"(B
Emacs$B$O$9$Y$F$NF~NO$r%I%j%V%k%U%!%$%k$K%3%T!<$9$k!#(B

@item
@findex open-termscript
@c @cindex termscript file
@c @cindex @code{TERM} environment variable
@cindex termscript$B%U%!%$%k(B
@cindex $B4D6-JQ?t(B@code{TERM}
@cindex @code{TERM}$B!J4D6-JQ?t!K(B
@c For possible display bugs, the terminal type (the value of environment
@c variable @code{TERM}), the complete termcap entry for the terminal from
@c @file{/etc/termcap} (since that file is not identical on all machines),
@c and the output that Emacs actually sent to the terminal.
$BI=<($K4X$9$k%P%0$N2DG=@-$,$"$k>l9g$K$O!"(B
$BC<Kv<oJL!J4D6-JQ?t(B@code{TERM}$B$NCM!K!"(B
$B!J$9$Y$F$N%^%7%s$GF1$8$H$O8B$i$J$$$N$G!K(B
@file{/etc/termcap}$B%U%!%$%kCf$NEv3:C<Kv$N(Btermcap$B$NDj5A$9$Y$F!"(B
$B$*$h$S!"(BEmacs$B$,<B:]$KC<Kv$KAw$C$?=PNO!#(B

@c The way to collect the terminal output is to execute the Lisp expression
$BC<Kv$X$N=PNO$r<}=8$9$k$K$O!"(BEmacs$B$r<B9T3+;O$7$?D>8e$K!"(B@kbd{M-:}$B$+(B
$B%P%C%U%!(B@samp{*scratch*}$B$G$D$.$N(BLisp$B<0$r<B9T$9$k!#(B

@example
(open-termscript "~/termscript")
@end example

@noindent
@c using @kbd{M-:} or from the @samp{*scratch*} buffer just after
@c starting Emacs.  From then on, Emacs copies all terminal output to the
@c specified termscript file as well, until the Emacs process is killed.
@c If the problem happens when Emacs starts up, put this expression into
@c your @file{.emacs} file so that the termscript file will be open when
@c Emacs displays the screen for the first time.
$B$=$l0J9_!"(BEmacs$B$O%W%m%;%9$,=*N;$9$k$^$G$N$9$Y$F$NC<Kv=PNO$N<L$7$r(B
$B;XDj$5$l$?(Btermscript$B%U%!%$%k$K=q$-=P$9!#(B
Emacs$B$,5/F0$9$k$H$-$KLdBj$,5/$-$k$N$J$i!"(B
$B>e$N<0$r(B@file{.emacs}$B%U%!%$%k$KF~$l$F!"(B
Emacs$B$,:G=i$K2hLL$r3+$/$H$-$K0l=o$K(Btermscript$B%U%!%$%k$b(B
$B=q$-;O$a$k$h$&$K$9$k!#(B

@c Be warned: it is often difficult, and sometimes impossible, to fix a
@c terminal-dependent bug without access to a terminal of the type that
@c stimulates the bug.@refill
$B$?$@$7!"C<Kv$K0MB8$7$?%P%0$O!"(B
$B$=$N%P%0$N=P$kC<Kv$J$7$GD>$9$3$H$OFq$7$$$3$H$,B?$/!"(B
$B$H$-$H$7$FIT2DG=$G$"$k$3$H$b>5CN$7$F$*$$$F$[$7$$!#(B

@item
@c A description of what behavior you observe that you believe is
@c incorrect.  For example, ``The Emacs process gets a fatal signal,'' or,
@c ``The resulting text is as follows, which I think is wrong.''
$B@5$7$/$J$$$H7kO@$7$?$3$H$,$I$&@5$7$/$J$$$N$+5-=R$9$k!#(B
$B$?$H$($P!"!V(BEmacs$B%W%m%;%9$,CWL?E*$J%7%0%J%k$r<u$1<h$k!W$H$+(B
$B!V:G=*E*$J%F%-%9%H$O$D$.$N$h$&$K$J$k$,!"$3$l$O@5$7$/$J$$!#!W$J$I!#(B

@c Of course, if the bug is that Emacs gets a fatal signal, then one can't
@c miss it.  But if the bug is incorrect text, the maintainer might fail to
@c notice what is wrong.  Why leave it to chance?
$B$b$A$m$s!"(BEmacs$B$,CWL?E*$J%7%0%J%k$r<u$1<h$k$N$J$i!"$=$l$OC/$K$G$b$o$+$k!#(B
$B$7$+$7!"%P%0$,@5$7$/$J$$%F%-%9%H$@$H$9$k$H!"(B
$BJ]<i%A!<%`$K$O$I$3$,@5$7$/$J$$$N$+$o$+$i$J$$2DG=@-$,$"$k!#(B
$B$=$&$$$&2DG=@-$N$"$k=q$-J}$O$d$a$F$[$7$$!#(B

@c Even if the problem you experience is a fatal signal, you should still
@c say so explicitly.  Suppose something strange is going on, such as, your
@c copy of the source is out of sync, or you have encountered a bug in the
@c C library on your system.  (This has happened!)  Your copy might crash
@c and the copy here might not.  If you @emph{said} to expect a crash, then
@c when Emacs here fails to crash, we would know that the bug was not
@c happening.  If you don't say to expect a crash, then we would not know
@c whether the bug was happening---we would not be able to draw any
@c conclusion from our observations.
$BAx6x$9$kLdBj$,CWL?E*$J%7%0%J%k$@$H$7$F$b!"$O$C$-$j$H$=$&=q$/$Y$-$G$"$k!#(B
$B$?$H$($P!"(BEmacs$B$N%=!<%9$,0lIt0c$C$F$$$kHG$@$C$?$H$+!"(B
$B%7%9%F%`$N(BC$B%i%$%V%i%j$N%P%0$KAx6x$7$?$H$$$C$?(B
$B4qL/$J$3$H$K=P2q$C$?$H$7$h$&!J<BOC!*!K!#(B
$B$"$J$?$,;H$C$F$$$k(BEmacs$B$O%/%i%C%7%e$9$k$,!"J]<i%A!<%`$N$[$&$G$O2?$H$b$J$$!#(B
$B%/%i%C%7%e$9$k$H(B@emph{$B$$$C$F(B}$B$b$i$($l$P!"(B
$BJ]<i%A!<%`$N$[$&$G<B9T$7$F%/%i%C%7%e$7$J$1$l$P%P%0$,:F8=$7$J$$$H$o$+$k!#(B
$B$7$+$7$=$&$$$C$F$b$i$($J$$$H!"(B
$B%P%0$,:F8=$7$?$N$+$I$&$+$5$($o$+$i$:$K!"(B
$B;n$7$F$_$?7k2L$+$i$O2?$N7kO@$bF@$i$l$J$$!#(B

@item
@c If the manifestation of the bug is an Emacs error message, it is
@c important to report the precise text of the error message, and a
@c backtrace showing how the Lisp program in Emacs arrived at the error.
$B%P%0$N7k2L$,(BEmacs$B$N%(%i!<%a%C%;!<%8$G$"$l$P!"(B
$B$=$N%(%i!<%a%C%;!<%8$NJ8LL$r@53N$KJs9p$9$k$3$H$H!"(B
Emacs$BCf$N(BLisp$B%W%m%0%i%`$,$I$&$d$C$F$=$N%(%i!<$N2U=j$K(B
$BE~C#$7$?$+$r<($9%P%C%/%H%l!<%9$rJs9p$9$k$3$H$,=EMW!#(B

@c To get the error message text accurately, copy it from the
@c @samp{*Messages*} buffer into the bug report.  Copy all of it, not just
@c part.
$B%(%i!<%a%C%;!<%8$NJ8LL$r@53N$KJs9p$9$k$K$O!"(B
@samp{*Message*}$B%P%C%U%!$+$i%a%C%;!<%8$r%P%0%l%]!<%H$K%3%T!<$9$k!#(B
$B0lIt$G$O$J$/!"A4BN$r%3%T!<$7$F$[$7$$!#(B

@c To make a backtrace for the error, evaluate the Lisp expression
@c @code{(setq @w{debug-on-error t})} before the error happens (that is to
@c say, you must execute that expression and then make the bug happen).
@c This causes the error to run the Lisp debugger, which shows you a
@c backtrace.  Copy the text of the debugger's backtrace into the bug
@c report.
$B%(%i!<$N%P%C%/%H%l!<%9$r<hF@$9$k$K$O!"%(%i!<$,H/@8$9$k$h$j$^$($K(BLisp$B<0(B
@code{(setq @w{debug-on-error t})}$B$rI>2A$9$k(B
$B!J$D$^$j!"$^$:$3$N(BLisp$B<0$r<B9T$7$F!"$=$l$+$i%(%i!<$r:F8=$5$;$k!K!#(B
$B$9$k$H!"%(%i!<$,5/$-$?$H$-$K(BLisp$B%G%P%C%,$,<B9T$5$l!"(B
$B%G%P%C%,$,%P%C%/%H%l!<%9$rI=<($9$k!#(B
$B$3$N%G%P%C%,$N%P%C%/%H%l!<%9=PNO$r!"%P%0%l%]!<%H$K%3%T!<$9$k!#(B

@c This use of the debugger is possible only if you know how to make the
@c bug happen again.  If you can't make it happen again, at least copy
@c the whole error message.
$B$3$N$d$jJ}$O!"%P%0$r:F8=$G$-$k$H$-$@$1;H$($k!#(B
$B:F8=$G$-$J$$>l9g$O!":GDc8B!"%(%i!<%a%C%;!<%8$@$1$G$b$9$Y$F%3%T!<$9$k!#(B

@item
@c Check whether any programs you have loaded into the Lisp world,
@c including your @file{.emacs} file, set any variables that may affect the
@c functioning of Emacs.  Also, see whether the problem happens in a
@c freshly started Emacs without loading your @file{.emacs} file (start
@c Emacs with the @code{-q} switch to prevent loading the init file).  If
@c the problem does @emph{not} occur then, you must report the precise
@c contents of any programs that you must load into the Lisp world in order
@c to cause the problem to occur.
$B8D?M$N%U%!%$%k(B@file{.emacs}$B$r4^$a$F%m!<%I$7$?(BLisp$B%3!<%I$N$I$l$+$,!"(B
Emacs$B$NF0:n$K1F6A$9$k$h$&$JJQ?t@_Dj$r9T$C$F$$$J$$$+3NG'$9$k!#(B
$B$^$?!"!J%*%W%7%g%s(B@code{-q}$B$r;XDj$7$F=i4|2=%U%!%$%k$N%m!<%I$rM^@)$7$F!K(B
$B8D?M$N%U%!%$%k(B@file{.emacs}$B$r%m!<%I$;$:$K5/F0$7$?(BEmacs$B$G$b(B
$B%(%i!<$,:F8=$9$k$+$I$&$+D4$Y$k!#(B
$B$3$l$G%(%i!<$,:F8=(B@emph{$B$7$J$$(B}$B$J$i!"(B
$B%(%i!<$N:F8=$KI,MW$J$N$G!"%m!<%I$7$?$9$Y$F$N%W%m%0%i%`$NFbMF$r@53N$KJs9p$9$k!#(B

@item
@c If the problem does depend on an init file or other Lisp programs that
@c are not part of the standard Emacs system, then you should make sure it
@c is not a bug in those programs by complaining to their maintainers
@c first.  After they verify that they are using Emacs in a way that is
@c supposed to work, they should report the bug.
$BLdBj$,=i4|@_Dj%U%!%$%k$dI8=`$N(BEmacs$B%7%9%F%`$K4^$^$l$J$$(BLisp$B%W%m%0%i%`$K(B
$B0MB8$9$k$J$i!"$^$:$=$l$i$rJ]<i$7$F$$$k?M$KAjCL$7$F!"(B
$B$=$l$i$N%W%m%0%i%`$NLdBj$G$O$J$$$3$H$r3NG'$9$k!#(B
$B$=$N?M$?$A$,!"$=$N%3!<%I$O(BEmacs$B$N@5$7$$;H$$J}$r$7$F$$$k$H3NG'$7$?$&$($G!"(B
$B$=$N?M$?$A$,%P%0$rJs9p$9$k$Y$-$G$"$k!#(B

@item
@c If you wish to mention something in the GNU Emacs source, show the line
@c of code with a few lines of context.  Don't just give a line number.
GNU Emacs$B$N%=!<%9$K4X$7$F2?$+%3%a%s%H$7$?$$$J$i!"(B
$B$=$NItJ,$N%3!<%I$rA08e?t9T$r4^$a$F<($7$?$&$($G%3%a%s%H$9$k!#(B
$B9THV9f$@$1=q$/$H$$$&$N$O$d$a$F$[$7$$!#(B

@c The line numbers in the development sources don't match those in your
@c sources.  It would take extra work for the maintainers to determine what
@c code is in your version at a given line number, and we could not be
@c certain.
$B3+H/Cf$N%=!<%9$N9THV9f$H%f!<%6!<$,F~<j$9$k%=!<%9$N9THV9f$H$OF1$8$G$O$J$$!#(B
$B$"$J$?$,;H$C$F$$$k%P!<%8%g%s$N%=!<%9$N2?9TL\$,!"(B
$B3+H/Cf$N%=!<%9$N2?9TL\$KBP1~$7$F$$$k$+D4$Y$k$N$OM>J,$J<j4V$G$"$j!"(B
$B@53N$K$O$o$+$i$J$$$+$b$7$l$J$$!#(B

@item
@c Additional information from a C debugger such as GDB might enable
@c someone to find a problem on a machine which he does not have available.
@c If you don't know how to use GDB, please read the GDB manual---it is not
@c very long, and using GDB is easy.  You can find the GDB distribution,
@c including the GDB manual in online form, in most of the same places you
@c can find the Emacs distribution.  To run Emacs under GDB, you should
@c switch to the @file{src} subdirectory in which Emacs was compiled, then
@c do @samp{gdb emacs}.  It is important for the directory @file{src} to be
@c current so that GDB will read the @file{.gdbinit} file in this
@c directory.
GDB$B$J$I$N(BC$B8@8lMQ$N%G%P%C%,$+$i$NDI2C>pJs$,$"$k$H!"(B
$BJ]<i%A!<%`$N<j85$K$J$$%^%7%s$G$b%P%0$N860x$,$o$+$k$3$H$b$"$k!#(B
$B$b$7(BGDB$B$N;H$$J}$,$o$+$i$J$$$h$&$J$i!"(BGDB$B$N%^%K%e%"%k$r$<$RFI$s$G$[$7$$!#(B
$B$?$$$7$FD9$/$J$$$7!"(BGDB$B$r;H$&$N$O4JC1!#(B
GDB$B$N%*%s%i%$%s7A<0$N%^%K%e%"%k$r4^$`(BGDB$B$NG[I[$O!"(B
$B$?$$$F$$$O(BEmacs$B$NG[I[$HF1$8>l=j$KCV$$$F$"$k!#(B
GDB$B$rMQ$$$F(BEmacs$B$r<B9T$9$k$K$O!"(B
Emacs$B$r%3%s%Q%$%k$7$?%5%V%G%#%l%/%H%j(B@file{src}$B$K0\F0$7$F$+$i!"(B
@samp{gdb emacs}$B$r9T$&I,MW$,$"$k!#(B
GDB$B$,%G%#%l%/%H%j(B@file{src}$B$K$"$k%U%!%$%k(B@file{.gdbinit}$B$rFI$a$k$h$&$K!"(B
$B$3$N%G%#%l%/%H%j$,%+%l%s%H%G%#%l%/%H%j$G$"$k$3$H$,=EMW!#(B

@c However, you need to think when you collect the additional information
@c if you want it to show what causes the bug.
$B$?$@$7!"%P%0$N860x$r<($9$?$a$KDI2C>pJs$r=8$a$k>l9g$K$O!"(B
$BDI2C>pJs$r$$$D=8$a$k$+$r$h$/9M$($kI,MW$,$"$k!#(B

@c @cindex backtrace for bug reports
@cindex $B%P%0%l%]!<%HMQ$N%P%C%/%H%l!<%9(B
@c For example, many people send just a backtrace, but that is not very
@c useful by itself.  A simple backtrace with arguments often conveys
@c little about what is happening inside GNU Emacs, because most of the
@c arguments listed in the backtrace are pointers to Lisp objects.  The
@c numeric values of these pointers have no significance whatever; all that
@c matters is the contents of the objects they point to (and most of the
@c contents are themselves pointers).
$B$?$H$($P!"B?$/$N?M$O%P%C%/%H%l!<%9$@$1$rAw$C$F$/$k$,!"(B
$B$=$lC1BN$G$O$"$^$jLr$KN)$?$J$$!#(B
$B0z?t$N5-O?$D$-$NC1=c$J%P%C%/%H%l!<%9$G$O!"(B
GNU Emacs$B$NFbIt$G2?$,5/$-$F$$$k$+$K$D$$$F$N>pJs$O$[$H$s$I$J$$!#(B
$B$H$$$&$N$O!"%P%C%/%H%l!<%9$KI=<($5$l$k0z?t$N$[$H$s$I$O(B
Lisp$B%*%V%8%'%/%H$X$N%]%$%s%?$@$+$i!#(B
$B$=$l$i$N%]%$%s%?$NCM$=$N$b$N$O!"$J$s$i=EMW$G$O$J$$!#(B
$B=EMW$J$N$O!"%]%$%s%?$,;X$7$F$$$k@h$N%*%V%8%'%/%H$NFbMF(B
$B!J$=$7$F$=$NFbMF$b$^$?%]%$%s%?$G$"$k$3$H$,B?$$!K!#(B

@findex debug_print
@c To provide useful information, you need to show the values of Lisp
@c objects in Lisp notation.  Do this for each variable which is a Lisp
@c object, in several stack frames near the bottom of the stack.  Look at
@c the source to see which variables are Lisp objects, because the debugger
@c thinks of them as integers.
$BLr$KN)$D>pJs$rDs6!$9$k$K$O!"(B
Lisp$B%*%V%8%'%/%H$NCM$r(BLisp$B$N5-K!$G<($9I,MW$,$"$k!#(B
$B%9%?%C%/$NDlIU6a$K$"$k?t8D$N%U%l!<%`$K$D$$$F!"(B
Lisp$B%*%V%8%'%/%H$G$"$k$h$&$J3FJQ?t$KBP$7$F$3$l$r9T$C$F$[$7$$!#(B
$B%G%P%C%,$OC1$J$k@0?t$@$H;W$&$N$G!"(B
$B$I$NJQ?t$,(BLisp$B%*%V%8%'%/%H$G$"$k$+$O%=!<%9$r8+$F$[$7$$!#(B

@c To show a variable's value in Lisp syntax, first print its value, then
@c use the user-defined GDB command @code{pr} to print the Lisp object in
@c Lisp syntax.  (If you must use another debugger, call the function
@c @code{debug_print} with the object as an argument.)  The @code{pr}
@c command is defined by the file @file{.gdbinit}, and it works only if you
@c are debugging a running process (not with a core dump).
$BJQ?t$NCM$r(BLisp$B$N5-K!$G<($9$K$O!"$^$:!"$=$NCM$r%W%j%s%H$7$F$+$i!"(B
GDB$B$N%f!<%6!<Dj5A%3%^%s%I(B@code{pr}$B$r;H$C$F(BLisp$B%*%V%8%'%/%H$r(BLisp$B$N5-K!$G(B
$BI=<($5$;$k!#(B
$B!JJL$N%G%P%C%,$r;H$o$J$1$l$P$J$i$J$$>l9g$O!"(B
$B%*%V%8%'%/%H$r0z?t$H$7$F4X?t(B@code{debug_print}$B$r8F$S=P$9!K!#(B
$B%3%^%s%I(B@code{pr}$B$O!"%U%!%$%k(B@file{.gdbinit}$B$GDj5A$5$l$F$*$j!"(B
$B!J%3%"%@%s%W$G$O$J$/!K<B9TCf$N%W%m%;%9$r%G%P%C%0$9$k$H$-$@$1;H$($k!#(B

@c To make Lisp errors stop Emacs and return to GDB, put a breakpoint at
@c @code{Fsignal}.
Lisp$B$G%(%i!<$,H/@8$7$?$H$-$K(BEmacs$B$rCfCG$7$F(BGDB$B$KLa$k$h$&$K$9$k$K$O!"(B
@code{Fsignal}$B$K%V%l!<%/%]%$%s%H$r@_Dj$9$k!#(B

@c To find out which Lisp functions are running, using GDB, move up the
@c stack, and each time you get to a frame for the function
@c @code{Ffuncall}, type these GDB commands:
$B$I$N(BLisp$B4X?t$,<B9TCf$+$rD4$Y$k$K$O!"(BGDB$B$N>l9g!"(B
$B%9%?%C%/>e$r>e$K0\F0$7$F$$$-!"4X?t(B@code{Ffuncall}$B$N%U%l!<%`$KE~C#$9$k$4$H$K!"(B
$B$D$.$N(BGDB$B%3%^%s%I$r<B9T$9$k!#(B

@example
p *args
pr
@end example

@noindent
@c To print the first argument that the function received, use these
@c commands:
$B4X?t$,<u$1<h$C$?:G=i$N0z?t$r=PNO$9$k$K$O!"$D$.$N$h$&$K$9$k!#(B

@example
p args[1]
pr
@end example

@noindent
@c You can print the other arguments likewise.  The argument @code{nargs}
@c of @code{Ffuncall} says how many arguments @code{Ffuncall} received;
@c these include the Lisp function itself and the arguments for that
@c function.
2$BHVL\0J9_$N0z?t$G$bF1MM$K=PNO$G$-$k!#(B
@code{Ffuncall}$B$N0z?t(B@code{nargs}$B$O!"(B
@code{Ffuncall}$B$,<u$1<h$C$?0z?t$N8D?t$rI=$9!#(B
$B$3$N8D?t$O!"(BLisp$B4X?t<+?H$H$=$N4X?t$KBP$9$k0z?t$H$r9g$o$;$??t!#(B

@c The file @file{.gdbinit} defines several other commands that are useful
@c for examining the data types and contents of Lisp objects.  Their names
@c begin with @samp{x}.  These commands work at a lower level than
@c @code{pr}, and are less convenient, but they may work even when
@c @code{pr} does not, such as when debugging a core dump or when Emacs has
@c had a fatal signal.
$B%U%!%$%k(B@file{.gdbinit}$B$O!"(B
$B%G!<%?%?%$%W$d(BLisp$B%*%V%8%'%/%H$NCf?H$rD4$Y$k$N$KLrN)$D%3%^%s%IN`$rDj5A$9$k!#(B
$B$=$l$i$N%3%^%s%I$NL>A0$O(B@samp{x}$B$G;O$^$k!#(B
$B$3$l$i$N%3%^%s%I$O(B@code{pr}$B$h$j2<0L$N%l%Y%k$GF0:n$7;H$$Fq$$$,!"(B
$B%3%"%@%s%W$r%G%P%C%/$7$?$j!"(B
Emacs$B$,CWL?E*$J%7%0%J%k$r<uM}$7$?$H$-$N$h$&$K(B
@code{pr}$B$,$&$^$/F0$+$J$$$H$-$G$b;H$($k!#(B

@item
@c If the symptom of the bug is that Emacs fails to respond, don't assume
@c Emacs is ``hung''---it may instead be in an infinite loop.  To find out
@c which, make the problem happen under GDB and stop Emacs once it is not
@c responding.  (If Emacs is using X Windows directly, you can stop Emacs
@c by typing @kbd{C-z} at the GDB job.)  Then try stepping with
@c @samp{step}.  If Emacs is hung, the @samp{step} command won't return.
@c If it is looping, @samp{step} will return.
$B%P%0$N>I>u$,(BEmacs$B$,1~Ez$7$J$/$J$k$H$$$&$b$N$G$b!"(B
Emacs$B$,!X%O%s%0!Y$7$?!J8G$^$C$?!K$H9M$($F$O$$$1$J$$!#(B
$BL58B%k!<%W$KF~$C$F$$$k$N$+$b$7$l$J$$!#(B
$B$I$A$i$G$"$k$+$rD4$Y$k$K$O!"(B
GDB$B$N$b$H$G%P%0$r:F8=$5$;!"1~Ez$7$J$/$J$C$?$H$3$m$G(BEmacs$B$r;_$a$k!#(B
$B!J(BEmacs$B$,(BX$B%&%#%s%I%&%7%9%F%`$rD>@\;H$C$F$$$k>l9g$O!"(B
GDB$B$N%8%g%V$KBP$7$F(B@kbd{C-z}$B$rBG$F$P(BEmacs$B$r;_$a$i$l$k!K!#(B
$B$=$7$F!"%3%^%s%I(B@samp{step}$B$G(B1$B%9%F%C%W$:$D<B9T$r;n$_$k!#(B
$B8G$^$C$F$$$k$N$J$i%3%^%s%I(B@samp{step}$B$+$iLa$C$F$3$J$$!#(B
$B%k!<%W$7$F$$$k$J$i(B@samp{step}$B$+$iLa$C$F$/$k!#(B

@c If this shows Emacs is hung in a system call, stop it again and examine
@c the arguments of the call.  In your bug report, state exactly where in
@c the source the system call is, and what the arguments are.
$B$3$&$7$FD4$Y$?7k2L!"(BEmacs$B$,%7%9%F%`%3!<%k$NCf$G8G$^$C$F$$$k$H$o$+$C$?$i!"(B
Emacs$B$r:FEY;_$a$F!"%7%9%F%`%3!<%k$N0z?t$rD4$Y$k!#(B
$B$=$7$F%P%0%l%]!<%H$K$O!"%=!<%9Cf$G$N%7%9%F%`%3!<%k$N@53N$J0LCV$H!"(B
$B0z?t$,2?$@$C$?$+$r@53N$K5-F~$9$k!#(B

@c If Emacs is in an infinite loop, please determine where the loop starts
@c and ends.  The easiest way to do this is to use the GDB command
@c @samp{finish}.  Each time you use it, Emacs resumes execution until it
@c exits one stack frame.  Keep typing @samp{finish} until it doesn't
@c return---that means the infinite loop is in the stack frame which you
@c just tried to finish.
Emacs$B$,L58B%k!<%W$7$F$$$k$N$J$i!"%k!<%W$N;O$^$j$H=*$j$rD4$Y$k!#(B
$B$b$C$H$b4JC1$K$3$l$rD4$Y$k$K$O!"(BGDB$B$N%3%^%s%I(B@samp{finish}$B$r;H$&!#(B
$B$3$N%3%^%s%I$r;H$&$?$S$K!"(B1$B$D$N%9%?%C%/%U%l!<%`$+$iH4$1$k$^$G(B
Emacs$B$O<B9T$r7QB3$9$k!#(B
$BLa$C$F$3$J$/$J$k$^$G!"7+$jJV$7(B@samp{finish}$B$rBG$D!#(B
$BLa$C$F$3$J$$$N$O!"$=$N%U%l!<%`$GL58B%k!<%W$,5/$3$C$F$$$k$+$i$G$"$k!#(B

@c Stop Emacs again, and use @samp{finish} repeatedly again until you get
@c @emph{back to} that frame.  Then use @samp{next} to step through that
@c frame.  By stepping, you will see where the loop starts and ends.  Also
@c please examine the data being used in the loop and try to determine why
@c the loop does not exit when it should.  Include all of this information
@c in your bug report.
$B$3$3$G(BEmacs$B$r:FEYDd;_$7!"(B
$BLa$C$F$3$J$/$J$C$?%U%l!<%`$K(B@emph{$B$A$g$&$ILa$k(B}$B$^$G!"(B
$B7+$jJV$7(B@samp{finish}$B$r;H$&!#(B
$B$D$.$K!"(B@samp{next}$B$r;H$C$F$=$N%U%l!<%`Fb$G(B1$B%9%F%C%W$:$D<B9T$9$k!#(B
$B$3$&$9$l$P!"%k!<%W$,$I$3$G;O$^$j$I$3$G=*$k$+$o$+$k!#(B
$B$5$i$K!"%k!<%WFb$G;H$o$l$F$$$k%G!<%?$rD4$Y$F!"(B
$B%k!<%W$,=*$k$Y$-$H$3$m$G$J$<=*$i$J$$$+$rDI5a$7$F$_$F$[$7$$!#(B
$B$3$l$i$N>pJs$9$Y$F$r!"%P%0%l%]!<%H$K4^$a$k!#(B
@end itemize

@c Here are some things that are not necessary in a bug report:
$B0J2<$K$O!"%P%0%l%]!<%H$KI,MW$J$$$b$N$r$"$2$F$*$-$^$9!#(B

@itemize @bullet
@item
@c A description of the envelope of the bug---this is not necessary for a
@c reproducible bug.
$B%P%0$N@85/>r7o$K4X$9$k5-=R!#(B
$B:F8=2DG=$J%P%0$KBP$7$F$OITMW!#(B

@c Often people who encounter a bug spend a lot of time investigating
@c which changes to the input file will make the bug go away and which
@c changes will not affect it.
$B%P%0$K=P2q$C$??M$O$7$P$7$P!"F~NO$r$I$&JQ$($k$H%P%0$,=P$J$/$J$k$H$+!"(B
$B$"$k$$$O!"AjJQ$o$i$:=P$k$H$$$C$?$3$H$rC55a$9$k$N$K;~4V$r$+$1$k!#(B

@c This is often time-consuming and not very useful, because the way we
@c will find the bug is by running a single example under the debugger with
@c breakpoints, not by pure deduction from a series of examples.  You might
@c as well save time by not searching for additional examples.
$B$3$l$O;~4V$,$+$+$k$o$j$K$O!"Lr$KN)$?$J$$!#(B
$B$H$$$&$N$O!"J]<i%A!<%`$,%G%P%C%0$r9T$&$H$-$K$O!"(B
$B%G%P%C%,$N$b$H$G%V%l!<%/%]%$%s%H$r@_Dj$7$J$,$i%P%0$N=P$k(B1$B$D$NNc$r(B
$B<B9T$9$k$N$G$"$C$F!"2?DL$j$b$NNc$+$i5"G<E*$K?dO@$9$k$o$1$G$O$J$$!#(B
$B$@$+$i!"JL$NNc$rC5$9$N$K;~4V$r$+$1$?$j$7$J$$$G$[$7$$!#(B

@c Of course, if you can find a simpler example to report @emph{instead} of
@c the original one, that is a convenience.  Errors in the output will be
@c easier to spot, running under the debugger will take less time, etc.
$B$b$A$m$s!"$b$H$NNc$N(B@emph{$B$+$o$j$K(B}$B;H$($k$b$C$H4JC1$JNc$,$_$D$+$l$P!"(B
$B$=$l$OLr$KN)$D!#(B
$B4JC1$JNc$J$i!"=PNOCf$N%(%i!<$b$_$D$1$d$9$/$J$j!"(B
$B%G%P%C%,$r;H$C$F<B9T$9$k$K$bC;$$;~4V$G$9$`!#(B

@c However, simplification is not vital; if you can't do this or don't have
@c time to try, please report the bug with your original test case.
$B$?$@$7!"C1=c2=$OI,?\$G$O$J$$!#(B
$B$b$7C1=c2=$G$-$J$+$C$?$j!"C1=c2=$9$k;~4V$,$J$1$l$P!"(B
$B$b$H$NNc$N$^$^$G$h$$$N$G!"%P%0%l%]!<%H$r=P$7$F$[$7$$!#(B

@item
@c A system-call trace of Emacs execution.
Emacs$B<B9T$N%7%9%F%`%3!<%k%H%l!<%9(B

@c System-call traces are very useful for certain special kinds of
@c debugging, but in most cases they give little useful information.  It is
@c therefore strange that many people seem to think that @emph{the} way to
@c report information about a crash is to send a system-call trace.  Perhaps
@c this is a habit formed from experience debugging programs that don't
@c have source code or debugging symbols.
$B$"$kFCJL$J<oN`$N%P%0$K$D$$$F$O!"%7%9%F%`%3!<%k%H%l!<%9$OHs>o$KLrN)$D$,!"(B
$BB?$/$N>l9g$O$[$H$s$IM-MQ$J>pJs$OF@$i$l$J$$!#(B
$B$7$?$,$C$F!"B?$/$N?M$,%7%9%F%`%3!<%k$N%H%l!<%9$3$=%/%i%C%7%e$K(B
$B4X$9$k>pJs$rJs9p$9$k$N$K7g$+$;$J$$$b$N$@$H;W$C$F$$$k$i$7$$$N$O!"(B
$BIT;W5D$G$"$k!#(B
$B$3$l$O$?$V$s!"%=!<%9%3!<%I$d%G%P%C%0MQ%7%s%\%k$N$J$$%W%m%0%i%`$r(B
$B%G%P%C%0$7$?7P83$+$i@8$^$l$?=,47$@$m$&!#(B

@c In most programs, a backtrace is normally far, far more informative than
@c a system-call trace.  Even in Emacs, a simple backtrace is generally
@c more informative, though to give full information you should supplement
@c the backtrace by displaying variable values and printing them as Lisp
@c objects with @code{pr} (see above).
$B$[$H$s$I$N%W%m%0%i%`$G$O!"%7%9%F%`%3!<%k$N%H%l!<%9$h$j!"(B
$B%P%C%/%H%l!<%9$N$[$&$,$:$C$H$:$C$HLr$KN)$D!#(B
Emacs$B$G$5$(!"C1=c$J%P%C%/%H%l!<%9$N$[$&$,M-MQ$G$"$k!#(B
$B$7$+$7!"==J,$J>pJs$rDs6!$9$k$K$O!"%P%C%/%H%l!<%9$NJd5-$H$7$F!"(B
$BJQ?t$NCM$rI=<($7(B@code{pr}$B$G(BLisp$B%*%V%8%'%/%H$H$7$F$bI=<($9$k!J>e5-;2>H!K!#(B

@item
@c A patch for the bug.
$B%P%0$KBP$9$k=$@5!#(B

@c A patch for the bug is useful if it is a good one.  But don't omit the
@c other information that a bug report needs, such as the test case, on the
@c assumption that a patch is sufficient.  We might see problems with your
@c patch and decide to fix the problem another way, or we might not
@c understand it at all.  And if we can't understand what bug you are
@c trying to fix, or why your patch should be an improvement, we mustn't
@c install it.
$B%P%0$KBP$9$k=$@5$O!"$h$$IJ<A$N$b$N$J$iM-MQ$G$"$k!#(B
$B$7$+$7!"=$@5$,@5$7$$$3$H$r<($9%F%9%HNc$J$I$N(B
$B%P%0%l%]!<%H$KI,MW$J>pJs$r>J$+$J$$$G$[$7$$!#(B
$B=$@5$KLdBj$,$"$k$H$o$+$C$FJL$N$d$jJ}$G%P%0$r$D$V$9$+$b$7$l$J$$$7!"(B
$BJs9p$5$l$?=$@5$,$^$C$?$/M}2r$G$-$J$$$3$H$b$"$j$($k!#(B
$B$=$7$F!"$I$s$J%P%0$r=$@5$7$h$&$H$7$F$$$k$N$+$o$+$i$J$$!"$"$k$$$O!"(B
$B$=$N=$@5$,$J$<2~NI$K$J$k$N$+$o$+$i$J$1$l$P!"(B
$B$=$N=$@5$r:NMQ$9$k$o$1$K$$$+$J$$!#(B

@ifinfo
@c @xref{Sending Patches}, for guidelines on how to make it easy for us to
@c understand and install your patches.
$B2f!9$K$H$C$F!"FI<T$N%Q%C%A$,M}2r$7$d$9$/!"(B
$B%$%s%9%H!<%k$7$d$9$/$9$k$?$a$N;X?K$K$D$$$F$O!"(B
@pxref{Sending Patches}$B!#(B
@end ifinfo

@item
@c A guess about what the bug is or what it depends on.
$B%P%0$,2?$G$"$k$+!"$^$?2?$K0MB8$7$F$$$k$+$K$D$$$F$NM=A[!#(B

@c Such guesses are usually wrong.  Even experts can't guess right about
@c such things without first using the debugger to find the facts.
$B$3$&$$$&M=A[$O!"$?$$$F$$$O$^$A$,$C$F$$$k!#(B
$B@lLg2H$G$5$(!"$^$:%G%P%C%,$G;v<B$rD4$Y$J$$8B$j!"@5$7$$M=A[$O$G$-$J$$!#(B
@end itemize

@node Sending Patches
@c @subsection Sending Patches for GNU Emacs
@subsection GNU Emacs$B$KBP$9$k=$@5$rAw$k(B

@c @cindex sending patches for GNU Emacs
@c @cindex patches, sending
@cindex GNU Emacs$B$KBP$9$k=$@5$rAw$k(B
@cindex $B=$@5$rAw$k(B
@c   If you would like to write bug fixes or improvements for GNU Emacs,
@c that is very helpful.  When you send your changes, please follow these
@c guidelines to make it easy for the maintainers to use them.  If you
@c don't follow these guidelines, your information might still be useful,
@c but using it will take extra work.  Maintaining GNU Emacs is a lot of
@c work in the best of circumstances, and we can't keep up unless you do
@c your best to help.
GNU Emacs$B$KBP$9$k2~NI$dCn<h$j$N$?$a$N=$@5$rAw$m$&$H$$$&$3$H$G$"$l$P!"(B
$B$*$*$$$K=u$+$j$^$9!#(B
$B=$@5$rAw$k$K$"$?$C$F$O!"J]<i%A!<%`$,$=$l$rLrN)$F$d$9$$$h$&$K!"(B
$B0J2<$N;X?K$K=>$C$F$/$@$5$$!#(B
$B$5$b$J$$$H!"Aw$i$l$?>pJs$OM-MQ$G$"$C$F$b!"(B
$BLrN)$F$k$K$OM>J,$J:n6H$,I,MW$K$J$j$^$9!#(B
GNU Emacs$B$NJ]<i$O:GA1$N4D6-$G$d$C$F$b<j4V$N$+$+$k;E;v$G$9$+$i!"(B
$B<j=u$1$7$F$$$?$@$/$K$7$F$b==J,$JG[N8$,I,MW$J$N$G$9!#(B

@itemize @bullet
@item
@c Send an explanation with your changes of what problem they fix or what
@c improvement they bring about.  For a bug fix, just include a copy of the
@c bug report, and explain why the change fixes the bug.
$B$=$N=$@5$,$I$N$h$&$JLdBj$r2r7h$9$k$b$N$+!"(B
$B$^$?$O$I$N$h$&$J2~A1$r$b$?$i$9$b$N$J$N$+$N@bL@$rAw$C$F$[$7$$!#(B
$B%P%0$KBP$9$k=$@5$N>l9g$O!"%P%0%l%]!<%H$N%3%T!<$H!"(B
$B$J$<$3$N=$@5$G%P%0$,<h$l$k$N$+$N@bL@$r4^$a$k!#(B

@c (Referring to a bug report is not as good as including it, because then
@c we will have to look it up, and we have probably already deleted it if
@c we've already fixed the bug.)
$B!J%P%0%l%]!<%H$X$N%]%$%s%?$r<($9$h$j$b!"(B
$B%P%0%l%]!<%H$N%3%T!<$r4^$a$k$[$&$,K>$^$7$$!#(B
$B$H$$$&$N$O!"%]%$%s%?$@$H%P%0%l%]!<%H$rC5$9I,MW$,$"$k$7!"(B
$B$=$N%P%0$rD>$7=*$($F$$$k$H!"%P%0%l%]!<%H$r>C$7$F$7$^$C$F$$$k$+$b$7$l$J$$!#!K(B

@item
@c Always include a proper bug report for the problem you think you have
@c fixed.  We need to convince ourselves that the change is right before
@c installing it.  Even if it is correct, we might have trouble
@c understanding it if we don't have a way to reproduce the problem.
$B=$@5$7$?$H;W$&LdBj$KBP1~$7$?E,@Z$J%P%0%l%]!<%HA4BN$r$D$M$K4^$a$F$[$7$$!#(B
$BJ]<i%A!<%`$N$[$&$G$b=$@5$rE,MQ$9$k$^$($K$=$NJQ99$,E,@Z$J$b$N$G$"$k$3$H$r(B
$B3N?.$9$kI,MW$,$"$k!#(B
$B$?$H$(=$@5$,@5$7$$$b$N$G$"$C$F$b!"$b$H$NLdBj$r:F8=$9$kJ}K!$,$J$$$H!"(B
$B=$@5FbMF$r@5$7$/M}2r$G$-$J$$$+$b$7$l$J$$!#(B

@item
@c Include all the comments that are appropriate to help people reading the
@c source in the future understand why this change was needed.
$B>-Mh$=$N%=!<%9$rFI$`$9$Y$F$N?M$K!"$=$NJQ99$,$J$<I,MW$@$C$?$+(B
$BM}2r$9$k$N$r=u$1$k$KB-$k$@$1$N%3%a%s%H$r%=!<%9$KF~$l$k!#(B

@item
@c Don't mix together changes made for different reasons.
@c Send them @emph{individually}.
$B0[$J$kM}M3$K4p$E$/JQ99$r:.$<$J$$!#(B
$B$"$/$^$G$b(B@emph{$BJL!9$K(B}$BAw$k!#(B

@c If you make two changes for separate reasons, then we might not want to
@c install them both.  We might want to install just one.  If you send them
@c all jumbled together in a single set of diffs, we have to do extra work
@c to disentangle them---to figure out which parts of the change serve
@c which purpose.  If we don't have time for this, we might have to ignore
@c your changes entirely.
$B0[$J$kM}M3$K4p$E$$$F(B2$B$D$NJQ99$r9T$C$?>l9g!"(B
$B$=$NN>J}$r:NMQ$9$k$3$H$O$J$$$@$m$&!#(B
$B$I$A$i$+0lJ}$@$1$r:NMQ$9$k$+$b$7$l$J$$!#(B
$B$b$7$=$l$i$r$$$C$7$g$/$?$K(B1$B$D$N(Bdiff$B$K$7$F$7$^$&$H!"(B
$B$=$l$rJ,N%$9$k$?$a$KM>7W$J:n6H$,I,MW$K$J$k!#(B
$B$I$NItJ,$NJQ99$,$I$A$i$NL\E*$KBP1~$7$F$$$k$N$+D4$Y$kI,MW$,$"$k!#(B
$B$=$N;~4V$r3d$1$J$$$H!"$=$NJQ99$r$^$C$?$/(B
$B:NMQ$7$J$$$H$$$&$3$H$K$b$J$j$+$M$J$$!#(B

@c If you send each change as soon as you have written it, with its own
@c explanation, then two changes never get tangled up, and we can consider
@c each one properly without any extra work to disentangle them.
$B$=$l$>$l$NJQ99$r9T$C$F$9$0$K!"JL8D$K!"@bL@$rIU$1$FAw$C$F$b$i$($l$P!"(B
2$B$D$NJQ99$,0l=o$K$J$k$J$I$H$$$&$3$H$O$J$$$7!"(B
$B$=$l$>$l$NJQ99$rJ,N%$9$k$J$I$NM>7W$J:n6H$r$;$:$KE,@Z$K9MN8$G$-$k!#(B

@item
@c Send each change as soon as that change is finished.  Sometimes people
@c think they are helping us by accumulating many changes to send them all
@c together.  As explained above, this is absolutely the worst thing you
@c could do.
$B$=$l$>$l$NJQ99$O40@.$7$?$i$9$0$KAw$C$F$[$7$$!#(B
$B$H$-$I$-!"B?$/$NJQ99$rN/$a$F$*$$$F$^$H$a$FAw$C$?$[$&$,(B
$B$$$$$H;W$C$F$$$k?M$K=P2q$&!#(B
$B>e$G@bL@$7$?$h$&$K!"$=$l$O:G0-$N$d$jJ}!#(B

@c Since you should send each change separately, you might as well send it
@c right away.  That gives us the option of installing it immediately if it
@c is important.
$B$=$l$>$l$NJQ99$OJL8D$KAw$k$Y$-$J$N$G!"JQ99$r9T$C$?$i$9$0$KAw$l$k$O$:!#(B
$B$=$&$9$l$P!"J]<i%A!<%`$N$[$&$G$=$NJQ99$,=EMW$J$b$N$@$H(B
$BH=CG$7$?$i$9$0<h$jF~$l$k$3$H$,$G$-$k!#(B

@item
@c Use @samp{diff -c} to make your diffs.  Diffs without context are hard
@c to install reliably.  More than that, they are hard to study; we must
@c always study a patch to decide whether we want to install it.  Unidiff
@c format is better than contextless diffs, but not as easy to read as
@c @samp{-c} format.
diff$B%U%!%$%k$r:n$k$H$-$K$O!"(B@samp{diff -c}$B$r;H$&!#(B
$B%3%s%F%-%9%H(Bdiff$B$G$J$$(Bdiff$B%U%!%$%k$O@5$7$/E,MQ$9$k$N$,Fq$7$$!#(B
$B$=$l0J>e$K!"D4$Y$k$N$b$?$$$X$s!#(B
$BI,$:J]<i%A!<%`$N?M4V$,=$@5$rE,MQ$9$k$+$I$&$+8!F$$9$k!#(B
@samp{-u}$B7A<0$O9THV9f$@$1$N(Bdiff$B$h$j$O$^$7$@$,!"(B
$B$$$A$P$sFI$_$d$9$$$N$O(B@samp{-c}$B7A<0!#(B

@c If you have GNU diff, use @samp{diff -c -F'^[_a-zA-Z0-9$]+ *('} when
@c making diffs of C code.  This shows the name of the function that each
@c change occurs in.
$B$b$7(BGNU diff$B$r;H$C$F$$$k$N$J$i!"(BC$B$N%3!<%I$N(Bdiff$B$r:n$k$H$-$K$O(B
@samp{diff -c -F'^[_a-zA-Z0-9$]+ *('}$B$r;H$&!#(B
$B$3$&$9$k$H!"JQ99$5$l$k3F4X?t$NL>A0$,0l=o$KI=<($5$l$k!#(B

@item
@c Avoid any ambiguity as to which is the old version and which is the new.
@c Please make the old version the first argument to diff, and the new
@c version the second argument.  And please give one version or the other a
@c name that indicates whether it is the old version or your new changed
@c one.
$B$I$C$A$,8E$$HG$G$I$C$A$,?7$7$$HG$+[#Kf$5$,$J$$$h$&$K$9$k!#(B
diff$B%3%^%s%I$NBh(B1$B0z?t$K8E$$%U%!%$%k!"Bh(B2$B0z?t$K?7$7$$%U%!%$%k$r;XDj$7$F(B
diff$B%U%!%$%k$r:n@.$9$k!#(B
$B$=$7$F!"$=$l$>$l$N%U%!%$%kL>$r8+$l$P$I$C$A$,8E$$HG$G$I$C$A$,(B
$B?7$7$$HG$+$o$+$k$h$&$K%U%!%$%kL>$rIU$1$k!#(B

@item
@c Write the change log entries for your changes.  This is both to save us
@c the extra work of writing them, and to help explain your changes so we
@c can understand them.
$BJQ99$KBP$9$kJQ995-O?$r=q$/!#(B
$B$=$&$7$F$"$l$P!"J]<i%A!<%`$N$[$&$G=q$/;~4V$,@aLs$G$-!"(B
$BJ]<i%A!<%`$,JQ99FbMF$rM}2r$9$k<j=u$1$K$b$J$k!#(B

@c The purpose of the change log is to show people where to find what was
@c changed.  So you need to be specific about what functions you changed;
@c in large functions, it's often helpful to indicate where within the
@c function the change was.
$BJQ995-O?$NL\E*$O!"?M$,FI$s$G$I$3$,JQ$o$C$?$+$o$+$k$h$&$K$9$k$3$H!#(B
$B$@$+$i!"$I$N4X?t$rJQ99$7$?$+6qBNE*$K=q$/!#(B
$BBg$-$$4X?t$N>l9g$O!"4X?t$NCf$N$I$N2U=j$rJQ99$7$?$+$b=q$$$F$"$k$H=u$+$k!#(B

@c On the other hand, once you have shown people where to find the change,
@c you need not explain its purpose in the change log.  Thus, if you add a
@c new function, all you need to say about it is that it is new.  If you
@c feel that the purpose needs explaining, it probably does---but put the
@c explanation in comments in the code.  It will be more useful there.
$B$=$NH?LL!"$I$3$,JQ99$5$l$?$+$o$+$k$h$&$K$5$($J$C$F$$$l$P!"(B
$BJQ99$NL\E*$OJQ995-O?$G@bL@$9$kI,MW$O$J$$!#(B
$B$?$H$($P!"?7$7$$4X?t$rDI2C$7$?$N$G$"$l$P!"(B
$B$=$N4X?t$,?7$7$$$H$$$&$3$H$@$1$r=q$1$P==J,!#(B
$BL\E*$r@bL@$7$?$[$&$,$h$$$H46$8$k$J$i!"$?$V$s$=$N$H$*$j$@$m$&!#(B
$B$7$+$7!"@bL@$O%3!<%ICf$N%3%a%s%H$K=q$/!#(B
$B$=$N$[$&$,Lr$KN)$D!#(B

@c Please read the @file{ChangeLog} files in the @file{src} and @file{lisp}
@c directories to see what sorts of information to put in, and to learn the
@c style that we use.  If you would like your name to appear in the header
@c line, showing who made the change, send us the header line.
@c @xref{Change Log}.
$B%G%#%l%/%H%j(B@file{src}$B$H%G%#%l%/%H%j(B@file{lisp}$B$N(B
$B%U%!%$%k(B@file{ChangeLog}$B$rD/$a$F!"$I$N$h$&$J>pJs$rF~$l$k$+$H$+!"(B
$B$I$N$h$&$J%9%?%$%k$G=q$/$+$N;29M$K$7$F$[$7$$!#(B
$BC/$,JQ99$7$?$+$o$+$k$h$&$K<+J,$NL>A0$r%X%C%@$N9T$K5-O?$7$?$$$J$i!"(B
$B%X%C%@9T$bAw$k$3$H!#(B

@item
@c When you write the fix, keep in mind that we can't install a change that
@c would break other systems.  Please think about what effect your change
@c will have if compiled on another type of system.
$B=$@5$r9T$&$K$"$?$C$F$O!"B>$N%7%9%F%`$GF0$+$J$/$J$k$h$&$JJQ99$O(B
$B:NMQ$G$-$J$$$H$$$&$3$H$r>5CN$7$F$*$$$F$[$7$$!#(B
$B<+J,$,9T$&JQ99$,!"B>$N<oN`$N%7%9%F%`$K$*$$$F$O(B
$B$I$N$h$&$J1F6A$r$b$?$i$9$+$K$D$$$F=ON8$7$F$[$7$$!#(B

@c Sometimes people send fixes that @emph{might} be an improvement in
@c general---but it is hard to be sure of this.  It's hard to install
@c such changes because we have to study them very carefully.  Of course,
@c a good explanation of the reasoning by which you concluded the change
@c was correct can help convince us.
$B$H$-$I$-!"$*$*$`$M2~NI$K$J$k(B@emph{$B$+$b(B}$B$7$l$J$$$,!"(B
$B$O$C$-$j2~NI$@$H$O$$$$$,$?$$$h$&$JJQ99$rAw$C$F$/$k?M$,$$$k!#(B
$B$=$N$h$&$JJQ99$O!"$-$o$a$F?5=E$K8!F$$7$J$1$l$P$J$i$J$$$N$G!"(B
$B:NMQ$9$k$N$OFq$7$$!#(B
$B$b$A$m$s!"$"$J$?$,$I$N$h$&$JM}M3$G$=$NJQ99$,@5$7$$$N$+$h$$@bL@$r(B
$B=q$$$F$/$l$l$P!"J]<i%A!<%`$,$=$l$rM}2r$9$k=u$1$K$J$k!#(B

@c The safest changes are changes to the configuration files for a
@c particular machine.  These are safe because they can't create new bugs
@c on other machines.
$B$b$C$H$b0BA4$JJQ99$O!"FCDj$N%^%7%s$N9=@.%U%!%$%k$KBP$9$kJQ99!#(B
$B$=$l$,0BA4$@$H$$$&M}M3$O!"(B
$B$=$NJQ99$,B>$N%^%7%s$K$*$$$FLdBj$r0z$-5/$3$9$3$H$O$"$j$($J$$$+$i!#(B

@c Please help us keep up with the workload by designing the patch in a
@c form that is clearly safe to install.
$B=$@5$r:NMQ$7$F$b0BA4$@$H$O$C$-$j$o$+$k7A$K@_7W$9$k$3$H$G!"(B
$BJ]<i%A!<%`$NO+NO$r7Z8:$G$-$k!#(B
@end itemize

@node Contributing, Service, Bugs, Top
@c @section Contributing to Emacs Development
@section Emacs$B$N3+H/$K9W8%$9$k$K$O(B

@c If you would like to help pretest Emacs releases to assure they work
@c well, or if you would like to work on improving Emacs, please contact
@c the maintainers at @code{bug-gnu-emacs@@gnu.org}.  A pretester
@c should be prepared to investigate bugs as well as report them.  If you'd
@c like to work on improving Emacs, please ask for suggested projects or
@c suggest your own ideas.
Emacs$B$N%W%l%F%9%HHG$,@5$7$/F0:n$9$k$3$H$N3NG'$r<j=u$1$7$?$+$C$?$j!"(B
Emacs$B$N2~NI:n6H$K2C$o$j$?$1$l$P!"(B
@code{bug-gun-emacs@@gnu.org}$B$NJ]<i%A!<%`$KO"Mm$7$F$/$@$5$$!#(B
$B%W%l%F%9%H;22C<T$O!"%P%0$rJs9p$9$k$@$1$G$J$/!"%P%0$rC5$9$3$H$bMW5a$5$l$^$9!#(B
Emacs$B$N2~NI$K2C$o$j$?$1$l$P!"J]<i%A!<%`$K%W%m%8%'%/%H$N<(:6$r5a$a$k$+!"(B
$B$"$J$?$N%"%$%G%"$rDs0F$7$F$/$@$5$$!#(B

@c If you have already written an improvement, please tell us about it.  If
@c you have not yet started work, it is useful to contact
@c @code{bug-gnu-emacs@@gnu.org} before you start; it might be
@c possible to suggest ways to make your extension fit in better with the
@c rest of Emacs.
$B$9$G$K2~NI$7$?%3!<%I$r=q$$$F$7$^$C$?$N$J$i!"$=$l$K$D$$$F65$($F$/$@$5$$!#(B
$B$^$@:n6H$r;O$a$F$$$J$$$N$J$i!";O$a$k$^$($K(B
@code{bug-gnu-emacs@@gnu.org}$B$KO"Mm$7$?$[$&$,$h$$$G$9!#(B
$B$=$&$9$l$P!"(BEmacs$B$N;D$j$NItJ,$H$h$/E,9g$9$k7A$G(B
$B3HD%$r9T$&$K$O$I$&$7$?$i$h$$$+$N%R%s%H$,$b$i$($k$G$7$g$&!#(B

@node Service, Command Arguments, Contributing, Top
@c @section How To Get Help with GNU Emacs
@section GNU Emacs$B$K4X$9$k=u8@$rF@$k$K$O(B

@c If you need help installing, using or changing GNU Emacs, there are two
@c ways to find it:
GNU Emacs$B$r%$%s%9%H!<%k$7$?$j!";H$C$?$j!"JQ99$7$?$j$9$k$&$($G<j=u$1$,I,MW$J$i!"(B
2$B$D$NJ}K!$,$"$j$^$9!#(B

@itemize @bullet
@item
@c Send a message to the mailing list
@c @code{help-gnu-emacs@@gnu.org}, or post your request on
@c newsgroup @code{gnu.emacs.help}.  (This mailing list and newsgroup
@c interconnect, so it does not matter which one you use.)
$B%a%$%j%s%0%j%9%H(B@code{help-gnu-emacs@@gnu.org}$B$K%a%C%;!<%8$rAw$k$+!"(B
$B%K%e!<%9%0%k!<%W(B@code{gnu.emacs.help}$B$KEj9F$9$k!#(B
$B!J$3$l$i$N%a%$%j%s%0%j%9%H$H%K%e!<%9%0%k!<%W$OAj8_>h$jF~$l$7$F$$$k$N$G!"(B
$B$I$A$i$r;H$C$F$b$+$^$o$J$$!#!K(B

@item
@c Look in the service directory for someone who might help you for a fee.
@c The service directory is found in the file named @file{etc/SERVICE} in the
@c Emacs distribution.
$B%5!<%S%9%G%#%l%/%H%j$G!"M-=~$G<j=u$1$7$F$/$l$k$h$&$J?M$rC5$9!#(B
$B%5!<%S%9%G%#%l%/%H%j$O!"(BEmacs$BG[I[J*$NCf$N(B
$B%U%!%$%k(B@file{etc/SERVICE}$B$K$"$k!#(B
@end itemize