home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / E17INFO.ZIP / EMACS-3 < prev    next >
Encoding:
GNU Info File  |  1993-07-18  |  47.7 KB  |  1,147 lines

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