annotate man/xemacs/trouble.texi @ 5157:1fae11d56ad2

redo memory-usage mechanism, add way of dynamically initializing Lisp objects -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-03-18 Ben Wing <ben@xemacs.org> * diagnose.el (show-memory-usage): Rewrite to take into account API changes in memory-usage functions. src/ChangeLog addition: 2010-03-18 Ben Wing <ben@xemacs.org> * alloc.c: * alloc.c (disksave_object_finalization_1): * alloc.c (lisp_object_storage_size): * alloc.c (listu): * alloc.c (listn): * alloc.c (Fobject_memory_usage_stats): * alloc.c (compute_memusage_stats_length): * alloc.c (Fobject_memory_usage): * alloc.c (Ftotal_object_memory_usage): * alloc.c (malloced_storage_size): * alloc.c (common_init_alloc_early): * alloc.c (reinit_alloc_objects_early): * alloc.c (reinit_alloc_early): * alloc.c (init_alloc_once_early): * alloc.c (syms_of_alloc): * alloc.c (reinit_vars_of_alloc): * buffer.c: * buffer.c (struct buffer_stats): * buffer.c (compute_buffer_text_usage): * buffer.c (compute_buffer_usage): * buffer.c (buffer_memory_usage): * buffer.c (buffer_objects_create): * buffer.c (syms_of_buffer): * buffer.c (vars_of_buffer): * console-impl.h (struct console_methods): * dynarr.c (Dynarr_memory_usage): * emacs.c (main_1): * events.c (clear_event_resource): * extents.c: * extents.c (compute_buffer_extent_usage): * extents.c (extent_objects_create): * extents.h: * faces.c: * faces.c (compute_face_cachel_usage): * faces.c (face_objects_create): * faces.h: * general-slots.h: * glyphs.c: * glyphs.c (compute_glyph_cachel_usage): * glyphs.c (glyph_objects_create): * glyphs.h: * lisp.h: * lisp.h (struct usage_stats): * lrecord.h: * lrecord.h (enum lrecord_type): * lrecord.h (struct lrecord_implementation): * lrecord.h (MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE): * lrecord.h (DEFINE_DUMPABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_FROB_BLOCK_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_SIZABLE_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_FROB_BLOCK_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_INTERNAL_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_SIZABLE_INTERNAL_LISP_OBJECT): * lrecord.h (MAKE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_LISP_OBJECT): * lrecord.h (DEFINE_DUMPABLE_MODULE_SIZABLE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_LISP_OBJECT): * lrecord.h (DEFINE_NODUMP_MODULE_SIZABLE_LISP_OBJECT): * lrecord.h (MAKE_MODULE_LISP_OBJECT): * lrecord.h (INIT_LISP_OBJECT): * lrecord.h (INIT_MODULE_LISP_OBJECT): * lrecord.h (UNDEF_LISP_OBJECT): * lrecord.h (UNDEF_MODULE_LISP_OBJECT): * lrecord.h (DECLARE_LISP_OBJECT): * lrecord.h (DECLARE_MODULE_API_LISP_OBJECT): * lrecord.h (DECLARE_MODULE_LISP_OBJECT): * lstream.c: * lstream.c (syms_of_lstream): * lstream.c (vars_of_lstream): * marker.c: * marker.c (compute_buffer_marker_usage): * mc-alloc.c (mc_alloced_storage_size): * mc-alloc.h: * mule-charset.c: * mule-charset.c (struct charset_stats): * mule-charset.c (compute_charset_usage): * mule-charset.c (charset_memory_usage): * mule-charset.c (mule_charset_objects_create): * mule-charset.c (syms_of_mule_charset): * mule-charset.c (vars_of_mule_charset): * redisplay.c: * redisplay.c (compute_rune_dynarr_usage): * redisplay.c (compute_display_block_dynarr_usage): * redisplay.c (compute_glyph_block_dynarr_usage): * redisplay.c (compute_display_line_dynarr_usage): * redisplay.c (compute_line_start_cache_dynarr_usage): * redisplay.h: * scrollbar-gtk.c (gtk_compute_scrollbar_instance_usage): * scrollbar-msw.c (mswindows_compute_scrollbar_instance_usage): * scrollbar-x.c (x_compute_scrollbar_instance_usage): * scrollbar.c (compute_scrollbar_instance_usage): * scrollbar.h: * symbols.c: * symbols.c (reinit_symbol_objects_early): * symbols.c (init_symbols_once_early): * symbols.c (reinit_symbols_early): * symbols.c (defsymbol_massage_name_1): * symsinit.h: * ui-gtk.c: * ui-gtk.c (emacs_gtk_object_getprop): * ui-gtk.c (emacs_gtk_object_putprop): * ui-gtk.c (ui_gtk_objects_create): * unicode.c (compute_from_unicode_table_size_1): * unicode.c (compute_to_unicode_table_size_1): * unicode.c (compute_from_unicode_table_size): * unicode.c (compute_to_unicode_table_size): * window.c: * window.c (struct window_stats): * window.c (compute_window_mirror_usage): * window.c (compute_window_usage): * window.c (window_memory_usage): * window.c (window_objects_create): * window.c (syms_of_window): * window.c (vars_of_window): * window.h: Redo memory-usage mechanism, make it general; add way of dynamically initializing Lisp object types -- OBJECT_HAS_METHOD(), similar to CONSOLE_HAS_METHOD(). (1) Create OBJECT_HAS_METHOD(), OBJECT_HAS_PROPERTY() etc. for specifying that a Lisp object type has a particular method or property. Call such methods with OBJECT_METH, MAYBE_OBJECT_METH, OBJECT_METH_OR_GIVEN; retrieve properties with OBJECT_PROPERTY. Methods that formerly required a DEFINE_*GENERAL_LISP_OBJECT() to specify them (getprop, putprop, remprop, plist, disksave) now instead use the dynamic-method mechanism. The main benefit of this is that new methods or properties can be added without requiring that the declaration statements of all existing methods be modified. We have to make the `struct lrecord_implementation' non-const, but I don't think this should have any effect on speed -- the only possible method that's really speed-critical is the mark method, and we already extract those out into a separate (non-const) array for increased cache locality. Object methods need to be reinitialized after pdump, so we put them in separate functions such as face_objects_create(), extent_objects_create() and call them appropriately from emacs.c The only current object property (`memusage_stats_list') that objects can specify is a Lisp object and gets staticpro()ed so it only needs to be set during dump time, but because it references symbols that might not exist in a syms_of_() function, we initialize it in vars_of_(). There is also an object property (`num_extra_memusage_stats') that is automatically initialized based on `memusage_stats_list'; we do that in reinit_vars_of_alloc(), which is called after all vars_of_() functions are called. `disksaver' method was renamed `disksave' to correspond with the name normally given to the function (e.g. disksave_lstream()). (2) Generalize the memory-usage mechanism in `buffer-memory-usage', `window-memory-usage', `charset-memory-usage' into an object-type- specific mechanism called by a single function `object-memory-usage'. (Former function `object-memory-usage' renamed to `total-object-memory-usage'). Generalize the mechanism of different "slices" so that we can have different "classes" of memory described and different "slices" onto each class; `t' separates classes, `nil' separates slices. Currently we have three classes defined: the memory of an object itself, non-Lisp-object memory associated with the object (e.g. arrays or dynarrs stored as fields in the object), and Lisp-object memory associated with the object (other internal Lisp objects stored in the object). This isn't completely finished yet and we might need to further separate the "other internal Lisp objects" class into two classes. The memory-usage mechanism uses a `struct usage_stats' (renamed from `struct overhead_stats') to describe a malloc-view onto a set of allocated memory (listing how much was requested and various types of overhead) and a more general `struct generic_usage_stats' (with a `struct usage_stats' in it) to hold all statistics about object memory. `struct generic_usage_stats' contains an array of 32 Bytecounts, which are statistics of unspecified semantics. The intention is that individual types declare a corresponding struct (e.g. `struct window_stats') with the same structure but with specific fields in place of the array, corresponding to specific statistics. The number of such statistics is an object property computed from the list of tags (Lisp symbols describing the statistics) stored in `memusage_stats_list'. The idea here is to allow particular object types to customize the number and semantics of the statistics where completely avoiding consing. This doesn't matter so much yet, but the intention is to have the memory usage of all objects computed at the end of GC, at the same time as other statistics are currently computed. The values for all statistics for a single type would be added up to compute aggregate values for all objects of a specific type. To make this efficient, we can't allow any memory allocation at all. (3) Create some additional functions for creating lists that specify the elements directly as args rather than indirectly through an array: listn() (number of args given), listu() (list terminated by Qunbound). (4) Delete a bit of remaining unused C window_config stuff, also unused lrecord_type_popup_data.
author Ben Wing <ben@xemacs.org>
date Thu, 18 Mar 2010 10:50:06 -0500
parents 6b0000935adc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @iftex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 @chapter Correcting Mistakes (Yours or Emacs's)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 If you type an Emacs command you did not intend, the results are often
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 mysterious. This chapter discusses how you can undo your mistake or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 recover from a mysterious situation. Emacs bugs and system crashes are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 also considered.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 @end iftex
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 @node Quitting, Lossage, Customization, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 @section Quitting and Aborting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 @cindex quitting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 @item C-g
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 Quit. Cancel running or partially typed command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 @item C-]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Abort innermost recursive editing level and cancel the command which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 invoked it (@code{abort-recursive-edit}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 @item M-x top-level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 Abort all recursive editing levels that are currently executing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 @item C-x u
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 Cancel an already-executed command, usually (@code{undo}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 There are two ways of cancelling commands which are not finished
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 executing: @dfn{quitting} with @kbd{C-g}, and @dfn{aborting} with @kbd{C-]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 or @kbd{M-x top-level}. Quitting is cancelling a partially typed command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 or one which is already running. Aborting is getting out of a recursive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 editing level and cancelling the command that invoked the recursive edit.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 @cindex quitting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 @kindex C-g
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 Quitting with @kbd{C-g} is used for getting rid of a partially typed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 command or a numeric argument that you don't want. It also stops a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 running command in the middle in a relatively safe way, so you can use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 it if you accidentally start executing a command that takes a long
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 time. In particular, it is safe to quit out of killing; either your
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 text will @var{all} still be there, or it will @var{all} be in the kill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 ring (or maybe both). Quitting an incremental search does special
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 things documented under searching; in general, it may take two
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 successive @kbd{C-g} characters to get out of a search. @kbd{C-g} works
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 by setting the variable @code{quit-flag} to @code{t} the instant
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 @kbd{C-g} is typed; Emacs Lisp checks this variable frequently and quits
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 if it is non-@code{nil}. @kbd{C-g} is only actually executed as a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 command if it is typed while Emacs is waiting for input.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 If you quit twice in a row before the first @kbd{C-g} is recognized, you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 activate the ``emergency escape'' feature and return to the shell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 @xref{Emergency Escape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 @cindex recursive editing level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 @cindex editing level, recursive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 @cindex aborting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 @findex abort-recursive-edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 @kindex C-]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 You can use @kbd{C-]} (@code{abort-recursive-edit}) to get out
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 of a recursive editing level and cancel the command which invoked it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 Quitting with @kbd{C-g} does not do this, and could not do this because it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 is used to cancel a partially typed command @i{within} the recursive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 editing level. Both operations are useful. For example, if you are in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 Emacs debugger (@pxref{Lisp Debug}) and have typed @kbd{C-u 8} to enter a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 numeric argument, you can cancel that argument with @kbd{C-g} and remain in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 the debugger.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 @findex top-level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 The command @kbd{M-x top-level} is equivalent to ``enough'' @kbd{C-]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 commands to get you out of all the levels of recursive edits that you are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 in. @kbd{C-]} only gets you out one level at a time, but @kbd{M-x top-level}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 goes out all levels at once. Both @kbd{C-]} and @kbd{M-x top-level} are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 like all other commands and unlike @kbd{C-g} in that they are effective
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 only when Emacs is ready for a command. @kbd{C-]} is an ordinary key and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 has its meaning only because of its binding in the keymap.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 @xref{Recursive Edit}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 @kbd{C-x u} (@code{undo}) is not strictly speaking a way of cancelling a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 command, but you can think of it as cancelling a command already finished
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 executing. @xref{Undo}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 @node Lossage, Bugs, Quitting, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 @section Dealing With Emacs Trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 This section describes various conditions in which Emacs fails to work,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 and how to recognize them and correct them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 * Stuck Recursive:: `[...]' in mode line around the parentheses.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 * Screen Garbled:: Garbage on the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 * Text Garbled:: Garbage in the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 * Unasked-for Search:: Spontaneous entry to incremental search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 * Emergency Escape:: Emergency escape---
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 What to do if Emacs stops responding.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 * Total Frustration:: When you are at your wits' end.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 @node Stuck Recursive, Screen Garbled, Lossage, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 @subsection Recursive Editing Levels
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 Recursive editing levels are important and useful features of Emacs, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 they can seem like malfunctions to the user who does not understand them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 If the mode line has square brackets @samp{[@dots{}]} around the parentheses
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 that contain the names of the major and minor modes, you have entered a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 recursive editing level. If you did not do this on purpose, or if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 don't understand what that means, you should just get out of the recursive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 editing level. To do so, type @kbd{M-x top-level}. This is called getting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 back to top level. @xref{Recursive Edit}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 @node Screen Garbled, Text Garbled, Stuck Recursive, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 @subsection Garbage on the Screen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 If the data on the screen looks wrong, the first thing to do is see
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 whether the text is actually wrong. Type @kbd{C-l}, to redisplay the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 entire screen. If the text appears correct after this, the problem was
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 entirely in the previous screen update.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 Display updating problems often result from an incorrect termcap entry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 for the terminal you are using. The file @file{etc/TERMS} in the Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 distribution gives the fixes for known problems of this sort.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 @file{INSTALL} contains general advice for these problems in one of its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 sections. Very likely there is simply insufficient padding for certain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 display operations. To investigate the possibility that you have this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 sort of problem, try Emacs on another terminal made by a different
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 manufacturer. If problems happen frequently on one kind of terminal but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 not another kind, the real problem is likely to be a bad termcap entry,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 though it could also be due to a bug in Emacs that appears for terminals
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 that have or lack specific features.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 @node Text Garbled, Unasked-for Search, Screen Garbled, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 @subsection Garbage in the Text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 If @kbd{C-l} shows that the text is wrong, try undoing the changes to it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 using @kbd{C-x u} until it gets back to a state you consider correct. Also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 try @kbd{C-h l} to find out what command you typed to produce the observed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 results.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 If a large portion of text appears to be missing at the beginning or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 end of the buffer, check for the word @samp{Narrow} in the mode line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 If it appears, the text is still present, but marked off-limits.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 To make it visible again, type @kbd{C-x n w}. @xref{Narrowing}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 @node Unasked-for Search, Emergency Escape, Text Garbled, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 @subsection Spontaneous Entry to Incremental Search
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 If Emacs spontaneously displays @samp{I-search:} at the bottom of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 screen, it means that the terminal is sending @kbd{C-s} and @kbd{C-q}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 according to the poorly designed xon/xoff ``flow control'' protocol. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 should try to prevent this by putting the terminal in a mode where it will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 not use flow control, or by giving it enough padding that it will never send a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 @kbd{C-s}. If that cannot be done, you must tell Emacs to expect flow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 control to be used, until you can get a properly designed terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 Information on how to do these things can be found in the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 @file{INSTALL} in the Emacs distribution.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 @node Emergency Escape, Total Frustration, Unasked-for Search, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 @subsection Emergency Escape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 Because at times there have been bugs causing Emacs to loop without
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 checking @code{quit-flag}, a special feature causes Emacs to be suspended
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 immediately if you type a second @kbd{C-g} while the flag is already set,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 so you can always get out of XEmacs. Normally Emacs recognizes and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 clears @code{quit-flag} (and quits!) quickly enough to prevent this from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 happening.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 When you resume Emacs after a suspension caused by multiple @kbd{C-g}, it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 asks two questions before going back to what it had been doing:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 Auto-save? (y or n)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 Abort (and dump core)? (y or n)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 Answer each one with @kbd{y} or @kbd{n} followed by @key{RET}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 Saying @kbd{y} to @samp{Auto-save?} causes immediate auto-saving of all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 modified buffers in which auto-saving is enabled.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 Saying @kbd{y} to @samp{Abort (and dump core)?} causes an illegal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 instruction to be executed, dumping core. This is to enable a wizard to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 figure out why Emacs was failing to quit in the first place. Execution
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 does not continue after a core dump. If you answer @kbd{n}, execution
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 does continue. With luck, Emacs will ultimately check
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 @code{quit-flag} and quit normally. If not, and you type another
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 @kbd{C-g}, it is suspended again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 If Emacs is not really hung, but is just being slow, you may invoke
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 the double @kbd{C-g} feature without really meaning to. In that case,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 simply resume and answer @kbd{n} to both questions, and you will arrive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 at your former state. Presumably the quit you requested will happen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 soon.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 The double-@kbd{C-g} feature may be turned off when Emacs is running under
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 a window system, since the window system always enables you to kill Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 or to create another window and run another program.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 @node Total Frustration,, Emergency Escape, Lossage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 @subsection Help for Total Frustration
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 @cindex Eliza
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 @cindex doctor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 If using Emacs (or something else) becomes terribly frustrating and none
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 of the techniques described above solve the problem, Emacs can still help
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 you.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 First, if the Emacs you are using is not responding to commands, type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 @kbd{C-g C-g} to get out of it and then start a new one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 @findex doctor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 Second, type @kbd{M-x doctor @key{RET}}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 The doctor will make you feel better. Each time you say something to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 the doctor, you must end it by typing @key{RET} @key{RET}. This lets the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 doctor know you are finished.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 @node Bugs,, Lossage, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 @section Reporting Bugs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 @cindex bugs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 Sometimes you will encounter a bug in Emacs. Although we cannot promise
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 we can or will fix the bug, and we might not even agree that it is a bug,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 we want to hear about bugs you encounter in case we do want to fix them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 To make it possible for us to fix a bug, you must report it. In order
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 to do so effectively, you must know when and how to do it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 @subsection When Is There a Bug
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 If Emacs executes an illegal instruction, or dies with an operating
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 system error message that indicates a problem in the program (as opposed to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 something like ``disk full''), then it is certainly a bug.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 If Emacs updates the display in a way that does not correspond to what is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 in the buffer, then it is certainly a bug. If a command seems to do the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 wrong thing but the problem corrects itself if you type @kbd{C-l}, it is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 case of incorrect display updating.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 Taking forever to complete a command can be a bug, but you must make
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 certain that it was really Emacs's fault. Some commands simply take a long
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 time. Type @kbd{C-g} and then @kbd{C-h l} to see whether the input Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 received was what you intended to type; if the input was such that you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 @var{know} it should have been processed quickly, report a bug. If you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 don't know whether the command should take a long time, find out by looking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 in the manual or by asking for assistance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 If a command you are familiar with causes an Emacs error message in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 case where its usual definition ought to be reasonable, it is probably a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 bug.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 If a command does the wrong thing, that is a bug. But be sure you know
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 for certain what it ought to have done. If you aren't familiar with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 command, or don't know for certain how the command is supposed to work,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 then it might actually be working right. Rather than jumping to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 conclusions, show the problem to someone who knows for certain.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 Finally, a command's intended definition may not be best for editing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 with. This is a very important sort of problem, but it is also a matter of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 judgment. Also, it is easy to come to such a conclusion out of ignorance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 of some of the existing features. It is probably best not to complain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 about such a problem until you have checked the documentation in the usual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 ways, feel confident that you understand it, and know for certain that what
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 you want is not available. If you are not sure what the command is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 supposed to do after a careful reading of the manual, check the index and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 glossary for any terms that may be unclear. If you still do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 understand, this indicates a bug in the manual. The manual's job is to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 make everything clear. It is just as important to report documentation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 bugs as program bugs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 If the online documentation string of a function or variable disagrees
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 with the manual, one of them must be wrong, so report the bug.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 @subsection How to Report a Bug
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 @findex emacs-version
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 When you decide that there is a bug, it is important to report it and to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 report it in a way which is useful. What is most useful is an exact
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 description of what commands you type, starting with the shell command to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 run Emacs, until the problem happens. Always include the version number
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 of Emacs that you are using; type @kbd{M-x emacs-version} to print this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 The most important principle in reporting a bug is to report @var{facts},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 not hypotheses or categorizations. It is always easier to report the facts,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 but people seem to prefer to strain to posit explanations and report
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 them instead. If the explanations are based on guesses about how Emacs is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 implemented, they will be useless; we will have to try to figure out what
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 the facts must have been to lead to such speculations. Sometimes this is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 impossible. But in any case, it is unnecessary work for us.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 For example, suppose that you type @kbd{C-x C-f /glorp/baz.ugh
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 @key{RET}}, visiting a file which (you know) happens to be rather large,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 and Emacs prints out @samp{I feel pretty today}. The best way to report
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 the bug is with a sentence like the preceding one, because it gives all the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 facts and nothing but the facts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 Do not assume that the problem is due to the size of the file and say,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 ``When I visit a large file, Emacs prints out @samp{I feel pretty today}.''
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 This is what we mean by ``guessing explanations''. The problem is just as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 likely to be due to the fact that there is a @samp{z} in the file name. If
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 this is so, then when we got your report, we would try out the problem with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 some ``large file'', probably with no @samp{z} in its name, and not find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 anything wrong. There is no way in the world that we could guess that we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 should try visiting a file with a @samp{z} in its name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 Alternatively, the problem might be due to the fact that the file starts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 with exactly 25 spaces. For this reason, you should make sure that you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 inform us of the exact contents of any file that is needed to reproduce the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 bug. What if the problem only occurs when you have typed the @kbd{C-x a l}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 command previously? This is why we ask you to give the exact sequence of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 characters you typed since starting to use Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 You should not even say ``visit a file'' instead of @kbd{C-x C-f} unless
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 you @i{know} that it makes no difference which visiting command is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 Similarly, rather than saying ``if I have three characters on the line,''
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 say ``after I type @kbd{@key{RET} A B C @key{RET} C-p},'' if that is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 the way you entered the text.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 If you are not in Fundamental mode when the problem occurs, you should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 say what mode you are in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 If the manifestation of the bug is an Emacs error message, it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 important to report not just the text of the error message but a backtrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 showing how the Lisp program in Emacs arrived at the error. To make the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 backtrace, you must execute the Lisp expression
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 @code{(setq @w{debug-on-error t})} before the error happens (that is to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 say, you must execute that expression and then make the bug happen). This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 causes the Lisp debugger to run (@pxref{Lisp Debug}). The debugger's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 backtrace can be copied as text into the bug report. This use of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 debugger is possible only if you know how to make the bug happen again. Do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 note the error message the first time the bug happens, so if you can't make
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 it happen again, you can report at least that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 Check whether any programs you have loaded into the Lisp world, including
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
335 your init file, set any variables that may affect the functioning of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
336 Emacs. @xref{Init File}. Also, see whether the problem happens in a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
337 freshly started Emacs without loading your init file (start Emacs with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
338 the @code{-q} switch to prevent loading the init file). If the problem
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
339 does @var{not} occur then, it is essential that we know the contents of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
340 any programs that you must load into the Lisp world in order to cause
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
341 the problem to occur.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 If the problem does depend on an init file or other Lisp programs that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 are not part of the standard Emacs system, then you should make sure it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 not a bug in those programs by complaining to their maintainers first.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 After they verify that they are using Emacs in a way that is supposed to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 work, they should report the bug.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 If you can tell us a way to cause the problem without visiting any files,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 please do so. This makes it much easier to debug. If you do need files,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 make sure you arrange for us to see their exact contents. For example, it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 can often matter whether there are spaces at the ends of lines, or a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 newline after the last line in the buffer (nothing ought to care whether
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 the last line is terminated, but tell that to the bugs).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 @findex open-dribble-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 @cindex dribble file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 The easy way to record the input to Emacs precisely is to write a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 dribble file; execute the Lisp expression:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 (open-dribble-file "~/dribble")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 using @kbd{Meta-@key{ESC}} or from the @samp{*scratch*} buffer just after starting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 Emacs. From then on, all Emacs input will be written in the specified
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 dribble file until the Emacs process is killed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 @findex open-termscript
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 @cindex termscript file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 For possible display bugs, it is important to report the terminal type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 (the value of environment variable @code{TERM}), the complete termcap entry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 for the terminal from @file{/etc/termcap} (since that file is not identical
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 on all machines), and the output that Emacs actually sent to the terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 The way to collect this output is to execute the Lisp expression:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 (open-termscript "~/termscript")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
382 @noindent using @kbd{Meta-@key{ESC}} or from the @samp{*scratch*} buffer
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
383 just after starting Emacs. From then on, all output from Emacs to the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
384 terminal will be written in the specified termscript file as well, until
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
385 the Emacs process is killed. If the problem happens when Emacs starts
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
386 up, put this expression into your init file so that the termscript file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
387 will be open when Emacs displays the screen for the first time.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
388 @xref{Init File}. Be warned: it is often difficult, and sometimes
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
389 impossible, to fix a terminal-dependent bug without access to a terminal
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
390 of the type that stimulates the bug.@refill
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 The newsgroup @samp{comp.emacs.xemacs} may be used for bug reports,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 other discussions and requests for assistance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394
4488
6b0000935adc Spelling fixes.
"Ville Skyttä <scop@xemacs.org>"
parents: 442
diff changeset
395 If you don't have access to this newsgroup, you can subscribe to the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 mailing list version: the newsgroup is bidirectionally gatewayed into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 the mailing list @samp{xemacs@@xemacs.org}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 To be added or removed from this mailing list, send mail to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 @samp{xemacs-request@@xemacs.org}. Do not send requests for addition
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 to the mailing list itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 The mailing lists and newsgroups are archived on our anonymous FTP server,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 @samp{ftp.xemacs.org}, and at various other archive sites around the net. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 should also check the @samp{FAQ} in @samp{/pub/xemacs} on our anonymous
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 FTP server. It provides some introductory information and help for initial
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 configuration problems.