home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / e1858src.lha / emacs-18.58 / info / emacs-2 < prev    next >
Encoding:
GNU Info File  |  1992-02-21  |  47.7 KB  |  1,119 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.43 from the
  2. input file emacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  15. General Public License" are included exactly as in the original, and
  16. provided that the entire resulting derived work is distributed under
  17. the terms of a permission notice identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the sections entitled "The GNU Manifesto",
  22. "Distribution" and "GNU General Public License" may be included in a
  23. translation approved by the author instead of in the original English.
  24.  
  25. 
  26. File: emacs,  Node: Commands,  Next: Entering Emacs,  Prev: Keys,  Up: Top
  27.  
  28. Keys and Commands
  29. =================
  30.  
  31.    This manual is full of passages that tell you what particular keys
  32. do.  But Emacs does not assign meanings to keys directly.  Instead,
  33. Emacs assigns meanings to "functions", and then gives keys their
  34. meanings by "binding" them to functions.
  35.  
  36.    A function is a Lisp object that can be executed as a program. 
  37. Usually it is a Lisp symbol which has been given a function
  38. definition; every symbol has a name, usually made of a few English
  39. words separated by dashes, such as `next-line' or `forward-word'.  It
  40. also has a "definition" which is a Lisp program; this is what makes
  41. the function do what it does.  Only some functions can be the bindings
  42. of keys; these are functions whose definitions use `interactive' to
  43. specify how to call them interactively.  Such functions are called
  44. "commands", and their names are "command names".  More information on
  45. this subject will appear in the GNU Emacs Lisp Manual (which is not
  46. yet written).
  47.  
  48.    The bindings between keys and functions are recorded in various
  49. tables called "keymaps".  *Note Keymaps::.
  50.  
  51.    When we say that "`C-n' moves down vertically one line" we are
  52. glossing over a distinction that is irrelevant in ordinary use but is
  53. vital in understanding how to customize Emacs.  It is the function
  54. `next-line' that is programmed to move down vertically.  `C-n' has
  55. this effect because it is bound to that function.  If you rebind `C-n'
  56. to the function `forward-word' then `C-n' will move forward by words
  57. instead.  Rebinding keys is a common method of customization.
  58.  
  59.    In the rest of this manual, we usually ignore this subtlety to keep
  60. things simple.  To give the customizer the information he needs, we
  61. state the name of the command which really does the work in parentheses
  62. after mentioning the key that runs it.  For example, we will say that
  63. "The command `C-n' (`next-line') moves point vertically down," meaning
  64. that `next-line' is a command that moves vertically down and `C-n' is
  65. a key that is standardly bound to it.
  66.  
  67.    While we are on the subject of information for customization only,
  68. it's a good time to tell you about "variables".  Often the description
  69. of a command will say, "To change this, set the variable `mumble-foo'."
  70. A variable is a name used to remember a value.  Most of the variables
  71. documented in this manual exist just to facilitate customization: some
  72. command or other part of Emacs examines the variable and behaves
  73. differently accordingly.  Until you are interested in customizing, you
  74. can ignore the information about variables.  When you are ready to be
  75. interested, read the basic information on variables, and then the
  76. information on individual variables will make sense.  *Note
  77. Variables::.
  78.  
  79. 
  80. File: emacs,  Node: Entering Emacs,  Next: Exiting,  Prev: Commands,  Up: Top
  81.  
  82. Entering and Exiting Emacs
  83. **************************
  84.  
  85.    The usual way to invoke Emacs is just to type `emacs RET' at the
  86. shell.  Emacs clears the screen and then displays an initial advisor
  87. message and copyright notice.  You can begin typing Emacs commands
  88. immediately afterward.
  89.  
  90.    Some operating systems insist on discarding all type-ahead when
  91. Emacs starts up; they give Emacs no way to prevent this.  Therefore,
  92. it is wise to wait until Emacs clears the screen before typing your
  93. first editing command.
  94.  
  95.    Before Emacs reads the first command, you have not had a chance to
  96. give a command to specify a file to edit.  But Emacs must always have
  97. a current buffer for editing.  In an attempt to do something useful,
  98. Emacs presents a buffer named `*scratch*' which is in Lisp Interaction
  99. mode; you can use it to type Lisp expressions and evaluate them, or
  100. you can ignore that capability and simply doodle.  (You can specify a
  101. different major mode for this buffer by setting the variable
  102. `initial-major-mode' in your init file.  *Note Init File::.)
  103.  
  104.    It is also possible to specify files to be visited, Lisp files to be
  105. loaded, and functions to be called, by giving Emacs arguments in the
  106. shell command line.  *Note Command Switches::.
  107.  
  108. 
  109. File: emacs,  Node: Exiting,  Next: Command Switches,  Prev: Entering Emacs,  Up: Top
  110.  
  111. Exiting Emacs
  112. =============
  113.  
  114.    There are two commands for exiting Emacs because there are two
  115. kinds of exiting: "suspending" Emacs and "killing" Emacs. 
  116. "Suspending" means stopping Emacs temporarily and returning control to
  117. its superior (usually the shell), allowing you to resume editing later
  118. in the same Emacs job, with the same files, same kill ring, same undo
  119. history, and so on.  This is the usual way to exit.  "Killing" Emacs
  120. means destroying the Emacs job.  You can run Emacs again later, but
  121. you will get a fresh Emacs; there is no way to resume the same editing
  122. session after it has been killed.
  123.  
  124. `C-z'
  125.      Suspend Emacs (`suspend-emacs').
  126.  
  127. `C-x C-c'
  128.      Kill Emacs (`save-buffers-kill-emacs').
  129.  
  130.    To suspend Emacs, type `C-z' (`suspend-emacs').  This takes you
  131. back to the shell from which you invoked Emacs.  You can resume Emacs
  132. with the command `%emacs' if you are using the C shell.
  133.  
  134.    On systems that do not permit programs to be suspended, `C-z' runs
  135. an inferior shell that communicates directly with the terminal, and
  136. Emacs waits until you exit the subshell.  The only way on these
  137. systems to get back to the shell from which Emacs was run (to log out,
  138. for example) is to kill Emacs.  `C-d' or `exit' are typical commands
  139. to exit a subshell.
  140.  
  141.    To kill Emacs, type `C-x C-c' (`save-buffers-kill-emacs').  A
  142. two-character key is used for this to make it harder to type.  Unless a
  143. numeric argument is used, this command first offers to save any
  144. modified buffers.  If you do not save them all, it asks for
  145. reconfirmation with `yes' before killing Emacs, since any changes not
  146. saved before that will be lost forever.  Also, if any subprocesses are
  147. still running, `C-x C-c' asks for confirmation about them, since
  148. killing Emacs will kill the subprocesses immediately.
  149.  
  150.    In most programs running on Unix, certain characters may instantly
  151. suspend or kill the program.  (In Berkeley Unix these characters are
  152. normally `C-z' and `C-c'.)  This Unix feature is turned off while you
  153. are in Emacs.  The meanings of `C-z' and `C-x C-c' as keys in Emacs
  154. were inspired by the standard Berkeley Unix meanings of `C-z' and
  155. `C-c', but that is their only relationship with Unix.  You could
  156. customize these keys to do anything (*note Keymaps::.).
  157.  
  158. 
  159. File: emacs,  Node: Command Switches,  Next: Basic,  Prev: Exiting,  Up: Top
  160.  
  161. Command Line Switches and Arguments
  162. ===================================
  163.  
  164.    GNU Emacs supports command line arguments to request various actions
  165. when invoking Emacs.  These are for compatibility with other editors
  166. and for sophisticated activities.  They are not needed for ordinary
  167. editing with Emacs, so new users can skip this section.
  168.  
  169.    You may be used to using command line arguments with other editors
  170. to specify which file to edit.  That's because many other editors are
  171. designed to be started afresh each time you want to edit.  You edit
  172. one file and then exit the editor.  The next time you want to edit
  173. either another file or the same one, you must run the editor again. 
  174. With these editors, it makes sense to use a command line argument to
  175. say which file to edit.
  176.  
  177.    The recommended way to use GNU Emacs is to start it only once, just
  178. after you log in, and do all your editing in the same Emacs process. 
  179. Each time you want to edit a different file, you visit it with the
  180. existing Emacs, which eventually comes to have many files in it ready
  181. for editing.  Usually you do not kill the Emacs until you are about to
  182. log out.
  183.  
  184.    When files are nearly always read by typing commands to an editor
  185. that is already running, command line arguments for specifying a file
  186. when the editor is started are seldom needed.
  187.  
  188.    Emacs accepts command-line arguments that specify files to visit,
  189. functions to call, and other activities and operating modes.
  190.  
  191.    The command arguments are processed in the order they appear in the
  192. command argument list; however, certain arguments (the ones in the
  193. second table) must be at the front of the list if they are used.
  194.  
  195.    Here are the arguments allowed:
  196.  
  197. `FILE'
  198.      Visit FILE using `find-file'.  *Note Visiting::.
  199.  
  200. `+LINENUM FILE'
  201.      Visit FILE using `find-file', then go to line number LINENUM in
  202.      it.
  203.  
  204. `-l FILE'
  205. `-load FILE'
  206.      Load a file FILE of Lisp code with the function `load'.  *Note
  207.      Lisp Libraries::.
  208.  
  209. `-f FUNCTION'
  210. `-funcall FUNCTION'
  211.      Call Lisp function FUNCTION with no arguments.
  212.  
  213. `-i FILE'
  214. `-insert FILE'
  215.      Insert the contents of FILE into the current buffer.  This is
  216.      like what `M-x insert-buffer' does; *Note Misc File Ops::.
  217.  
  218. `-kill'
  219.      Exit from Emacs without asking for confirmation.
  220.  
  221.    The remaining switches are recognized only at the beginning of the
  222. command line.  If more than one of them appears, they must appear in
  223. the order that they appear in this table.
  224.  
  225. `-t DEVICE'
  226.      Use DEVICE as the device for terminal input and output.
  227.  
  228. `-d DISPLAY'
  229.      When running with the X window system, use the display named
  230.      DISPLAY to make the window that serves as Emacs's terminal.
  231.  
  232. `-batch'
  233.      Run Emacs in "batch mode", which means that the text being edited
  234.      is not displayed and the standard Unix interrupt characters such
  235.      as `C-z' and `C-c' continue to have their normal effect.  Emacs
  236.      in batch mode outputs to `stdout' only what would normally be
  237.      printed in the echo area under program control.
  238.  
  239.      Batch mode is used for running programs written in Emacs Lisp from
  240.      shell scripts, makefiles, and so on.  Normally the `-l' switch or
  241.      `-f' switch will be used as well, to invoke a Lisp program to do
  242.      the batch processing.
  243.  
  244.      `-batch' implies `-q' (do not load an init file).  It also causes
  245.      Emacs to kill itself after all command switches have been
  246.      processed.  In addition, auto-saving is not done except in
  247.      buffers for which it has been explicitly requested.
  248.  
  249. `-q'
  250. `-no-init-file'
  251.      Do not load your Emacs init file `~/.emacs'.
  252.  
  253. `-u USER'
  254. `-user USER'
  255.      Load USER's Emacs init file `~USER/.emacs' instead of your own.
  256.  
  257.    Note that the init file can get access to the command line argument
  258. values as the elements of a list in the variable `command-line-args'. 
  259. (The arguments in the second table above will already have been
  260. processed and will not be in the list.)  The init file can override
  261. the normal processing of the other arguments by setting this variable.
  262.  
  263.    One way to use command switches is to visit many files
  264. automatically:
  265.  
  266.      emacs *.c
  267.  
  268. passes each `.c' file as a separate argument to Emacs, so that Emacs
  269. visits each file (*note Visiting::.).
  270.  
  271.    Here is an advanced example that assumes you have a Lisp program
  272. file called `hack-c-program.el' which, when loaded, performs some
  273. useful operation on current buffer, expected to be a C program.
  274.  
  275.      emacs -batch foo.c -l hack-c-program -f save-buffer -kill > log
  276.  
  277. Here Emacs is told to visit `foo.c', load `hack-c-program.el' (which
  278. makes changes in the visited file), save `foo.c' (note that
  279. `save-buffer' is the function that `C-x C-s' is bound to), and then
  280. exit to the shell that this command was done with.  `-batch'
  281. guarantees there will be no problem redirecting output to `log',
  282. because Emacs will not assume that it has a display terminal to work
  283. with.
  284.  
  285. 
  286. File: emacs,  Node: Basic,  Next: Undo,  Prev: Command Switches,  Up: Top
  287.  
  288. Basic Editing Commands
  289. **********************
  290.  
  291.    We now give the basics of how to enter text, make corrections, and
  292. save the text in a file.  If this material is new to you, you might
  293. learn it more easily by running the Emacs learn-by-doing tutorial.  To
  294. do this, type `Control-h t' (`help-with-tutorial').
  295.  
  296. Inserting Text
  297. ==============
  298.  
  299.    To insert printing characters into the text you are editing, just
  300. type them.  This inserts the character into the buffer at the cursor
  301. (that is, at "point"; *note Point::.).  The cursor moves forward.  Any
  302. characters after the cursor move forward too.  If the text in the
  303. buffer is `FOOBAR', with the cursor before the `B', then if you type
  304. `XX', you get `FOOXXBAR', with the cursor still before the `B'.
  305.  
  306.    To "delete" text you have just inserted, use DEL.  DEL deletes the
  307. character BEFORE the cursor (not the one that the cursor is on top of
  308. or under; that is the character AFTER the cursor).  The cursor and all
  309. characters after it move backwards.  Therefore, if you type a printing
  310. character and then type DEL, they cancel out.
  311.  
  312.    To end a line and start typing a new one, type RET.  This inserts a
  313. newline character in the buffer.  If point is in the middle of a line,
  314. RET splits the line.  Typing DEL when the cursor is at the beginning
  315. of a line rubs out the newline before the line, thus joining the line
  316. with the preceding line.
  317.  
  318.    Emacs will split lines automatically when they become too long, if
  319. you turn on a special mode called "Auto Fill" mode.  *Note Filling::,
  320. for how to use Auto Fill mode.
  321.  
  322.    Customization information: DEL in most modes runs the command named
  323. `delete-backward-char'; RET runs the command `newline', and
  324. self-inserting printing characters run the command `self-insert',
  325. which inserts whatever character was typed to invoke it.  Some major
  326. modes rebind DEL to other commands.
  327.  
  328.    Direct insertion works for printing characters and SPC, but other
  329. characters act as editing commands and do not insert themselves.  If
  330. you need to insert a control character or a character whose code is
  331. above 200 octal, you must "quote" it by typing the character
  332. `control-q' (`quoted-insert') first.  There are two ways to use `C-q':
  333.  
  334.    * `Control-q' followed by any non-graphic character (even `C-g')
  335.      inserts that character.
  336.  
  337.    * `Control-q' followed by three octal digits inserts the character
  338.      with the specified character code.
  339.  
  340. A numeric argument to `C-q' specifies how many copies of the quoted
  341. character should be inserted (*note Arguments::.).
  342.  
  343.    If you prefer to have text characters replace (overwrite) existing
  344. text rather than shove it to the right, you can enable Overwrite mode,
  345. a minor mode.  *Note Minor Modes::.
  346.  
  347. Changing the Location of Point
  348. ==============================
  349.  
  350.    To do more than insert characters, you have to know how to move
  351. point (*note Point::.).  Here are a few of the commands for doing that.
  352.  
  353. `C-a'
  354.      Move to the beginning of the line (`beginning-of-line').
  355.  
  356. `C-e'
  357.      Move to the end of the line (`end-of-line').
  358.  
  359. `C-f'
  360.      Move forward one character (`forward-char').
  361.  
  362. `C-b'
  363.      Move backward one character (`backward-char').
  364.  
  365. `M-f'
  366.      Move forward one word (`forward-word').
  367.  
  368. `M-b'
  369.      Move backward one word (`backward-word').
  370.  
  371. `C-n'
  372.      Move down one line, vertically (`next-line').  This command
  373.      attempts to keep the horizontal position unchanged, so if you
  374.      start in the middle of one line, you end in the middle of the
  375.      next.  When on the last line of text, `C-n' creates a new line
  376.      and moves onto it.
  377.  
  378. `C-p'
  379.      Move up one line, vertically (`previous-line').
  380.  
  381. `C-l'
  382.      Clear the screen and reprint everything (`recenter').  Text moves
  383.      on the screen to bring point to the center of the window.
  384.  
  385. `M-r'
  386.      Move point to left margin on the line halfway down the screen or
  387.      window (`move-to-window-line').  Text does not move on the
  388.      screen.  A numeric argument says how many screen lines down from
  389.      the top of the window (zero for the top).  A negative argument
  390.      counts from the bottom (-1 for the bottom).
  391.  
  392. `C-t'
  393.      Transpose two characters, the ones before and after the cursor
  394.      (`transpose-chars').
  395.  
  396. `M-<'
  397.      Move to the top of the buffer (`beginning-of-buffer').  With
  398.      numeric argument N, move to N/10 of the way from the top.  *Note
  399.      Arguments::, for more information on numeric arguments.
  400.  
  401. `M->'
  402.      Move to the end of the buffer (`end-of-buffer').
  403.  
  404. `M-x goto-char'
  405.      Read a number N and move cursor to character number N.  Position
  406.      1 is the beginning of the buffer.
  407.  
  408. `M-x goto-line'
  409.      Read a number N and move cursor to line number N.  Line 1 is the
  410.      beginning of the buffer.
  411.  
  412. `C-x C-n'
  413.      Use the current column of point as the "semipermanent goal
  414.      column" for `C-n' and `C-p' (`set-goal-column').  Henceforth,
  415.      those commands always move to this column in each line moved
  416.      into, or as close as possible given the contents of the line. 
  417.      This goal column remains in effect until canceled.
  418.  
  419. `C-u C-x C-n'
  420.      Cancel the goal column.  Henceforth, `C-n' and `C-p' once again
  421.      try to avoid changing the horizontal position, as usual.
  422.  
  423.    If you set the variable `track-eol' to a non-`nil' value, then
  424. `C-n' and `C-p' when at the end of the starting line move to the end
  425. of the line.  Normally, `track-eol' is `nil'.
  426.  
  427. Erasing Text
  428. ============
  429.  
  430. `DEL'
  431.      Delete the character before the cursor (`delete-backward-char').
  432.  
  433. `C-d'
  434.      Delete the character after the cursor (`delete-char').
  435.  
  436. `C-k'
  437.      Kill to the end of the line (`kill-line').
  438.  
  439. `M-d'
  440.      Kill forward to the end of the next word (`kill-word').
  441.  
  442. `M-DEL'
  443.      Kill back to the beginning of the previous word
  444.      (`backward-kill-word').
  445.  
  446.    You already know about the DEL key which deletes the character
  447. before the cursor.  Another key, `Control-d', deletes the character
  448. after the cursor, causing the rest of the text on the line to shift
  449. left.  If `Control-d' is typed at the end of a line, that line and the
  450. next line are joined together.
  451.  
  452.    To erase a larger amount of text, use the `Control-k' key, which
  453. kills a line at a time.  If `C-k' is done at the beginning or middle of
  454. a line, it kills all the text up to the end of the line.  If `C-k' is
  455. done at the end of a line, it joins that line and the next line.
  456.  
  457.    *Note Killing::, for more flexible ways of killing text.
  458.  
  459. Files
  460. =====
  461.  
  462.    The commands above are sufficient for creating and altering text in
  463. an Emacs buffer; the more advanced Emacs commands just make things
  464. easier.  But to keep any text permanently you must put it in a "file".
  465.  Files are named units of text which are stored by the operating
  466. system for you to retrieve later by name.  To look at or use the
  467. contents of a file in any way, including editing the file with Emacs,
  468. you must specify the file name.
  469.  
  470.    Consider a file named `/usr/rms/foo.c'.  In Emacs, to begin editing
  471. this file, type
  472.  
  473.      C-x C-f /usr/rms/foo.c RET
  474.  
  475. Here the file name is given as an "argument" to the command `C-x C-f'
  476. (`find-file').  That command uses the "minibuffer" to read the
  477. argument, and you type RET to terminate the argument (*note
  478. Minibuffer::.).
  479.  
  480.    Emacs obeys the command by "visiting" the file: creating a buffer,
  481. copying the contents of the file into the buffer, and then displaying
  482. the buffer for you to edit.  You can make changes in it, and then
  483. "save" the file by typing `C-x C-s' (`save-buffer').  This makes the
  484. changes permanent by copying the altered contents of the buffer back
  485. into the file `/usr/rms/foo.c'.  Until then, the changes are only
  486. inside your Emacs, and the file `foo.c' is not changed.
  487.  
  488.    To create a file, just visit the file with `C-x C-f' as if it
  489. already existed.  Emacs will make an empty buffer in which you can
  490. insert the text you want to put in the file.  When you save your text
  491. with `C-x C-s', the file will be created.
  492.  
  493.    Of course, there is a lot more to learn about using files.  *Note
  494. Files::.
  495.  
  496. Help
  497. ====
  498.  
  499.    If you forget what a key does, you can find out with the Help
  500. character, which is `C-h'.  Type `C-h k' followed by the key you want
  501. to know about; for example, `C-h k C-n' tells you all about what `C-n'
  502. does.  `C-h' is a prefix key; `C-h k' is just one of its subcommands
  503. (the command `describe-key').  The other subcommands of `C-h' provide
  504. different kinds of help.  Type `C-h' three times to get a description
  505. of all the help facilities.  *Note Help::.
  506.  
  507. * Menu:
  508.  
  509. * Blank Lines::        Commands to make or delete blank lines.
  510. * Continuation Lines:: Lines too wide for the screen.
  511. * Position Info::      What page, line, row, or column is point on?
  512. * Arguments::           Numeric arguments for repeating a command.
  513.  
  514. 
  515. File: emacs,  Node: Blank Lines,  Next: Continuation Lines,  Prev: Basic,  Up: Basic
  516.  
  517. Blank Lines
  518. ===========
  519.  
  520.    Here are special commands and techniques for putting in and taking
  521. out blank lines.
  522.  
  523. `C-o'
  524.      Insert one or more blank lines after the cursor (`open-line').
  525.  
  526. `C-x C-o'
  527.      Delete all but one of many consecutive blank lines
  528.      (`delete-blank-lines').
  529.  
  530.    When you want to insert a new line of text before an existing line,
  531. you can do it by typing the new line of text, followed by RET. 
  532. However, it may be easier to see what you are doing if you first make
  533. a blank line and then insert the desired text into it.  This is easy
  534. to do using the key `C-o' (`open-line'), which inserts a newline after
  535. point but leaves point in front of the newline.  After `C-o', type the
  536. text for the new line.  `C-o F O O' has the same effect as `F O O
  537. RET', except for the final location of point.
  538.  
  539.    You can make several blank lines by typing `C-o' several times, or
  540. by giving it an argument to tell it how many blank lines to make. 
  541. *Note Arguments::, for how.
  542.  
  543.    If you have many blank lines in a row and want to get rid of them,
  544. use `C-x C-o' (`delete-blank-lines').  When point is on a blank line
  545. which is adjacent to at least one other blank line, `C-x C-o' deletes
  546. all but one of the consecutive blank lines, leaving exactly one.  With
  547. point on a blank line with no other blank line adjacent to it, the
  548. sole blank line is deleted, leaving none.  When point is on a nonblank
  549. line, `C-x C-o' deletes any blank lines following that nonblank line.
  550.  
  551. 
  552. File: emacs,  Node: Continuation Lines,  Next: Position Info,  Prev: Blank Lines,  Up: Basic
  553.  
  554. Continuation Lines
  555. ==================
  556.  
  557.    If you add too many characters to one line, without breaking it
  558. with a RET, the line will grow to occupy two (or more) lines on the
  559. screen, with a `\' at the extreme right margin of all but the last of
  560. them.  The `\' says that the following screen line is not really a
  561. distinct line in the text, but just the "continuation" of a line too
  562. long to fit the screen.  Sometimes it is nice to have Emacs insert
  563. newlines automatically when a line gets too long; for this, use Auto
  564. Fill mode (*note Filling::.).
  565.  
  566.    Instead of continuation, long lines can be displayed by
  567. "truncation".  This means that all the characters that do not fit in
  568. the width of the screen or window do not appear at all.  They remain
  569. in the buffer, temporarily invisible.  `$' is used in the last column
  570. instead of `\' to inform you that truncation is in effect.
  571.  
  572.    Continuation can be turned off for a particular buffer by setting
  573. the variable `truncate-lines' to non-`nil' in that buffer.  Truncation
  574. instead of continuation also happens whenever horizontal scrolling is
  575. in use, and optionally whenever side-by-side windows are in use (*note
  576. Windows::.).  Altering the value of `truncate-lines' makes it local to
  577. the current buffer; until that time, the default value is in effect. 
  578. The default is initially `nil'.  *Note Locals::.
  579.  
  580. 
  581. File: emacs,  Node: Position Info,  Next: Arguments,  Prev: Continuation Lines,  Up: Basic
  582.  
  583. Cursor Position Information
  584. ===========================
  585.  
  586.    If you are accustomed to other display editors, you may be
  587. surprised that Emacs does not always display the page number or line
  588. number of point in the mode line.  This is because the text is stored
  589. in a way that makes it difficult to compute this information. 
  590. Displaying them all the time would be intolerably slow.  They are not
  591. needed very often in Emacs anyway, but there are commands to compute
  592. them and print them.
  593.  
  594. `M-x what-page'
  595.      Print page number of point, and line number within page.
  596.  
  597. `M-x what-line'
  598.      Print line number of point in the buffer.
  599.  
  600. `M-='
  601.      Print number of lines in the current region
  602.      (`count-lines-region').
  603.  
  604. `C-x ='
  605.      Print character code of character after point, character position
  606.      of point, and column of point (`what-cursor-position').
  607.  
  608.    There are two commands for printing line numbers.  `M-x what-line'
  609. counts lines from the beginning of the file and prints the line number
  610. point is on.  The first line of the file is line number 1.  These
  611. numbers can be used as arguments to `M-x goto-line'.  By contrast, `M-x
  612. what-page' counts pages from the beginning of the file, and counts
  613. lines within the page, printing both of them.  *Note Pages::.
  614.  
  615.    While on this subject, we might as well mention `M-='
  616. (`count-lines-region'), which prints the number of lines in the region
  617. (*note Mark::.).  *Note Pages::, for the command `C-x l' which counts
  618. the lines in the current page.
  619.  
  620.    The command `C-x =' (`what-cursor-position') can be used to find out
  621. the column that the cursor is in, and other miscellaneous information
  622. about point.  It prints a line in the echo area that looks like this:
  623.  
  624.      Char: x (0170)  point=65986 of 563027(12%)  x=44
  625.  
  626. (In fact, this is the output produced when point is before the `x=44'
  627. in the example.)
  628.  
  629.    The two values after `Char:' describe the character following point,
  630. first by showing it and second by giving its octal character code.
  631.  
  632.    `point=' is followed by the position of point expressed as a
  633. character count.  The front of the buffer counts as position 1, one
  634. character later as 2, and so on.  The next, larger number is the total
  635. number of characters in the buffer.  Afterward in parentheses comes
  636. the position expressed as a percentage of the total size.
  637.  
  638.    `x=' is followed by the horizontal position of point, in columns
  639. from the left edge of the window.
  640.  
  641.    If the buffer has been narrowed, making some of the text at the
  642. beginning and the end temporarily invisible, `C-x =' prints additional
  643. text describing the current visible range.  For example, it might say
  644.  
  645.      Char: x (0170)  point=65986 of 563025(12%) <65102 - 68533>  x=44
  646.  
  647. where the two extra numbers give the smallest and largest character
  648. position that point is allowed to assume.  The characters between
  649. those two positions are the visible ones.  *Note Narrowing::.
  650.  
  651.    If point is at the end of the buffer (or the end of the visible
  652. part), `C-x =' omits any description of the character after point. 
  653. The output looks like
  654.  
  655.      point=563026 of 563025(100%)  x=0
  656.  
  657. 
  658. File: emacs,  Node: Arguments,  Prev: Position Info,  Up: Basic
  659.  
  660. Numeric Arguments
  661. =================
  662.  
  663.    Any Emacs command can be given a "numeric argument".  Some commands
  664. interpret the argument as a repetition count.  For example, giving an
  665. argument of ten to the key `C-f' (the command `forward-char', move
  666. forward one character) moves forward ten characters.  With these
  667. commands, no argument is equivalent to an argument of one.  Negative
  668. arguments are allowed.  Often they tell a command to move or act
  669. backwards.
  670.  
  671.    If your terminal keyboard has a META key, the easiest way to
  672. specify a numeric argument is to type digits and/or a minus sign while
  673. holding down the the META key.  For example,
  674.      M-5 C-n
  675.  
  676. would move down five lines.  The characters `Meta-1', `Meta-2', and so
  677. on, as well as `Meta--', do this because they are keys bound to
  678. commands (`digit-argument' and `negative-argument') that are defined
  679. to contribute to an argument for the next command.
  680.  
  681.    Another way of specifying an argument is to use the `C-u'
  682. (`universal-argument') command followed by the digits of the argument. 
  683. With `C-u', you can type the argument digits without holding down
  684. shift keys.  To type a negative argument, start with a minus sign. 
  685. Just a minus sign normally means -1.  `C-u' works on all terminals.
  686.  
  687.    `C-u' followed by a character which is neither a digit nor a minus
  688. sign has the special meaning of "multiply by four".  It multiplies the
  689. argument for the next command by four.  `C-u' twice multiplies it by
  690. sixteen.  Thus, `C-u C-u C-f' moves forward sixteen characters.  This
  691. is a good way to move forward "fast", since it moves about 1/5 of a
  692. line in the usual size screen.  Other useful combinations are `C-u
  693. C-n', `C-u C-u C-n' (move down a good fraction of a screen), `C-u C-u
  694. C-o' (make "a lot" of blank lines), and `C-u C-k' (kill four lines).
  695.  
  696.    Some commands care only about whether there is an argument, and not
  697. about its value.  For example, the command `M-q' (`fill-paragraph')
  698. with no argument fills text; with an argument, it justifies the text
  699. as well.  (*Note Filling::, for more information on `M-q'.)  Just
  700. `C-u' is a handy way of providing an argument for such commands.
  701.  
  702.    Some commands use the value of the argument as a repeat count, but
  703. do something peculiar when there is no argument.  For example, the
  704. command `C-k' (`kill-line') with argument N kills N lines, including
  705. their terminating newlines.  But `C-k' with no argument is special: it
  706. kills the text up to the next newline, or, if point is right at the
  707. end of the line, it kills the newline itself.  Thus, two `C-k'
  708. commands with no arguments can kill a nonblank line, just like `C-k'
  709. with an argument of one.  (*Note Killing::, for more information on
  710. `C-k'.)
  711.  
  712.    A few commands treat a plain `C-u' differently from an ordinary
  713. argument.  A few others may treat an argument of just a minus sign
  714. differently from an argument of -1.  These unusual cases will be
  715. described when they come up; they are always for reasons of
  716. convenience of use of the individual command.
  717.  
  718. 
  719. File: emacs,  Node: Undo,  Next: Minibuffer,  Prev: Basic,  Up: Top
  720.  
  721. Undoing Changes
  722. ***************
  723.  
  724.    Emacs allows all changes made in the text of a buffer to be undone,
  725. up to a certain amount of change (8000 characters).  Each buffer
  726. records changes individually, and the undo command always applies to
  727. the current buffer.  Usually each editing command makes a separate
  728. entry in the undo records, but some commands such as `query-replace'
  729. make many entries, and very simple commands such as self-inserting
  730. characters are often grouped to make undoing less tedious.
  731.  
  732. `C-x u'
  733.      Undo one batch of changes (usually, one command worth) (`undo').
  734.  
  735. `C-_'
  736.      The same.
  737.  
  738.    The command `C-x u' or `C-_' is how you undo.  The first time you
  739. give this command, it undoes the last change.  Point moves to the text
  740. affected by the undo, so you can see what was undone.
  741.  
  742.    Consecutive repetitions of the `C-_' or `C-x u' commands undo
  743. earlier and earlier changes, back to the limit of what has been
  744. recorded.  If all recorded changes have already been undone, the undo
  745. command prints an error message and does nothing.
  746.  
  747.    Any command other than an undo command breaks the sequence of undo
  748. commands.  Starting at this moment, the previous undo commands are
  749. considered ordinary changes that can themselves be undone.  Thus, you
  750. can redo changes you have undone by typing `C-f' or any other command
  751. that will have no important effect, and then using more undo commands.
  752.  
  753.    If you notice that a buffer has been modified accidentally, the
  754. easiest way to recover is to type `C-_' repeatedly until the stars
  755. disappear from the front of the mode line.  At this time, all the
  756. modifications you made have been cancelled.  If you do not remember
  757. whether you changed the buffer deliberately, type `C-_' once, and when
  758. you see the last change you made undone, you will remember why you
  759. made it.  If it was an accident, leave it undone.  If it was
  760. deliberate, redo the change as described in the preceding paragraph.
  761.  
  762.    Whenever an undo command makes the stars disappear from the mode
  763. line, it means that the buffer contents are the same as they were when
  764. the file was last read in or saved.
  765.  
  766.    Not all buffers record undo information.  Buffers whose names start
  767. with spaces don't; these buffers are used internally by Emacs and its
  768. extensions to hold text that users don't normally look at or edit. 
  769. Also, minibuffers, help buffers and documentation buffers don't record
  770. undo information.
  771.  
  772.    At most 8000 or so characters of deleted or modified text can be
  773. remembered in any one buffer for reinsertion by the undo command. 
  774. Also, there is a limit on the number of individual insert, delete or
  775. change actions that can be remembered.
  776.  
  777.    The reason the `undo' command has two keys, `C-x u' and `C-_', set
  778. up to run it is that it is worthy of a single-character key, but the
  779. way to type `C-_' on some keyboards is not obvious.  `C-x u' is an
  780. alternative you can type in the same fashion on any terminal.
  781.  
  782. 
  783. File: emacs,  Node: Minibuffer,  Next: M-x,  Prev: Undo,  Up: Top
  784.  
  785. The Minibuffer
  786. **************
  787.  
  788.    The "minibuffer" is the facility used by Emacs commands to read
  789. arguments more complicated than a single number.  Minibuffer arguments
  790. can be file names, buffer names, Lisp function names, Emacs command
  791. names, Lisp expressions, and many other things, depending on the
  792. command reading the argument.  The usual Emacs editing commands can be
  793. used in the minibuffer to edit the argument.
  794.  
  795.    When the minibuffer is in use, it appears in the echo area, and the
  796. terminal's cursor moves there.  The beginning of the minibuffer line
  797. displays a "prompt" which says what kind of input you should supply and
  798. how it will be used.  Often this prompt is derived from the name of the
  799. command that the argument is for.  The prompt normally ends with a
  800. colon.
  801.  
  802.    Sometimes a "default argument" appears in parentheses after the
  803. colon; it too is part of the prompt.  The default will be used as the
  804. argument value if you enter an empty argument (e.g., just type RET). 
  805. For example, commands that read buffer names always show a default,
  806. which is the name of the buffer that will be used if you type just RET.
  807.  
  808.    The simplest way to give a minibuffer argument is to type the text
  809. you want, terminated by RET which exits the minibuffer.  You can get
  810. out of the minibuffer, canceling the command that it was for, by typing
  811. `C-g'.
  812.  
  813.    Since the minibuffer uses the screen space of the echo area, it can
  814. conflict with other ways Emacs customarily uses the echo area.  Here
  815. is how Emacs handles such conflicts:
  816.  
  817.    * If a command gets an error while you are in the minibuffer, this
  818.      does not cancel the minibuffer.  However, the echo area is needed
  819.      for the error message and therefore the minibuffer itself is
  820.      hidden for a while.  It comes back after a few seconds, or as
  821.      soon as you type anything.
  822.  
  823.    * If in the minibuffer you use a command whose purpose is to print a
  824.      message in the echo area, such as `C-x =', the message is printed
  825.      normally, and the minibuffer is hidden for a while.  It comes back
  826.      after a few seconds, or as soon as you type anything.
  827.  
  828.    * Echoing of keystrokes does not take place while the minibuffer is
  829.      in use.
  830.  
  831. * Menu:
  832.  
  833. * File: Minibuffer File.  Entering file names with the minibuffer.
  834. * Edit: Minibuffer Edit.  How to edit in the minibuffer.
  835. * Completion::          An abbreviation facility for minibuffer input.
  836. * Repetition::          Re-executing commands that used the minibuffer.
  837.  
  838. 
  839. File: emacs,  Node: Minibuffer File,  Next: Minibuffer Edit,  Prev: Minibuffer,  Up: Minibuffer
  840.  
  841. Minibuffers for File Names
  842. ==========================
  843.  
  844.    Sometimes the minibuffer starts out with text in it.  For example,
  845. when you are supposed to give a file name, the minibuffer starts out
  846. containing the "default directory", which ends with a slash.  This is
  847. to inform you which directory the file will be found in if you do not
  848. specify a directory.  For example, the minibuffer might start out with
  849.  
  850.      Find File: /u2/emacs/src/
  851.  
  852. where `Find File: ' is the prompt.  Typing `buffer.c' specifies the
  853. file `/u2/emacs/src/buffer.c'.  To find files in nearby directories,
  854. use `..'; thus, if you type `../lisp/simple.el', the file that you
  855. visit will be the one named `/u2/emacs/lisp/simple.el'. 
  856. Alternatively, you can kill with `M-DEL' the directory names you don't
  857. want (*note Words::.).
  858.  
  859.    You can also type an absolute file name, one starting with a slash
  860. or a tilde, ignoring the default directory.  For example, to find the
  861. file `/etc/termcap', just type the name, giving
  862.  
  863.      Find File: /u2/emacs/src//etc/termcap
  864.  
  865. Two slashes in a row are not normally meaningful in Unix file names,
  866. but they are allowed in GNU Emacs.  They mean, "ignore everything
  867. before the second slash in the pair."  Thus, `/u2/emacs/src/' is
  868. ignored, and you get the file `/etc/termcap'.
  869.  
  870.    If you set `insert-default-directory' to `nil', the default
  871. directory is not inserted in the minibuffer.  This way, the minibuffer
  872. starts out empty.  But the name you type, if relative, is still
  873. interpreted with respect to the same default directory.
  874.  
  875. 
  876. File: emacs,  Node: Minibuffer Edit,  Next: Completion,  Prev: Minibuffer File,  Up: Minibuffer
  877.  
  878. Editing in the Minibuffer
  879. =========================
  880.  
  881.    The minibuffer is an Emacs buffer (albeit a peculiar one), and the
  882. usual Emacs commands are available for editing the text of an argument
  883. you are entering.
  884.  
  885.    Since RET in the minibuffer is defined to exit the minibuffer,
  886. inserting a newline into the minibuffer must be done with `C-o' or with
  887. `C-q LFD'.  (Recall that a newline is really the LFD character.)
  888.  
  889.    The minibuffer has its own window which always has space on the
  890. screen but acts as if it were not there when the minibuffer is not in
  891. use.  When the minibuffer is in use, its window is just like the
  892. others; you can switch to another window with `C-x o', edit text in
  893. other windows and perhaps even visit more files, before returning to
  894. the minibuffer to submit the argument.  You can kill text in another
  895. window, return to the minibuffer window, and then yank the text to use
  896. it in the argument.  *Note Windows::.
  897.  
  898.    There are some restrictions on the use of the minibuffer window,
  899. however.  You cannot switch buffers in it--the minibuffer and its
  900. window are permanently attached.  Also, you cannot split or kill the
  901. minibuffer window.  But you can make it taller in the normal fashion
  902. with `C-x ^'.
  903.  
  904.    If while in the minibuffer you issue a command that displays help
  905. text of any sort in another window, then that window is identified as
  906. the one to scroll if you type `C-M-v' while in the minibuffer.  This
  907. lasts until you exit the minibuffer.  This feature comes into play if
  908. a completing minibuffer gives you a list of possible completions.
  909.  
  910.    Recursive use of the minibuffer is supported by Emacs.  However, it
  911. is easy to do this by accident (because of autorepeating keyboards, for
  912. example) and get confused.  Therefore, most Emacs commands that use the
  913. minibuffer refuse to operate if the minibuffer window is selected.  If
  914. the minibuffer is active but you have switched to a different window,
  915. recursive use of the minibuffer is allowed--if you know enough to try
  916. to do this, you probably will not get confused.
  917.  
  918.    If you set the variable `enable-recursive-minibuffers' to be
  919. non-`nil', recursive use of the minibuffer is always allowed.
  920.  
  921. 
  922. File: emacs,  Node: Completion,  Next: Repetition,  Prev: Minibuffer Edit,  Up: Minibuffer
  923.  
  924. Completion
  925. ==========
  926.  
  927.    When appropriate, the minibuffer provides a "completion" facility. 
  928. This means that you type enough of the argument to determine the rest,
  929. based on Emacs's knowledge of which arguments make sense, and Emacs
  930. visibly fills in the rest, or as much as can be determined from the
  931. part you have typed.
  932.  
  933.    When completion is available, certain keys--TAB, RET, and SPC--are
  934. redefined to complete an abbreviation present in the minibuffer into a
  935. longer string that it stands for, by matching it against a set of
  936. "completion alternatives" provided by the command reading the argument. 
  937. `?' is defined to display a list of possible completions of what you
  938. have inserted.
  939.  
  940.    For example, when the minibuffer is being used by `Meta-x' to read
  941. the name of a command, it is given a list of all available Emacs
  942. command names to complete against.  The completion keys match the text
  943. in the minibuffer against all the command names, find any additional
  944. characters of the name that are implied by the ones already present in
  945. the minibuffer, and add those characters to the ones you have given.
  946.  
  947.    Case is normally significant in completion, because it is
  948. significant in most of the names that you can complete (buffer names,
  949. file names and command names).  Thus, `fo' will not complete to `Foo'.
  950.  When you are completing a name in which case does not matter, case
  951. may be ignored for completion's sake if the program said to do so.
  952.  
  953. Completion Example
  954. ------------------
  955.  
  956.    A concrete example may help here.  If you type `Meta-x au TAB', the
  957. TAB looks for alternatives (in this case, command names) that start
  958. with `au'.  There are only two: `auto-fill-mode' and `auto-save-mode'.
  959.  These are the same as far as `auto-', so the `au' in the minibuffer
  960. changes to `auto-'.
  961.  
  962.    If you type TAB again immediately, there are multiple possibilities
  963. for the very next character--it could be `s' or `f'--so no more
  964. characters are added; but a list of all possible completions is
  965. displayed in another window.
  966.  
  967.    If you go on to type `f TAB', this TAB sees `auto-f'.  The only
  968. command name starting this way is `auto-fill-mode', so completion
  969. inserts the rest of that.  You now have `auto-fill-mode' in the
  970. minibuffer after typing just `au TAB f TAB'.  Note that TAB has this
  971. effect because in the minibuffer it is bound to the function
  972. `minibuffer-complete' when completion is supposed to be done.
  973.  
  974. Completion Commands
  975. -------------------
  976.  
  977.    Here is a list of all the completion commands, defined in the
  978. minibuffer when completion is available.
  979.  
  980. `TAB'
  981.      Complete the text in the minibuffer as much as possible 
  982.       (`minibuffer-complete').
  983.  
  984. `SPC'
  985.      Complete the text in the minibuffer but don't add or fill out more
  986.      than one word (`minibuffer-complete-word').
  987.  
  988. `RET'
  989.      Submit the text in the minibuffer as the argument, possibly
  990.      completing first as described below
  991.      (`minibuffer-complete-and-exit').
  992.  
  993. `?'
  994.      Print a list of all possible completions of the text in the
  995.      minibuffer (`minibuffer-list-completions').
  996.  
  997.    SPC completes much like TAB, but never goes beyond the next hyphen
  998. or space.  If you have `auto-f' in the minibuffer and type SPC, it
  999. finds that the completion is `auto-fill-mode', but it stops completing
  1000. after `fill-'.  This gives `auto-fill-'.  Another SPC at this point
  1001. completes all the way to `auto-fill-mode'.  SPC in the minibuffer runs
  1002. the function `minibuffer-complete-word' when completion is available.
  1003.  
  1004.    There are three different ways that RET can work in completing
  1005. minibuffers, depending on how the argument will be used.
  1006.  
  1007.    * "Strict" completion is used when it is meaningless to give any
  1008.      argument except one of the known alternatives.  For example, when
  1009.      `C-x k' reads the name of a buffer to kill, it is meaningless to
  1010.      give anything but the name of an existing buffer.  In strict
  1011.      completion, RET refuses to exit if the text in the minibuffer
  1012.      does not complete to an exact match.
  1013.  
  1014.    * "Cautious" completion is similar to strict completion, except that
  1015.      RET exits only if the text was an exact match already, not
  1016.      needing completion.  If the text is not an exact match, RET does
  1017.      not exit, but it does complete the text.  If it completes to an
  1018.      exact match, a second RET will exit.
  1019.  
  1020.      Cautious completion is used for reading file names for files that
  1021.      must already exist.
  1022.  
  1023.    * "Permissive" completion is used when any string whatever is
  1024.      meaningful, and the list of completion alternatives is just a
  1025.      guide.  For example, when `C-x C-f' reads the name of a file to
  1026.      visit, any file name is allowed, in case you want to create a
  1027.      file.  In permissive completion, RET takes the text in the
  1028.      minibuffer exactly as given, without completing it.
  1029.  
  1030.    The completion commands display a list of all possible completions
  1031. in a window whenever there is more than one possibility for the very
  1032. next character.  Also, typing `?' explicitly requests such a list.  The
  1033. list of completions counts as help text, so `C-M-v' typed in the
  1034. minibuffer scrolls the list.
  1035.  
  1036.    When completion is done on file names, certain file names are
  1037. usually ignored.  The variable `completion-ignored-extensions'
  1038. contains a list of strings; a file whose name ends in any of those
  1039. strings is ignored as a possible completion.  The standard value of
  1040. this variable has several elements including `".o"', `".elc"',
  1041. `".dvi"' and `"~"'.  The effect is that, for example, `foo' can
  1042. complete to `foo.c' even though `foo.o' exists as well.  If the only
  1043. possible completions are files that end in "ignored" strings, then
  1044. they are not ignored.
  1045.  
  1046.    Normally, a completion command that finds the next character is
  1047. undetermined automatically displays a list of all possible
  1048. completions.  If the variable `completion-auto-help' is set to `nil',
  1049. this does not happen, and you must type `?' to display the possible
  1050. completions.
  1051.  
  1052. 
  1053. File: emacs,  Node: Repetition,  Prev: Completion,  Up: Minibuffer
  1054.  
  1055. Repeating Minibuffer Commands
  1056. =============================
  1057.  
  1058.    Every command that uses the minibuffer at least once is recorded on
  1059. a special history list, together with the values of the minibuffer
  1060. arguments, so that you can repeat the command easily.  In particular,
  1061. every use of `Meta-x' is recorded, since `M-x' uses the minibuffer to
  1062. read the command name.
  1063.  
  1064. `C-x ESC'
  1065.      Re-execute a recent minibuffer command 
  1066.      (`repeat-complex-command').
  1067.  
  1068. `M-p'
  1069.      Within `C-x ESC', move to previous recorded command
  1070.      (`previous-complex-command').
  1071.  
  1072. `M-n'
  1073.      Within `C-x ESC', move to the next (more recent) recorded command
  1074.      (`next-complex-command').
  1075.  
  1076. `M-x list-command-history'
  1077.      Display the entire command history, showing all the commands `C-x
  1078.      ESC' can repeat, most recent first.
  1079.  
  1080.    `C-x ESC' is used to re-execute a recent minibuffer-using command. 
  1081. With no argument, it repeats the last such command.  A numeric
  1082. argument specifies which command to repeat; one means the last one, and
  1083. larger numbers specify earlier ones.
  1084.  
  1085.    `C-x ESC' works by turning the previous command into a Lisp
  1086. expression and then entering a minibuffer initialized with the text for
  1087. that expression.  If you type just RET, the command is repeated as
  1088. before.  You can also change the command by editing the Lisp
  1089. expression.  Whatever expression you finally submit is what will be
  1090. executed.  The repeated command is added to the front of the command
  1091. history unless it is identical to the most recently executed command
  1092. already there.
  1093.  
  1094.    Even if you don't understand Lisp syntax, it will probably be
  1095. obvious which command is displayed for repetition.  If you do not
  1096. change the text, you can be sure it will repeat exactly as before.
  1097.  
  1098.    Once inside the minibuffer for `C-x ESC', if the command shown to
  1099. you is not the one you want to repeat, you can move around the list of
  1100. previous commands using `M-n' and `M-p'.  `M-p' replaces the contents
  1101. of the minibuffer with the next earlier recorded command, and `M-n'
  1102. replaces them with the next later command.  After finding the desired
  1103. previous command, you can edit its expression as usual and then
  1104. resubmit it by typing RET as usual.  Any editing you have done on the
  1105. command to be repeated is lost if you use `M-n' or `M-p'.
  1106.  
  1107.    `M-p' is more useful than `M-n', since more often you will
  1108. initially request to repeat the most recent command and then decide to
  1109. repeat an older one instead.  These keys are specially defined within
  1110. `C-x ESC' to run the commands `previous-complex-command' and
  1111. `next-complex-command'.
  1112.  
  1113.    The list of previous minibuffer-using commands is stored as a Lisp
  1114. list in the variable `command-history'.  Each element is a Lisp
  1115. expression which describes one command and its arguments.  Lisp
  1116. programs can reexecute a command by feeding the corresponding
  1117. `command-history' element to `eval'.
  1118.  
  1119.