home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / emacs.i02 < prev    next >
Encoding:
GNU Info File  |  1993-06-14  |  48.8 KB  |  1,106 lines

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