home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / os2 / e17info.zip / EMACS / 19.17 / INFO / EMACS-17 (.txt) < prev    next >
GNU Info File  |  1993-07-18  |  50KB  |  871 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Lossage,  Next: Bugs,  Prev: Quitting,  Up: Top
  4. Dealing with Emacs Trouble
  5. ==========================
  6.    This section describes various conditions in which Emacs fails to
  7. work normally, and how to recognize them and correct them.
  8. * Menu:
  9. * DEL Gets Help::       What to do if DEL doesn't delete.
  10. * Stuck Recursive::     `[...]' in mode line around the parentheses.
  11. * Screen Garbled::      Garbage on the screen.
  12. * Text Garbled::        Garbage in the text.
  13. * Unasked-for Search::  Spontaneous entry to incremental search.
  14. * Emergency Escape::    Emergency escape--
  15.                           What to do if Emacs stops responding.
  16. * Total Frustration::   When you are at your wits' end.
  17. File: emacs,  Node: DEL Gets Help,  Next: Stuck Recursive,  Up: Lossage
  18. If DEL Fails to Delete
  19. ----------------------
  20.    If you find that DEL enters Help like `Control-h' instead of
  21. deleting a character, your terminal is sending the wrong code for DEL.
  22. You can work around this problem by changing the keyboard translation
  23. table (*note Keyboard Translations::.).
  24. File: emacs,  Node: Stuck Recursive,  Next: Screen Garbled,  Prev: DEL Gets Help,  Up: Lossage
  25. Recursive Editing Levels
  26. ------------------------
  27.    Recursive editing levels are important and useful features of Emacs,
  28. but they can seem like malfunctions to the user who does not understand
  29. them.
  30.    If the mode line has square brackets `[...]' around the parentheses
  31. that contain the names of the major and minor modes, you have entered a
  32. recursive editing level.  If you did not do this on purpose, or if you
  33. don't understand what that means, you should just get out of the
  34. recursive editing level.  To do so, type `M-x top-level'.  This is
  35. called getting back to top level.  *Note Recursive Edit::.
  36. File: emacs,  Node: Screen Garbled,  Next: Text Garbled,  Prev: Stuck Recursive,  Up: Lossage
  37. Garbage on the Screen
  38. ---------------------
  39.    If the data on the screen looks wrong, the first thing to do is see
  40. whether the text is really wrong.  Type `C-l', to redisplay the entire
  41. screen.  If the screen appears correct after this, the problem was
  42. entirely in the previous screen update.
  43.    Display updating problems often result from an incorrect termcap
  44. entry for the terminal you are using.  The file `etc/TERMS' in the Emacs
  45. distribution gives the fixes for known problems of this sort.
  46. `INSTALL' contains general advice for these problems in one of its
  47. sections.  Very likely there is simply insufficient padding for certain
  48. display operations.  To investigate the possibility that you have this
  49. sort of problem, try Emacs on another terminal made by a different
  50. manufacturer.  If problems happen frequently on one kind of terminal
  51. but not another kind, it is likely to be a bad termcap entry, though it
  52. could also be due to a bug in Emacs that appears for terminals that
  53. have or that lack specific features.
  54. File: emacs,  Node: Text Garbled,  Next: Unasked-for Search,  Prev: Screen Garbled,  Up: Lossage
  55. Garbage in the Text
  56. -------------------
  57.    If `C-l' shows that the text is wrong, try undoing the changes to it
  58. using `C-x u' until it gets back to a state you consider correct.  Also
  59. try `C-h l' to find out what command you typed to produce the observed
  60. results.
  61.    If a large portion of text appears to be missing at the beginning or
  62. end of the buffer, check for the word `Narrow' in the mode line.  If it
  63. appears, the text is still present, but temporarily off-limits.  To
  64. make it accessible again, type `C-x n w'.  *Note Narrowing::.
  65. File: emacs,  Node: Unasked-for Search,  Next: Emergency Escape,  Prev: Text Garbled,  Up: Lossage
  66. Spontaneous Entry to Incremental Search
  67. ---------------------------------------
  68.    If Emacs spontaneously displays `I-search:' at the bottom of the
  69. screen, it means that the terminal is sending `C-s' and `C-q' according
  70. to the poorly designed xon/xoff "flow control" protocol.
  71.    If this happens to you, your best recourse is to put the terminal in
  72. a mode where it will not use flow control, or give it so much padding
  73. that it will never send a `C-s'.  (One way to increase the amount of
  74. padding is to set the variable `baud-rate' to a larger value.  Its
  75. value is the terminal output speed, measured in the conventional units
  76. of baud.)
  77.    If you don't succeed in turning off flow control, the next best thing
  78. is to tell Emacs to cope with it.  To do this, call the function
  79. `enable-flow-control'.
  80.    Typically there are particular terminal types with which you must use
  81. flow control.  You can conveniently ask for flow control on those
  82. terminal types only, using `enable-flow-control-on'.  For example, if
  83. you find you must use flow control on VT-100 and H19 terminals, put the
  84. following in your `.emacs' file:
  85.      (enable-flow-control-on "vt100" "h19")
  86.    When flow control is enabled, you must type `C-\' to get the effect
  87. of a `C-s', and type `C-^' to get the effect of a `C-q'.  (These
  88. aliases work by means of keyboard translations; see *Note Keyboard
  89. Translations::.)
  90. File: emacs,  Node: Emergency Escape,  Next: Total Frustration,  Prev: Unasked-for Search,  Up: Lossage
  91. Emergency Escape
  92. ----------------
  93.    Because at times there have been bugs causing Emacs to loop without
  94. checking `quit-flag', a special feature causes Emacs to be suspended
  95. immediately if you type a second `C-g' while the flag is already set,
  96. so you can always get out of GNU Emacs.  Normally Emacs recognizes and
  97. clears `quit-flag' (and quits!) quickly enough to prevent this from
  98. happening.
  99.    When you resume Emacs after a suspension caused by multiple `C-g', it
  100. asks two questions before going back to what it had been doing:
  101.      Auto-save? (y or n)
  102.      Abort (and dump core)? (y or n)
  103. Answer each one with `y' or `n' followed by RET.
  104.    Saying `y' to `Auto-save?' causes immediate auto-saving of all
  105. modified buffers in which auto-saving is enabled.
  106.    Saying `y' to `Abort (and dump core)?' causes an illegal instruction
  107. to be executed, dumping core.  This is to enable a wizard to figure out
  108. why Emacs was failing to quit in the first place.  Execution does not
  109. continue after a core dump.  If you answer `n', execution does
  110. continue.  With luck, GNU Emacs will ultimately check `quit-flag' and
  111. quit normally.  If not, and you type another `C-g', it is suspended
  112. again.
  113.    If Emacs is not really hung, just slow, you may invoke the double
  114. `C-g' feature without really meaning to.  Then just resume and answer
  115. `n' to both questions, and you will arrive at your former state.
  116. Presumably the quit you requested will happen soon.
  117.    The double-`C-g' feature is turned off when Emacs is running under
  118. the X Window System, since the you can use the window manager to kill
  119. Emacs or to create another window and run another program.
  120. File: emacs,  Node: Total Frustration,  Prev: Emergency Escape,  Up: Lossage
  121. Help for Total Frustration
  122. --------------------------
  123.    If using Emacs (or something else) becomes terribly frustrating and
  124. none of the techniques described above solve the problem, Emacs can
  125. still help you.
  126.    First, if the Emacs you are using is not responding to commands, type
  127. `C-g C-g' to get out of it and then start a new one.
  128.    Second, type `M-x doctor RET'.
  129.    The doctor will help you feel better.  Each time you say something to
  130. the doctor, you must end it by typing RET RET.  This lets the doctor
  131. know you are finished.
  132. File: emacs,  Node: Bugs,  Next: Service,  Prev: Lossage,  Up: Top
  133. Reporting Bugs
  134. ==============
  135.    Sometimes you will encounter a bug in Emacs.  Although we cannot
  136. promise we can or will fix the bug, and we might not even agree that it
  137. is a bug, we want to hear about bugs you encounter in case we do want
  138. to fix them.
  139.    To make it possible for us to fix a bug, you must report it.  In
  140. order to do so effectively, you must know when and how to do it.
  141. * Menu:
  142. * Criteria:  Bug Criteria.     Have you really found a bug?
  143. * Understanding Bug Reporting::     How to report a bug effectively.
  144. * Checklist::             Steps to follow for a good bug report.
  145. * Sending Patches::         How to send a patch for GNU Emacs.
  146. File: emacs,  Node: Bug Criteria,  Next: Understanding Bug Reporting,  Up: Bugs
  147. When Is There a Bug
  148. -------------------
  149.    If Emacs executes an illegal instruction, or dies with an operating
  150. system error message that indicates a problem in the program (as
  151. opposed to something like "disk full"), then it is certainly a bug.
  152.    If Emacs updates the display in a way that does not correspond to
  153. what is in the buffer, then it is certainly a bug.  If a command seems
  154. to do the wrong thing but the problem corrects itself if you type
  155. `C-l', it is a case of incorrect display updating.
  156.    Taking forever to complete a command can be a bug, but you must make
  157. certain that it was really Emacs's fault.  Some commands simply take a
  158. long time.  Type `C-g' and then `C-h l' to see whether the input Emacs
  159. received was what you intended to type; if the input was such that you
  160. *know* it should have been processed quickly, report a bug.  If you
  161. don't know whether the command should take a long time, find out by
  162. looking in the manual or by asking for assistance.
  163.    If a command you are familiar with causes an Emacs error message in a
  164. case where its usual definition ought to be reasonable, it is probably a
  165.    If a command does the wrong thing, that is a bug.  But be sure you
  166. know for certain what it ought to have done.  If you aren't familiar
  167. with the command, or don't know for certain how the command is supposed
  168. to work, then it might actually be working right.  Rather than jumping
  169. to conclusions, show the problem to someone who knows for certain.
  170.    Finally, a command's intended definition may not be best for editing
  171. with.  This is a very important sort of problem, but it is also a
  172. matter of judgment.  Also, it is easy to come to such a conclusion out
  173. of ignorance of some of the existing features.  It is probably best not
  174. to complain about such a problem until you have checked the
  175. documentation in the usual ways, feel confident that you understand it,
  176. and know for certain that what you want is not available.  If you are
  177. not sure what the command is supposed to do after a careful reading of
  178. the manual, check the index and glossary for any terms that may be
  179. unclear.
  180.    If you still do not understand, that indicates a bug in the manual,
  181. which you should report.  The manual's job is to make everything clear
  182. to people who are not Emacs experts--including you.  It is just as
  183. important to report documentation bugs as program bugs.
  184.    If the on-line documentation string of a function or variable
  185. disagrees with the manual, one of them must be wrong; that is a bug.
  186. File: emacs,  Node: Understanding Bug Reporting,  Next: Checklist,  Prev: Bug Criteria,  Up: Bugs
  187. Understanding Bug Reporting
  188. ---------------------------
  189.    When you decide that there is a bug, it is important to report it
  190. and to report it in a way which is useful.  What is most useful is an
  191. exact description of what commands you type, starting with the shell
  192. command to run Emacs, until the problem happens.
  193.    The most important principle in reporting a bug is to report *facts*,
  194. not hypotheses or categorizations.  It is always easier to report the
  195. facts, but people seem to prefer to strain to posit explanations and
  196. report them instead.  If the explanations are based on guesses about
  197. how Emacs is implemented, they will be useless; we will have to try to
  198. figure out what the facts must have been to lead to such speculations.
  199. Sometimes this is impossible.  But in any case, it is unnecessary work
  200. for us.
  201.    For example, suppose that you type `C-x C-f /glorp/baz.ugh RET',
  202. visiting a file which (you know) happens to be rather large, and Emacs
  203. prints out `I feel pretty today'.  The best way to report the bug is
  204. with a sentence like the preceding one, because it gives all the facts
  205. and nothing but the facts.
  206.    Do not assume that the problem is due to the size of the file and
  207. say, "When I visit a large file, Emacs prints out `I feel pretty
  208. today'." This is what we mean by "guessing explanations".  The problem
  209. is just as likely to be due to the fact that there is a `z' in the file
  210. name.  If this is so, then when we got your report, we would try out
  211. the problem with some "large file", probably with no `z' in its name,
  212. and not find anything wrong.  There is no way in the world that we
  213. could guess that we should try visiting a file with a `z' in its name.
  214.    Alternatively, the problem might be due to the fact that the file
  215. starts with exactly 25 spaces.  For this reason, you should make sure
  216. that you inform us of the exact contents of any file that is needed to
  217. reproduce the bug.  What if the problem only occurs when you have typed
  218. the `C-x C-a' command previously?  This is why we ask you to give the
  219. exact sequence of characters you typed since starting to use Emacs.
  220.    You should not even say "visit a file" instead of `C-x C-f' unless
  221. you *know* that it makes no difference which visiting command is used.
  222. Similarly, rather than saying "if I have three characters on the line,"
  223. say "after I type `RET A B C RET C-p'," if that is the way you entered
  224. the text.
  225. File: emacs,  Node: Checklist,  Next: Sending Patches,  Prev: Understanding Bug Reporting,  Up: Bugs
  226. Checklist for Bug Reports
  227. -------------------------
  228.    The best way to send a bug report is to mail it electronically to the
  229. Emacs maintainers at `bug-gnu-emacs@prep.ai.mit.edu'.
  230.    If you'd like to read the bug reports, you can find them on the
  231. repeater newsgroup `gnu.emacs.bugs'; keep in mind, however, that as a
  232. spectator you should not criticize anything about what you see there.
  233. The purpose of bug reports is to give information to the Emacs
  234. maintainers.  Spectators are welcome only as long as they do not
  235. interfere with this.
  236.    Please do not post bug reports using netnews; mail is more reliable
  237. than netnews about reporting your correct address, which we may need in
  238. order to ask you for more information.
  239.    If you can't send electronic mail, then mail the bug report on paper
  240. to this address:
  241. GNU Emacs Bugs
  242. Free Software Foundation
  243. 675 Mass Ave
  244. Cambridge, MA 02139
  245.    We do not promise to fix the bug; but if the bug is serious, or
  246. ugly, or easy to fix, chances are we will want to.
  247.    To enable maintainers to investigate a bug, your report should
  248. include all these things:
  249.    * The version number of Emacs.  Without this, we won't know whether
  250.      there is any point in looking for the bug in the current version
  251.      of GNU Emacs.
  252.      You can get the version number by typing `M-x emacs-version RET'.
  253.      If that command does not work, you probably have something other
  254.      than GNU Emacs, so you will have to report the bug somewhere else.
  255.    * The type of machine you are using, and the operating system name
  256.      and version number.
  257.    * The operands you gave to the `configure' command when you installed
  258.      Emacs.
  259.    * A complete list of any modifications you have made to the Emacs
  260.      source.  (We may not have time to investigate the bug unless it
  261.      happens in an unmodified Emacs.  But if you've made modifications
  262.      and don't tell us, then you are sending us on a wild goose chase.)
  263.      Be precise about these changes.  A description in English is not
  264.      enough--send a context diff for them.
  265.      Adding files of your own (such as a machine description for a
  266.      machine we don't support) is a modification of the source.
  267.    * Details of any other deviations from the standard procedure for
  268.      installing GNU Emacs.
  269.    * The complete text of any files needed to reproduce the bug.
  270.      If you can tell us a way to cause the problem without visiting any
  271.      files, please do so.  This makes it much easier to debug.  If you
  272.      do need files, make sure you arrange for us to see their exact
  273.      contents.  For example, it can often matter whether there are
  274.      spaces at the ends of lines, or a newline after the last line in
  275.      the buffer (nothing ought to care whether the last line is
  276.      terminated, but try telling the bugs that).
  277.    * The precise commands we need to type to reproduce the bug.
  278.      The easy way to record the input to Emacs precisely is to to write
  279.      a dribble file.  To start the file, execute the Lisp expression
  280.           (open-dribble-file "~/dribble")
  281.      using `M-ESC' or from the `*scratch*' buffer just after starting
  282.      Emacs.  From then on, Emacs copies all your input to the specified
  283.      dribble file until the Emacs process is killed.
  284.    * For possible display bugs, the terminal type (the value of
  285.      environment variable `TERM'), the complete termcap entry for the
  286.      terminal from `/etc/termcap' (since that file is not identical on
  287.      all machines), and the output that Emacs actually sent to the
  288.      terminal.
  289.      The way to collect the terminal output is to execute the Lisp
  290.      expression
  291.           (open-termscript "~/termscript")
  292.      using `M-ESC' or from the `*scratch*' buffer just after starting
  293.      Emacs.  From then on, Emacs copies all terminal output to the
  294.      specified termscript file as well, until the Emacs process is
  295.      killed.  If the problem happens when Emacs starts up, put this
  296.      expression into your `.emacs' file so that the termscript file
  297.      will be open when Emacs displays the screen for the first time.
  298.      Be warned: it is often difficult, and sometimes impossible, to fix
  299.      a terminal-dependent bug without access to a terminal of the type
  300.      that stimulates the bug.
  301.    * A description of what behavior you observe that you believe is
  302.      incorrect.  For example, "The Emacs process gets a fatal signal,"
  303.      or, "The resulting text is as follows, which I think is wrong."
  304.      Of course, if the bug is that Emacs gets a fatal signal, then one
  305.      can't miss it.  But if the bug is incorrect text, the maintainer
  306.      might fail to notice what is wrong.  Why leave it to chance?
  307.      Even if the problem you experience is a fatal signal, you should
  308.      still say so explicitly.  Suppose something strange is going on,
  309.      such as, your copy of the source is out of sync, or you have
  310.      encountered a bug in the C library on your system.  (This has
  311.      happened!)  Your copy might crash and the copy here would not.  If
  312.      you *said* to expect a crash, then when Emacs here fails to crash,
  313.      we would know that the bug was not happening.  If you don't say to
  314.      expect a crash, then we would not know whether the bug was
  315.      happening.  We would not be able to draw any conclusion from our
  316.      observations.
  317.      If the manifestation of the bug is an Emacs error message, it is
  318.      important to report not just the text of the error message but a
  319.      backtrace showing how the Lisp program in Emacs arrived at the
  320.      error.  To make the backtrace, execute the Lisp expression `(setq
  321.      debug-on-error t)' before the error happens (that is to say, you
  322.      must execute that expression and then make the bug happen).  This
  323.      causes the Lisp debugger to run, showing you a backtrace.  Copy
  324.      the text of the debugger's backtrace into the bug report.
  325.      This use of the debugger is possible only if you know how to make
  326.      the bug happen again.  Do note the error message the first time
  327.      the bug happens, so if you can't make it happen again, you can
  328.      report at least the error message.
  329.    * Check whether any programs you have loaded into the Lisp world,
  330.      including your `.emacs' file, set any variables that may affect the
  331.      functioning of Emacs.  Also, see whether the problem happens in a
  332.      freshly started Emacs without loading your `.emacs' file (start
  333.      Emacs with the `-q' switch to prevent loading the init file.)  If
  334.      the problem does *not* occur then, you must report the precise
  335.      contents of any programs that you must load into the Lisp world in
  336.      order to cause the problem to occur.
  337.    * If the problem does depend on an init file or other Lisp programs
  338.      that are not part of the standard Emacs system, then you should
  339.      make sure it is not a bug in those programs by complaining to
  340.      their maintainers first.  After they verify that they are using
  341.      Emacs in a way that is supposed to work, they should report the
  342.      bug.
  343.    * If you wish to mention something in the GNU Emacs source, show the
  344.      portion in its context.  Don't just give a line number.
  345.      The line numbers in the development sources don't match those in
  346.      your sources.  It would take extra work for the maintainers to
  347.      determine what code is in your version at a given line number, and
  348.      we could not be certain.
  349.    * Additional information from a debugger might enable someone to
  350.      find a problem on a machine which he does not have available.
  351.      However, you need to think when you collect this information if
  352.      you want it to be useful.
  353.      For example, many people send just a backtrace, but that is never
  354.      useful by itself.  A simple backtrace with arguments conveys
  355.      little about what is happening inside GNU Emacs, because most of
  356.      the arguments listed in the backtrace are pointers to Lisp
  357.      objects.  The numeric values of these pointers have no
  358.      significance whatever; all that matters is the contents of the
  359.      objects they point to (and most of the contents are themselves
  360.      pointers).
  361.      To provide useful information, you need to show the values of Lisp
  362.      objects in Lisp notation.  Do this for each variable which is a
  363.      Lisp object, in several stack frames near the bottom of the stack.
  364.      Look at the source to see which variables are Lisp objects,
  365.      because the debugger thinks of them as integers.
  366.      To show a variable's value in Lisp syntax, first print its value,
  367.      then use the GDB command `pr' to print the Lisp object in Lisp
  368.      syntax.  (If you must use another debugger, call the function
  369.      `debug_print' with the object as an argument.)
  370.    Here are some things that are not necessary:
  371.    * A description of the envelope of the bug--this is not necessary
  372.      for a reproducible bug.
  373.      Often people who encounter a bug spend a lot of time investigating
  374.      which changes to the input file will make the bug go away and which
  375.      changes will not affect it.
  376.      This is often time consuming and not very useful, because the way
  377.      we will find the bug is by running a single example under the
  378.      debugger with breakpoints, not by pure deduction from a series of
  379.      examples.  You might as well save time by not doing this.
  380.      Of course, if you can find a simpler example to report *instead* of
  381.      the original one, that is a convenience.  Errors in the output
  382.      will be easier to spot, running under the debugger will take less
  383.      time, etc.
  384.      However, simplification is not vital; if you don't want to do this,
  385.      please report the bug with your original test case.
  386.    * A patch for the bug.
  387.      A patch for the bug is useful if it is a good one.  But don't omit
  388.      the necessary information, such as the test case, on the
  389.      assumption that a patch is all we need.  We might see problems
  390.      with your patch and decide to fix the problem another way, or we
  391.      might not understand it at all.
  392.      And if we can't understand what bug you are trying to fix, or why
  393.      your patch should be an improvement, we mustn't install it.  A
  394.      test case will help us to understand.
  395.      *Note Sending Patches::, for guidelines on how to make it easy for
  396.      us to understand and install your patches.
  397.    * A guess about what the bug is or what it depends on.
  398.      Such guesses are usually wrong.  Even experts can't guess right
  399.      about such things without first using the debugger to find the
  400.      facts.
  401. File: emacs,  Node: Sending Patches,  Prev: Checklist,  Up: Bugs
  402. Sending Patches for GNU Emacs
  403. -----------------------------
  404.    If you would like to write bug fixes or improvements for GNU Emacs,
  405. that is very helpful.  When you send your changes, please follow these
  406. guidelines to make it easy for the maintainers to use them.
  407.    If you don't follow these guidelines, your information might still be
  408. useful, but using it will take extra work.  Maintaining GNU Emacs is a
  409. lot of work in the best of circumstances, and we can't keep up unless
  410. you do your best to help.
  411.    * Send an explanation with your changes of what problem they fix or
  412.      what improvement they bring about.  For a bug fix, just include a
  413.      copy of the bug report, and explain why the change fixes the bug.
  414.      (Referring to a bug report is not as good as including it, because
  415.      then we will have to look it up, and we have probably already
  416.      deleted it if we've already fixed the bug.)
  417.    * Always include a proper bug report for the problem you think you
  418.      have fixed.  We need to convince ourselves that the change is
  419.      right before installing it.  Even if it is correct, we might have
  420.      trouble understanding it if we don't have a way to reproduce the
  421.      problem.
  422.    * Include all the comments that are appropriate to help people
  423.      reading the source in the future understand why this change was
  424.      needed.
  425.    * Don't mix together changes made for different reasons.  Send them
  426.      *individually*.
  427.      If you make two changes for separate reasons, then we might not
  428.      want to install them both.  We might want to install just one.  If
  429.      you send them all jumbled together in a single set of diffs, we
  430.      have to do extra work to disentangle them--to figure out which
  431.      parts of the change serve which purpose.  If we don't have time
  432.      for this, we might have to ignore your changes entirely.
  433.      If you send each change as soon as you have written it, with its
  434.      own explanation, then the two changes never get tangled up, and we
  435.      can consider each one properly without any extra work to
  436.      disentangle them.
  437.    * Send each change as soon as that change is finished.  Sometimes
  438.      people think they are helping us by accumulating many changes to
  439.      send them all together.  As explained above, this is absolutely
  440.      the worst thing you could do.
  441.      Since you should send each change separately, you might as well
  442.      send it right away.  That gives us the option of installing it
  443.      immediately if it is important.
  444.    * Use `diff -c' to make your diffs.  Diffs without context are hard
  445.      to install reliably.  More than that, they are hard to study; we
  446.      must always study a patch to decide whether we want to install it.
  447.      Unidiff format is better than contextless diffs, but not as easy
  448.      to read as `-c' format.
  449.      If you have GNU diff, use `diff -cp', which shows the name of the
  450.      function that each change occurs in.
  451.    * Write the change log entries for your changes.  This is both to
  452.      save us the extra work of writing them, and to help explain your
  453.      changes so we can understand them.
  454.      The purpose of the change log is to show people where to find what
  455.      was changed.  So you need to be specific about what functions you
  456.      changed; in large functions, it's often helpful to indicate where
  457.      within the function the change was.
  458.      On the other hand, once you have shown people where to find the
  459.      change, you need not explain its purpose. Thus, if you add a new
  460.      function, all you need to say about it is that it is new.  If you
  461.      feel that the purpose needs explaining, it probably does--but the
  462.      explanation will be much more useful if you put it in comments in
  463.      the code.
  464.      Please read the `ChangeLog' file to see what sorts of information
  465.      to put in, and to learn the style that we use.  If you would like
  466.      your name to appear in the header line showing who made the
  467.      change, send us the header line.
  468.    * When you write the fix, keep in mind that we can't install a
  469.      change that would break other systems.  Please think about what
  470.      effect your change will have if compiled on another type of system.
  471.      Sometimes people send fixes that *might* be an improvement in
  472.      general--but it is hard to be sure of this.  It's hard to install
  473.      such changes because we have to study them very carefully.  Of
  474.      course, a good explanation of the reasoning by which you concluded
  475.      the change was correct can help convince us.
  476.      The safest changes are changes to the configuration files for a
  477.      particular machine.  These are safe because they can't create new
  478.      bugs on other machines.
  479.      Please help us keep up with the workload by designing the patch in
  480.      a form that is clearly safe to install.
  481. File: emacs,  Node: Service,  Next: Command Arguments,  Prev: Bugs,  Up: Top
  482. How To Get Help with GNU Emacs
  483. ==============================
  484.    If you need help installing, using or changing GNU Emacs, there are
  485. two ways to find it:
  486.    * Send a message to a suitable network mailing list.  First try
  487.      `bug-gnu-emacs@prep.ai.mit.edu', and if that brings no response,
  488.      try `help-gnu-emacs@prep.ai.mit.edu'.
  489.    * Look in the service directory for someone who might help you for a
  490.      fee.  The service directory is found in the file named
  491.      `etc/SERVICE' in the Emacs distribution.
  492. File: emacs,  Node: Command Arguments,  Next: Antinews,  Prev: Service,  Up: Top
  493. Command Line Options and Arguments
  494. **********************************
  495.    GNU Emacs supports command line arguments to request various actions
  496. when invoking Emacs.  These are for compatibility with other editors and
  497. for sophisticated activities.  We don't recommend using them for
  498. ordinary editing.
  499.    Arguments that are not options specify files to visit.  Emacs visits
  500. the specified files while it starts up.  (The last file name on your
  501. command line is the one you see displayed, but the rest are all there in
  502. other buffers.)
  503.    You can use options to specify other things, such as the size and
  504. position of the Emacs window if you are running it under the X Window
  505. System.  A few arguments support advanced usage, like running Lisp
  506. functions on files in batch mode.
  507.    There are two kinds of options: "ordinary options" and "initial
  508. options".  Ordinary options can appear in any order and can be
  509. intermixed with file names to visit.  These and file names are called
  510. "ordinary arguments".  Emacs processes all of these in the order they
  511. are written.  Initial options must come at the beginning of the command
  512. line.
  513. * Menu:
  514. * Ordinary Arguments::    Arguments to visit files, load libraries,
  515.               and call functions.
  516. * Initial Options::     Arguments that must come at the start of the command.
  517. * Command Example::     Examples of using command line arguments.
  518. * Resume Arguments::    Specifying arguments when you resume a running Emacs.
  519. * Display X::           Changing the default display and using remote login.
  520. * Font X::            Choosing a font for text, under X.
  521. * Colors X::            Choosing colors, under X.
  522. * Window Size X::       Start-up window size, under X.
  523. * Borders X::            Internal and external borders, under X.
  524. * Icons X::             Choosing what sort of icon to use, under X.
  525. * Resources X::         Advanced use of classes and resources, under X.
  526. File: emacs,  Node: Ordinary Arguments,  Next: Initial Options,  Up: Command Arguments
  527. Ordinary Arguments
  528. ==================
  529.    Here is a table of the ordinary arguments and options:
  530. `FILE'
  531.      Visit FILE using `find-file'.  *Note Visiting::.
  532. `+LINENUM FILE'
  533.      Visit FILE using `find-file', then go to line number LINENUM in it.
  534. `-l FILE'
  535. `-load FILE'
  536.      Load a file FILE of Lisp code with the function `load'.  *Note
  537.      Lisp Libraries::.
  538. `-f FUNCTION'
  539. `-funcall FUNCTION'
  540.      Call Lisp function FUNCTION with no arguments.
  541. `-insert FILE'
  542.      Insert the contents of FILE into the current buffer.  This is like
  543.      what `M-x insert-buffer' does; *Note Misc File Ops::.
  544. `-kill'
  545.      Exit from Emacs without asking for confirmation.
  546. File: emacs,  Node: Initial Options,  Next: Command Example,  Prev: Ordinary Arguments,  Up: Command Arguments
  547. Initial Options
  548. ===============
  549.    The initial options are recognized only at the beginning of the
  550. command line.  If you use more than one of them, they must appear in the
  551. order that they appear in this table.
  552. `-t DEVICE'
  553.      Use DEVICE as the device for terminal input and output.
  554. `-d DISPLAY'
  555.      When running with the X window system, use the display named
  556.      DISPLAY to make the window that serves as Emacs's terminal.
  557. `-batch'
  558.      Run Emacs in "batch mode", which means that the text being edited
  559.      is not displayed and the standard Unix interrupt characters such
  560.      as `C-z' and `C-c' continue to have their normal effect.  Emacs in
  561.      batch mode outputs to `stdout' only what would normally be printed
  562.      in the echo area under program control.
  563.      Batch mode is used for running programs written in Emacs Lisp from
  564.      shell scripts, makefiles, and so on.  Normally the `-l' option or
  565.      `-f' option will be used as well, to invoke a Lisp program to do
  566.      the batch processing.
  567.      `-batch' implies `-q' (do not load an init file).  It also causes
  568.      Emacs to kill itself after all command options have been
  569.      processed.  In addition, auto-saving is not done except in buffers
  570.      for which it has been explicitly requested.
  571. `-no-init-file'
  572.      Do not load your Emacs init file `~/.emacs'.
  573. `-u USER'
  574. `-user USER'
  575.      Load USER's Emacs init file `~USER/.emacs' instead of your own.
  576.    The init file can get access to the values of the command line
  577. arguments as the elements of a list in the variable
  578. `command-line-args'.  (The list contains only the arguments from the
  579. first table above.  Emacs processes the arguments from the second table
  580. before building the list.)  The init file can override the normal
  581. processing of the other arguments by setting this variable.
  582. File: emacs,  Node: Command Example,  Next: Resume Arguments,  Prev: Initial Options,  Up: Command Arguments
  583. Command Argument Example
  584. ========================
  585.    Here is an example of using Emacs with arguments and options.  It
  586. assumes you have a Lisp program file called `hack-c.el' which, when
  587. loaded, performs some useful operation on current buffer, expected to be
  588. a C program.
  589.      emacs -batch foo.c -l hack-c -f save-buffer -kill > log
  590. This says to visit `foo.c', load `hack-c.el' (which makes changes in
  591. the visited file), save `foo.c' (note that `save-buffer' is the
  592. function that `C-x C-s' is bound to), and then exit to the shell that
  593. this command was done with.  The initial option `-batch' guarantees
  594. there will be no problem redirecting output to `log', because Emacs
  595. will not assume that it has a display terminal to work with.
  596. File: emacs,  Node: Resume Arguments,  Next: Display X,  Prev: Command Example,  Up: Command Arguments
  597. Resuming Emacs with Arguments
  598. =============================
  599.    You can specify ordinary arguments for Emacs when you resume it after
  600. a suspension.  To prepare for this, put the following code in your
  601. `.emacs' file (*note Hooks::.):
  602.      (add-hook 'suspend-hook 'resume-suspend-hook)
  603.    As further preparation, you must execute the shell script
  604. `emacs.csh' (if you use CSH as your shell) or `emacs.bash' (if you use
  605. BASH as your shell).  These scripts define an alias named `edit', which
  606. will resume Emacs give it new command line arguments such as files to
  607. visit.
  608.    Only ordinary arguments work properly when you resume Emacs.  Initial
  609. arguments are not recognized.  It's too late to execute them anyway.
  610.    Note that resuming Emacs (with or without arguments) must be done
  611. from within the shell that is the parent of the Emacs job.  This is why
  612. `edit' is an alias rather than a program or a shell script.  It is not
  613. possible to implement a resumption command that could be run from other
  614. subjobs of the shell; no way to define a command that could be made the
  615. value of `EDITOR', for example.  Therefore, this feature does not take
  616. the place of the the Emacs Server feature.  *Note Emacs Server::.
  617.    The aliases use the Emacs Server feature if you appear to have a
  618. server Emacs running.  However, they cannot determine this with complete
  619. accuracy.  They may think that a server is still running when in
  620. actuality you have killed that Emacs, because the file `/tmp/.esrv...'
  621. still exists.  If this happens, find that file and delete it.
  622. File: emacs,  Node: Display X,  Next: Font X,  Prev: Resume Arguments,  Up: Command Arguments
  623. Specifying the Display Name
  624. ===========================
  625.    The environment variable `DISPLAY' tells all X clients where to
  626. display their windows.  Its value is set up by default in ordinary
  627. circumstances, when you start an X server and run jobs locally.
  628. Occasionally you may need to specify the display yourself; for example,
  629. if you do a remote login and want to run a client program remotely,
  630. displaying on your local screen.
  631.    With Emacs, the main reason people change the default display is to
  632. let them log into another system, run Emacs on that system, but have the
  633. window displayed at their local terminal.  You might need to use login
  634. to another system because the files you want to edit are there, or
  635. because the Emacs executable file you want to run is there.
  636.    The syntax of the `DISPLAY' environment variable is:
  637.      HOST:DISPLAY.SCREEN
  638. where HOST is the host name of the X Window System server machine,
  639. DISPLAY is an arbitrarily-assigned number that distinguishes your
  640. server (X terminal) from other servers on the same machine, and SCREEN
  641. is a rarely-used field that allows an X server to control multiple
  642. terminal screens.  The period and the SCREEN field are optional.  If
  643. included, SCREEN is usually zero.
  644.    If your host is named `glasperle' and your server is the first (or
  645. perhaps the only) server listed in the configuration, your `DISPLAY' is
  646. `glasperle:0.0'.
  647.    You can specify the display name explicitly when you run Emacs,
  648. either by changing the `DISPLAY' variable, or with the option `-d
  649. DISPLAY' or `-display DISPLAY'.  These are initial options; they must
  650. come at the beginning of the command line.  *Note Initial Options::.
  651. Here is an example:
  652.      emacs -display glasperle:0 &
  653.    You can inhibit the direct use of X with the `-nw' option.  This is
  654. also an initial option.  This option tells Emacs to display using
  655. ordinary ASCII on its controlling terminal.
  656.    Sometimes, security arrangements prevent a program on a remote system
  657. from displaying on your local system.  In this case, trying to run Emacs
  658. produces messages like:
  659.      Xlib:  connection to "glasperle:0.0" refused by server
  660.    You might be able to overcome this problem by using the `xhost'
  661. command on the local system to give permission for access from your
  662. remote machine.
  663. File: emacs,  Node: Font X,  Next: Colors X,  Prev: Display X,  Up: Command Arguments
  664. Font Specification Options
  665. ==========================
  666.    By default, Emacs displays text in the font named `9x15', which
  667. makes each character nine pixels wide and fifteen pixels high.  You can
  668. specify a different font on your command line through the option `-fn
  669. NAME'.  The `-font' option is a synonym for `-fn'.
  670.    Here is how to specify the font `6x13':
  671.      emacs -fn 6x13 &
  672. You can also do this in your `.Xdefaults' file:
  673.      emacs.font:      6x13
  674.    Use only fixed width fonts--that is, fonts in which all characters
  675. have the same width.  Emacs cannot yet handle display properly for
  676. variable width fonts.  Fixed width fonts include the one named `fixed',
  677. and fonts with names in the form NxN, such as `6x13', `8x13', and
  678. `9x15'.  Under the font-naming conventions in X11 Release 4 or later,
  679. any font with `m' or `c' in the eleventh field of the name is a fixed
  680. width font.
  681.    Here's how to use the `xlsfonts' program to list all the fixed width
  682. fonts available on your system:
  683.      xlsfonts -fn '*x*'
  684.      xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-m*'
  685.      xlsfonts -fn '*-*-*-*-*-*-*-*-*-*-*-c*'
  686. To see what a particular font looks like, use the `xfd' command.  For
  687. example:
  688.      xfd -fn 6x13
  689. displays the entire font `6x13'.
  690.    While running Emacs, you can set the font of the current frame
  691. (*note Frame Parameters::.) or for a specific kind of text (*note
  692. Faces::.).
  693. File: emacs,  Node: Colors X,  Next: Window Size X,  Prev: Font X,  Up: Command Arguments
  694. Window Color Options
  695. ====================
  696.    On a color display, you can specify which color to use for various
  697. parts of the Emacs display.  To find out what colors are available on
  698. your system, look at the `/usr/lib/X11/rgb.txt' file.  If you do not
  699. specify colors, the default for the background is white and the default
  700. for all other colors is black.
  701.    On a monochrome (black and white) display, the foreground is black,
  702. the background is white, and the border is grey.  You can reverse the
  703. foreground and background colors through the `-r' option or the
  704. `reverseVideo' resource.
  705.    Here is a list of the options for specifying colors:
  706. `-fg COLOR'
  707.      Specify the foreground color.
  708. `-bg COLOR'
  709.      Specify the background color.
  710. `-bd COLOR'
  711.      Specify the color of the border of the X window.
  712. `-cr COLOR'
  713.      Specify the color of the Emacs cursor which indicates where point
  714.      is.
  715. `-ms COLOR'
  716.      Specify the color for the mouse cursor when the mouse is in the
  717.      Emacs window.
  718.    For example, to use a coral mouse cursor and a slate blue text
  719. cursor, enter:
  720.      emacs -ms coral -cr 'slate blue' &
  721. File: emacs,  Node: Window Size X,  Next: Borders X,  Prev: Colors X,  Up: Command Arguments
  722. Options for Window Geometry
  723. ===========================
  724.    The `-geometry' option controls the size and position of the initial
  725. Emacs frame.  Here is the format for specifying the window geometry:
  726.      WIDTHxHEIGHT{+-}XOFFSET{+-}YOFFSET
  727. where WIDTH specifies the number of characters displayed on a line,
  728. HEIGHT specifies the number of lines displayed, a positive XOFFSET
  729. specifies the distance from the left side of the screen, a negative
  730. XOFFSET specifies the distance from the right side of the screen, a
  731. positive YOFFSET specifies the distance from the top of the screen, and
  732. a negative YOFFSET specifies the distance from the bottom of the screen.
  733.    Emacs uses the same units as `xterm' does to interpret the geometry.
  734. The WIDTH and HEIGHT are measured in characters, so a large font
  735. creates a larger frame than a small font.  The XOFFSET and YOFFSET are
  736. measured in pixels.
  737.    Since the the mode line and the echo area occupy the last 2 lines of
  738. the frame, the height of the initial text window is 2 less than the
  739. height specified in your geometry.
  740.    You do not have to specify all of the fields in the geometry
  741. specification.  The default width for Emacs is 80 characters and the
  742. default height is 24 characters.  You can omit either the width or the
  743. height or both.
  744.    If you omit both XOFFSET nor YOFFSET, the window manager decides
  745. where to put the Emacs frame, possibly by letting you place it with the
  746. mouse.  For example, `164x55' specifies a window 164 columns wide,
  747. enough for two ordinary width windows side by side, and 55 lines tall.
  748.    If you start the geometry with an integer, Emacs interprets it as the
  749. width.  If you start with an `x' followed by an integer, Emacs
  750. interprets it as the height.  Thus, `81' specifies just the width;
  751. `x45' specifies just the height.
  752.    If you start with `+' or `-', that introduces an offset, which means
  753. both sizes are omitted.  Thus, `-3' specifies the XOFFSET only.  (If
  754. you give just one offset, it is always XOFFSET.)  `+3-3' specifies both
  755. the XOFFSET and the YOFFSET, placing the frame near the bottom left of
  756. the screen.
  757.    You can specify a default for any or all of the fields in
  758. `.Xdefaults' file, and then override selected fields through a
  759. `-geometry' option.
  760. File: emacs,  Node: Borders X,  Next: Icons X,  Prev: Window Size X,  Up: Command Arguments
  761. Internal and External Borders
  762. =============================
  763.    An Emacs frame has an internal border and an external border.  The
  764. internal border is an extra strip of the background color around all
  765. four edges of the frame.  Emacs itself adds the internal border.  The
  766. external border is added by the window manager outside the internal
  767. border; it may contain various boxes you can click on to move or iconify
  768. the window.
  769.    When you specify the size of the frame, that does not count the
  770. borders.  The frame's position is measured from the outside edge of the
  771. external border.
  772.    Use the `-ib N' option to specify an internal border N pixels wide.
  773. The default is 1.  Use `-b N' to specify the width of the external
  774. border (though the window manager may add to this on certain edges).
  775. The default width of the external border is 2.
  776. File: emacs,  Node: Icons X,  Next: Resources X,  Prev: Borders X,  Up: Command Arguments
  777. Icons
  778. =====
  779.    Most window managers allow the user to "iconify" a frame, removing
  780. it from sight, and leaving a small, distinctive "icon" window in its
  781. place.  Clicking on the icon window will make the original frame visible
  782. again.  If a user has many clients running at once, they can avoid
  783. cluttering up their screen by iconifying all but the clients currently
  784. in use.
  785.    The `-i' and `-itype' option tells Emacs to use an icon window
  786. containing a picture of the GNU gnu.  If omitted, Emacs lets the window
  787. manager choose what sort of icon to use -- usually just a small
  788. rectangle containing the frame's title.
  789.    The `-iconic' option tells Emacs to begin running as an icon, rather
  790. than opening a frame right away.  In this situation, the icon window
  791. provides only indication that Emacs has started; the usual text frame
  792. doesn't appear until you de-iconify it.
  793. File: emacs,  Node: Resources X,  Prev: Icons X,  Up: Command Arguments
  794. X Resources
  795. ===========
  796.    Programs running under the X Window System organize their user
  797. options under a hierarchy of classes and resources.  You can specify
  798. default values for these options in your X resources file, usually named
  799. `~/.Xdefaults'.
  800.    Each line in the file specifies a value for one option or for a
  801. collection of related options, for one program or for several programs
  802. (perhaps even all programs).
  803.    Programs define named resources with particular meanings.  They also
  804. define how to group resources into named classes.  For instance, in
  805. Emacs, the `internalBorder' resource controls the width of the internal
  806. border, and the `borderWidth' resource controls the width of the
  807. external border.  Both of these resources are part of the `BorderWidth'
  808. class.  Case distinctions are significant in these names.
  809.    In `~/.Xdefaults', you can specify a value for a single resource on
  810. one line, like this:
  811.      emacs.borderWidth: 2
  812. Or you can use a class name to specify the same value for all resources
  813. in that class.  Here's an example:
  814.      emacs.BorderWidth: 2
  815.    If you specify a value for a class, it becomes the default for all
  816. resources in that class.  You can specify values for individual
  817. resources as well; these override the class value, for those particular
  818. resources.  Thus, this example specifies 2 as the default width for all
  819. borders, but overrides this value with 4 for the external border:
  820.      emacs.Borderwidth: 2
  821.      emacs.borderwidth: 4
  822.    The order in which the lines appear in the file does not matter.
  823. Also, command-line options always override the X resources file.
  824.    The string `emacs' in the examples above is also a resource name.
  825. It actually represents the name of the executable file that you invoke
  826. to run Emacs.  If Emacs is installed under a different name, it look
  827. for resources under that name instead of `emacs'.
  828.    You can tell Emacs to use a different name instead of the name of the
  829. executable file, with the option `-rn NAME'.  Then that Emacs job uses
  830. NAME instead of `Emacs' to look up all of its option values in the X
  831. resource file.
  832.    The resources that name Emacs invocations also belong to a class; its
  833. name is `Emacs'.  To specify options for all Emacs jobs, no matter what
  834. name is used to run them, write `Emacs' instead of `emacs', like this:
  835.      Emacs.BorderWidth: 2
  836.      Emacs.borderWidth: 4
  837.    The following table lists the resource names that designate options
  838. for Emacs, each with the class that it belongs to:
  839. `background' (class `Background')
  840.      Background color name.
  841. `bitmapIcon' (class `BitMapIcon')
  842.      Use kitchen sink icon if `on', let the window manager choose an
  843.      icon if `off'.
  844. `borderColor' (class `BorderColor')
  845.      Color name for external border.
  846. `borderWidth' (class `BorderWidth')
  847.      Width in pixels of external border.
  848. `cursorColor' (class `Foreground')
  849.      Color name for text cursor (point).
  850. `font' (class `Font')
  851.      Font name for text.
  852. `foreground' (class `Foreground')
  853.      Color name for text.
  854. `geometry' (class `Geometry')
  855.      Window size and position.
  856. `iconName' (class `Title')
  857.      Name to display in icon.
  858. `internalBorder' (class `BorderWidth')
  859.      Width in pixels of internal border.
  860. `paneFont' (class `Font')
  861.      Font name for menu pane titles.
  862. `pointerColor' (class `Foreground')
  863.      Color of mouse cursor.
  864. `reverseVideo' (class `ReverseVideo')
  865.      Switch foreground and background default colors if `on', use
  866.      colors as specified if `off'.
  867. `selectionFont' (class `Font')
  868.      Font name for menu items.
  869. `title' (class `Title')
  870.      Name to display in title bar of initial Emacs frame.
  871.