home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / E17INFO.ZIP / EMACS-11 < prev    next >
Encoding:
GNU Info File  |  1993-07-18  |  47.4 KB  |  1,138 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: ForIndent Num,  Next: ForIndent Conv,  Prev: ForIndent Cont,  Up: Fortran Indent
  6.  
  7. Line Numbers
  8. ............
  9.  
  10.    If a number is the first non-whitespace in the line, Fortran
  11. indentation assumes it is a line number and moves it to columns 0
  12. through 4.  (Columns always count from 0 in GNU Emacs.)
  13.  
  14.    Line numbers of four digits or less are normally indented one space.
  15. The variable `fortran-line-number-indent' controls this; it specifies
  16. the maximum indentation a line number can have.  Line numbers are
  17. indented to right-justify them to end in column 4 unless that would
  18. require more than this maximum indentation.  The default value of the
  19. variable is 1.
  20.  
  21.    Simply inserting a line number is enough to indent it according to
  22. these rules.  As each digit is inserted, the indentation is recomputed.
  23. To turn off this feature, set the variable
  24. `fortran-electric-line-number' to `nil'.  Then inserting line numbers
  25. is like inserting anything else.
  26.  
  27. 
  28. File: emacs,  Node: ForIndent Conv,  Next: ForIndent Vars,  Prev: ForIndent Num,  Up: Fortran Indent
  29.  
  30. Syntactic Conventions
  31. .....................
  32.  
  33.    Fortran mode assumes that you follow certain conventions that
  34. simplify the task of understanding a Fortran program well enough to
  35. indent it properly:
  36.  
  37.    * Two nested `do' loops never share a `continue' statement.
  38.  
  39.    * Fortran keywords such as `if', `else', `then', `do' and others are
  40.      written without embedded whitespace or line breaks.
  41.  
  42.      Fortran compilers generally ignore whitespace outside of string
  43.      constants, but Fortran mode does not recognize these keywords if
  44.      they are not contiguous.  Constructs such as `else if' or `end do'
  45.      are acceptable, but the second word should be on the same line as
  46.      the first and not on a continuation line.
  47.  
  48. If you fail to follow these conventions, the indentation commands may
  49. indent some lines unaesthetically.  However, a correct Fortran program
  50. retains its meaning when reindented even if the conventions are not
  51. followed.
  52.  
  53. 
  54. File: emacs,  Node: ForIndent Vars,  Prev: ForIndent Conv,  Up: Fortran Indent
  55.  
  56. Variables for Fortran Indentation
  57. .................................
  58.  
  59.    Several additional variables control how Fortran indentation works:
  60.  
  61. `fortran-do-indent'
  62.      Extra indentation within each level of `do' statement (default 3).
  63.  
  64. `fortran-if-indent'
  65.      Extra indentation within each level of `if' statement (default 3).
  66.      This value is also used for extra indentation within each level of
  67.      the Fortran 90 `where' statement.
  68.  
  69. `fortran-structure-indent'
  70.      Extra indentation within each level of `structure', `union', or
  71.      `map' statements (default 3).
  72.  
  73. `fortran-continuation-indent'
  74.      Extra indentation for bodies of continuation lines (default 5).
  75.  
  76. `fortran-check-all-num-for-matching-do'
  77.      If this is `nil', indentation assumes that each `do' statement
  78.      ends on a `continue' statement.  Therefore, when computing
  79.      indentation for a statement other than `continue', it can save time
  80.      by not checking for a `do' statement ending there.  If this is
  81.      non-`nil', indenting any numbered statement must check for a `do'
  82.      that ends there.  The default is `nil'.
  83.  
  84. `fortran-blink-matching-if'
  85.      If this is `t', indenting an `endif' statement moves the cursor
  86.      momentarily to the matching `if' statement to show where it is.
  87.      The default is `nil'.
  88.  
  89. `fortran-minimum-statement-indent-fixed'
  90.      Minimum indentation for fortran statements when using fixed format
  91.      continuation line style.  Statement bodies are never indented less
  92.      than this much.  The default is 6.
  93.  
  94. `fortran-minimum-statement-indent-tab'
  95.      Minimum indentation for fortran statements for tab format
  96.      continuation line style.  Statement bodies are never indented less
  97.      than this much.  The default is 8.
  98.  
  99. 
  100. File: emacs,  Node: Fortran Comments,  Next: Fortran Autofill,  Prev: Fortran Indent,  Up: Fortran
  101.  
  102. Comments
  103. --------
  104.  
  105.    The usual Emacs comment commands assume that a comment can follow a
  106. line of code.  In Fortran, the standard comment syntax requires an
  107. entire line to be just a comment.  Therefore, Fortran mode replaces the
  108. standard Emacs comment commands and defines some new variables.
  109.  
  110.    Fortran mode can also handle a nonstandard comment syntax where
  111. comments start with `!' and can follow other text.  Because only some
  112. Fortran compilers accept this syntax, Fortran mode will not insert such
  113. comments unless you have said in advance to do so.  To do this, set the
  114. variable `comment-start' to `"!"' (*note Variables::.).
  115.  
  116. `M-;'
  117.      Align comment or insert new comment (`fortran-comment-indent').
  118.  
  119. `C-x ;'
  120.      Applies to nonstandard `!' comments only.
  121.  
  122. `C-c ;'
  123.      Turn all lines of the region into comments, or (with argument)
  124.      turn them back into real code (`fortran-comment-region').
  125.  
  126.    `M-;' in Fortran mode is redefined as the command
  127. `fortran-comment-indent'.  Like the usual `M-;' command, this
  128. recognizes any kind of existing comment and aligns its text
  129. appropriately; if there is no existing comment, a comment is inserted
  130. and aligned.  But inserting and aligning comments are not the same in
  131. Fortran mode as in other modes.
  132.  
  133.    When a new comment must be inserted, if the current line is blank, a
  134. full-line comment is inserted.  On a non-blank line, a nonstandard `!'
  135. comment is inserted if you have said you want to use them.  Otherwise a
  136. full-line comment is inserted on a new line before the current line.
  137.  
  138.    Nonstandard `!' comments are aligned like comments in other
  139. languages, but full-line comments are different.  In a standard
  140. full-line comment, the comment delimiter itself must always appear in
  141. column zero.  What can be aligned is the text within the comment.  You
  142. can choose from three styles of alignment by setting the variable
  143. `fortran-comment-indent-style' to one of these values:
  144.  
  145. `fixed'
  146.      Align the text at a fixed column, which is the sum of
  147.      `fortran-comment-line-extra-indent' and the minimum statement
  148.      indentation.  This is the default.
  149.  
  150.      The minimum statement indentation is
  151.      `fortran-minimum-statement-indent-fixed' for fixed format
  152.      continuation line style and `fortran-minimum-statement-indent-tab'
  153.      for tab format style.
  154.  
  155. `relative'
  156.      Align the text as if it were a line of code, but with an additional
  157.      `fortran-comment-line-extra-indent' columns of indentation.
  158.  
  159. `nil'
  160.      Don't move text in full-line columns automatically at all.
  161.  
  162.    In addition, you can specify the character to be used to indent
  163. within full-line comments by setting the variable
  164. `fortran-comment-indent-char' to the single-character string you want
  165. to use.
  166.  
  167.    Fortran mode introduces two variables `comment-line-start' and
  168. `comment-line-start-skip' which play for full-line comments the same
  169. roles played by `comment-start' and `comment-start-skip' for ordinary
  170. text-following comments.  Normally these are set properly by Fortran
  171. mode so you do not need to change them.
  172.  
  173.    The normal Emacs comment command `C-x ;' has not been redefined.  If
  174. you use `!' comments, this command can be used with them.  Otherwise it
  175. is useless in Fortran mode.
  176.  
  177.    The command `C-c ;' (`fortran-comment-region') turns all the lines
  178. of the region into comments by inserting the string `C$$$' at the front
  179. of each one.  With a numeric argument, it turns the region back into
  180. live code by deleting `C$$$' from the front of each line in it.  The
  181. string used for these comments can be controlled by setting the
  182. variable `fortran-comment-region'.  Note that here we have an example
  183. of a command and a variable with the same name; these two uses of the
  184. name never conflict because in Lisp and in Emacs it is always clear
  185. from the context which one is meant.
  186.  
  187. 
  188. File: emacs,  Node: Fortran Autofill,  Next: Fortran Columns,  Prev: Fortran Comments,  Up: Fortran
  189.  
  190. Fortran Auto Fill Mode
  191. ----------------------
  192.  
  193.    Fortran Auto Fill mode is a minor mode which automatically splits
  194. Fortran statements as you insert them when they become too wide.
  195. Splitting a statement involves making continuation lines.  This
  196. splitting happens when you type SPC, RET, or TAB, and also in the
  197. Fortran indentation commands.
  198.  
  199.    `M-x fortran-auto-fill-mode' turns Fortran Auto Fill mode on if it
  200. was off, or off if it was on.  This command works the same as `M-x
  201. auto-fill-mode' does for normal Auto Fill mode (*note Filling::.).  A
  202. positive numeric argument turns Fortran Auto Fill mode on, and a
  203. negative argument turns it off.  You can see when Fortran Auto Fill mode
  204. is in effect by the presence of the word `Fill' in the mode line,
  205. inside the parentheses.  Fortran Auto Fill mode is a minor mode, turned
  206. on or off for each buffer individually.  *Note Minor Modes::.
  207.  
  208.    Fortran Auto Fill mode breaks lines at spaces or delimiters when the
  209. lines get longer than the desired width (the value of `fill-column').
  210. The delimiters that Fortran Auto Fill mode may break at are `,', `'',
  211. `+', `-', `/', `*', `=', and `)'.  The line break comes after the
  212. delimiter if the variable `fortran-break-before-delimiters' is `nil'.
  213. Otherwise (and by default), the break comes before the delimiter.
  214.  
  215.    By default, Fortran Auto Fill mode is not enabled.  If you want this
  216. feature turned on permanently, add a hook function to
  217. `fortran-mode-hook' to execute `(fortran-auto-fill-mode 1)'.  *Note
  218. Hooks::.
  219.  
  220. 
  221. File: emacs,  Node: Fortran Columns,  Next: Fortran Abbrev,  Prev: Fortran Autofill,  Up: Fortran
  222.  
  223. Columns
  224. -------
  225.  
  226. `C-c C-r'
  227.      Display a "column ruler" momentarily above the current line
  228.      (`fortran-column-ruler').
  229.  
  230. `C-c C-w'
  231.      Split the current window horizontally temporarily so that it is 72
  232.      columns wide.  This may help you avoid making lines longer than
  233.      the 72 character limit that some fortran compilers impose
  234.      (`fortran-window-create-momentarily').
  235.  
  236.    The command `C-c C-r' (`fortran-column-ruler') shows a column ruler
  237. momentarily above the current line.  The comment ruler is two lines of
  238. text that show you the locations of columns with special significance in
  239. Fortran programs.  Square brackets show the limits of the columns for
  240. line numbers, and curly brackets show the limits of the columns for the
  241. statement body.  Column numbers appear above them.
  242.  
  243.    Note that the column numbers count from zero, as always in GNU Emacs.
  244. As a result, the numbers may be one less than those you are familiar
  245. with; but the positions they indicate in the line are standard for
  246. Fortran.
  247.  
  248.    The text used to display the column ruler is the value of the
  249. variable `fortran-comment-ruler'.  By changing this variable, you can
  250. change the display.
  251.  
  252.    For even more help, use `C-c C-w' (`fortran-window-create'), a
  253. command which splits the current window horizontally, making a window 72
  254. columns wide.  By editing in this window you can immediately see when
  255. you make a line too wide to be correct Fortran.
  256.  
  257. 
  258. File: emacs,  Node: Fortran Abbrev,  Prev: Fortran Columns,  Up: Fortran
  259.  
  260. Fortran Keyword Abbrevs
  261. -----------------------
  262.  
  263.    Fortran mode provides many built-in abbrevs for common keywords and
  264. declarations.  These are the same sort of abbrev that you can define
  265. yourself.  To use them, you must turn on Abbrev mode.  *Note Abbrevs::.
  266.  
  267.    The built-in abbrevs are unusual in one way: they all start with a
  268. semicolon.  You cannot normally use semicolon in an abbrev, but Fortran
  269. mode makes this possible by changing the syntax of semicolon to "word
  270. constituent."
  271.  
  272.    For example, one built-in Fortran abbrev is `;c' for `continue'.  If
  273. you insert `;c' and then insert a punctuation character such as a space
  274. or a newline, the `;c' expands automatically to `continue', provided
  275. Abbrev mode is enabled.
  276.  
  277.    Type `;?' or `;C-h' to display a list of all the built-in Fortran
  278. abbrevs and what they stand for.
  279.  
  280. 
  281. File: emacs,  Node: Asm Mode,  Prev: Fortran,  Up: Programs
  282.  
  283. Asm Mode
  284. ========
  285.  
  286.    Asm mode is a major mode for editing files of assembler code.  It
  287. defines these commands:
  288.  
  289. `TAB'
  290.      `tab-to-tab-stop'.
  291.  
  292. `LFD'
  293.      Insert a newline and then indent using `tab-to-tab-stop'.
  294.  
  295. `:'
  296.      Insert a colon and then remove the indentation from before the
  297.      label preceding colon.  Then do `tab-to-tab-stop'.
  298.  
  299. `;'
  300.      Insert or align a comment.
  301.  
  302.    The variable `asm-comment-char' specifies which character starts
  303. comments in assembler syntax.
  304.  
  305. 
  306. File: emacs,  Node: Building,  Next: Abbrevs,  Prev: Programs,  Up: Top
  307.  
  308. Compiling and Testing Programs
  309. ******************************
  310.  
  311.    The previous chapter discusses the Emacs commands that are useful for
  312. making changes in programs.  This chapter deals with commands that
  313. assist in the larger process of developing and maintaining programs.
  314.  
  315. * Menu:
  316.  
  317. * Compilation::                   Compiling programs in languages other
  318.                                     than Lisp (C, Pascal, etc.)
  319. * Debuggers::                      Running symbolic debuggers for
  320.                                     non-Lisp programs.
  321. * Executing Lisp::                Various modes for editing Lisp programs,
  322.                                     with different facilities for running
  323.                                     the Lisp programs.
  324. * Libraries: Lisp Libraries.      Creating Lisp programs to run in Emacs.
  325. * Interaction: Lisp Interaction.  Executing Lisp in an Emacs buffer.
  326. * Eval: Lisp Eval.                Executing a single Lisp expression in Emacs.
  327. * External Lisp::                 Communicating through Emacs with a
  328.                                     separate Lisp.
  329.  
  330. 
  331. File: emacs,  Node: Compilation,  Next: Debuggers,  Up: Building
  332.  
  333. Running `make', or Compilers Generally
  334. ======================================
  335.  
  336.    Emacs can run compilers for noninteractive languages such as C and
  337. Fortran as inferior processes, feeding the error log into an Emacs
  338. buffer.  It can also parse the error messages and show you the source
  339. lines where compilation errors occurred.
  340.  
  341. `M-x compile'
  342.      Run a compiler asynchronously under Emacs, with error messages to
  343.      `*compilation*' buffer.
  344.  
  345. `M-x grep'
  346.      Run `grep' asynchronously under Emacs, with matching lines listed
  347.      in the buffer named `*grep*'.
  348.  
  349. `M-x kill-compilation'
  350. `M-x kill-grep'
  351.      Kill the running compilation or `grep' subprocess.
  352.  
  353. `C-x `'
  354.      Visit the locus of the next compiler error message or `grep' match.
  355.  
  356.    To run `make' or another compilation command, do `M-x compile'.
  357. This command reads a shell command line using the minibuffer, and then
  358. executes the command in an inferior shell, putting output in the buffer
  359. named `*compilation*'.  The current buffer's default directory is used
  360. as the working directory for the execution of the command; normally,
  361. therefore, the compilation happens in this directory.
  362.  
  363.    When the shell command line is read, the minibuffer appears
  364. containing a default command line, which is the command you used the
  365. last time you did `M-x compile'.  If you type just RET, the same command
  366. line is used again.  For the first `M-x compile', the default is `make
  367. -k'.
  368.  
  369.    The default compilation command comes from the variable
  370. `compile-command'; if the appropriate compilation command for a file is
  371. something other than `make -k', it can be useful for the file to
  372. specify a local value for `compile-command' (*note File Variables::.).
  373.  
  374.    Starting a compilation displays the buffer `*compilation*' in
  375. another window but does not select it.  The buffer's mode line tells you
  376. whether compilation is finished, with the word `run' or `exit' inside
  377. the parentheses.  You do not have to keep this buffer visible;
  378. compilation continues in any case.  While a compilation is going on, the
  379. string `Compiling' appears in the mode lines of all windows.  When this
  380. string disappears, the compilation is finished.
  381.  
  382.    To kill the compilation process, do `M-x kill-compilation'.  When
  383. the compiler process terminates, the mode line of the `*compilation*'
  384. buffer changes to say `signal' instead of `run'.  Starting a new
  385. compilation also kills any running compilation, as only one can exist
  386. at any time.  However, `M-x compile' asks for confirmation before
  387. actually killing a compilation that is running.
  388.  
  389.    The `*compilation*' buffer uses a special major mode, Compilation
  390. mode.  This mode provides the keys SPC and DEL to scroll by screenfuls,
  391. and `M-n' and `M-p' to move to the next or previous error message.  You
  392. can also use `M-{' and `M-}' to move up or down to an error message for
  393. a different source file.  You can visit the source for any particular
  394. error message by moving point in `*compilation*' to that error message
  395. and typing `C-c C-c' (`compile-goto-error').
  396.  
  397.    To parse the compiler error messages sequentially, type `C-x `'
  398. (`next-error').  The character following the `C-x' is the backquote or
  399. "grave accent," not the single-quote.  This command is available in all
  400. buffers, not just in `*compilation*'.  It displays the next error
  401. message at the top of one window and source location of the error in
  402. another window.
  403.  
  404.    The first time `C-x `' is used after the start of a compilation, it
  405. moves to the first error's location.  Subsequent uses of `C-x `'
  406. advance down the data set up by the first use.  When the preparsed error
  407. messages are exhausted, the next `C-x `' checks for any more error
  408. messages that have come in; this is useful if you start editing the
  409. compilation errors while the compilation is still going on.  If no more
  410. error messages have come in, `C-x `' reports an error.
  411.  
  412.    `C-u C-x `' discards the preparsed error message data and parses the
  413. `*compilation*' buffer over again, then displaying the first error.
  414. This way, you can process the same set of errors again.
  415.  
  416.    Instead of running a compiler, you can run `grep' and see the lines
  417. on which matches were found.  To do this, type `M-x grep' with an
  418. argument line that contains the same arguments you would give `grep'
  419. when running it normally: a `grep'-style regexp (usually in
  420. single-quotes to quote the shell's special characters) followed by file
  421. names which may use wildcards.  The output from `grep' goes in the
  422. `*grep*' buffer and the lines that matched can be found with `C-x `' as
  423. if they were compilation errors.
  424.  
  425.    Note: a shell is used to run the compile command, but the shell is
  426. told that it should be noninteractive.  This means in particular that
  427. the shell starts up with no prompt.  If you find your usual shell
  428. prompt making an unsightly appearance in the `*compilation*' buffer, it
  429. means you have made a mistake in your shell's init file (`.cshrc' or
  430. `.shrc' or ...) by setting the prompt unconditionally.  The shell init
  431. file should set the prompt only if there already is a prompt.  In
  432. `csh', here is how to do it:
  433.  
  434.      if ($?prompt) set prompt = ...
  435.  
  436. 
  437. File: emacs,  Node: Debuggers,  Next: Executing Lisp,  Prev: Compilation,  Up: Building
  438.  
  439. Running Debuggers Under Emacs
  440. =============================
  441.  
  442.    The GUD (Grand Unified Debugger) library provides an interface to
  443. various symbolic debuggers from within Emacs.  We recommend the
  444. debugger GDB, which is free software, but you can also run DBX or SDB
  445. if you have them.
  446.  
  447. * Menu:
  448.  
  449. * Starting GUD::    How to start a debugger subprocess.
  450. * Debugger Operation::    Connection between the debugger and source buffers.
  451. * Commands of GUD::    Keybindings for common commands.
  452. * GUD Customization::    Defining your own commands for GUD.
  453.  
  454. 
  455. File: emacs,  Node: Starting GUD,  Next: Debugger Operation,  Up: Debuggers
  456.  
  457. Starting GUD
  458. ------------
  459.  
  460.    There are three commands for starting a debugger, each corresponding
  461. to a particular debugger program.
  462.  
  463. `M-x gdb RET FILE RET'
  464.      Run GDB as a subprocess of Emacs.  This command creates a buffer
  465.      for input and output to GDB, and switches to it.  If a GDB buffer
  466.      already exists, it just switches to that buffer.
  467.  
  468. `M-x dbx RET FILE RET'
  469.      Similar, but run DBX instead of GDB.
  470.  
  471. `M-x sdb RET FILE RET'
  472.      Similar, but run SDB instead of GDB.
  473.  
  474.      Some versions of SDB do not mention source file names in their
  475.      messages.  When you use them, you need to have a valid tags table
  476.      (*note Tags::.) in order for GUD to find functions in the source
  477.      code.  If you have not visited a tags table or the tags table
  478.      doesn't list one of the functions, you get a message saying `The
  479.      sdb support requires a valid tags table to work'.  If this
  480.      happens, generate a valid tags table in the working directory and
  481.      try again.
  482.  
  483. `M-x xdb'
  484.      Similar, but run XDB instead of GDB.
  485.  
  486.    You can only run one debugger process at a time.
  487.  
  488.    Each of these commands takes one argument: a command line to invoke
  489. the debugger.  In the simplest case, specify just the name of the
  490. executable file you want to debug.  You may also use options that the
  491. debugger supports.  However, shell wild cards and variables are not
  492. allowed.  GUD assumes that the first argument not preceded by a `-' is
  493. the executable file name.
  494.  
  495. 
  496. File: emacs,  Node: Debugger Operation,  Next: Commands of GUD,  Prev: Starting GUD,  Up: Debuggers
  497.  
  498. Debugger Operation
  499. ------------------
  500.  
  501.    When you run a debugger with GUD, the debugger uses an Emacs buffer
  502. for its ordinary input and output.  This is called the GUD buffer.  The
  503. debugger uses other Emacs buffers to display the source files of the
  504. program.  An arrow (`=>') in one of these buffers indicates the current
  505. execution line.  Moving point in this buffer does not move the arrow.
  506.  
  507.    You can start editing these source files at any time in the buffers
  508. that were made to display them.  The arrow is not part of the file's
  509. text; it appears only on the screen.  If you do modify a source file,
  510. keep in mind that inserting or deleting lines will throw off the arrow's
  511. positioning; GUD has no way of figuring out which line corresponded
  512. before your changes to the line number in a debugger message.  Also,
  513. you'll typically have to recompile and restart the program for your
  514. changes to be reflected in the debugger's tables.
  515.  
  516.    If you wish, you can control your debugger process entirely through
  517. the debugger buffer, which uses a variant of Shell mode.  All the usual
  518. commands for your debugger are available, and you can use the Shell mode
  519. history commands to repeat them.
  520.  
  521. 
  522. File: emacs,  Node: Commands of GUD,  Next: GUD Customization,  Prev: Debugger Operation,  Up: Debuggers
  523.  
  524. Commands of GUD
  525. ---------------
  526.  
  527.    GUD provides a command available in all buffers for setting
  528. breakpoints.  This command is defined globally because you need to use
  529. it in the source files' buffers.
  530.  
  531. `C-x SPC'
  532.      Set a breakpoint on the line that point is on.
  533.  
  534.    Here are the other commands provided by GUD.  The keys starting with
  535. `C-c' are available only in the GUD interaction buffer.  The bindings
  536. that start with `C-x C-a' are available in the GUD buffer and also in
  537. source files.
  538.  
  539. `C-c C-l'
  540. `C-x C-a C-l'
  541.      Display in another window the last line referred to in the GUD
  542.      buffer (that is, the line indicated in the last location message).
  543.      This runs the command `gud-refresh'.
  544.  
  545. `C-c C-s'
  546. `C-x C-a C-s'
  547.      Execute a single line of code (`gud-step').  If the code contains
  548.      a function call, execution stops after entering the called
  549.      function.
  550.  
  551. `C-c C-n'
  552. `C-x C-a C-n'
  553.      Execute a single line of code, stepping across entire function
  554.      calls at full speed (`gud-next').
  555.  
  556. `C-c C-i'
  557. `C-x C-a C-i'
  558.      Execute a single machine instruction (`gud-stepi').
  559.  
  560. `C-c C-c'
  561. `C-x C-a C-c'
  562.      Continue execution until the next breakpoint, or other event that
  563.      would normally stop the program (`gud-cont').
  564.  
  565. `C-c C-d'
  566. `C-x C-a C-d'
  567.      Delete the breakpoint(s) on the current source line, if any
  568.      (`gud-remove').  If you use this command in the GUD interaction
  569.      buffer, it applies to the line where the program last stopped.
  570.  
  571. `C-c C-t'
  572. `C-x C-a C-t'
  573.      Set a temporary breakpoint on the current source line, if any.  If
  574.      you use this command in the GUD interaction buffer, it applies to
  575.      the line where the program last stopped.
  576.  
  577.    The above commands are common to all supported debuggers.  If you are
  578. using GDB or (some versions of) DBX, these additional commands are
  579. available:
  580.  
  581. `C-c <'
  582. `C-x C-a <'
  583.      Select the next enclosing stack frame (`gud-up').  This is
  584.      equivalent to the `up' command.
  585.  
  586. `C-c >'
  587. `C-x C-a >'
  588.      Select the next inner stack frame (`gud-down').  This is
  589.      equivalent to the `down' command.
  590.  
  591.    If you are using GDB, two additional keybindings are available:
  592.  
  593. `C-c C-f'
  594. `C-x C-a C-f'
  595.      Run the program until the selected stack frame returns (or until it
  596.      stops for some other reason).
  597.  
  598.    These commands interpret a prefix argument as a repeat count, when
  599. that makes sense.
  600.  
  601. 
  602. File: emacs,  Node: GUD Customization,  Prev: Commands of GUD,  Up: Debuggers
  603.  
  604. GUD Customization
  605. -----------------
  606.  
  607.    On startup, GUD runs one of the following hooks: `gdb-mode-hook', if
  608. you are using GDB; `dbx-mode-hook', if you are using DBX;
  609. `sdb-mode-hook', if you are using SDB; and `xdb-mode-hook', if you are
  610. using XDB.  You can use these hooks to define custom keybindings for
  611. the debugger interaction buffer.  *Note Hooks::.
  612.  
  613.    Here is a convenient way to define a command that sends a particular
  614. command string to the debugger, and set up a key binding for it in the
  615. debugger interaction buffer:
  616.  
  617.      (gud-def FUNCTION CMDSTRING BINDING DOCSTRING)
  618.  
  619.    This defines a command named FUNCTION which sends CMDSTRING to the
  620. debugger process, with documentation string DOCSTRING.  You can use the
  621. command thus defined in any buffer.  If BINDING is non-`nil', `gud-def'
  622. also binds the command to `C-c BINDING' in the GUD buffer's mode and to
  623. `C-x C-a BINDING' generally.
  624.  
  625.    The command string CMDSTRING may contain certain escape sequences
  626. that are filled in with varying data at the time FUNCTION is called:
  627.  
  628. `%f'
  629.      Name of the current source file.  If the current buffer is the GUD
  630.      buffer, then the "current source file" is the file that the
  631.      program stopped in.
  632.  
  633. `%l'
  634.      Number of the current source line.  If the current buffer is the
  635.      GUD buffer, then the "current source line" is the line that the
  636.      program stopped in.
  637.  
  638. `%e'
  639.      Text of the C lvalue or function-call expression surrounding point.
  640.  
  641. `%a'
  642.      Text of the hexadecimal address surrounding point.
  643.  
  644. `%p'
  645.      Prefix (numeric) argument of the called function (if any) as a
  646.      number.  (If you don't use `%p' in the command string, the command
  647.      you define ignores any prefix argument.)
  648.  
  649. 
  650. File: emacs,  Node: Executing Lisp,  Next: Lisp Libraries,  Prev: Debuggers,  Up: Building
  651.  
  652. Executing Lisp Expressions
  653. ==========================
  654.  
  655.    Emacs has several different major modes for Lisp and Scheme.  They
  656. are the same in terms of editing commands, but differ in the commands
  657. for executing Lisp expressions.
  658.  
  659. Emacs-Lisp mode
  660.      The mode for editing source files of programs to run in Emacs Lisp.
  661.      This mode defines `C-M-x' to evaluate the current defun.  *Note
  662.      Lisp Libraries::.
  663.  
  664. Lisp Interaction mode
  665.      The mode for an interactive session with Emacs Lisp.  It defines
  666.      LFD to evaluate the sexp before point and insert its value in the
  667.      buffer.  *Note Lisp Interaction::.
  668.  
  669. Lisp mode
  670.      The mode for editing source files of programs that run in Lisps
  671.      other than Emacs Lisp.  This mode defines `C-M-x' to send the
  672.      current defun to an inferior Lisp process.  *Note External Lisp::.
  673.  
  674. Inferior Lisp mode
  675.      The mode for an interactive session with an inferior Lisp process.
  676.      This mode combines the special features of Lisp mode and Shell mode
  677.      (*note Shell Mode::.).
  678.  
  679. Scheme mode
  680.      Like Lisp mode but for Scheme programs.
  681.  
  682. Inferior Scheme mode
  683.      The mode for an interactive session with an inferior Scheme
  684.      process.
  685.  
  686. * Menu:
  687.  
  688. These subnodes of the chapter on editing programs describe the editing
  689. commands for working with Lisp programs, which are in fact available
  690. globally.
  691.  
  692. * Lists::               Expressions with balanced parentheses.
  693. * List Commands::       The commands for working with list and sexps.
  694. * Defuns::              Each program is made up of separate functions.
  695.                           There are editing commands to operate on them.
  696. * Program Indent::      Adjusting indentation to show the nesting.
  697. * Matching::            Insertion of a close-delimiter flashes matching open.
  698. * Comments::            Inserting, killing, and aligning comments.
  699.  
  700. 
  701. File: emacs,  Node: Lisp Libraries,  Next: Lisp Interaction,  Prev: Executing Lisp,  Up: Building
  702.  
  703. Libraries of Lisp Code for Emacs
  704. ================================
  705.  
  706.    Lisp code for Emacs editing commands is stored in files whose names
  707. conventionally end in `.el'.  This ending tells Emacs to edit them in
  708. Emacs-Lisp mode (*note Executing Lisp::.).
  709.  
  710.    To execute a file of Emacs Lisp code, use `M-x load-file'.  This
  711. command reads a file name using the minibuffer and then executes the
  712. contents of that file as Lisp code.  It is not necessary to visit the
  713. file first; in any case, this command reads the file as found on disk,
  714. not text in an Emacs buffer.
  715.  
  716.    Once a file of Lisp code is installed in the Emacs Lisp library
  717. directories, users can load it using `M-x load-library'.  Programs can
  718. load it by calling `load-library', or with `load', a more primitive
  719. function that is similar but accepts some additional arguments.
  720.  
  721.    `M-x load-library' differs from `M-x load-file' in that it searches
  722. a sequence of directories and tries three file names in each directory.
  723. Suppose your argument is LIB; the three names are `LIB.elc', `LIB.el',
  724. and lastly just `LIB'.  If `LIB.elc' exists, it is by convention the
  725. result of compiling `LIB.el'; it is better to load the compiled file,
  726. since it will load and run faster.
  727.  
  728.    If `load-library' finds that `LIB.el' is newer than `LIB.elc' file,
  729. it prints a warning, because it's likely that somebody made changes to
  730. the `.el' file and forgot to recompile it.
  731.  
  732.    Because the argument to `load-library' is usually not in itself a
  733. valid file name, file name completion is not available.  Indeed, when
  734. using this command, you usually do not know exactly what file name will
  735. be used.
  736.  
  737.    The sequence of directories searched by `M-x load-library' is
  738. specified by the variable `load-path', a list of strings that are
  739. directory names.  The default value of the list contains the directory
  740. where the Lisp code for Emacs itself is stored.  If you have libraries
  741. of your own, put them in a single directory and add that directory to
  742. `load-path'.  `nil' in this list stands for the current default
  743. directory, but it is probably not a good idea to put `nil' in the list.
  744. If you find yourself wishing that `nil' were in the list, most likely
  745. what you really want to do is use `M-x load-file' this once.
  746.  
  747.    Often you do not have to give any command to load a library, because
  748. the commands defined in the library are set up to "autoload" that
  749. library.  Running any of those commands causes `load' to be called to
  750. load the library; this replaces the autoload definitions with the real
  751. ones from the library.
  752.  
  753.    If autoloading a file does not finish, either because of an error or
  754. because of a `C-g' quit, all function definitions made by the file are
  755. undone automatically.  So are any calls to `provide'.  As a consequence,
  756. if you use one of the autoloadable commands again, the entire file will
  757. be loaded a second time.  This prevents problems where the command is no
  758. longer autoloading but it works wrong because not all the file was
  759. loaded.  Function definitions are undone only for autoloading; explicit
  760. calls to `load' do not undo anything if loading is not completed.
  761.  
  762.    Emacs Lisp code can be compiled into byte-code which loads faster,
  763. takes up less space when loaded, and executes faster.  *Note Byte
  764. Compilation: (elisp)Byte Compilation.
  765.  
  766.    By convention, the compiled code for a library goes in a separate
  767. file whose name consists of the library source file with `c' appended.
  768. Thus, the compiled code for `foo.el' goes in `foo.elc'.  That's why
  769. `load-library' searches for `.elc' files first.
  770.  
  771. 
  772. File: emacs,  Node: Lisp Eval,  Next: External Lisp,  Prev: Lisp Interaction,  Up: Building
  773.  
  774. Evaluating Emacs-Lisp Expressions
  775. =================================
  776.  
  777.    Lisp programs intended to be run in Emacs should be edited in
  778. Emacs-Lisp mode; this happens automatically for file names ending in
  779. `.el'.  By contrast, Lisp mode itself is used for editing Lisp programs
  780. intended for other Lisp systems.  To switch to Emacs-Lisp mode
  781. explicitly, use the command `M-x emacs-lisp-mode'.
  782.  
  783.    For testing of Lisp programs to run in Emacs, it is often useful to
  784. evaluate part of the program as it is found in the Emacs buffer.  For
  785. example, after changing the text of a Lisp function definition,
  786. evaluating the definition installs the change for future calls to the
  787. function.  Evaluation of Lisp expressions is also useful in any kind of
  788. editing, for invoking noninteractive functions (functions that are not
  789. commands).
  790.  
  791. `M-ESC'
  792.      Read a single Lisp expression in the minibuffer, evaluate it, and
  793.      print the value in the echo area (`eval-expression').
  794.  
  795. `C-x C-e'
  796.      Evaluate the Lisp expression before point, and print the value in
  797.      the echo area (`eval-last-sexp').
  798.  
  799. `C-M-x'
  800.      Evaluate the defun containing or after point, and print the value
  801.      in the echo area (`eval-defun').
  802.  
  803. `M-x eval-region'
  804.      Evaluate all the Lisp expressions in the region.
  805.  
  806. `M-x eval-current-buffer'
  807.      Evaluate all the Lisp expressions in the buffer.
  808.  
  809.    `M-ESC' (`eval-expression') is the most basic command for evaluating
  810. a Lisp expression interactively.  It reads the expression using the
  811. minibuffer, so you can execute any expression on a buffer regardless of
  812. what the buffer contains.  When the expression is evaluated, the current
  813. buffer is once again the buffer that was current when `M-ESC' was typed.
  814.  
  815.    `M-ESC' can easily confuse users who do not understand it,
  816. especially on keyboards with autorepeat where it can result from holding
  817. down the ESC key for too long.  Therefore, `eval-expression' is
  818. normally a disabled command.  Attempting to use this command asks for
  819. confirmation and gives you the option of enabling it; once you enable
  820. the command, confirmation will no longer be required for it.  *Note
  821. Disabling::.
  822.  
  823.    In Emacs-Lisp mode, the key `C-M-x' is bound to the command
  824. `eval-defun', which parses the defun containing or following point as a
  825. Lisp expression and evaluates it.  The value is printed in the echo
  826. area.  This command is convenient for installing in the Lisp environment
  827. changes that you have just made in the text of a function definition.
  828.  
  829.    The command `C-x C-e' (`eval-last-sexp') performs a similar job but
  830. is available in all major modes, not just Emacs-Lisp mode.  It finds
  831. the sexp before point, reads it as a Lisp expression, evaluates it, and
  832. prints the value in the echo area.  It is sometimes useful to type in an
  833. expression and then, with point still after it, type `C-x C-e'.
  834.  
  835.    If `C-M-x' or `C-x C-e' is given a numeric argument, it prints the
  836. value by insertion into the current buffer at point, rather than in the
  837. echo area.  The argument value does not matter.
  838.  
  839.    The most general command for evaluating Lisp expressions from a
  840. buffer is `eval-region'.  `M-x eval-region' parses the text of the
  841. region as one or more Lisp expressions, evaluating them one by one.
  842. `M-x eval-current-buffer' is similar but evaluates the entire buffer.
  843. This is a reasonable way to install the contents of a file of Lisp code
  844. that you are just ready to test.  After finding and fixing a bug, use
  845. `C-M-x' on each function that you change, to keep the Lisp world in
  846. step with the source file.
  847.  
  848. 
  849. File: emacs,  Node: Lisp Interaction,  Next: Lisp Eval,  Prev: Lisp Libraries,  Up: Building
  850.  
  851. Lisp Interaction Buffers
  852. ========================
  853.  
  854.    The buffer `*scratch*' which is selected when Emacs starts up is
  855. provided for evaluating Lisp expressions interactively inside Emacs.
  856.  
  857.    Thus, the way to use the `*scratch*' buffer is to insert Lisp
  858. expressions at the end, ending each one with LFD so that it will be
  859. evaluated.  This command reads the Lisp expression before point,
  860. evaluates it, and inserts the value in printed representation before
  861. point.  The result is a complete typescript of the expressions you have
  862. evaluated and their values.
  863.  
  864.    The `*scratch*' buffer's major mode is Lisp Interaction mode, which
  865. is the same as Emacs-Lisp mode except for the binding of LFD.
  866.  
  867.    The rationale for this feature is that Emacs must have a buffer when
  868. it starts up, but that buffer is not useful for editing files since a
  869. new buffer is made for every file that you visit.  The Lisp interpreter
  870. typescript is the most useful thing I can think of for the initial
  871. buffer to do.  Type `M-x lisp-interaction-mode' to put the current
  872. buffer in Lisp Interaction mode.
  873.  
  874. 
  875. File: emacs,  Node: External Lisp,  Prev: Lisp Eval,  Up: Building
  876.  
  877. Running an External Lisp
  878. ========================
  879.  
  880.    Emacs has facilities for running programs in other Lisp systems.
  881. You can run a Lisp process as an inferior of Emacs, and pass
  882. expressions to it to be evaluated.  You can also pass changed function
  883. definitions directly from the Emacs buffers in which you edit the Lisp
  884. programs to the inferior Lisp process.
  885.  
  886.    To run an inferior Lisp process, type `M-x run-lisp'.  This runs the
  887. program named `lisp', the same program you would run by typing `lisp'
  888. as a shell command, with both input and output going through an Emacs
  889. buffer named `*lisp*'.  That is to say, any "terminal output" from Lisp
  890. will go into the buffer, advancing point, and any "terminal input" for
  891. Lisp comes from text in the buffer.  (You can change the name of the
  892. Lisp executable file by setting the variable `inferior-lisp-program'.)
  893.  
  894.    To give input to Lisp, go to the end of the buffer and type the
  895. input, terminated by RET.  The `*lisp*' buffer is in Inferior Lisp
  896. mode, which combines the special characteristics of Lisp mode and Shell
  897. mode (*note Shell Mode::.).
  898.  
  899.    For the source files of programs to run in external Lisps, use Lisp
  900. mode.  This mode can be selected with `M-x lisp-mode', and is used
  901. automatically for files whose names end in `.l' or `.lisp', as most Lisp
  902. systems usually expect.
  903.  
  904.    When you edit a function in a Lisp program you are running, the
  905. easiest way to send the changed definition to the inferior Lisp process
  906. is the key `C-M-x'.  In Lisp mode, this runs the function
  907. `lisp-send-defun', which finds the defun around or following point and
  908. sends it as input to the Lisp process.  (Emacs can send input to any
  909. inferior process regardless of what buffer is current.)
  910.  
  911.    Contrast the meanings of `C-M-x' in Lisp mode (for editing programs
  912. to be run in another Lisp system) and Emacs-Lisp mode (for editing Lisp
  913. programs to be run in Emacs): in both modes it has the effect of
  914. installing the function definition that point is in, but the way of
  915. doing so is different according to where the relevant Lisp environment
  916. is found.  *Note Executing Lisp::.
  917.  
  918. 
  919. File: emacs,  Node: Abbrevs,  Next: Picture,  Prev: Building,  Up: Top
  920.  
  921. Abbrevs
  922. *******
  923.  
  924.    An "abbrev" is a word which "expands", if you insert it, into some
  925. different text.  Abbrevs are defined by the user to expand in specific
  926. ways.  For example, you might define `foo' as an abbrev expanding to
  927. `find outer otter'.  With this abbrev defined, you would be able to get
  928. `find outer otter ' into the buffer by typing `f o o SPC'.
  929.  
  930.    Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
  931. Disabling Abbrev mode does not cause abbrev definitions to be forgotten,
  932. but they do not expand until Abbrev mode is enabled again.  The command
  933. `M-x abbrev-mode' toggles Abbrev mode; with a numeric argument, it
  934. turns Abbrev mode on if the argument is positive, off otherwise.  *Note
  935. Minor Modes::.  `abbrev-mode' is also a variable; Abbrev mode is on
  936. when the variable is non-`nil'.  The variable `abbrev-mode'
  937. automatically becomes local to the current buffer when it is set.
  938.  
  939.    Abbrev definitions can be "mode-specific"--active only in one major
  940. mode.  Abbrevs can also have "global" definitions that are active in
  941. all major modes.  The same abbrev can have a global definition and
  942. various mode-specific definitions for different major modes.  A mode
  943. specific definition for the current major mode overrides a global
  944. definition.
  945.  
  946.    Abbrevs can be defined interactively during the editing session.
  947. Lists of abbrev definitions can also be saved in files and reloaded in
  948. later sessions.  Some users keep extensive lists of abbrevs that they
  949. load in every session.
  950.  
  951.    A second kind of abbreviation facility is called the "dynamic
  952. expansion".  Dynamic abbrev expansion happens only when you give an
  953. explicit command and the result of the expansion depends only on the
  954. current contents of the buffer.  *Note Dynamic Abbrevs::.
  955.  
  956. * Menu:
  957.  
  958. * Defining Abbrevs::  Defining an abbrev, so it will expand when typed.
  959. * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
  960. * Editing Abbrevs::   Viewing or editing the entire list of defined abbrevs.
  961. * Saving Abbrevs::    Saving the entire list of abbrevs for another session.
  962. * Dynamic Abbrevs::   Abbreviations for words already in the buffer.
  963.  
  964. 
  965. File: emacs,  Node: Defining Abbrevs,  Next: Expanding Abbrevs,  Up: Abbrevs
  966.  
  967. Defining Abbrevs
  968. ================
  969.  
  970. `C-x a g'
  971.      Define an abbrev, using one or more words before point as its
  972.      expansion (`add-global-abbrev').
  973.  
  974. `C-x a l'
  975.      Similar, but define an abbrev specific to the current major mode
  976.      (`add-mode-abbrev').
  977.  
  978. `C-x a i g'
  979.      Define a word in the buffer as an abbrev
  980.      (`inverse-add-global-abbrev').
  981.  
  982. `C-x a i l'
  983.      Define a word in the buffer as a mode-specific abbrev
  984.      (`inverse-add-mode-abbrev').
  985.  
  986. `M-x kill-all-abbrevs'
  987.      After this command, there are no abbrev definitions in effect.
  988.  
  989.    The usual way to define an abbrev is to enter the text you want the
  990. abbrev to expand to, position point after it, and type `C-x a g'
  991. (`add-global-abbrev').  This reads the abbrev itself using the
  992. minibuffer, and then defines it as an abbrev for one or more words
  993. before point.  Use a numeric argument to say how many words before
  994. point should be taken as the expansion.  For example, to define the
  995. abbrev `foo' as mentioned above, insert the text `find outer otter' and
  996. then type `C-u 3 C-x a g f o o RET'.
  997.  
  998.    An argument of zero to `C-x a g' means to use the contents of the
  999. region as the expansion of the abbrev being defined.
  1000.  
  1001.    The command `C-x a l' (`add-mode-abbrev') is similar, but defines a
  1002. mode-specific abbrev.  Mode specific abbrevs are active only in a
  1003. particular major mode.  `C-x a l' defines an abbrev for the major mode
  1004. in effect at the time `C-x a l' is typed.  The arguments work the same
  1005. as for `C-x a g'.
  1006.  
  1007.    If the text of the abbrev you want is already in the buffer instead
  1008. of the expansion, use command `C-x a i g' (`inverse-add-global-abbrev')
  1009. instead of `C-x a g', or use `C-x a i l' (`inverse-add-mode-abbrev')
  1010. instead of `C-x a l'.  These commands are called "inverse" because they
  1011. invert the meaning of the argument found in the buffer and the argument
  1012. read using the minibuffer.
  1013.  
  1014.    To change the definition of an abbrev, just add the new definition.
  1015. You will be asked to confirm if the abbrev has a prior definition.  To
  1016. remove an abbrev definition, give a negative argument to `C-x a g' or
  1017. `C-x a l'.  You must choose the command to specify whether to kill a
  1018. global definition or a mode-specific definition for the current mode,
  1019. since those two definitions are independent for one abbrev.
  1020.  
  1021.    `M-x kill-all-abbrevs' removes all the abbrev definitions there are.
  1022.  
  1023. 
  1024. File: emacs,  Node: Expanding Abbrevs,  Next: Editing Abbrevs,  Prev: Defining Abbrevs,  Up: Abbrevs
  1025.  
  1026. Controlling Abbrev Expansion
  1027. ============================
  1028.  
  1029.    An abbrev expands whenever it is present in the buffer just before
  1030. point and a self-inserting punctuation character (SPC, comma, etc.) is
  1031. typed.  Most often the way an abbrev is used is to insert the abbrev
  1032. followed by punctuation.
  1033.  
  1034.    Abbrev expansion preserves case; thus, `foo' expands into `find
  1035. outer otter'; `Foo' into `Find outer otter', and `FOO' into `FIND OUTER
  1036. OTTER' or `Find Outer Otter' according to the variable
  1037. `abbrev-all-caps' (a non-`nil' value chooses the first of the two
  1038. expansions).
  1039.  
  1040.    These two commands are used to control abbrev expansion:
  1041.  
  1042. `M-''
  1043.      Separate a prefix from a following abbrev to be expanded
  1044.      (`abbrev-prefix-mark').
  1045.  
  1046. `C-x a e'
  1047.      Expand the abbrev before point (`expand-abbrev').  This is
  1048.      effective even when Abbrev mode is not enabled.
  1049.  
  1050. `M-x unexpand-abbrev'
  1051.      Undo last abbrev expansion.
  1052.  
  1053. `M-x expand-region-abbrevs'
  1054.      Expand some or all abbrevs found in the region.
  1055.  
  1056.    You may wish to expand an abbrev with a prefix attached; for
  1057. example, if `cnst' expands into `construction', you might want to use
  1058. it to enter `reconstruction'.  It does not work to type `recnst',
  1059. because that is not necessarily a defined abbrev.  What does work is to
  1060. use the command `M-'' (`abbrev-prefix-mark') in between the prefix `re'
  1061. and the abbrev `cnst'.  First, insert `re'.  Then type `M-''; this
  1062. inserts a minus sign in the buffer to indicate that it has done its
  1063. work.  Then insert the abbrev `cnst'; the buffer now contains
  1064. `re-cnst'.  Now insert a punctuation character to expand the abbrev
  1065. `cnst' into `construction'.  The minus sign is deleted at this point,
  1066. because `M-'' left word for this to be done.  The resulting text is the
  1067. desired `reconstruction'.
  1068.  
  1069.    If you actually want the text of the abbrev in the buffer, rather
  1070. than its expansion, you can accomplish this by inserting the following
  1071. punctuation with `C-q'.  Thus, `foo C-q -' leaves `foo-' in the buffer.
  1072.  
  1073.    If you expand an abbrev by mistake, you can undo the expansion
  1074. (replace the expansion by the original abbrev text) with `M-x
  1075. unexpand-abbrev'.  `C-_' (`undo') can also be used to undo the
  1076. expansion; but first it undoes the insertion of the following
  1077. punctuation character.  Therefore, if you want both the punctuation
  1078. character and the unexpanded abbrev, you must reinsert the punctuation
  1079. character, quoting it with `C-q'.
  1080.  
  1081.    `M-x expand-region-abbrevs' searches through the region for defined
  1082. abbrevs, and for each one found offers to replace it with its expansion.
  1083. This command is useful if you have typed in text using abbrevs but
  1084. forgot to turn on Abbrev mode first.  It may also be useful together
  1085. with a special set of abbrev definitions for making several global
  1086. replacements at once.  This command is effective even if Abbrev mode is
  1087. not enabled.
  1088.  
  1089.    Expanding an abbrev runs the hook `pre-abbrev-expand-hook' (*note
  1090. Hooks::.).
  1091.  
  1092. 
  1093. File: emacs,  Node: Editing Abbrevs,  Next: Saving Abbrevs,  Prev: Expanding Abbrevs,  Up: Abbrevs
  1094.  
  1095. Examining and Editing Abbrevs
  1096. =============================
  1097.  
  1098. `M-x list-abbrevs'
  1099.      Print a list of all abbrev definitions.
  1100.  
  1101. `M-x edit-abbrevs'
  1102.      Edit a list of abbrevs; you can add, alter or remove definitions.
  1103.  
  1104.    The output from `M-x list-abbrevs' looks like this:
  1105.  
  1106.      (lisp-mode-abbrev-table)
  1107.      "dk"           0    "define-key"
  1108.      (global-abbrev-table)
  1109.      "dfn"           0    "definition"
  1110.  
  1111. (Some blank lines of no semantic significance, and some other abbrev
  1112. tables, have been omitted.)
  1113.  
  1114.    A line containing a name in parentheses is the header for abbrevs in
  1115. a particular abbrev table; `global-abbrev-table' contains all the global
  1116. abbrevs, and the other abbrev tables that are named after major modes
  1117. contain the mode-specific abbrevs.
  1118.  
  1119.    Within each abbrev table, each nonblank line defines one abbrev.  The
  1120. word at the beginning is the abbrev.  The number that appears is the
  1121. number of times the abbrev has been expanded.  Emacs keeps track of
  1122. this to help you see which abbrevs you actually use, in case you decide
  1123. to eliminate those that you don't use often.  The string at the end of
  1124. the line is the expansion.
  1125.  
  1126.    `M-x edit-abbrevs' allows you to add, change or kill abbrev
  1127. definitions by editing a list of them in an Emacs buffer.  The list has
  1128. the same format described above.  The buffer of abbrevs is called
  1129. `*Abbrevs*', and is in Edit-Abbrevs mode.  This mode redefines the key
  1130. `C-c C-c' to install the abbrev definitions as specified in the buffer.
  1131. The command that does this is `edit-abbrevs-redefine'.  Any abbrevs
  1132. not described in the buffer are eliminated when this is done.
  1133.  
  1134.    The command `edit-abbrevs' is actually the same as `list-abbrevs'
  1135. except that it selects the buffer `*Abbrevs*' whereas `list-abbrevs'
  1136. merely displays it in another window.
  1137.  
  1138.