home *** CD-ROM | disk | FTP | other *** search
/ Dream 49 / Amiga_Dream_49.iso / beos / emacs / emacs-19.34-bin / emacs-19 / info / emacs-21 < prev    next >
Encoding:
GNU Info File  |  1997-09-17  |  47.5 KB  |  1,095 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Quitting,  Next: Lossage,  Prev: Customization,  Up: Top
  6.  
  7. Quitting and Aborting
  8. =====================
  9.  
  10. `C-g'
  11.      Quit.  Cancel running or partially typed command.
  12.  
  13. `C-]'
  14.      Abort innermost recursive editing level and cancel the command
  15.      which invoked it (`abort-recursive-edit').
  16.  
  17. `ESC ESC ESC'
  18.      Either quit or abort, whichever makes sense
  19.      (`keyboard-escape-quit').
  20.  
  21. `M-x top-level'
  22.      Abort all recursive editing levels that are currently executing.
  23.  
  24. `C-x u'
  25.      Cancel a previously made change in the buffer contents (`undo').
  26.  
  27.    There are two ways of canceling commands which are not finished
  28. executing: "quitting" with `C-g', and "aborting" with `C-]' or `M-x
  29. top-level'.  Quitting cancels a partially typed command or one which is
  30. already running.  Aborting exits a recursive editing level and cancels
  31. the command that invoked the recursive edit.  (*Note Recursive Edit::.)
  32.  
  33.    Quitting with `C-g' is used for getting rid of a partially typed
  34. command, or a numeric argument that you don't want.  It also stops a
  35. running command in the middle in a relatively safe way, so you can use
  36. it if you accidentally give a command which takes a long time.  In
  37. particular, it is safe to quit out of killing; either your text will
  38. *all* still be in the buffer, or it will *all* be in the kill ring (or
  39. maybe both).  Quitting an incremental search does special things
  40. documented under searching; in general, it may take two successive
  41. `C-g' characters to get out of a search (*note Incremental Search::.).
  42.  
  43.    `C-g' works by setting the variable `quit-flag' to `t' the instant
  44. `C-g' is typed; Emacs Lisp checks this variable frequently and quits if
  45. it is non-`nil'.  `C-g' is only actually executed as a command if you
  46. type it while Emacs is waiting for input.
  47.  
  48.    If you quit with `C-g' a second time before the first `C-g' is
  49. recognized, you activate the "emergency escape" feature and return to
  50. the shell.  *Note Emergency Escape::.
  51.  
  52.    There may be times when you cannot quit.  When Emacs is waiting for
  53. the operating system to do something, quitting is impossible unless
  54. special pains are taken for the particular system call within Emacs
  55. where the waiting occurs.  We have done this for the system calls that
  56. users are likely to want to quit from, but it's possible you will find
  57. another.  In one very common case--waiting for file input or output
  58. using NFS--Emacs itself knows how to quit, but most NFS implementations
  59. simply do not allow user programs to stop waiting for NFS when the NFS
  60. server is hung.
  61.  
  62.    Aborting with `C-]' (`abort-recursive-edit') is used to get out of a
  63. recursive editing level and cancel the command which invoked it.
  64. Quitting with `C-g' does not do this, and could not do this, because it
  65. is used to cancel a partially typed command *within* the recursive
  66. editing level.  Both operations are useful.  For example, if you are in
  67. a recursive edit and type `C-u 8' to enter a numeric argument, you can
  68. cancel that argument with `C-g' and remain in the recursive edit.
  69.  
  70.    The command `ESC ESC ESC' (`keyboard-escape-quit') can either quit
  71. or abort.  This key was defined because ESC is used to "get out" in
  72. many PC programs.  It can cancel a prefix argument, clear a selected
  73. region, or get out of a Query Replace, like `C-g'.  It can get out of
  74. the minibuffer or a recursive edit, like `C-]'.  It can also get out of
  75. splitting the frame into multiple windows, like `C-x 1'.  One thing it
  76. cannot do, however, is stop a command that is running.  That's because
  77. it executes as an ordinary command, and Emacs doesn't notice it until
  78. it is ready for a command.
  79.  
  80.    The command `M-x top-level' is equivalent to "enough" `C-]' commands
  81. to get you out of all the levels of recursive edits that you are in.
  82. `C-]' gets you out one level at a time, but `M-x top-level' goes out
  83. all levels at once.  Both `C-]' and `M-x top-level' are like all other
  84. commands, and unlike `C-g', in that they take effect only when Emacs is
  85. ready for a command.  `C-]' is an ordinary key and has its meaning only
  86. because of its binding in the keymap.  *Note Recursive Edit::.
  87.  
  88.    `C-x u' (`undo') is not strictly speaking a way of canceling a
  89. command, but you can think of it as canceling a command that already
  90. finished executing.  *Note Undo::.
  91.  
  92. 
  93. File: emacs,  Node: Lossage,  Next: Bugs,  Prev: Quitting,  Up: Top
  94.  
  95. Dealing with Emacs Trouble
  96. ==========================
  97.  
  98.    This section describes various conditions in which Emacs fails to
  99. work normally, and how to recognize them and correct them.
  100.  
  101. * Menu:
  102.  
  103. * DEL Gets Help::       What to do if DEL doesn't delete.
  104. * Stuck Recursive::     `[...]' in mode line around the parentheses.
  105. * Screen Garbled::      Garbage on the screen.
  106. * Text Garbled::        Garbage in the text.
  107. * Unasked-for Search::  Spontaneous entry to incremental search.
  108. * Memory Full::         How to cope when you run out of memory.
  109. * After a Crash::       Recovering editing in an Emacs session that crashed.
  110. * Emergency Escape::    Emergency escape--
  111.                           What to do if Emacs stops responding.
  112. * Total Frustration::   When you are at your wits' end.
  113.  
  114. 
  115. File: emacs,  Node: DEL Gets Help,  Next: Stuck Recursive,  Up: Lossage
  116.  
  117. If DEL Fails to Delete
  118. ----------------------
  119.  
  120.    If you find that DEL enters Help like `Control-h' instead of
  121. deleting a character, your terminal is sending the wrong code for DEL.
  122. You can work around this problem by changing the keyboard translation
  123. table (*note Keyboard Translations::.).
  124.  
  125. 
  126. File: emacs,  Node: Stuck Recursive,  Next: Screen Garbled,  Prev: DEL Gets Help,  Up: Lossage
  127.  
  128. Recursive Editing Levels
  129. ------------------------
  130.  
  131.    Recursive editing levels are important and useful features of Emacs,
  132. but they can seem like malfunctions to the user who does not understand
  133. them.
  134.  
  135.    If the mode line has square brackets `[...]' around the parentheses
  136. that contain the names of the major and minor modes, you have entered a
  137. recursive editing level.  If you did not do this on purpose, or if you
  138. don't understand what that means, you should just get out of the
  139. recursive editing level.  To do so, type `M-x top-level'.  This is
  140. called getting back to top level.  *Note Recursive Edit::.
  141.  
  142. 
  143. File: emacs,  Node: Screen Garbled,  Next: Text Garbled,  Prev: Stuck Recursive,  Up: Lossage
  144.  
  145. Garbage on the Screen
  146. ---------------------
  147.  
  148.    If the data on the screen looks wrong, the first thing to do is see
  149. whether the text is really wrong.  Type `C-l', to redisplay the entire
  150. screen.  If the screen appears correct after this, the problem was
  151. entirely in the previous screen update.  (Otherwise, see *Note Text
  152. Garbled::.)
  153.  
  154.    Display updating problems often result from an incorrect termcap
  155. entry for the terminal you are using.  The file `etc/TERMS' in the Emacs
  156. distribution gives the fixes for known problems of this sort.
  157. `INSTALL' contains general advice for these problems in one of its
  158. sections.  Very likely there is simply insufficient padding for certain
  159. display operations.  To investigate the possibility that you have this
  160. sort of problem, try Emacs on another terminal made by a different
  161. manufacturer.  If problems happen frequently on one kind of terminal
  162. but not another kind, it is likely to be a bad termcap entry, though it
  163. could also be due to a bug in Emacs that appears for terminals that
  164. have or that lack specific features.
  165.  
  166. 
  167. File: emacs,  Node: Text Garbled,  Next: Unasked-for Search,  Prev: Screen Garbled,  Up: Lossage
  168.  
  169. Garbage in the Text
  170. -------------------
  171.  
  172.    If `C-l' shows that the text is wrong, try undoing the changes to it
  173. using `C-x u' until it gets back to a state you consider correct.  Also
  174. try `C-h l' to find out what command you typed to produce the observed
  175. results.
  176.  
  177.    If a large portion of text appears to be missing at the beginning or
  178. end of the buffer, check for the word `Narrow' in the mode line.  If it
  179. appears, the text you don't see is probably still present, but
  180. temporarily off-limits.  To make it accessible again, type `C-x n w'.
  181. *Note Narrowing::.
  182.  
  183. 
  184. File: emacs,  Node: Unasked-for Search,  Next: Memory Full,  Prev: Text Garbled,  Up: Lossage
  185.  
  186. Spontaneous Entry to Incremental Search
  187. ---------------------------------------
  188.  
  189.    If Emacs spontaneously displays `I-search:' at the bottom of the
  190. screen, it means that the terminal is sending `C-s' and `C-q' according
  191. to the poorly designed xon/xoff "flow control" protocol.
  192.  
  193.    If this happens to you, your best recourse is to put the terminal in
  194. a mode where it will not use flow control, or give it so much padding
  195. that it will never send a `C-s'.  (One way to increase the amount of
  196. padding is to set the variable `baud-rate' to a larger value.  Its
  197. value is the terminal output speed, measured in the conventional units
  198. of baud.)
  199.  
  200.    If you don't succeed in turning off flow control, the next best thing
  201. is to tell Emacs to cope with it.  To do this, call the function
  202. `enable-flow-control'.
  203.  
  204.    Typically there are particular terminal types with which you must use
  205. flow control.  You can conveniently ask for flow control on those
  206. terminal types only, using `enable-flow-control-on'.  For example, if
  207. you find you must use flow control on VT-100 and H19 terminals, put the
  208. following in your `.emacs' file:
  209.  
  210.      (enable-flow-control-on "vt100" "h19")
  211.  
  212.    When flow control is enabled, you must type `C-\' to get the effect
  213. of a `C-s', and type `C-^' to get the effect of a `C-q'.  (These
  214. aliases work by means of keyboard translations; see *Note Keyboard
  215. Translations::.)
  216.  
  217. 
  218. File: emacs,  Node: Memory Full,  Next: After a Crash,  Prev: Unasked-for Search,  Up: Lossage
  219.  
  220. Running out of Memory
  221. ---------------------
  222.  
  223.    If you get the error message `Virtual memory exceeded', save your
  224. modified buffers with `C-x s'.  This method of saving them has the
  225. smallest need for additional memory.  Emacs keeps a reserve of memory
  226. which it makes available when this error happens; that should be enough
  227. to enable `C-x s' to complete its work.
  228.  
  229.    Once you have saved your modified buffers, you can exit this Emacs
  230. job and start another, or you can use `M-x kill-some-buffers' to free
  231. space in the current Emacs job.  If you kill buffers containing a
  232. substantial amount of text, you can safely go on editing.  Emacs refills
  233. its memory reserve automatically when it sees sufficient free space
  234. available, in case you run out of memory another time.
  235.  
  236.    Do not use `M-x buffer-menu' to save or kill buffers when you run
  237. out of memory, because the buffer menu needs a fair amount memory
  238. itself, and the reserve supply may not be enough.
  239.  
  240. 
  241. File: emacs,  Node: After a Crash,  Next: Emergency Escape,  Prev: Memory Full,  Up: Lossage
  242.  
  243. Recovery After a Crash
  244. ----------------------
  245.  
  246.    If Emacs or the computer crashes, you can recover the files you were
  247. editing at the time of the crash from their auto-save files.  To do
  248. this, start Emacs again and type the command `M-x recover-session'.
  249.  
  250.    This command initially displays a buffer which lists interrupted
  251. session files, each with its date.  You must choose which session to
  252. recover from.  Typically the one you want is the most recent one.  Move
  253. point to the one you choose, and type `C-c C-c'.
  254.  
  255.    Then `recover-session' asks about each of the files that you were
  256. editing during that session; it asks whether to recover that file.  If
  257. you answer `y' for a file, it shows the dates of that file and its
  258. auto-save file, then asks once again whether to recover that file.  For
  259. the second question, you must confirm with `yes'.  If you do, Emacs
  260. visits the file but gets the text from the auto-save file.
  261.  
  262.    When `recover-session' is done, the files you've chosen to recover
  263. are present in Emacs buffers.  You should then save them.  Only
  264. this--saving them--updates the files themselves.
  265.  
  266. 
  267. File: emacs,  Node: Emergency Escape,  Next: Total Frustration,  Prev: After a Crash,  Up: Lossage
  268.  
  269. Emergency Escape
  270. ----------------
  271.  
  272.    Because at times there have been bugs causing Emacs to loop without
  273. checking `quit-flag', a special feature causes Emacs to be suspended
  274. immediately if you type a second `C-g' while the flag is already set,
  275. so you can always get out of GNU Emacs.  Normally Emacs recognizes and
  276. clears `quit-flag' (and quits!) quickly enough to prevent this from
  277. happening.
  278.  
  279.    When you resume Emacs after a suspension caused by multiple `C-g', it
  280. asks two questions before going back to what it had been doing:
  281.  
  282.      Auto-save? (y or n)
  283.      Abort (and dump core)? (y or n)
  284.  
  285. Answer each one with `y' or `n' followed by RET.
  286.  
  287.    Saying `y' to `Auto-save?' causes immediate auto-saving of all
  288. modified buffers in which auto-saving is enabled.
  289.  
  290.    Saying `y' to `Abort (and dump core)?' causes an illegal instruction
  291. to be executed, dumping core.  This is to enable a wizard to figure out
  292. why Emacs was failing to quit in the first place.  Execution does not
  293. continue after a core dump.  If you answer `n', execution does
  294. continue.  With luck, GNU Emacs will ultimately check `quit-flag' and
  295. quit normally.  If not, and you type another `C-g', it is suspended
  296. again.
  297.  
  298.    If Emacs is not really hung, just slow, you may invoke the double
  299. `C-g' feature without really meaning to.  Then just resume and answer
  300. `n' to both questions, and you will arrive at your former state.
  301. Presumably the quit you requested will happen soon.
  302.  
  303.    The double-`C-g' feature is turned off when Emacs is running under
  304. the X Window System, since you can use the window manager to kill Emacs
  305. or to create another window and run another program.
  306.  
  307. 
  308. File: emacs,  Node: Total Frustration,  Prev: Emergency Escape,  Up: Lossage
  309.  
  310. Help for Total Frustration
  311. --------------------------
  312.  
  313.    If using Emacs (or something else) becomes terribly frustrating and
  314. none of the techniques described above solve the problem, Emacs can
  315. still help you.
  316.  
  317.    First, if the Emacs you are using is not responding to commands, type
  318. `C-g C-g' to get out of it and then start a new one.
  319.  
  320.    Second, type `M-x doctor RET'.
  321.  
  322.    The doctor will help you feel better.  Each time you say something to
  323. the doctor, you must end it by typing RET RET.  This lets the doctor
  324. know you are finished.
  325.  
  326. 
  327. File: emacs,  Node: Bugs,  Next: Contributing,  Prev: Lossage,  Up: Top
  328.  
  329. Reporting Bugs
  330. ==============
  331.  
  332.    Sometimes you will encounter a bug in Emacs.  Although we cannot
  333. promise we can or will fix the bug, and we might not even agree that it
  334. is a bug, we want to hear about problems you encounter.  Often we agree
  335. they are bugs and want to fix them.
  336.  
  337.    To make it possible for us to fix a bug, you must report it.  In
  338. order to do so effectively, you must know when and how to do it.
  339.  
  340. * Menu:
  341.  
  342. * Criteria:  Bug Criteria.     Have you really found a bug?
  343. * Understanding Bug Reporting::     How to report a bug effectively.
  344. * Checklist::             Steps to follow for a good bug report.
  345. * Sending Patches::         How to send a patch for GNU Emacs.
  346.  
  347. 
  348. File: emacs,  Node: Bug Criteria,  Next: Understanding Bug Reporting,  Up: Bugs
  349.  
  350. When Is There a Bug
  351. -------------------
  352.  
  353.    If Emacs executes an illegal instruction, or dies with an operating
  354. system error message that indicates a problem in the program (as
  355. opposed to something like "disk full"), then it is certainly a bug.
  356.  
  357.    If Emacs updates the display in a way that does not correspond to
  358. what is in the buffer, then it is certainly a bug.  If a command seems
  359. to do the wrong thing but the problem corrects itself if you type
  360. `C-l', it is a case of incorrect display updating.
  361.  
  362.    Taking forever to complete a command can be a bug, but you must make
  363. certain that it was really Emacs's fault.  Some commands simply take a
  364. long time.  Type `C-g' and then `C-h l' to see whether the input Emacs
  365. received was what you intended to type; if the input was such that you
  366. *know* it should have been processed quickly, report a bug.  If you
  367. don't know whether the command should take a long time, find out by
  368. looking in the manual or by asking for assistance.
  369.  
  370.    If a command you are familiar with causes an Emacs error message in a
  371. case where its usual definition ought to be reasonable, it is probably a
  372. bug.
  373.  
  374.    If a command does the wrong thing, that is a bug.  But be sure you
  375. know for certain what it ought to have done.  If you aren't familiar
  376. with the command, or don't know for certain how the command is supposed
  377. to work, then it might actually be working right.  Rather than jumping
  378. to conclusions, show the problem to someone who knows for certain.
  379.  
  380.    Finally, a command's intended definition may not be best for editing
  381. with.  This is a very important sort of problem, but it is also a
  382. matter of judgment.  Also, it is easy to come to such a conclusion out
  383. of ignorance of some of the existing features.  It is probably best not
  384. to complain about such a problem until you have checked the
  385. documentation in the usual ways, feel confident that you understand it,
  386. and know for certain that what you want is not available.  If you are
  387. not sure what the command is supposed to do after a careful reading of
  388. the manual, check the index and glossary for any terms that may be
  389. unclear.
  390.  
  391.    If after careful rereading of the manual you still do not understand
  392. what the command should do, that indicates a bug in the manual, which
  393. you should report.  The manual's job is to make everything clear to
  394. people who are not Emacs experts--including you.  It is just as
  395. important to report documentation bugs as program bugs.
  396.  
  397.    If the on-line documentation string of a function or variable
  398. disagrees with the manual, one of them must be wrong; that is a bug.
  399.  
  400. 
  401. File: emacs,  Node: Understanding Bug Reporting,  Next: Checklist,  Prev: Bug Criteria,  Up: Bugs
  402.  
  403. Understanding Bug Reporting
  404. ---------------------------
  405.  
  406.    When you decide that there is a bug, it is important to report it
  407. and to report it in a way which is useful.  What is most useful is an
  408. exact description of what commands you type, starting with the shell
  409. command to run Emacs, until the problem happens.
  410.  
  411.    The most important principle in reporting a bug is to report *facts*,
  412. not hypotheses or categorizations.  It is always easier to report the
  413. facts, but people seem to prefer to strain to posit explanations and
  414. report them instead.  If the explanations are based on guesses about
  415. how Emacs is implemented, they will be useless; we will have to try to
  416. figure out what the facts must have been to lead to such speculations.
  417. Sometimes this is impossible.  But in any case, it is unnecessary work
  418. for us.
  419.  
  420.    For example, suppose that you type `C-x C-f /glorp/baz.ugh RET',
  421. visiting a file which (you know) happens to be rather large, and Emacs
  422. prints out `I feel pretty today'.  The best way to report the bug is
  423. with a sentence like the preceding one, because it gives all the facts
  424. and nothing but the facts.
  425.  
  426.    Do not assume that the problem is due to the size of the file and
  427. say, "When I visit a large file, Emacs prints out `I feel pretty
  428. today'." This is what we mean by "guessing explanations".  The problem
  429. is just as likely to be due to the fact that there is a `z' in the file
  430. name.  If this is so, then when we got your report, we would try out
  431. the problem with some "large file", probably with no `z' in its name,
  432. and not find anything wrong.  There is no way in the world that we
  433. could guess that we should try visiting a file with a `z' in its name.
  434.  
  435.    Alternatively, the problem might be due to the fact that the file
  436. starts with exactly 25 spaces.  For this reason, you should make sure
  437. that you inform us of the exact contents of any file that is needed to
  438. reproduce the bug.  What if the problem only occurs when you have typed
  439. the `C-x C-a' command previously?  This is why we ask you to give the
  440. exact sequence of characters you typed since starting the Emacs session.
  441.  
  442.    You should not even say "visit a file" instead of `C-x C-f' unless
  443. you *know* that it makes no difference which visiting command is used.
  444. Similarly, rather than saying "if I have three characters on the line,"
  445. say "after I type `RET A B C RET C-p'," if that is the way you entered
  446. the text.
  447.  
  448. 
  449. File: emacs,  Node: Checklist,  Next: Sending Patches,  Prev: Understanding Bug Reporting,  Up: Bugs
  450.  
  451. Checklist for Bug Reports
  452. -------------------------
  453.  
  454.    The best way to send a bug report is to mail it electronically to the
  455. Emacs maintainers at `bug-gnu-emacs@prep.ai.mit.edu'.  (If you want to
  456. suggest a change as an improvement, use the same address.)
  457.  
  458.    If you'd like to read the bug reports, you can find them on the
  459. newsgroup `gnu.emacs.bug'; keep in mind, however, that as a spectator
  460. you should not criticize anything about what you see there.  The
  461. purpose of bug reports is to give information to the Emacs maintainers.
  462. Spectators are welcome only as long as they do not interfere with
  463. this.  In particular, some bug reports contain large amounts of data;
  464. spectators should not complain about this.
  465.  
  466.    Please do not post bug reports using netnews; mail is more reliable
  467. than netnews about reporting your correct address, which we may need in
  468. order to ask you for more information.
  469.  
  470.    If you can't send electronic mail, then mail the bug report on paper
  471. or machine-readable media to this address:
  472.  
  473. GNU Emacs Bugs
  474. Free Software Foundation
  475. 59 Temple Place, Suite 330
  476. Boston, MA 02111-1307 USA
  477.  
  478.    We do not promise to fix the bug; but if the bug is serious, or
  479. ugly, or easy to fix, chances are we will want to.
  480.  
  481.    A convenient way to send a bug report for Emacs is to use the command
  482. `M-x report-emacs-bug'.  This sets up a mail buffer (*note Sending
  483. Mail::.) and automatically inserts *some* of the essential information.
  484. However, it cannot supply all the necessary information; you should
  485. still read and follow the guidelines below, so you can enter the other
  486. crucial information by hand before you send the message.
  487.  
  488.    To enable maintainers to investigate a bug, your report should
  489. include all these things:
  490.  
  491.    * The version number of Emacs.  Without this, we won't know whether
  492.      there is any point in looking for the bug in the current version
  493.      of GNU Emacs.
  494.  
  495.      You can get the version number by typing `M-x emacs-version RET'.
  496.      If that command does not work, you probably have something other
  497.      than GNU Emacs, so you will have to report the bug somewhere else.
  498.  
  499.    * The type of machine you are using, and the operating system name
  500.      and version number.  `M-x emacs-version RET' provides this
  501.      information too.  Copy its output from the `*Messages*' buffer, so
  502.      that you get it all and get it accurately.
  503.  
  504.    * The operands given to the `configure' command when Emacs was
  505.      installed.
  506.  
  507.    * A complete list of any modifications you have made to the Emacs
  508.      source.  (We may not have time to investigate the bug unless it
  509.      happens in an unmodified Emacs.  But if you've made modifications
  510.      and you don't tell us, you are sending us on a wild goose chase.)
  511.  
  512.      Be precise about these changes.  A description in English is not
  513.      enough--send a context diff for them.
  514.  
  515.      Adding files of your own, or porting to another machine, is a
  516.      modification of the source.
  517.  
  518.    * Details of any other deviations from the standard procedure for
  519.      installing GNU Emacs.
  520.  
  521.    * The complete text of any files needed to reproduce the bug.
  522.  
  523.      If you can tell us a way to cause the problem without visiting any
  524.      files, please do so.  This makes it much easier to debug.  If you
  525.      do need files, make sure you arrange for us to see their exact
  526.      contents.  For example, it can often matter whether there are
  527.      spaces at the ends of lines, or a newline after the last line in
  528.      the buffer (nothing ought to care whether the last line is
  529.      terminated, but try telling the bugs that).
  530.  
  531.    * The precise commands we need to type to reproduce the bug.
  532.  
  533.      The easy way to record the input to Emacs precisely is to write a
  534.      dribble file.  To start the file, execute the Lisp expression
  535.  
  536.           (open-dribble-file "~/dribble")
  537.  
  538.      using `M-:' or from the `*scratch*' buffer just after starting
  539.      Emacs.  From then on, Emacs copies all your input to the specified
  540.      dribble file until the Emacs process is killed.
  541.  
  542.    * For possible display bugs, the terminal type (the value of
  543.      environment variable `TERM'), the complete termcap entry for the
  544.      terminal from `/etc/termcap' (since that file is not identical on
  545.      all machines), and the output that Emacs actually sent to the
  546.      terminal.
  547.  
  548.      The way to collect the terminal output is to execute the Lisp
  549.      expression
  550.  
  551.           (open-termscript "~/termscript")
  552.  
  553.      using `M-:' or from the `*scratch*' buffer just after starting
  554.      Emacs.  From then on, Emacs copies all terminal output to the
  555.      specified termscript file as well, until the Emacs process is
  556.      killed.  If the problem happens when Emacs starts up, put this
  557.      expression into your `.emacs' file so that the termscript file
  558.      will be open when Emacs displays the screen for the first time.
  559.  
  560.      Be warned: it is often difficult, and sometimes impossible, to fix
  561.      a terminal-dependent bug without access to a terminal of the type
  562.      that stimulates the bug.
  563.  
  564.    * A description of what behavior you observe that you believe is
  565.      incorrect.  For example, "The Emacs process gets a fatal signal,"
  566.      or, "The resulting text is as follows, which I think is wrong."
  567.  
  568.      Of course, if the bug is that Emacs gets a fatal signal, then one
  569.      can't miss it.  But if the bug is incorrect text, the maintainer
  570.      might fail to notice what is wrong.  Why leave it to chance?
  571.  
  572.      Even if the problem you experience is a fatal signal, you should
  573.      still say so explicitly.  Suppose something strange is going on,
  574.      such as, your copy of the source is out of sync, or you have
  575.      encountered a bug in the C library on your system.  (This has
  576.      happened!)  Your copy might crash and the copy here might not.  If
  577.      you *said* to expect a crash, then when Emacs here fails to crash,
  578.      we would know that the bug was not happening.  If you don't say to
  579.      expect a crash, then we would not know whether the bug was
  580.      happening--we would not be able to draw any conclusion from our
  581.      observations.
  582.  
  583.    * If the manifestation of the bug is an Emacs error message, it is
  584.      important to report the precise text of the error message, and a
  585.      backtrace showing how the Lisp program in Emacs arrived at the
  586.      error.
  587.  
  588.      To get the error message text accurately, copy it from the
  589.      `*Messages*' buffer into the bug report.  Copy all of it, not just
  590.      part.
  591.  
  592.      To make a backtrace for the error, evaluate the Lisp expression
  593.      `(setq debug-on-error t)' before the error happens (that is to
  594.      say, you must execute that expression and then make the bug
  595.      happen).  This causes the error to run the Lisp debugger, which
  596.      shows you a backtrace.  Copy the text of the debugger's backtrace
  597.      into the bug report.
  598.  
  599.      This use of the debugger is possible only if you know how to make
  600.      the bug happen again.  If you can't make it happen again, at least
  601.      copy the whole error message.
  602.  
  603.    * Check whether any programs you have loaded into the Lisp world,
  604.      including your `.emacs' file, set any variables that may affect the
  605.      functioning of Emacs.  Also, see whether the problem happens in a
  606.      freshly started Emacs without loading your `.emacs' file (start
  607.      Emacs with the `-q' switch to prevent loading the init file.)  If
  608.      the problem does *not* occur then, you must report the precise
  609.      contents of any programs that you must load into the Lisp world in
  610.      order to cause the problem to occur.
  611.  
  612.    * If the problem does depend on an init file or other Lisp programs
  613.      that are not part of the standard Emacs system, then you should
  614.      make sure it is not a bug in those programs by complaining to
  615.      their maintainers first.  After they verify that they are using
  616.      Emacs in a way that is supposed to work, they should report the
  617.      bug.
  618.  
  619.    * If you wish to mention something in the GNU Emacs source, show the
  620.      line of code with a few lines of context.  Don't just give a line
  621.      number.
  622.  
  623.      The line numbers in the development sources don't match those in
  624.      your sources.  It would take extra work for the maintainers to
  625.      determine what code is in your version at a given line number, and
  626.      we could not be certain.
  627.  
  628.    * Additional information from a C debugger such as GDB might enable
  629.      someone to find a problem on a machine which he does not have
  630.      available.  If you don't know how to use GDB, please read the GDB
  631.      manual--it is not very long, and using GDB is easy.  You can find
  632.      the GDB distribution, including the GDB manual in online form, in
  633.      most of the same places you can find the Emacs distribution.
  634.  
  635.      However, you need to think when you collect the additional
  636.      information if you want it to show what causes the bug.
  637.  
  638.      For example, many people send just a backtrace, but that is not
  639.      very useful by itself.  A simple backtrace with arguments often
  640.      conveys little about what is happening inside GNU Emacs, because
  641.      most of the arguments listed in the backtrace are pointers to Lisp
  642.      objects.  The numeric values of these pointers have no
  643.      significance whatever; all that matters is the contents of the
  644.      objects they point to (and most of the contents are themselves
  645.      pointers).
  646.  
  647.      To provide useful information, you need to show the values of Lisp
  648.      objects in Lisp notation.  Do this for each variable which is a
  649.      Lisp object, in several stack frames near the bottom of the stack.
  650.      Look at the source to see which variables are Lisp objects,
  651.      because the debugger thinks of them as integers.
  652.  
  653.      To show a variable's value in Lisp syntax, first print its value,
  654.      then use the user-defined GDB command `pr' to print the Lisp
  655.      object in Lisp syntax.  (If you must use another debugger, call
  656.      the function `debug_print' with the object as an argument.)  The
  657.      `pr' command is defined by the file `.gdbinit' in the `src'
  658.      subdirectory, and it works only if you are debugging a running
  659.      process (not with a core dump).
  660.  
  661.      To make Lisp errors stop Emacs and return to GDB, put a breakpoint
  662.      at `Fsignal'.
  663.  
  664.      To find out which Lisp functions are running, using GDB, move up
  665.      the stack, and each time you get to a frame for the function
  666.      `Ffuncall', type these GDB commands:
  667.  
  668.           p *args
  669.           pr
  670.  
  671.      To print the first argument that the function received, use these
  672.      commands:
  673.  
  674.           p args[1]
  675.           pr
  676.  
  677.      You can print the other arguments likewise.  The argument `nargs'
  678.      of `Ffuncall' says how many arguments `Ffuncall' received; these
  679.      include the Lisp function itself and the arguments for that
  680.      function.
  681.  
  682.    * If the symptom of the bug is that Emacs fails to respond, don't
  683.      assume Emacs is "hung"--it may instead be in an infinite loop.  To
  684.      find out which, make the problem happen under GDB and stop Emacs
  685.      once it is not responding.  (If Emacs is using X Windows directly,
  686.      you can stop Emacs by typing `C-c' at the GDB job.)  Then try
  687.      stepping with `step'.  If Emacs is hung, the `step' command won't
  688.      return.  If it is looping, `step' will return.
  689.  
  690.      If this shows Emacs is hung in a system call, stop it again and
  691.      examine the arguments of the call.  In your bug report, state
  692.      exactly where in the source the system call is, and what the
  693.      arguments are.
  694.  
  695.      If Emacs is in an infinite loop, please determine where the loop
  696.      starts and ends.  The easiest way to do this is to use the GDB
  697.      command `finish'.  Each time you use it, Emacs resumes execution
  698.      until it exits one stack frame.  Keep typing `finish' until it
  699.      doesn't return--that means the infinite loop is in the stack frame
  700.      which you just tried to finish.
  701.  
  702.      Stop Emacs again, and use `finish' repeatedly again until you get
  703.      *back to* that frame.  Then use `next' to step through that frame.
  704.      By stepping, you will see where the loop starts and ends.  Also
  705.      please examine the data being used in the loop and try to
  706.      determine why the loop does not exit when it should.  Include all
  707.      of this information in your bug report.
  708.  
  709.    Here are some things that are not necessary in a bug report:
  710.  
  711.    * A description of the envelope of the bug--this is not necessary
  712.      for a reproducible bug.
  713.  
  714.      Often people who encounter a bug spend a lot of time investigating
  715.      which changes to the input file will make the bug go away and which
  716.      changes will not affect it.
  717.  
  718.      This is often time consuming and not very useful, because the way
  719.      we will find the bug is by running a single example under the
  720.      debugger with breakpoints, not by pure deduction from a series of
  721.      examples.  You might as well save time by not searching for
  722.      additional examples.
  723.  
  724.      Of course, if you can find a simpler example to report *instead* of
  725.      the original one, that is a convenience.  Errors in the output
  726.      will be easier to spot, running under the debugger will take less
  727.      time, etc.
  728.  
  729.      However, simplification is not vital; if you can't do this or
  730.      don't have time to try, please report the bug with your original
  731.      test case.
  732.  
  733.    * A system call trace of Emacs execution.
  734.  
  735.      System call traces are very useful for certain special kinds of
  736.      debugging, but in most cases they give little useful information.
  737.      It is therefore strange that many people seem to think that *the*
  738.      way to report information about a crash is to send a system call
  739.      trace.
  740.  
  741.      In most programs, a backtrace is normally far, far more
  742.      informative than a system call trace.  Even in Emacs, a simple
  743.      backtrace is generally more informative, though to give full
  744.      information you should supplement the backtrace by displaying
  745.      variable values and printing them as Lisp objects with `pr' (see
  746.      above).
  747.  
  748.    * A patch for the bug.
  749.  
  750.      A patch for the bug is useful if it is a good one.  But don't omit
  751.      the other information that a bug report needs, such as the test
  752.      case, on the assumption that a patch is sufficient.  We might see
  753.      problems with your patch and decide to fix the problem another
  754.      way, or we might not understand it at all.  And if we can't
  755.      understand what bug you are trying to fix, or why your patch
  756.      should be an improvement, we mustn't install it.
  757.  
  758.      *Note Sending Patches::, for guidelines on how to make it easy for
  759.      us to understand and install your patches.
  760.  
  761.    * A guess about what the bug is or what it depends on.
  762.  
  763.      Such guesses are usually wrong.  Even experts can't guess right
  764.      about such things without first using the debugger to find the
  765.      facts.
  766.  
  767. 
  768. File: emacs,  Node: Sending Patches,  Prev: Checklist,  Up: Bugs
  769.  
  770. Sending Patches for GNU Emacs
  771. -----------------------------
  772.  
  773.    If you would like to write bug fixes or improvements for GNU Emacs,
  774. that is very helpful.  When you send your changes, please follow these
  775. guidelines to make it easy for the maintainers to use them.  If you
  776. don't follow these guidelines, your information might still be useful,
  777. but using it will take extra work.  Maintaining GNU Emacs is a lot of
  778. work in the best of circumstances, and we can't keep up unless you do
  779. your best to help.
  780.  
  781.    * Send an explanation with your changes of what problem they fix or
  782.      what improvement they bring about.  For a bug fix, just include a
  783.      copy of the bug report, and explain why the change fixes the bug.
  784.  
  785.      (Referring to a bug report is not as good as including it, because
  786.      then we will have to look it up, and we have probably already
  787.      deleted it if we've already fixed the bug.)
  788.  
  789.    * Always include a proper bug report for the problem you think you
  790.      have fixed.  We need to convince ourselves that the change is
  791.      right before installing it.  Even if it is correct, we might have
  792.      trouble understanding it if we don't have a way to reproduce the
  793.      problem.
  794.  
  795.    * Include all the comments that are appropriate to help people
  796.      reading the source in the future understand why this change was
  797.      needed.
  798.  
  799.    * Don't mix together changes made for different reasons.  Send them
  800.      *individually*.
  801.  
  802.      If you make two changes for separate reasons, then we might not
  803.      want to install them both.  We might want to install just one.  If
  804.      you send them all jumbled together in a single set of diffs, we
  805.      have to do extra work to disentangle them--to figure out which
  806.      parts of the change serve which purpose.  If we don't have time
  807.      for this, we might have to ignore your changes entirely.
  808.  
  809.      If you send each change as soon as you have written it, with its
  810.      own explanation, then two changes never get tangled up, and we can
  811.      consider each one properly without any extra work to disentangle
  812.      them.
  813.  
  814.    * Send each change as soon as that change is finished.  Sometimes
  815.      people think they are helping us by accumulating many changes to
  816.      send them all together.  As explained above, this is absolutely
  817.      the worst thing you could do.
  818.  
  819.      Since you should send each change separately, you might as well
  820.      send it right away.  That gives us the option of installing it
  821.      immediately if it is important.
  822.  
  823.    * Use `diff -c' to make your diffs.  Diffs without context are hard
  824.      to install reliably.  More than that, they are hard to study; we
  825.      must always study a patch to decide whether we want to install it.
  826.      Unidiff format is better than contextless diffs, but not as easy
  827.      to read as `-c' format.
  828.  
  829.      If you have GNU diff, use `diff -c -F'^[_a-zA-Z0-9$]+ *('' when
  830.      making diffs of C code.  This shows the name of the function that
  831.      each change occurs in.
  832.  
  833.    * Write the change log entries for your changes.  This is both to
  834.      save us the extra work of writing them, and to help explain your
  835.      changes so we can understand them.
  836.  
  837.      The purpose of the change log is to show people where to find what
  838.      was changed.  So you need to be specific about what functions you
  839.      changed; in large functions, it's often helpful to indicate where
  840.      within the function the change was.
  841.  
  842.      On the other hand, once you have shown people where to find the
  843.      change, you need not explain its purpose in the change log.  Thus,
  844.      if you add a new function, all you need to say about it is that it
  845.      is new.  If you feel that the purpose needs explaining, it
  846.      probably does--but put the explanation in comments in the code.
  847.      It will be more useful there.
  848.  
  849.      Please read the `ChangeLog' files in the `src' and `lisp'
  850.      directories to see what sorts of information to put in, and to
  851.      learn the style that we use.  If you would like your name to
  852.      appear in the header line, showing who made the change, send us
  853.      the header line.  *Note Change Log::.
  854.  
  855.    * When you write the fix, keep in mind that we can't install a
  856.      change that would break other systems.  Please think about what
  857.      effect your change will have if compiled on another type of system.
  858.  
  859.      Sometimes people send fixes that *might* be an improvement in
  860.      general--but it is hard to be sure of this.  It's hard to install
  861.      such changes because we have to study them very carefully.  Of
  862.      course, a good explanation of the reasoning by which you concluded
  863.      the change was correct can help convince us.
  864.  
  865.      The safest changes are changes to the configuration files for a
  866.      particular machine.  These are safe because they can't create new
  867.      bugs on other machines.
  868.  
  869.      Please help us keep up with the workload by designing the patch in
  870.      a form that is clearly safe to install.
  871.  
  872. 
  873. File: emacs,  Node: Contributing,  Next: Service,  Prev: Bugs,  Up: Top
  874.  
  875. Contributing to Emacs Development
  876. =================================
  877.  
  878.    If you would like to help pretest Emacs releases to assure they work
  879. well, or if you would like to work on improving Emacs, please contact
  880. the maintainers at `bug-gnu-emacs@prep.ai.mit.edu'.  A pretester should
  881. be prepared to investigate bugs as well as report them.  If you'd like
  882. to work on improving Emacs, please ask for suggested projects or
  883. suggest your own ideas.
  884.  
  885.    If you have already written an improvement, please tell us about it.
  886. If you have not yet started work, it is useful to contact
  887. `bug-gnu-emacs@prep.ai.mit.edu' before you start; it might be possible
  888. to suggest ways to make your extension fit in better with the rest of
  889. Emacs.
  890.  
  891. 
  892. File: emacs,  Node: Service,  Next: Command Arguments,  Prev: Contributing,  Up: Top
  893.  
  894. How To Get Help with GNU Emacs
  895. ==============================
  896.  
  897.    If you need help installing, using or changing GNU Emacs, there are
  898. two ways to find it:
  899.  
  900.    * Send a message to the mailing list
  901.      `help-gnu-emacs@prep.ai.mit.edu', or post your request on
  902.      newsgroup `gnu.emacs.help'.  (This mailing list and newsgroup
  903.      interconnect, so it does not matter which one you use.)
  904.  
  905.    * Look in the service directory for someone who might help you for a
  906.      fee.  The service directory is found in the file named
  907.      `etc/SERVICE' in the Emacs distribution.
  908.  
  909. 
  910. File: emacs,  Node: Command Arguments,  Next: Antinews,  Prev: Service,  Up: Top
  911.  
  912. Command Line Arguments
  913. **********************
  914.  
  915.    GNU Emacs supports command line arguments to request various actions
  916. when invoking Emacs.  These are for compatibility with other editors and
  917. for sophisticated activities.  We don't recommend using them for
  918. ordinary editing.
  919.  
  920.    Arguments starting with `-' are "options".  Other arguments specify
  921. files to visit.  Emacs visits the specified files while it starts up.
  922. The last file name on your command line becomes the current buffer; the
  923. other files are also present in other buffers.
  924.  
  925.    You can use options to specify various other things, such as the size
  926. and position of the X window Emacs uses, its colors, and so on.  A few
  927. options support advanced usage, such as running Lisp functions on files
  928. in batch mode.  The sections of this chapter describe the available
  929. options, arranged according to their purpose.
  930.  
  931.    There are two ways of writing options: the short forms that start
  932. with a single `-', and the long forms that start with `--'.  For
  933. example, `-d' is a short form and `--display' is the corresponding long
  934. form.
  935.  
  936.    The long forms with `--' are easier to remember, but longer to type.
  937. However, you don't have to spell out the whole option name; any
  938. unambiguous abbreviation is enough.  When a long option takes an
  939. argument, you can use either a space or an equal sign to separate the
  940. option name and the argument.  Thus, you can write either `--display
  941. sugar-bombs:0.0' or `--display=sugar-bombs:0.0'.  We recommend an equal
  942. sign because it makes the relationship clearer, and the tables below
  943. always show an equal sign.
  944.  
  945.    Most options specify how to initialize Emacs, or set parameters for
  946. the Emacs session.  We call them "initial options".  A few options
  947. specify things to do: for example, load libraries, call functions, or
  948. exit Emacs.  These are called "action options".  These and file names
  949. together are called "action arguments".  Emacs processes all the action
  950. arguments in the order they are written.
  951.  
  952. * Menu:
  953.  
  954. * Action Arguments::    Arguments to visit files, load libraries,
  955.               and call functions.
  956. * Initial Options::     Arguments that take effect while starting Emacs.
  957. * Command Example::     Examples of using command line arguments.
  958. * Resume Arguments::    Specifying arguments when you resume a running Emacs.
  959. * Environment::         Environment variables that Emacs uses.
  960.  
  961. * Display X::           Changing the default display and using remote login.
  962. * Font X::            Choosing a font for text, under X.
  963. * Colors X::            Choosing colors, under X.
  964. * Window Size X::       Start-up window size, under X.
  965. * Borders X::            Internal and external borders, under X.
  966. * Title X::             Specifying the initial frame's title.
  967. * Icons X::             Choosing what sort of icon to use, under X.
  968. * Resources X::         Advanced use of classes and resources, under X.
  969. * Lucid Resources::     X resources for Lucid menus.
  970. * Motif Resources::     X resources for Motif menus.
  971.  
  972. 
  973. File: emacs,  Node: Action Arguments,  Next: Initial Options,  Up: Command Arguments
  974.  
  975. Action Arguments
  976. ================
  977.  
  978.    Here is a table of the action arguments and options:
  979.  
  980. `FILE'
  981.      Visit FILE using `find-file'.  *Note Visiting::.
  982.  
  983. `+LINENUM FILE'
  984.      Visit FILE using `find-file', then go to line number LINENUM in it.
  985.  
  986. `-l FILE'
  987. `--load=FILE'
  988.      Load a file FILE of Lisp code with the function `load'.  *Note
  989.      Lisp Libraries::.
  990.  
  991. `-f FUNCTION'
  992. `--funcall=FUNCTION'
  993.      Call Lisp function FUNCTION with no arguments.
  994.  
  995. `--eval EXPRESSION'
  996.      Evaluate Lisp expression EXPRESSION.
  997.  
  998. `--insert=FILE'
  999.      Insert the contents of FILE into the current buffer.  This is like
  1000.      what `M-x insert-file' does.  *Note Misc File Ops::.
  1001.  
  1002. `--kill'
  1003.      Exit from Emacs without asking for confirmation.
  1004.  
  1005.    The init file can access the values of the action arguments as the
  1006. elements of a list in the variable `command-line-args'.  The init file
  1007. can override the normal processing of the action arguments, or define
  1008. new ones, by reading and setting this variable.
  1009.  
  1010. 
  1011. File: emacs,  Node: Initial Options,  Next: Command Example,  Prev: Action Arguments,  Up: Command Arguments
  1012.  
  1013. Initial Options
  1014. ===============
  1015.  
  1016.    The initial options specify parameter for the Emacs session.  This
  1017. section describes the more general initial options; some other options
  1018. specifically related to X Windows appear in the following sections.
  1019.  
  1020.    Some initial options affect the loading of init files.  The normal
  1021. actions of Emacs are to first load `site-start.el' if it exists, then
  1022. your own init file `~/.emacs' if it exists, and finally `default.el' if
  1023. it exists; certain options prevent loading of some of these files or
  1024. substitute other files for them.
  1025.  
  1026. `-t DEVICE'
  1027. `--terminal=DEVICE'
  1028.      Use DEVICE as the device for terminal input and output.
  1029.  
  1030. `-d DISPLAY'
  1031. `--display=DISPLAY'
  1032.      Use the X Window System and use the display named DISPLAY to open
  1033.      the initial Emacs frame.
  1034.  
  1035. `-nw'
  1036. `--no-windows'
  1037.      Don't communicate directly with X, disregarding the `DISPLAY'
  1038.      environment variable even if it is set.
  1039.  
  1040. `-batch'
  1041. `--batch'
  1042.      Run Emacs in "batch mode", which means that the text being edited
  1043.      is not displayed and the standard terminal interrupt characters
  1044.      such as `C-z' and `C-c' continue to have their normal effect.
  1045.      Emacs in batch mode outputs to `stderr' only what would normally
  1046.      be printed in the echo area under program control.
  1047.  
  1048.      Batch mode is used for running programs written in Emacs Lisp from
  1049.      shell scripts, makefiles, and so on.  Normally the `-l' option or
  1050.      `-f' option will be used as well, to invoke a Lisp program to do
  1051.      the batch processing.
  1052.  
  1053.      `-batch' implies `-q' (do not load an init file).  It also causes
  1054.      Emacs to kill itself after all command options have been
  1055.      processed.  In addition, auto-saving is not done except in buffers
  1056.      for which it has been explicitly requested.
  1057.  
  1058. `-q'
  1059. `--no-init-file'
  1060.      Do not load your Emacs init file `~/.emacs', or `default.el'
  1061.      either.
  1062.  
  1063. `--no-site-file'
  1064.      Do not load `site-start.el'.  The options `-q', `-u' and `-batch'
  1065.      have no effect on the loading of this file--this is the only
  1066.      option that blocks it.
  1067.  
  1068. `-u USER'
  1069. `--user=USER'
  1070.      Load USER's Emacs init file `~USER/.emacs' instead of your own.
  1071.  
  1072. `--debug-init'
  1073.      Enable the Emacs Lisp debugger for errors in the init file.
  1074.  
  1075. 
  1076. File: emacs,  Node: Command Example,  Next: Resume Arguments,  Prev: Initial Options,  Up: Command Arguments
  1077.  
  1078. Command Argument Example
  1079. ========================
  1080.  
  1081.    Here is an example of using Emacs with arguments and options.  It
  1082. assumes you have a Lisp program file called `hack-c.el' which, when
  1083. loaded, performs some useful operation on current buffer, expected to be
  1084. a C program.
  1085.  
  1086.      emacs -batch foo.c -l hack-c -f save-buffer >& log
  1087.  
  1088. This says to visit `foo.c', load `hack-c.el' (which makes changes in
  1089. the visited file), save `foo.c' (note that `save-buffer' is the
  1090. function that `C-x C-s' is bound to), and then exit back to the shell
  1091. (because of `-batch').  `-batch' also guarantees there will be no
  1092. problem redirecting output to `log', because Emacs will not assume that
  1093. it has a display terminal to work with.
  1094.  
  1095.