home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / emacs / info / emacs-12 (.txt) < prev    next >
GNU Info File  |  1992-10-30  |  50KB  |  914 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.49 from the
  2. input file emacs.texi.
  3.    This file documents the GNU Emacs editor.
  4.    Copyright (C) 1985, 1986, 1988, 1992 Richard M. Stallman.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  11. General Public License" are included exactly as in the original, and
  12. provided that the entire resulting derived work is distributed under the
  13. terms of a permission notice identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "The GNU Manifesto",
  17. "Distribution" and "GNU General Public License" may be included in a
  18. translation approved by the author instead of in the original English.
  19. File: emacs,  Node: Init Examples,  Next: Terminal Init,  Prev: Init Syntax,  Up: Init File
  20. Init File Examples
  21. ------------------
  22.    Here are some examples of doing certain commonly desired things with
  23. Lisp expressions:
  24.    * Make TAB in C mode just insert a tab if point is in the middle of a
  25.      line.
  26.           (setq c-tab-always-indent nil)
  27.      Here we have a variable whose value is normally `t' for `true' and
  28.      the alternative is `nil' for `false'.
  29.    * Make searches case sensitive by default (in all buffers that do not
  30.      override this).
  31.           (setq-default case-fold-search nil)
  32.      This sets the default value, which is effective in all buffers
  33.      that do not have local values for the variable.  Setting
  34.      `case-fold-search' with `setq' affects only the current buffer's
  35.      local value, which is not what you probably want to do in an init
  36.      file.
  37.    * Make Text mode the default mode for new buffers.
  38.           (setq default-major-mode 'text-mode)
  39.      Note that `text-mode' is used because it is the command for
  40.      entering the mode we want.  A single-quote is written before it to
  41.      make a symbol constant; otherwise, `text-mode' would be treated as
  42.      a variable name.
  43.    * Turn on Auto Fill mode automatically in Text mode and related
  44.      modes.
  45.           (setq text-mode-hook
  46.             '(lambda () (auto-fill-mode 1)))
  47.      Here we have a variable whose value should be a Lisp function.  The
  48.      function we supply is a list starting with `lambda', and a single
  49.      quote is written in front of it to make it (for the purpose of this
  50.      `setq') a list constant rather than an expression.  Lisp functions
  51.      are not explained here, but for mode hooks it is enough to know
  52.      that `(auto-fill-mode 1)' is an expression that will be executed
  53.      when Text mode is entered, and you could replace it with any other
  54.      expression that you like, or with several expressions in a row.
  55.           (setq text-mode-hook 'turn-on-auto-fill)
  56.      This is another way to accomplish the same result.
  57.      `turn-on-auto-fill' is a symbol whose function definition is
  58.      `(lambda () (auto-fill-mode 1))'.
  59.    * Load the installed Lisp library named `foo' (actually a file
  60.      `foo.elc' or `foo.el' in a standard Emacs directory).
  61.           (load "foo")
  62.      When the argument to `load' is a relative pathname, not starting
  63.      with `/' or `~', `load' searches the directories in `load-path'
  64.      (*note Loading::.).
  65.    * Load the compiled Lisp file `foo.elc' from your home directory.
  66.           (load "~/foo.elc")
  67.      Here an absolute file name is used, so no searching is done.
  68.    * Rebind the key `C-x l' to run the function `make-symbolic-link'.
  69.           (global-set-key "\C-xl" 'make-symbolic-link)
  70.      or
  71.           (define-key global-map "\C-xl" 'make-symbolic-link)
  72.      Note once again the single-quote used to refer to the symbol
  73.      `make-symbolic-link' instead of its value as a variable.
  74.    * Do the same thing for C mode only.
  75.           (define-key c-mode-map "\C-xl" 'make-symbolic-link)
  76.    * Redefine all keys which now run `next-line' in Fundamental mode so
  77.      that they run `forward-line' instead.
  78.           (substitute-key-definition 'next-line 'forward-line
  79.                                      global-map)
  80.    * Make `C-x C-v' undefined.
  81.           (global-unset-key "\C-x\C-v")
  82.      One reason to undefine a key is so that you can make it a prefix.
  83.      Simply defining `C-x C-v ANYTHING' would make `C-x C-v' a prefix,
  84.      but `C-x C-v' must be freed of any non-prefix definition first.
  85.    * Make `$' have the syntax of punctuation in Text mode. Note the use
  86.      of a character constant for `$'.
  87.           (modify-syntax-entry ?\$ "." text-mode-syntax-table)
  88.    * Enable the use of the command `eval-expression' without
  89.      confirmation.
  90.           (put 'eval-expression 'disabled nil)
  91. File: emacs,  Node: Terminal Init,  Next: Debugging Init,  Prev: Init Examples,  Up: Init File
  92. Terminal-specific Initialization
  93. --------------------------------
  94.    Each terminal type can have a Lisp library to be loaded into Emacs
  95. when it is run on that type of terminal.  For a terminal type named
  96. TERMTYPE, the library is called `term/TERMTYPE' and it is found by
  97. searching the directories `load-path' as usual and trying the suffixes
  98. `.elc' and `.el'.  Normally it appears in the subdirectory `term' of
  99. the directory where most Emacs libraries are kept.
  100.    The usual purpose of the terminal-specific library is to define the
  101. escape sequences used by the terminal's function keys using the library
  102. `keypad.el'.  See the file `term/vt100.el' for an example of how this
  103. is done.
  104.    When the terminal type contains a hyphen, only the part of the name
  105. before the first hyphen is significant in choosing the library name.
  106. Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library
  107. `term/aaa'.  The code in the library can use `(getenv "TERM")' to find
  108. the full terminal type name.
  109.    The library's name is constructed by concatenating the value of the
  110. variable `term-file-prefix' and the terminal type.  Your `.emacs' file
  111. can prevent the loading of the terminal-specific library by setting
  112. `term-file-prefix' to `nil'.
  113.    The value of the variable `term-setup-hook', if not `nil', is called
  114. as a function of no arguments at the end of Emacs initialization, after
  115. both your `.emacs' file and any terminal-specific library have been
  116. read in.  You can set the value in the `.emacs' file to override part
  117. of any of the terminal-specific libraries and to define initializations
  118. for terminals that do not have a library.
  119. File: emacs,  Node: Debugging Init,  Prev: Terminal Init,  Up: Init File
  120. Debugging Your `.emacs' File
  121. ----------------------------
  122.    Ordinarily, Emacs traps errors that occur while reading `.emacs'.
  123. This is convenient, most of the time, because it means you can still get
  124. an Emacs in which you can edit.  But it causes inconvenience because
  125. there is no way to enter the debugger if there is an error.
  126.    But you can run the `.emacs' file explicitly in an Emacs that is
  127. already set up, and debug errors at that time.
  128.      M-x set-variable
  129.      debug-on-error
  130.      t
  131.      M-x load-file
  132.      ~/.emacs
  133.    In Emacs 19, use the `-debug-init' option if you want errors in
  134. `.emacs' to enter the debugger.
  135. File: emacs,  Node: Quitting,  Next: Lossage,  Prev: Customization,  Up: Top
  136. Quitting and Aborting
  137. =====================
  138. `C-g'
  139.      Quit.  Cancel running or partially typed command.
  140. `C-]'
  141.      Abort innermost recursive editing level and cancel the command
  142.      which invoked it (`abort-recursive-edit').
  143. `M-x top-level'
  144.      Abort all recursive editing levels that are currently executing.
  145. `C-x u'
  146.      Cancel an already-executed command, usually (`undo').
  147.    There are two ways of cancelling commands which are not finished
  148. executing: "quitting" with `C-g', and "aborting" with `C-]' or `M-x
  149. top-level'.  Quitting is cancelling a partially typed command or one
  150. which is already running.  Aborting is getting out of a recursive
  151. editing level and cancelling the command that invoked the recursive
  152. edit.
  153.    Quitting with `C-g' is used for getting rid of a partially typed
  154. command, or a numeric argument that you don't want.  It also stops a
  155. running command in the middle in a relatively safe way, so you can use
  156. it if you accidentally give a command which takes a long time.  In
  157. particular, it is safe to quit out of killing; either your text will
  158. ALL still be there, or it will ALL be in the kill ring (or maybe both).
  159.  Quitting an incremental search does special things documented under
  160. searching; in general, it may take two successive `C-g' characters to
  161. get out of a search.  `C-g' works by setting the variable `quit-flag' to
  162. `t' the instant `C-g' is typed; Emacs Lisp checks this variable
  163. frequently and quits if it is non-`nil'.  `C-g' is only actually
  164. executed as a command if it is typed while Emacs is waiting for input.
  165.    If you quit twice in a row before the first `C-g' is recognized, you
  166. activate the "emergency escape" feature and return to the shell. *Note
  167. Emergency Escape::.
  168.    Aborting with `C-]' (`abort-recursive-edit') is used to get out of a
  169. recursive editing level and cancel the command which invoked it.
  170. Quitting with `C-g' does not do this, and could not do this, because it
  171. is used to cancel a partially typed command within the recursive
  172. editing level.  Both operations are useful.  For example, if you are in
  173. the Emacs debugger (*note Lisp Debug::.) and have typed `C-u 8' to
  174. enter a numeric argument, you can cancel that argument with `C-g' and
  175. remain in the debugger.
  176.    The command `M-x top-level' is equivalent to "enough" `C-]' commands
  177. to get you out of all the levels of recursive edits that you are in. 
  178. `C-]' gets you out one level at a time, but `M-x top-level' goes out
  179. all levels at once.  Both `C-]' and `M-x top-level' are like all other
  180. commands, and unlike `C-g', in that they are effective only when Emacs
  181. is ready for a command.  `C-]' is an ordinary key and has its meaning
  182. only because of its binding in the keymap. *Note Recursive Edit::.
  183.    `C-x u' (`undo') is not strictly speaking a way of cancelling a
  184. command, but you can think of it as cancelling a command already
  185. finished executing.  *Note Undo::.
  186. File: emacs,  Node: Lossage,  Next: Bugs,  Prev: Quitting,  Up: Top
  187. Dealing with Emacs Trouble
  188. ==========================
  189.    This section describes various conditions in which Emacs fails to
  190. work, and how to recognize them and correct them.
  191. * Menu:
  192. * Stuck Recursive::    `[...]' in mode line around the parentheses
  193. * Screen Garbled::     Garbage on the screen
  194. * Text Garbled::       Garbage in the text
  195. * Unasked-for Search:: Spontaneous entry to incremental search
  196. * Emergency Escape::   Emergency escape--
  197.                         What to do if Emacs stops responding
  198. * Total Frustration::  When you are at your wits' end.
  199. File: emacs,  Node: Stuck Recursive,  Next: Screen Garbled,  Prev: Lossage,  Up: Lossage
  200. Recursive Editing Levels
  201. ------------------------
  202.    Recursive editing levels are important and useful features of Emacs,
  203. but they can seem like malfunctions to the user who does not understand
  204. them.
  205.    If the mode line has square brackets `[...]' around the parentheses
  206. that contain the names of the major and minor modes, you have entered a
  207. recursive editing level.  If you did not do this on purpose, or if you
  208. don't understand what that means, you should just get out of the
  209. recursive editing level.  To do so, type `M-x top-level'.  This is
  210. called getting back to top level.  *Note Recursive Edit::.
  211. File: emacs,  Node: Screen Garbled,  Next: Text Garbled,  Prev: Stuck Recursive,  Up: Lossage
  212. Garbage on the Screen
  213. ---------------------
  214.    If the data on the screen looks wrong, the first thing to do is see
  215. whether the text is really wrong.  Type `C-l', to redisplay the entire
  216. screen.  If it appears correct after this, the problem was entirely in
  217. the previous screen update.
  218.    Display updating problems often result from an incorrect termcap
  219. entry for the terminal you are using.  The file `etc/TERMS' in the Emacs
  220. distribution gives the fixes for known problems of this sort. `INSTALL'
  221. contains general advice for these problems in one of its sections. 
  222. Very likely there is simply insufficient padding for certain display
  223. operations.  To investigate the possibility that you have this sort of
  224. problem, try Emacs on another terminal made by a different manufacturer.
  225. If problems happen frequently on one kind of terminal but not another
  226. kind, it is likely to be a bad termcap entry, though it could also be
  227. due to a bug in Emacs that appears for terminals that have or that lack
  228. specific features.
  229. File: emacs,  Node: Text Garbled,  Next: Unasked-for Search,  Prev: Screen Garbled,  Up: Lossage
  230. Garbage in the Text
  231. -------------------
  232.    If `C-l' shows that the text is wrong, try undoing the changes to it
  233. using `C-x u' until it gets back to a state you consider correct.  Also
  234. try `C-h l' to find out what command you typed to produce the observed
  235. results.
  236.    If a large portion of text appears to be missing at the beginning or
  237. end of the buffer, check for the word `Narrow' in the mode line. If it
  238. appears, the text is still present, but marked off-limits. To make it
  239. visible again, type `C-x w'.  *Note Narrowing::.
  240. File: emacs,  Node: Unasked-for Search,  Next: Emergency Escape,  Prev: Text Garbled,  Up: Lossage
  241. Spontaneous Entry to Incremental Search
  242. ---------------------------------------
  243.    If Emacs spontaneously displays `I-search:' at the bottom of the
  244. screen, it means that the terminal is sending `C-s' and `C-q' according
  245. to the poorly designed `xon/xoff' "flow control" protocol.  You should
  246. try to prevent this by putting the terminal in a mode where it will not
  247. use flow control or giving it enough padding that it will never send a
  248. `C-s'.  If that cannot be done, you must tell Emacs to expect flow
  249. control to be used, until you can get a properly designed terminal.
  250.    Information on how to do these things can be found in the file
  251. `INSTALL' in the Emacs distribution.
  252. File: emacs,  Node: Emergency Escape,  Next: Total Frustration,  Prev: Unasked-for Search,  Up: Lossage
  253. Emergency Escape
  254. ----------------
  255.    Because at times there have been bugs causing Emacs to loop without
  256. checking `quit-flag', a special feature causes Emacs to be suspended
  257. immediately if you type a second `C-g' while the flag is already set,
  258. so you can always get out of GNU Emacs.  Normally Emacs recognizes and
  259. clears `quit-flag' (and quits!) quickly enough to prevent this from
  260. happening.
  261.    When you resume Emacs after a suspension caused by multiple `C-g', it
  262. asks two questions before going back to what it had been doing:
  263.      Auto-save? (y or n)
  264.      Abort (and dump core)? (y or n)
  265. Answer each one with `y' or `n' followed by RET.
  266.    Saying `y' to `Auto-save?' causes immediate auto-saving of all
  267. modified buffers in which auto-saving is enabled.
  268.    Saying `y' to `Abort (and dump core)?' causes an illegal instruction
  269. to be executed, dumping core.  This is to enable a wizard to figure out
  270. why Emacs was failing to quit in the first place.  Execution does not
  271. continue after a core dump.  If you answer `n', execution does
  272. continue.  With luck, GNU Emacs will ultimately check `quit-flag' and
  273. quit normally. If not, and you type another `C-g', it is suspended
  274. again.
  275.    If Emacs is not really hung, just slow, you may invoke the double
  276. `C-g' feature without really meaning to.  Then just resume and answer
  277. `n' to both questions, and you will arrive at your former state.
  278. Presumably the quit you requested will happen soon.
  279.    The double-`C-g' feature may be turned off when Emacs is running
  280. under a window system, since the window system always enables you to
  281. kill Emacs or to create another window and run another program.
  282. File: emacs,  Node: Total Frustration,  Prev: Emergency Escape,  Up: Lossage
  283. Help for Total Frustration
  284. --------------------------
  285.    If using Emacs (or something else) becomes terribly frustrating and
  286. none of the techniques described above solve the problem, Emacs can
  287. still help you.
  288.    First, if the Emacs you are using is not responding to commands, type
  289. `C-g C-g' to get out of it and then start a new one.
  290.    Second, type `M-x doctor RET'.
  291.    The doctor will make you feel better.  Each time you say something to
  292. the doctor, you must end it by typing RET RET.  This lets the doctor
  293. know you are finished.
  294. File: emacs,  Node: Bugs,  Next: Version 19,  Prev: Lossage,  Up: Top
  295. Reporting Bugs
  296. ==============
  297.    Sometimes you will encounter a bug in Emacs.  Although we cannot
  298. promise we can or will fix the bug, and we might not even agree that it
  299. is a bug, we want to hear about bugs you encounter in case we do want
  300. to fix them.
  301.    To make it possible for us to fix a bug, you must report it.  In
  302. order to do so effectively, you must know when and how to do it.
  303. When Is There a Bug
  304. -------------------
  305.    If Emacs executes an illegal instruction, or dies with an operating
  306. system error message that indicates a problem in the program (as
  307. opposed to something like "disk full"), then it is certainly a bug.
  308.    If Emacs updates the display in a way that does not correspond to
  309. what is in the buffer, then it is certainly a bug.  If a command seems
  310. to do the wrong thing but the problem corrects itself if you type
  311. `C-l', it is a case of incorrect display updating.
  312.    Taking forever to complete a command can be a bug, but you must make
  313. certain that it was really Emacs's fault.  Some commands simply take a
  314. long time.  Type `C-g' and then `C-h l' to see whether the input Emacs
  315. received was what you intended to type; if the input was such that you
  316. KNOW it should have been processed quickly, report a bug.  If you don't
  317. know whether the command should take a long time, find out by looking
  318. in the manual or by asking for assistance.
  319.    If a command you are familiar with causes an Emacs error message in a
  320. case where its usual definition ought to be reasonable, it is probably a
  321.    If a command does the wrong thing, that is a bug.  But be sure you
  322. know for certain what it ought to have done.  If you aren't familiar
  323. with the command, or don't know for certain how the command is supposed
  324. to work, then it might actually be working right.  Rather than jumping
  325. to conclusions, show the problem to someone who knows for certain.
  326.    Finally, a command's intended definition may not be best for editing
  327. with.  This is a very important sort of problem, but it is also a
  328. matter of judgment.  Also, it is easy to come to such a conclusion out
  329. of ignorance of some of the existing features.  It is probably best not
  330. to complain about such a problem until you have checked the
  331. documentation in the usual ways, feel confident that you understand it,
  332. and know for certain that what you want is not available.  If you are
  333. not sure what the command is supposed to do after a careful reading of
  334. the manual, check the index and glossary for any terms that may be
  335. unclear.  If you still do not understand, this indicates a bug in the
  336. manual.  The manual's job is to make everything clear.  It is just as
  337. important to report documentation bugs as program bugs.
  338.    If the on-line documentation string of a function or variable
  339. disagrees with the manual, one of them must be wrong, so report the bug.
  340. How to Report a Bug
  341. -------------------
  342.    When you decide that there is a bug, it is important to report it
  343. and to report it in a way which is useful.  What is most useful is an
  344. exact description of what commands you type, starting with the shell
  345. command to run Emacs, until the problem happens.  Always include the
  346. version number of Emacs that you are using; type `M-x emacs-version' to
  347. print this.
  348.    The most important principle in reporting a bug is to report FACTS,
  349. not hypotheses or categorizations.  It is always easier to report the
  350. facts, but people seem to prefer to strain to posit explanations and
  351. report them instead.  If the explanations are based on guesses about
  352. how Emacs is implemented, they will be useless; we will have to try to
  353. figure out what the facts must have been to lead to such speculations. 
  354. Sometimes this is impossible.  But in any case, it is unnecessary work
  355. for us.
  356.    For example, suppose that you type `C-x C-f /glorp/baz.ugh RET',
  357. visiting a file which (you know) happens to be rather large, and Emacs
  358. prints out `I feel pretty today'.  The best way to report the bug is
  359. with a sentence like the preceding one, because it gives all the facts
  360. and nothing but the facts.
  361.    Do not assume that the problem is due to the size of the file and
  362. say, "When I visit a large file, Emacs prints out `I feel pretty
  363. today'." This is what we mean by "guessing explanations".  The problem
  364. is just as likely to be due to the fact that there is a `z' in the file
  365. name.  If this is so, then when we got your report, we would try out
  366. the problem with some "large file", probably with no `z' in its name,
  367. and not find anything wrong.  There is no way in the world that we
  368. could guess that we should try visiting a file with a `z' in its name.
  369.    Alternatively, the problem might be due to the fact that the file
  370. starts with exactly 25 spaces.  For this reason, you should make sure
  371. that you inform us of the exact contents of any file that is needed to
  372. reproduce the bug.  What if the problem only occurs when you have typed
  373. the `C-x C-a' command previously?  This is why we ask you to give the
  374. exact sequence of characters you typed since starting to use Emacs.
  375.    You should not even say "visit a file" instead of `C-x C-f' unless
  376. you know that it makes no difference which visiting command is used.
  377. Similarly, rather than saying "if I have three characters on the line,"
  378. say "after I type `RET A B C' RET C-p," if that is the way you entered
  379. the text.
  380.    If you are not in Fundamental mode when the problem occurs, you
  381. should say what mode you are in.
  382.    If the manifestation of the bug is an Emacs error message, it is
  383. important to report not just the text of the error message but a
  384. backtrace showing how the Lisp program in Emacs arrived at the error. 
  385. To make the backtrace, you must execute the Lisp expression `(setq
  386. debug-on-error t)' before the error happens (that is to say, you must
  387. execute that expression and then make the bug happen).  This causes the
  388. Lisp debugger to run (*note Lisp Debug::.).  The debugger's backtrace
  389. can be copied as text into the bug report.  This use of the debugger is
  390. possible only if you know how to make the bug happen again.  Do note
  391. the error message the first time the bug happens, so if you can't make
  392. it happen again, you can report at least that.
  393.    Check whether any programs you have loaded into the Lisp world,
  394. including your `.emacs' file, set any variables that may affect the
  395. functioning of Emacs.  Also, see whether the problem happens in a
  396. freshly started Emacs without loading your `.emacs' file (start Emacs
  397. with the `-q' switch to prevent loading the init file.)  If the problem
  398. does NOT occur then, it is essential that we know the contents of any
  399. programs that you must load into the Lisp world in order to cause the
  400. problem to occur.
  401.    If the problem does depend on an init file or other Lisp programs
  402. that are not part of the standard Emacs system, then you should make
  403. sure it is not a bug in those programs by complaining to their
  404. maintainers first. After they verify that they are using Emacs in a way
  405. that is supposed to work, they should report the bug.
  406.    If you can tell us a way to cause the problem without visiting any
  407. files, please do so.  This makes it much easier to debug.  If you do
  408. need files, make sure you arrange for us to see their exact contents. 
  409. For example, it can often matter whether there are spaces at the ends
  410. of lines, or a newline after the last line in the buffer (nothing ought
  411. to care whether the last line is terminated, but tell that to the bugs).
  412.    The easy way to record the input to Emacs precisely is to write a
  413. dribble file; execute the Lisp expression
  414.      (open-dribble-file "~/dribble")
  415. using `Meta-ESC' or from the `*scratch*' buffer just after starting
  416. Emacs.  From then on, all Emacs input will be written in the specified
  417. dribble file until the Emacs process is killed.
  418.    For possible display bugs, it is important to report the terminal
  419. type (the value of environment variable `TERM'), the complete termcap
  420. entry for the terminal from `/etc/termcap' (since that file is not
  421. identical on all machines), and the output that Emacs actually sent to
  422. the terminal. The way to collect this output is to execute the Lisp
  423. expression
  424.      (open-termscript "~/termscript")
  425. using `Meta-ESC' or from the `*scratch*' buffer just after starting
  426. Emacs.  From then on, all output from Emacs to the terminal will be
  427. written in the specified termscript file as well, until the Emacs
  428. process is killed.  If the problem happens when Emacs starts up, put
  429. this expression into your `.emacs' file so that the termscript file will
  430. be open when Emacs displays the screen for the first time.  Be warned:
  431. it is often difficult, and sometimes impossible, to fix a
  432. terminal-dependent bug without access to a terminal of the type that
  433. stimulates the bug.
  434.    The address for reporting bugs is
  435. GNU Emacs Bugs
  436. Free Software Foundation
  437. 675 Mass Ave
  438. Cambridge, MA 02139
  439. or send email either to `bug-gnu-emacs@prep.ai.mit.edu' (Internet) or
  440. to `uunet!prep.ai.mit.edu!bug-gnu-emacs' (Usenet).
  441.    Once again, we do not promise to fix the bug; but if the bug is
  442. serious, or ugly, or easy to fix, chances are we will want to.
  443. File: emacs,  Node: Version 19,  Next: Manifesto,  Prev: Bugs,  Up: Top
  444. Version 19 Antenews
  445. *******************
  446.    This chapter prematurely describes new features of Emacs 19, in
  447. anticipation of its release.  We have included this so that the version
  448. 18 manuals don't become obsolete as soon as Emacs 19 comes out.  This
  449. list mentions only features that would belong in `The GNU Emacs
  450. Manual'; changes relevant to Emacs Lisp programming will be documented
  451. in the next revision of `The GNU Emacs Lisp Manual'.
  452. * Menu:
  453. * Basic Changes::      Changes every user must know.
  454. * New Facilities::      Changes every user will want to know.
  455. * Binding Changes::      Ordinary commands that have been moved.  Important!.
  456. * Changed Commands::      Ordinary commands that have new features.  Important!
  457. * M-x Changes::          Changes in commands you run with `M-x'.  Important!
  458. * New Commands::      Commands that have been added
  459.                 that we expect many users to want to use.
  460. * Search Changes::      Changes in incremental search.  Some are important.
  461. The rest of the changes you can pretty much ignore unless you are interested.
  462. * Filling Changes::      Changes in fill commands.
  463. * TeX Mode Changes::      Changes in the commands for editing TeX files
  464.                 and running TeX.
  465. * Shell Changes::      Major changes in all the modes that run subprograms.
  466. * Spell Changes::      These commands now use ispell instead of spell.
  467. * Tags Changes::      Changes in Tags facility.
  468. * Mail Changes::      Changes in both Sendmail mode and Rmail mode.
  469. * Info Changes::      New commands in Info.
  470. * Dired Changes::      Powerful new features in Dired.
  471. * GNUS::          An alternative news reader.
  472. * Calendar/Diary::      The calendar feature now lets you move to different
  473.                 dates and convert to and from other calendars.
  474.               You can also display related entries from your diary
  475.                 file.
  476. * Version Control::      A convenient interface to RCS or SCCS.
  477. * Emerge::          A new feature for merging files interactively.
  478. * Debuggers::          Running debuggers (GDB, DBX, SDB) under Emacs.
  479. * Other New Modes::      Miscellaneous new and changed major modes.
  480. * Key Sequence Changes::  You can now bind key sequences that include function
  481.                 keys and mouse clicks.
  482. * Hook Changes::      Hook variables have been renamed more systematically.
  483. File: emacs,  Node: Basic Changes,  Next: New Facilities,  Up: Version 19
  484. Basic Changes
  485. =============
  486.    We have made changes to help Emacs use fewer resources and make it
  487. less likely to become irreparably hung.  While these changes don't
  488. alter the commands of Emacs, they are important enough to be worth
  489. mentioning.
  490.    You can quit with `C-g' while Emacs is waiting to read or write a
  491. file--provided the operating system will allow you to interrupt the
  492. system call that is hung.  (Unfortunately, most NFS implementations
  493. won't allow interruption.)
  494.    When you kill buffers, Emacs now returns memory to the operating
  495. system, thus reducing the size of the Emacs process.  The space that
  496. you free up by killing buffers can now be reused for other buffers no
  497. matter what their sizes, or reused by other processes if Emacs doesn't
  498. need it.
  499. Multiple X Windows
  500. ------------------
  501.    When using X windows, you can now create more than one window at the
  502. X level.  Each X window displays a "frame" which can contain one or
  503. several Emacs windows.  Each frame has its own echo area and normally
  504. its own minibuffer.  (To avoid confusion, we reserve the word "window"
  505. for the subdivisions that Emacs implements, and never use it to refer
  506. to a frame.)  The easiest way to create additional frames is with the
  507. `C-x 5' prefix character (*note New Everyday Commands: New Commands.).
  508.    Emacs windows can now have scroll bars; use the `scroll-bar-mode'
  509. command to turn scroll bars on or off.  With no argument, it toggles the
  510. use of scroll bars.  With an argument, it turns use of scroll bars on if
  511. and only if the argument is positive.  This command applies to all
  512. frames, including frames yet to be created.  (You can control scroll
  513. bars on a frame by frame basis by writing a Lisp program.)
  514. Undo Improvements
  515. -----------------
  516.    Undoing a deletion now puts the cursor position where it was just
  517. before the deletion.
  518. Auto Save Improvements
  519. ----------------------
  520.    Emacs now does garbage collection and auto saving while it is waiting
  521. for input, which often avoids the need to do these things while you are
  522. typing.  The variable `auto-save-timeout' says how many seconds Emacs
  523. should wait, after you stop typing, before it does an auto save and
  524. perhaps also a garbage collection.  (The actual time period varies also
  525. according to the size of the buffer--longer for longer buffers, since
  526. auto saving itself is slower for long buffers.)  This way, Emacs does
  527. not interrupt or delay your typing.
  528.    In Emacs 18, when auto saving detects that a buffer has shrunk
  529. greatly, it refrains from auto saving that buffer and displays a
  530. warning.  In version 19, it also turns off Auto Save mode in that
  531. buffer, so that you won't get the same warning repeatedly.  If you
  532. reenable Auto Save mode in that buffer, Emacs will start saving it
  533. again despite the shrinkage.
  534.    In Emacs 19, `revert-buffer' no longer offers to revert from the
  535. latest auto-save file.  That option hasn't been very useful since the
  536. change to keep more undo information.
  537.    The command `recover-file' no longer turns off Auto Save mode.
  538. File Local Variables
  539. --------------------
  540.    The user option for controlling whether files can set local
  541. variables is called `enable-local-variables' in Emacs 19, rather than
  542. `inhibit-local-variables'.  A value of `t' means local-variables lists
  543. are obeyed; `nil' means they are ignored; anything else means query the
  544. user.
  545. File: emacs,  Node: New Facilities,  Next: Binding Changes,  Prev: Basic Changes,  Up: Version 19
  546. New Basic Facilities
  547. ====================
  548.    You can now get back recent minibuffer inputs conveniently.  While in
  549. the minibuffer, type `M-p' (`previous-history-element') to fetch the
  550. next earlier minibuffer input, and use `M-n' (`next-history-element')
  551. to fetch the next later input.
  552.    There are also commands to search forward or backward through the
  553. history.  As of this writing, they search for history elements that
  554. match a regular expression that you specify with the minibuffer. `M-r'
  555. (`previous-matching-history-element') searches older elements in the
  556. history, while `M-s' (`next-matching-history-element') searches newer
  557. elements.  By special dispensation, these commands can always use the
  558. minibuffer to read their arguments even though you are already in the
  559. minibuffer when you issue them.
  560.    We may have changed the precise way these commands work by the time
  561. you use Emacs 19.  Perhaps they will search for a match for the string
  562. given so far in the minibuffer; perhaps they will search for a literal
  563. match rather than a regular expression match; perhaps they will only
  564. accept matches at the beginning of a history element; perhaps they will
  565. read the string to search for incrementally like `C-s'.  We want to
  566. choose an interface that is convenient, flexible and natural, and these
  567. goals are somewhat contradictory.  To find out what interface is
  568. actually available, type `C-h f previous-matching-history-element'.
  569.    The history feature is available for all uses of the minibuffer, but
  570. there are separate history lists for different kinds of input.  For
  571. example, there is a list for file names, used by all the commands that
  572. read file names.  There is a list for arguments of commands like
  573. `query-replace'.  There are also very specific history lists, such as
  574. the one that `compile' uses for compilation commands.
  575. Remote File Access
  576. ------------------
  577.    You can refer to files on other machines using a special file name
  578. syntax:
  579.      /HOST:FILENAME
  580.      /USER@HOST:FILENAME
  581.    When you do this, Emacs uses the FTP program to read and write files
  582. on the specified host.  It logs in through FTP using your user name or
  583. the name USER.  It may ask you for a password from time to time; this
  584. is used for logging in on HOST.
  585. Using Flow Control
  586. ------------------
  587.    There is now a convenient way to enable flow control when your
  588. terminal or your connection won't work without it.  Suppose you want to
  589. do this on VT-100 and H19 terminals; put the following in your `.emacs'
  590. file:
  591.      (evade-flow-control-on "vt100" "h19")
  592.    When flow control is enabled, you must type `C-\' to get the effect
  593. of a `C-s', and type `C-^' to get the effect of a `C-q'.
  594. Controlling Backup File Names
  595. -----------------------------
  596.    The default setting of the Lisp variable `version-control' now comes
  597. from the environment variable `VERSION_CONTROL'.  Thus, you can select
  598. a style of backup file naming for Emacs and other GNU utilities all
  599. together.
  600. File: emacs,  Node: Binding Changes,  Next: Changed Commands,  Prev: New Facilities,  Up: Version 19
  601. Changed Key Bindings
  602. ====================
  603. `M-{'
  604.      This is the new key sequence for `backward-paragraph'.  The old key
  605.      sequence for this, `M-[', is now undefined by default.
  606.      The reason for this change is to avoid conflict with the sequences
  607.      that function keys send on most terminals.
  608. `M-}'
  609.      This is the new key sequence for `forward-paragraph'.  The old key
  610.      sequence for this, `M-]', is now undefined by default.
  611.      We changed this to go along with `M-{'.
  612. `C-x C-u'
  613. `C-x C-l'
  614.      The two commands, `C-x C-u' (`upcase-region') and `C-x C-l'
  615.      (`downcase-region'), are now disabled by default; these keys seem
  616.      to be often hit by accident, and can be quite destructive if their
  617.      effects are not noticed immediately.
  618. `C-x 3'
  619.      `C-x 3' is now the key binding for `split-window-horizontally',
  620.      which splits a window into two side-by-side windows.  This used to
  621.      be `C-x 5'.
  622. ``C-x 4 C-o''
  623.      This key now runs `display-buffer', which displays a specified
  624.      buffer in another window without selecting it.
  625. `M-g'
  626.      `M-g' is now undefined.  It used to run the command `fill-region'.
  627.      This command used to be run more often by mistake than on purpose.
  628. `C-x a'
  629. `C-x n'
  630. `C-x r'
  631.      Three new prefix keys have been created to make many of the `C-x'
  632.      commands more systematic: `C-x a', `C-x n' and `C-x r'. `C-x a' is
  633.      used for abbreviation commands, `C-x n' for commands pertaining to
  634.      narrowing, and `C-x r' for register and rectangle commands.  These
  635.      are the new bindings, in detail:
  636.     `C-x a l'
  637.           `add-mode-abbrev' (previously `C-x C-a').
  638.     `C-x a g'
  639.           `add-global-abbrev' (previously `C-x +').
  640.     `C-x a i g'
  641.           `inverse-add-mode-abbrev' (previously `C-x C-h').
  642.     `C-x a i l'
  643.           `inverse-add-global-abbrev' (previously `C-x -').
  644.     `C-x a e'
  645.           `expand-abbrev' (previously `C-x '').
  646.     `C-x n n'
  647.           `narrow-to-region' (previously `C-x n').
  648.     `C-x n p'
  649.           `narrow-to-page' (previously `C-x p').
  650.     `C-x n w'
  651.           `widen' (previously `C-x w').
  652.     `C-x r C-SPC'
  653.           `point-to-register' (previously `C-x /').
  654.     `C-x r SPC'
  655.           Also `point-to-register' (previously `C-x /').
  656.     `C-x r j'
  657.           `jump-to-register' (previously `C-x j').
  658.     `C-x r s'
  659.           `copy-to-register' (previously `C-x x').
  660.     `C-x r i'
  661.           `insert-register' (previously `C-x g').
  662.     `C-x r r'
  663.           `copy-rectangle-to-register' (previously `C-x r').
  664.     `C-x r k'
  665.           `kill-rectangle' (no previous key binding).
  666.     `C-x r y'
  667.           `yank-rectangle' (no previous key binding).
  668.     `C-x r o'
  669.           `open-rectangle' (no previous key binding).
  670.     `C-x r f'
  671.           `frame-configuration-to-register' (a new command) saves the
  672.           state of all windows in all frames. Use `C-x r j' to restore
  673.           the configuration.
  674.     `C-x r w'
  675.           `window-configuration-to-register' (a new command) saves the
  676.           state of all windows in the selected  frame. Use `C-x r j' to
  677.           restore the configuration.
  678.      The old key bindings `C-x /', `C-x j', `C-x x' and `C-x g' have
  679.      not yet been removed.  The other old key bindings listed have been
  680.      removed.  The old key binding `C-x a', which was
  681.      `append-to-buffer', was removed to make way for a prefix key; now
  682.      `append-to-buffer' has no keybinding.
  683. `C-x v'
  684.      `C-x v' is a new prefix character, used for version control
  685.      commands. *Note Version Control::.
  686. File: emacs,  Node: Changed Commands,  Next: M-x Changes,  Prev: Binding Changes,  Up: Version 19
  687. Changed Everyday Commands
  688. =========================
  689. `C-o'
  690.      When you have a fill prefix, the command `C-o' inserts the prefix
  691.      on the newly created line.
  692. `M-^'
  693.      When you have a fill prefix, the command `M-^' deletes the prefix
  694.      (if it occurs) after the newline that it deletes.
  695. `M-z'
  696.      The `M-z' command (`zap-to-char') now kills through the target
  697.      character.  In version 18, it killed up to but not including the
  698.      target character.
  699. `M-!'
  700.      The command `M-!' (`shell-command') now runs the specified shell
  701.      command asynchronously if it ends in `&', just as the shell does.
  702. `C-x 2'
  703.      The `C-x 2' command (`split-window-vertically') now tries to avoid
  704.      scrolling by putting point in whichever window happens to contain
  705.      the screen line the cursor is already on.  If you don't like this,
  706.      you can turn it off by setting `split-window-keep-point' to `nil'.
  707. `C-x s'
  708.      The `C-x s' command (`save-some-buffers') now gives you more
  709.      options when it asks whether to save a particular buffer.  The
  710.      options are analogous to those of `query-replace'.  Here they are:
  711.     `y'
  712.           Save this buffer and ask about the rest of the buffers.
  713.     `n'
  714.           Don't save this buffer, but ask about the rest of the buffers.
  715.     `!'
  716.           Save this buffer and all the rest with no more questions.
  717.     `ESC'
  718.           Terminate `save-some-buffers' without any more saving.
  719.     `.'
  720.           Save only this buffer, then exit `save-some-buffers' without
  721.           even asking about other buffers.
  722.     `C-r'
  723.           View the buffer that you are currently being asked about. 
  724.           When you exit View mode, you get back to `save-some-buffers',
  725.           which asks the question again.
  726.     `C-h'
  727.           Display a help message about these options.
  728. `C-x C-v'
  729.      This command (`find-alternate-file') now inserts the entire current
  730.      file name in the minibuffer.  This is convenient if you made a
  731.      small mistake in typing it.  Point goes after the last slash,
  732.      before the last file name component, so if you want to replace it
  733.      entirely, you can use `C-k' right away to delete it.
  734. `C-M-f'
  735.      Expression and list commands such as `C-M-f' now ignore parentheses
  736.      within comments in Lisp mode.
  737. File: emacs,  Node: M-x Changes,  Next: New Commands,  Prev: Changed Commands,  Up: Version 19
  738. Changes in Common `M-x' Commands
  739. ================================
  740. `M-x make-symbolic-link'
  741.      This command now does not expand its second argument.  This lets
  742.      you make a link with a target that is a relative file name.
  743. `M-x add-change-log-entry'
  744. `C-x 4 a'
  745.      These commands now automatically insert the name of the file and
  746.      often the name of the function that you changed.  They also handle
  747.      grouping of entries.
  748.      There is now a special major mode for editing `ChangeLog' files.
  749.      It makes filling work conveniently.  Each bunch of grouped entries
  750.      is one paragraph, and each collection of entries from one person
  751.      on one day is considered a page.
  752. `M-x compare-windows'
  753.      With a prefix argument, `compare-windows' ignores changes in
  754.      whitespace.  If the variable `compare-ignore-case' is non-`nil',
  755.      it ignores differences in case as well.
  756. `M-x view-buffer'
  757. `M-x view-file'
  758.      The View commands (such as `M-x view-buffer' and `M-x view-file')
  759.      no longer use recursive edits; instead, they switch temporarily to
  760.      a different major mode (View mode) specifically designed for
  761.      moving around through a buffer without editing it.
  762. `M-x manual-entry'
  763.      `M-x manual-entry' now uses View mode for the buffer showing the
  764.      man page.
  765. `M-x compile'
  766.      You can repeat any previous `compile' conveniently using the
  767.      minibuffer history commands, while in the minibuffer entering the
  768.      compilation command.
  769.      While a compilation is going on, the string `Compiling' appears in
  770.      the mode line.  When this string disappears, the compilation is
  771.      finished.
  772.      The buffer of compiler messages is in Compilation mode.  This mode
  773.      provides the keys SPC and DEL to scroll by screenfuls, and `M-n'
  774.      and `M-p' to move to the next or previous error message. You can
  775.      also use `M-{' and `M-}' to move up or down to an error message
  776.      for a different source file.  Use `C-c C-c' on any error message
  777.      to find the corresponding source code.
  778.      Emacs 19 has a more general parser for compiler messages.  For
  779.      example, it can understand messages from lint, and from certain C
  780.      compilers whose error message format is unusual.
  781. File: emacs,  Node: New Commands,  Next: Search Changes,  Prev: M-x Changes,  Up: Version 19
  782. New Everyday Commands
  783. =====================
  784. `C-z'
  785.      When you are using X windows, `C-z' (`iconify-frame') now
  786.      iconifies the current frame.
  787. `C-M-l'
  788.      The `C-M-l' command (`reposition-window') scrolls the current
  789.      window heuristically in a way designed to get useful information
  790.      onto the screen.  For example, in a Lisp file, this command tries
  791.      to get the entire current defun onto the screen if possible.
  792. `C-M-r'
  793.      The `C-M-r' key now runs the command `isearch-backward-regexp',
  794.      which does reverse incremental regexp search.
  795. `C-x 5'
  796.      The prefix key `C-x 5' is analogous to `C-x 4', with parallel
  797.      subcommands.  The difference is that `C-x 5' commands create a new
  798.      frame rather than just a new window.
  799. `C-x 5 C-f'
  800. `C-x 5 b'
  801.      These new commands switch to a specified file or buffer in a new
  802.      frame (when using X windows).  The commands' names are
  803.      `find-file-other-frame' and `switch-to-buffer-other-frame'.
  804. `C-x 5 m'
  805.      Start outgoing mail in another frame (`mail-other-frame').
  806. `C-x 5 .'
  807.      Find a tag in another frame (`find-tag-other-frame').
  808. `C-x 4 r'
  809.      This is now `find-file-read-only-other-window'.
  810. arrow keys
  811.      The arrow keys now have default bindings to move in the appropriate
  812.      directions.
  813. `C-h C-f'
  814. `C-h C-k'
  815.      These new help commands enter Info and display the node for a given
  816.      Emacs function name or key sequence, respectively.
  817. `M-a'
  818. `M-e'
  819.      In C mode, `M-a' and `M-e' now move by complete C statements
  820.      (`c-beginning-of-statement' and `c-end-of-statement').
  821. `M-q'
  822.      `M-q' in C mode now runs `c-fill-paragraph', which is designed for
  823.      filling C comments.  (We assume you don't want to fill the actual C
  824.      code in a C program.)
  825. `M-x c-up-conditional'
  826.      In C mode, `c-up-conditional' moves back to the containing
  827.      preprocessor conditional, setting the mark where point was
  828.      previously.
  829.      A prefix argument acts as a repeat count.  With a negative
  830.      argument, this command moves forward to the end of the containing
  831.      preprocessor conditional.  When going backwards, `#elif' acts like
  832.      `#else' followed by `#if'.  When going forwards, `#elif' is
  833.      ignored.
  834. `M-x comment-region'
  835.      The `comment-region' command adds comment delimiters to the lines
  836.      that start in the region, thus commenting them out.  With a
  837.      negative argument, it deletes comment delimiters from the lines in
  838.      the region--this is the inverse of the effect of `comment-region'
  839.      without an argument.
  840.      With a positive argument, `comment-region' adds comment delimiters
  841.      but duplicates the last character of the comment start sequence as
  842.      many times as the argument specifies.  This is a way of calling
  843.      attention to the comment.  In Lisp, you should use an argument of
  844.      at least two, because the indentation convention for single
  845.      semicolon comments does not leave them at the beginning of a line.
  846. `M-x super-apropos'
  847.      This command is like `apropos' except that it searches for a
  848.      regular expression instead of merely a substring.
  849.      If you use a prefix argument (regardless of its value) with
  850.      `apropos' or `super-apropos', they also search documentation
  851.      strings for matches as well as symbol names.  The prefix argument
  852.      also controls looking up and printing the key bindings of all
  853.      commands.
  854. `M-x diff'
  855.      This new command compares two files, displaying the differences in
  856.      an Emacs buffer.  The options for the `diff' program come from the
  857.      variable `diff-switches', whose value should be a string.
  858.      The buffer of differences has Compilation mode as its major mode,
  859.      so you can use `C-x `' to visit successive changed locations in
  860.      the two source files, or you can move to a particular hunk of
  861.      changes and type `C-c C-c' to move to the corresponding source. 
  862.      You can also use the other special commands of Compilation mode:
  863.      SPC and DEL for scrolling, and `M-p' and `M-n' for cursor motion.
  864. `M-x diff-backup'
  865.      The command `diff-backup' compares a specified file with its most
  866.      recent backup.  If you specify the name of a backup file,
  867.      `diff-backup' compares it with the source file that it is a backup
  868.      of.
  869. File: emacs,  Node: Search Changes,  Next: Filling Changes,  Prev: New Commands,  Up: Version 19
  870. Changes in Incremental Search
  871. =============================
  872.    The most important change in incremental search is that RET now
  873. terminates a search, and ESC does not.  The other changes are useful,
  874. but not vital to know about.
  875.    * The character to terminate an incremental search is now RET.  This
  876.      is for compatibility with the way most other arguments are read.
  877.      To search for a newline in an incremental search, type LFD (also
  878.      known as `C-j').
  879.      (This change is somewhat of an experiment; it might be taken back
  880.      by the time Emacs 19 is really released.)
  881.    * Incremental search now maintains a ring of previous search
  882.      strings.  Use `M-p' and `M-n' to move through the ring to pick a
  883.      search string to reuse.  These commands leave the selected search
  884.      ring element in the minibuffer, where you can edit it.  Type RET
  885.      to finish editing and search for the chosen string.
  886.    * When there is an upper-case letter in the search string, then the
  887.      search is case sensitive.
  888.    * Incremental search is now implemented as a major mode.  When you
  889.      type `C-s', it switches temporarily to a different keymap which
  890.      defines each key to do what it ought to do for incremental search.
  891.       This has next to no effect on the user-visible behavior of
  892.      searching, but makes it easier to customize that behavior.
  893. File: emacs,  Node: Filling Changes,  Next: TeX Mode Changes,  Prev: Search Changes,  Up: Version 19
  894. Changes in Fill Commands
  895. ========================
  896.    * `fill-individual-paragraphs' now has two modes.  Its default mode
  897.      is that any change in indentation starts a new paragraph.  The
  898.      alternate mode is that only separator lines separate paragraphs;
  899.      this can handle paragraphs with extra indentation on the first
  900.      line.  To select the alternate mode, set
  901.      `fill-individual-varying-indent' to a non-`nil' value.
  902.    * Filling is now partially controlled by a new minor mode, Adaptive
  903.      Fill mode.  When this mode is enabled (and it is enabled by
  904.      default), if you use `fill-region-as-paragraph' on an indented
  905.      paragraph and you don't have a fill prefix, it uses the
  906.      indentation of the second line of the paragraph as the fill prefix.
  907.      Adaptive Fill mode doesn't have much effect on `M-q' in most major
  908.      modes, because an indented line will probably count as a paragraph
  909.      starter and thus each line of an indented paragraph will be
  910.      considered a paragraph of its own.
  911.    * `M-q' in C mode now runs `c-fill-paragraph', which is designed for
  912.      filling C comments.  (We assume you don't want to fill the actual C
  913.      code in a C program.)
  914.