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

  1. This is Info file ../info/emacs, produced by Makeinfo-1.43 from the
  2. input file emacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  15. General Public License" are included exactly as in the original, and
  16. provided that the entire resulting derived work is distributed under
  17. the terms of a permission notice identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the sections entitled "The GNU Manifesto",
  22. "Distribution" and "GNU General Public License" may be included in a
  23. translation approved by the author instead of in the original English.
  24.  
  25. 
  26. File: emacs,  Node: Lisp Debug,  Next: Lisp Interaction,  Prev: Lisp Eval,  Up: Running
  27.  
  28. The Emacs-Lisp Debugger
  29. =======================
  30.  
  31.    GNU Emacs contains a debugger for Lisp programs executing inside it. 
  32. This debugger is normally not used; many commands frequently get Lisp
  33. errors when invoked in inappropriate contexts (such as `C-f' at the end
  34. of the buffer) and it would be very unpleasant for that to enter a
  35. special debugging mode.  When you want to make Lisp errors invoke the
  36. debugger, you must set the variable `debug-on-error' to non-`nil'. 
  37. Quitting with `C-g' is not considered an error, and `debug-on-error'
  38. has no effect on the handling of `C-g'.  However, if you set
  39. `debug-on-quit' non-`nil', `C-g' will invoke the debugger.  This can
  40. be useful for debugging an infinite loop; type `C-g' once the loop has
  41. had time to reach its steady state.  `debug-on-quit' has no effect on
  42. errors.
  43.  
  44.    You can also cause the debugger to be entered when a specified
  45. function is called, or at a particular place in Lisp code.  Use `M-x
  46. debug-on-entry' with argument FUN-NAME to cause function FUN-NAME to
  47. enter the debugger as soon as it is called.  Use `M-x
  48. cancel-debug-on-entry' to make the function stop entering the debugger
  49. when called.  (Redefining the function also does this.)  To enter the
  50. debugger from some other place in Lisp code, you must insert the
  51. expression `(debug)' there and install the changed code with `C-M-x'. 
  52. *Note Lisp Eval::.
  53.  
  54.    When the debugger is entered, it displays the previously selected
  55. buffer in one window and a buffer named `*Backtrace*' in another
  56. window.  The backtrace buffer contains one line for each level of Lisp
  57. function execution currently going on.  At the beginning of this
  58. buffer is a message describing the reason that the debugger was
  59. invoked (such as, what error message if it was invoked due to an
  60. error).
  61.  
  62.    The backtrace buffer is read-only, and is in a special major mode,
  63. Backtrace mode, in which letters are defined as debugger commands.  The
  64. usual Emacs editing commands are available; you can switch windows to
  65. examine the buffer that was being edited at the time of the error, and
  66. you can also switch buffers, visit files, and do any other sort of
  67. editing.  However, the debugger is a recursive editing level (*note
  68. Recursive Edit::.) and it is wise to go back to the backtrace buffer
  69. and exit the debugger officially when you don't want to use it any
  70. more.  Exiting the debugger kills the backtrace buffer.
  71.  
  72.    The contents of the backtrace buffer show you the functions that are
  73. executing and the arguments that were given to them.  It has the
  74. additional purpose of allowing you to specify a stack frame by moving
  75. point to the line describing that frame.  The frame whose line point
  76. is on is considered the "current frame".  Some of the debugger
  77. commands operate on the current frame.  Debugger commands are mainly
  78. used for stepping through code an expression at a time.  Here is a
  79. list of them.
  80.  
  81. `c'
  82.      Exit the debugger and continue execution.  In most cases,
  83.      execution of the program continues as if the debugger had never
  84.      been entered (aside from the effect of any variables or data
  85.      structures you may have changed while inside the debugger).  This
  86.      includes entry to the debugger due to function entry or exit,
  87.      explicit invocation, quitting or certain errors.  Most errors
  88.      cannot be continued; trying to continue one of them causes the
  89.      same error to occur again.
  90.  
  91. `d'
  92.      Continue execution, but enter the debugger the next time a Lisp
  93.      function is called.  This allows you to step through the
  94.      subexpressions of an expression, seeing what values the
  95.      subexpressions compute and what else they do.
  96.  
  97.      The stack frame made for the function call which enters the
  98.      debugger in this way will be flagged automatically for the
  99.      debugger to be called when the frame is exited.  You can use the
  100.      `u' command to cancel this flag.
  101.  
  102. `b'
  103.      Set up to enter the debugger when the current frame is exited. 
  104.      Frames that will invoke the debugger on exit are flagged with
  105.      stars.
  106.  
  107. `u'
  108.      Don't enter the debugger when the current frame is exited.  This
  109.      cancels a `b' command on that frame.
  110.  
  111. `e'
  112.      Read a Lisp expression in the minibuffer, evaluate it, and print
  113.      the value in the echo area.  This is the same as the command
  114.      `M-ESC', except that `e' is not normally disabled like `M-ESC'.
  115.  
  116. `q'
  117.      Terminate the program being debugged; return to top-level Emacs
  118.      command execution.
  119.  
  120.      If the debugger was entered due to a `C-g' but you really want to
  121.      quit, not to debug, use the `q' command.
  122.  
  123. `r'
  124.      Return a value from the debugger.  The value is computed by
  125.      reading an expression with the minibuffer and evaluating it.
  126.  
  127.      The value returned by the debugger makes a difference when the
  128.      debugger was invoked due to exit from a Lisp call frame (as
  129.      requested with `b'); then the value specified in the `r' command
  130.      is used as the value of that frame.
  131.  
  132.      The debugger's return value also matters with many errors.  For
  133.      example, `wrong-type-argument' errors will use the debugger's
  134.      return value instead of the invalid argument; `no-catch' errors
  135.      will use the debugger value as a throw tag instead of the tag
  136.      that was not found.  If an error was signaled by calling the Lisp
  137.      function `signal', the debugger's return value is returned as the
  138.      value of `signal'.
  139.  
  140. 
  141. File: emacs,  Node: Lisp Interaction,  Next: External Lisp,  Prev: Lisp Debug,  Up: Running
  142.  
  143. Lisp Interaction Buffers
  144. ========================
  145.  
  146.    The buffer `*scratch*' which is selected when Emacs starts up is
  147. provided for evaluating Lisp expressions interactively inside Emacs. 
  148. Both the expressions you evaluate and their output goes in the buffer.
  149.  
  150.    The `*scratch*' buffer's major mode is Lisp Interaction mode, which
  151. is the same as Emacs-Lisp mode except for one command, LFD.  In
  152. Emacs-Lisp mode, LFD is an indentation command, as usual.  In Lisp
  153. Interaction mode, LFD is bound to `eval-print-last-sexp'.  This
  154. function reads the Lisp expression before point, evaluates it, and
  155. inserts the value in printed representation before point.
  156.  
  157.    Thus, the way to use the `*scratch*' buffer is to insert Lisp
  158. expressions at the end, ending each one with LFD so that it will be
  159. evaluated.  The result is a complete typescript of the expressions you
  160. have evaluated and their values.
  161.  
  162.    The rationale for this feature is that Emacs must have a buffer
  163. when it starts up, but that buffer is not useful for editing files
  164. since a new buffer is made for every file that you visit.  The Lisp
  165. interpreter typescript is the most useful thing I can think of for the
  166. initial buffer to do.  `M-x lisp-interaction-mode' will put any buffer
  167. in Lisp Interaction mode.
  168.  
  169. 
  170. File: emacs,  Node: External Lisp,  Prev: Lisp Interaction,  Up: Running
  171.  
  172. Running an External Lisp
  173. ========================
  174.  
  175.    Emacs has facilities for running programs in other Lisp systems. 
  176. You can run a Lisp process as an inferior of Emacs, and pass
  177. expressions to it to be evaluated.  You can also pass changed function
  178. definitions directly from the Emacs buffers in which you edit the Lisp
  179. programs to the inferior Lisp process.
  180.  
  181.    To run an inferior Lisp process, type `M-x run-lisp'.  This runs the
  182. program named `lisp', the same program you would run by typing `lisp'
  183. as a shell command, with both input and output going through an Emacs
  184. buffer named `*lisp*'.  That is to say, any "terminal output" from
  185. Lisp will go into the buffer, advancing point, and any "terminal
  186. input" for Lisp comes from text in the buffer.  To give input to Lisp,
  187. go to the end of the buffer and type the input, terminated by RET.  The
  188. `*lisp*' buffer is in Inferior Lisp mode, a mode which has all the
  189. special characteristics of Lisp mode and Shell mode (*note Shell
  190. Mode::.).
  191.  
  192.    For the source files of programs to run in external Lisps, use Lisp
  193. mode.  This mode can be selected with `M-x lisp-mode', and is used
  194. automatically for files whose names end in `.l' or `.lisp', as most
  195. Lisp systems usually expect.
  196.  
  197.    When you edit a function in a Lisp program you are running, the
  198. easiest way to send the changed definition to the inferior Lisp
  199. process is the key `C-M-x'.  In Lisp mode, this runs the function
  200. `lisp-send-defun', which finds the defun around or following point and
  201. sends it as input to the Lisp process.  (Emacs can send input to any
  202. inferior process regardless of what buffer is current.)
  203.  
  204.    Contrast the meanings of `C-M-x' in Lisp mode (for editing programs
  205. to be run in another Lisp system) and Emacs-Lisp mode (for editing Lisp
  206. programs to be run in Emacs): in both modes it has the effect of
  207. installing the function definition that point is in, but the way of
  208. doing so is different according to where the relevant Lisp environment
  209. is found.  *Note Lisp Modes::.
  210.  
  211. 
  212. File: emacs,  Node: Abbrevs,  Next: Picture,  Prev: Running,  Up: Top
  213.  
  214. Abbrevs
  215. *******
  216.  
  217.    An "abbrev" is a word which "expands", if you insert it, into some
  218. different text.  Abbrevs are defined by the user to expand in specific
  219. ways.  For example, you might define `foo' as an abbrev expanding to
  220. `find outer otter'.  With this abbrev defined, you would be able to
  221. get `find outer otter ' into the buffer by typing `f o o SPC'.
  222.  
  223.    Abbrevs expand only when Abbrev mode (a minor mode) is enabled. 
  224. Disabling Abbrev mode does not cause abbrev definitions to be
  225. forgotten, but they do not expand until Abbrev mode is enabled again. 
  226. The command `M-x abbrev-mode' toggles Abbrev mode; with a numeric
  227. argument, it turns Abbrev mode on if the argument is positive, off
  228. otherwise.  *Note Minor Modes::.  `abbrev-mode' is also a variable;
  229. Abbrev mode is on when the variable is non-`nil'.  The variable
  230. `abbrev-mode' automatically becomes local to the current buffer when
  231. it is set.
  232.  
  233.    Abbrev definitions can be "mode-specific"--active only in one major
  234. mode.  Abbrevs can also have "global" definitions that are active in
  235. all major modes.  The same abbrev can have a global definition and
  236. various mode-specific definitions for different major modes.  A mode
  237. specific definition for the current major mode overrides a global
  238. definition.
  239.  
  240.    Abbrevs can be defined interactively during the editing session. 
  241. Lists of abbrev definitions can also be saved in files and reloaded in
  242. later sessions.  Some users keep extensive lists of abbrevs that they
  243. load in every session.
  244.  
  245.    A second kind of abbreviation facility is called the "dynamic
  246. expansion".  Dynamic abbrev expansion happens only when you give an
  247. explicit command and the result of the expansion depends only on the
  248. current contents of the buffer.  *Note Dynamic Abbrevs::.
  249.  
  250. * Menu:
  251.  
  252. * Defining Abbrevs::  Defining an abbrev, so it will expand when typed.
  253. * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
  254. * Editing Abbrevs::   Viewing or editing the entire list of defined abbrevs.
  255. * Saving Abbrevs::    Saving the entire list of abbrevs for another session.
  256. * Dynamic Abbrevs::   Abbreviations for words already in the buffer.
  257.  
  258. 
  259. File: emacs,  Node: Defining Abbrevs,  Next: Expanding Abbrevs,  Prev: Abbrevs,  Up: Abbrevs
  260.  
  261. Defining Abbrevs
  262. ================
  263.  
  264. `C-x +'
  265.      Define an abbrev to expand into some text before point
  266.      (`add-global-abbrev').
  267.  
  268. `C-x C-a'
  269.      Similar, but define an abbrev available only in the current major
  270.      mode (`add-mode-abbrev').
  271.  
  272. `C-x -'
  273.      Define a word in the buffer as an abbrev
  274.      (`inverse-add-global-abbrev').
  275.  
  276. `C-x C-h'
  277.      Define a word in the buffer as a mode-specific abbrev
  278.      (`inverse-add-mode-abbrev').
  279.  
  280. `M-x kill-all-abbrevs'
  281.      After this command, there are no abbrev definitions in effect.
  282.  
  283.    The usual way to define an abbrev is to enter the text you want the
  284. abbrev to expand to, position point after it, and type `C-x +'
  285. (`add-global-abbrev').  This reads the abbrev itself using the
  286. minibuffer, and then defines it as an abbrev for one or more words
  287. before point.  Use a numeric argument to say how many words before
  288. point should be taken as the expansion.  For example, to define the
  289. abbrev `foo' as mentioned above, insert the text `find outer otter'
  290. and then type `C-u 3 C-x + f o o RET'.
  291.  
  292.    An argument of zero to `C-x +' means to use the contents of the
  293. region as the expansion of the abbrev being defined.
  294.  
  295.    The command `C-x C-a' (`add-mode-abbrev') is similar, but defines a
  296. mode-specific abbrev.  Mode specific abbrevs are active only in a
  297. particular major mode.  `C-x C-a' defines an abbrev for the major mode
  298. in effect at the time `C-x C-a' is typed.  The arguments work the same
  299. as for `C-x +'.
  300.  
  301.    If the text of the abbrev you want is already in the buffer instead
  302. of the expansion, use command `C-x -' (`inverse-add-global-abbrev')
  303. instead of `C-x +', or use `C-x C-h' (`inverse-add-mode-abbrev')
  304. instead of `C-x C-a'.  These commands are called "inverse" because
  305. they invert the meaning of the argument found in the buffer and the
  306. argument read using the minibuffer.
  307.  
  308.    To change the definition of an abbrev, just add the new definition.
  309.  You will be asked to confirm if the abbrev has a prior definition. 
  310. To remove an abbrev definition, give a negative argument to `C-x +' or
  311. `C-x C-a'.  You must choose the command to specify whether to kill a
  312. global definition or a mode-specific definition for the current mode,
  313. since those two definitions are independent for one abbrev.
  314.  
  315.    `M-x kill-all-abbrevs' removes all the abbrev definitions there are.
  316.  
  317. 
  318. File: emacs,  Node: Expanding Abbrevs,  Next: Editing Abbrevs,  Prev: Defining Abbrevs,  Up: Abbrevs
  319.  
  320. Controlling Abbrev Expansion
  321. ============================
  322.  
  323.    An abbrev expands whenever it is present in the buffer just before
  324. point and a self-inserting punctuation character (SPC, comma, etc.) is
  325. typed.  Most often the way an abbrev is used is to insert the abbrev
  326. followed by punctuation.
  327.  
  328.    Abbrev expansion preserves case; thus, `foo' expands into `find
  329. outer otter'; `Foo' into `Find outer otter', and `FOO' into `FIND
  330. OUTER OTTER' or `Find Outer Otter' according to the variable
  331. `abbrev-all-caps' (a non-`nil' value chooses the first of the two
  332. expansions).
  333.  
  334.    These two commands are used to control abbrev expansion:
  335.  
  336. `M-''
  337.      Separate a prefix from a following abbrev to be expanded
  338.      (`abbrev-prefix-mark').
  339.  
  340. `C-x ''
  341.      Expand the abbrev before point (`expand-abbrev').  This is
  342.      effective even when Abbrev mode is not enabled.
  343.  
  344. `M-x unexpand-abbrev'
  345.      Undo last abbrev expansion.
  346.  
  347. `M-x expand-region-abbrevs'
  348.      Expand some or all abbrevs found in the region.
  349.  
  350.    You may wish to expand an abbrev with a prefix attached; for
  351. example, if `cnst' expands into `construction', you might want to use
  352. it to enter `reconstruction'.  It does not work to type `recnst',
  353. because that is not necessarily a defined abbrev.  What does work is
  354. to use the command `M-'' (`abbrev-prefix-mark') in between the prefix
  355. `re' and the abbrev `cnst'.  First, insert `re'.  Then type `M-'';
  356. this inserts a minus sign in the buffer to indicate that it has done
  357. its work.  Then insert the abbrev `cnst'; the buffer now contains
  358. `re-cnst'.  Now insert a punctuation character to expand the abbrev
  359. `cnst' into `construction'.  The minus sign is deleted at this point,
  360. because `M-'' left word for this to be done.  The resulting text is
  361. the desired `reconstruction'.
  362.  
  363.    If you actually want the text of the abbrev in the buffer, rather
  364. than its expansion, you can accomplish this by inserting the following
  365. punctuation with `C-q'.  Thus, `foo C-q -' leaves `foo-' in the buffer.
  366.  
  367.    If you expand an abbrev by mistake, you can undo the expansion
  368. (replace the expansion by the original abbrev text) with `M-x
  369. unexpand-abbrev'.  `C-_' (`undo') can also be used to undo the
  370. expansion; but first it will undo the insertion of the following
  371. punctuation character!
  372.  
  373.    `M-x expand-region-abbrevs' searches through the region for defined
  374. abbrevs, and for each one found offers to replace it with its
  375. expansion.  This command is useful if you have typed in text using
  376. abbrevs but forgot to turn on Abbrev mode first.  It may also be
  377. useful together with a special set of abbrev definitions for making
  378. several global replacements at once.  This command is effective even
  379. if Abbrev mode is not enabled.
  380.  
  381. 
  382. File: emacs,  Node: Editing Abbrevs,  Next: Saving Abbrevs,  Prev: Expanding Abbrevs,  Up: Abbrevs
  383.  
  384. Examining and Editing Abbrevs
  385. =============================
  386.  
  387. `M-x list-abbrevs'
  388.      Print a list of all abbrev definitions.
  389.  
  390. `M-x edit-abbrevs'
  391.      Edit a list of abbrevs; you can add, alter or remove definitions.
  392.  
  393.    The output from `M-x list-abbrevs' looks like this:
  394.  
  395.      (lisp-mode-abbrev-table)
  396.      "dk"           0    "define-key"
  397.      (global-abbrev-table)
  398.      "dfn"           0    "definition"
  399.  
  400. (Some blank lines of no semantic significance, and some other abbrev
  401. tables, have been omitted.)
  402.  
  403.    A line containing a name in parentheses is the header for abbrevs
  404. in a particular abbrev table; `global-abbrev-table' contains all the
  405. global abbrevs, and the other abbrev tables that are named after major
  406. modes contain the mode-specific abbrevs.
  407.  
  408.    Within each abbrev table, each nonblank line defines one abbrev. 
  409. The word at the beginning is the abbrev.  The number that appears is
  410. the number of times the abbrev has been expanded.  Emacs keeps track
  411. of this to help you see which abbrevs you actually use, in case you
  412. decide to eliminate those that you don't use often.  The string at the
  413. end of the line is the expansion.
  414.  
  415.    `M-x edit-abbrevs' allows you to add, change or kill abbrev
  416. definitions by editing a list of them in an Emacs buffer.  The list
  417. has the same format described above.  The buffer of abbrevs is called
  418. `*Abbrevs*', and is in Edit-Abbrevs mode.  This mode redefines the key
  419. `C-c C-c' to install the abbrev definitions as specified in the
  420. buffer.  The command that does this is `edit-abbrevs-redefine'.  Any
  421. abbrevs not described in the buffer are eliminated when this is done.
  422.  
  423.    `edit-abbrevs' is actually the same as `list-abbrevs' except that
  424. it selects the buffer `*Abbrevs*' whereas `list-abbrevs' merely
  425. displays it in another window.
  426.  
  427. 
  428. File: emacs,  Node: Saving Abbrevs,  Next: Dynamic Abbrevs,  Prev: Editing Abbrevs,  Up: Abbrevs
  429.  
  430. Saving Abbrevs
  431. ==============
  432.  
  433.    These commands allow you to keep abbrev definitions between editing
  434. sessions.
  435.  
  436. `M-x write-abbrev-file'
  437.      Write a file describing all defined abbrevs.
  438.  
  439. `M-x read-abbrev-file'
  440.      Read such a file and define abbrevs as specified there.
  441.  
  442. `M-x quietly-read-abbrev-file'
  443.      Similar but do not display a message about what is going on.
  444.  
  445. `M-x define-abbrevs'
  446.      Define abbrevs from buffer.
  447.  
  448. `M-x insert-abbrevs'
  449.      Insert all abbrevs and their expansions into the buffer.
  450.  
  451.    `M-x write-abbrev-file' reads a file name using the minibuffer and
  452. writes a description of all current abbrev definitions into that file.
  453.  The text stored in the file looks like the output of `M-x
  454. list-abbrevs'.  This is used to save abbrev definitions for use in a
  455. later session.
  456.  
  457.    `M-x read-abbrev-file' reads a file name using the minibuffer and
  458. reads the file, defining abbrevs according to the contents of the file. 
  459. `M-x quietly-read-abbrev-file' is the same except that it does not
  460. display a message in the echo area saying that it is doing its work; it
  461. is actually useful primarily in the `.emacs' file.  If an empty
  462. argument is given to either of these functions, the file name used is
  463. the value of the variable `abbrev-file-name', which is by default
  464. `"~/.abbrev_defs"'.
  465.  
  466.    Emacs will offer to save abbrevs automatically if you have changed
  467. any of them, whenever it offers to save all files (for `C-x s' or `C-x
  468. C-c').  This feature can be inhibited by setting the variable
  469. `save-abbrevs' to `nil'.
  470.  
  471.    The commands `M-x insert-abbrevs' and `M-x define-abbrevs' are
  472. similar to the previous commands but work on text in an Emacs buffer. 
  473. `M-x insert-abbrevs' inserts text into the current buffer before point,
  474. describing all current abbrev definitions; `M-x define-abbrevs' parses
  475. the entire current buffer and defines abbrevs accordingly.
  476.  
  477. 
  478. File: emacs,  Node: Dynamic Abbrevs,  Prev: Saving Abbrevs,  Up: Abbrevs
  479.  
  480. Dynamic Abbrev Expansion
  481. ========================
  482.  
  483.    The abbrev facility described above operates automatically as you
  484. insert text, but all abbrevs must be defined explicitly.  By contrast,
  485. "dynamic abbrevs" allow the meanings of abbrevs to be determined
  486. automatically from the contents of the buffer, but dynamic abbrev
  487. expansion happens only when you request it explicitly.
  488.  
  489. `M-/'
  490.      Expand the word in the buffer before point as a "dynamic abbrev",
  491.      by searching in the buffer for words starting with that
  492.      abbreviation (`dabbrev-expand').
  493.  
  494.    For example, if the buffer contains `does this follow ' and you type
  495. `f o M-/', the effect is to insert `follow' because that is the last
  496. word in the buffer that starts with `fo'.  A numeric argument to `M-/'
  497. says to take the second, third, etc. distinct expansion found looking
  498. backward from point.  Repeating `M-/' searches for an alternative
  499. expansion by looking farther back.  After the entire buffer before
  500. point has been considered, the buffer after point is searched.
  501.  
  502.    Dynamic abbrev expansion is completely independent of Abbrev mode;
  503. the expansion of a word with `M-/' is completely independent of
  504. whether it has a definition as an ordinary abbrev.
  505.  
  506. 
  507. File: emacs,  Node: Picture,  Next: Sending Mail,  Prev: Abbrevs,  Up: Top
  508.  
  509. Editing Pictures
  510. ****************
  511.  
  512.    If you want to create a picture made out of text characters (for
  513. example, a picture of the division of a register into fields, as a
  514. comment in a program), use the command `edit-picture' to enter Picture
  515. mode.
  516.  
  517.    In Picture mode, editing is based on the "quarter-plane" model of
  518. text, according to which the text characters lie studded on an area
  519. that stretches infinitely far to the right and downward.  The concept
  520. of the end of a line does not exist in this model; the most you can
  521. say is where the last nonblank character on the line is found.
  522.  
  523.    Of course, Emacs really always considers text as a sequence of
  524. characters, and lines really do have ends.  But in Picture mode most
  525. frequently-used keys are rebound to commands that simulate the
  526. quarter-plane model of text.  They do this by inserting spaces or by
  527. converting tabs to spaces.
  528.  
  529.    Most of the basic editing commands of Emacs are redefined by
  530. Picture mode to do essentially the same thing but in a quarter-plane
  531. way.  In addition, Picture mode defines various keys starting with the
  532. `C-c' prefix to run special picture editing commands.
  533.  
  534.    One of these keys, `C-c C-c', is pretty important.  Often a picture
  535. is part of a larger file that is usually edited in some other major
  536. mode.  `M-x edit-picture' records the name of the previous major mode,
  537. and then you can use the `C-c C-c' command (`picture-mode-exit') to
  538. restore that mode.  `C-c C-c' also deletes spaces from the ends of
  539. lines, unless given a numeric argument.
  540.  
  541.    The commands used in Picture mode all work in other modes (provided
  542. the `picture' library is loaded), but are not bound to keys except in
  543. Picture mode.  Note that the descriptions below talk of moving "one
  544. column" and so on, but all the picture mode commands handle numeric
  545. arguments as their normal equivalents do.
  546.  
  547.    Turning on Picture mode calls the value of the variable
  548. `picture-mode-hook' as a function, with no arguments, if that value
  549. exists and is non-`nil'.
  550.  
  551. * Menu:
  552.  
  553. * Basic Picture::         Basic concepts and simple commands of Picture Mode.
  554. * Insert in Picture::     Controlling direction of cursor motion
  555.                            after "self-inserting" characters.
  556. * Tabs in Picture::       Various features for tab stops and indentation.
  557. * Rectangles in Picture:: Clearing and superimposing rectangles.
  558.  
  559. 
  560. File: emacs,  Node: Basic Picture,  Next: Insert in Picture,  Prev: Picture,  Up: Picture
  561.  
  562. Basic Editing in Picture Mode
  563. =============================
  564.  
  565.    Most keys do the same thing in Picture mode that they usually do,
  566. but do it in a quarter-plane style.  For example, `C-f' is rebound to
  567. run `picture-forward-column', which is defined to move point one
  568. column to the right, by inserting a space if necessary, so that the
  569. actual end of the line makes no difference.  `C-b' is rebound to run
  570. `picture-backward-column', which always moves point left one column,
  571. converting a tab to multiple spaces if necessary.  `C-n' and `C-p' are
  572. rebound to run `picture-move-down' and `picture-move-up', which can
  573. either insert spaces or convert tabs as necessary to make sure that
  574. point stays in exactly the same column.  `C-e' runs
  575. `picture-end-of-line', which moves to after the last nonblank
  576. character on the line.  There is no need to change `C-a', as the choice
  577. of screen model does not affect beginnings of lines.
  578.  
  579.    Insertion of text is adapted to the quarter-plane screen model
  580. through the use of Overwrite mode (*note Minor Modes::.). 
  581. Self-inserting characters replace existing text, column by column,
  582. rather than pushing existing text to the right.  RET runs
  583. `picture-newline', which just moves to the beginning of the following
  584. line so that new text will replace that line.
  585.  
  586.    Deletion and killing of text are replaced with erasure.  DEL
  587. (`picture-backward-clear-column') replaces the preceding character
  588. with a space rather than removing it.  `C-d' (`picture-clear-column')
  589. does the same thing in a forward direction.  `C-k'
  590. (`picture-clear-line') really kills the contents of lines, but does
  591. not ever remove the newlines from the buffer.
  592.  
  593.    To do actual insertion, you must use special commands.  `C-o'
  594. (`picture-open-line') still creates a blank line, but does so after
  595. the current line; it never splits a line.  `C-M-o', `split-line',
  596. makes sense in Picture mode, so it is not changed.  LFD
  597. (`picture-duplicate-line') inserts below the current line another line
  598. with the same contents.
  599.  
  600.    Real deletion can be done with `C-w', or with `C-c C-d' (which is
  601. defined as `delete-char', as `C-d' is in other modes), or with one of
  602. the picture rectangle commands (*note Rectangles in Picture::.).
  603.  
  604. 
  605. File: emacs,  Node: Insert in Picture,  Next: Tabs in Picture,  Prev: Basic Picture,  Up: Picture
  606.  
  607. Controlling Motion after Insert
  608. ===============================
  609.  
  610.    Since "self-inserting" characters in Picture mode just overwrite and
  611. move point, there is no essential restriction on how point should be
  612. moved.  Normally point moves right, but you can specify any of the
  613. eight orthogonal or diagonal directions for motion after a
  614. "self-inserting" character.  This is useful for drawing lines in the
  615. buffer.
  616.  
  617. `C-c <'
  618.      Move left after insertion (`picture-movement-left').
  619.  
  620. `C-c >'
  621.      Move right after insertion (`picture-movement-right').
  622.  
  623. `C-c ^'
  624.      Move up after insertion (`picture-movement-up').
  625.  
  626. `C-c .'
  627.      Move down after insertion (`picture-movement-down').
  628.  
  629. `C-c `'
  630.      Move up and left ("northwest") after insertion 
  631.      (`picture-movement-nw').
  632.  
  633. `C-c ''
  634.      Move up and right ("northeast") after insertion 
  635.       (`picture-movement-ne').
  636.  
  637. `C-c /'
  638.      Move down and left ("southwest") after insertion 
  639.      (`picture-movement-sw').
  640.  
  641. `C-c \'
  642.      Move down and right ("southeast") after insertion 
  643.      (`picture-movement-se').
  644.  
  645.    Two motion commands move based on the current Picture insertion
  646. direction.  The command `C-c C-f' (`picture-motion') moves in the same
  647. direction as motion after "insertion" currently does, while `C-c C-b'
  648. (`picture-motion-reverse') moves in the opposite direction.
  649.  
  650. 
  651. File: emacs,  Node: Tabs in Picture,  Next: Rectangles in Picture,  Prev: Insert in Picture,  Up: Picture
  652.  
  653. Picture Mode Tabs
  654. =================
  655.  
  656.    Two kinds of tab-like action are provided in Picture mode. 
  657. Context-based tabbing is done with `M-TAB' (`picture-tab-search'). 
  658. With no argument, it moves to a point underneath the next
  659. "interesting" character that follows whitespace in the previous
  660. nonblank line.  "Next" here means "appearing at a horizontal position
  661. greater than the one point starts out at".  With an argument, as in
  662. `C-u M-TAB', this command moves to the next such interesting character
  663. in the current line.  `M-TAB' does not change the text; it only moves
  664. point.  "Interesting" characters are defined by the variable
  665. `picture-tab-chars', which contains a string whose characters are all
  666. considered interesting.  Its default value is `"!-~"'.
  667.  
  668.    TAB itself runs `picture-tab', which operates based on the current
  669. tab stop settings; it is the Picture mode equivalent of
  670. `tab-to-tab-stop'.  Normally it just moves point, but with a numeric
  671. argument it clears the text that it moves over.
  672.  
  673.    The context-based and tab-stop-based forms of tabbing are brought
  674. together by the command `C-c TAB', `picture-set-tab-stops'.  This
  675. command sets the tab stops to the positions which `M-TAB' would
  676. consider significant in the current line.  The use of this command,
  677. together with TAB, can get the effect of context-based tabbing.  But
  678. `M-TAB' is more convenient in the cases where it is sufficient.
  679.  
  680. 
  681. File: emacs,  Node: Rectangles in Picture,  Prev: Tabs in Picture,  Up: Picture
  682.  
  683. Picture Mode Rectangle Commands
  684. ===============================
  685.  
  686.    Picture mode defines commands for working on rectangular pieces of
  687. the text in ways that fit with the quarter-plane model.  The standard
  688. rectangle commands may also be useful (*note Rectangles::.).
  689.  
  690. `C-c C-k'
  691.      Clear out the region-rectangle (`picture-clear-rectangle').  With
  692.      argument, kill it.
  693.  
  694. `C-c C-w R'
  695.      Similar but save rectangle contents in register R first
  696.      (`picture-clear-rectangle-to-register').
  697.  
  698. `C-c C-y'
  699.      Copy last killed rectangle into the buffer by overwriting, with
  700.      upper left corner at point (`picture-yank-rectangle').  With
  701.      argument, insert instead.
  702.  
  703. `C-c C-x R'
  704.      Similar, but use the rectangle in register R
  705.       (`picture-yank-rectangle-from-register').
  706.  
  707.    The picture rectangle commands `C-c C-k'
  708. (`picture-clear-rectangle') and `C-c C-w'
  709. (`picture-clear-rectangle-to-register') differ from the standard
  710. rectangle commands in that they normally clear the rectangle instead of
  711. deleting it; this is analogous with the way `C-d' is changed in Picture
  712. mode.
  713.  
  714.    However, deletion of rectangles can be useful in Picture mode, so
  715. these commands delete the rectangle if given a numeric argument.
  716.  
  717.    The Picture mode commands for yanking rectangles differ from the
  718. standard ones in overwriting instead of inserting.  This is the same
  719. way that Picture mode insertion of other text is different from other
  720. modes.  `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting)
  721. the rectangle that was most recently killed, while `C-c C-x'
  722. (`picture-yank-rectangle-from-register') does likewise for the
  723. rectangle found in a specified register.
  724.  
  725. 
  726. File: emacs,  Node: Sending Mail,  Next: Rmail,  Prev: Picture,  Up: Top
  727.  
  728. Sending Mail
  729. ************
  730.  
  731.    To send a message in Emacs, you start by typing a command (`C-x m')
  732. to select and initialize the `*mail*' buffer.  Then you edit the text
  733. and headers of the message in this buffer, and type another command
  734. (`C-c C-c') to send the message.
  735.  
  736. `C-x m'
  737.      Begin composing a message to send (`mail').
  738.  
  739. `C-x 4 m'
  740.      Likewise, but display the message in another window
  741.      (`mail-other-window').
  742.  
  743. `C-c C-c'
  744.      In Mail mode, send the message and switch to another buffer
  745.      (`mail-send-and-exit').
  746.  
  747.    The command `C-x m' (`mail') selects a buffer named `*mail*' and
  748. initializes it with the skeleton of an outgoing message.  `C-x 4 m'
  749. (`mail-other-window') selects the `*mail*' buffer in a different
  750. window, leaving the previous current buffer visible.
  751.  
  752.    Because the mail composition buffer is an ordinary Emacs buffer,
  753. you can switch to other buffers while in the middle of composing mail,
  754. and switch back later (or never).  If you use the `C-x m' command
  755. again when you have been composing another message but have not sent
  756. it, you are asked to confirm before the old message is erased.  If you
  757. answer `n', the `*mail*' buffer is left selected with its old
  758. contents, so you can finish the old message and send it.  `C-u C-x m'
  759. is another way to do this.  Sending the message marks the `*mail*'
  760. buffer "unmodified", which avoids the need for confirmation when `C-x
  761. m' is next used.
  762.  
  763.    If you are composing a message in the `*mail*' buffer and want to
  764. send another message before finishing the first, rename the `*mail*'
  765. buffer using `M-x rename-buffer' (*note Misc Buffer::.).
  766.  
  767. * Menu:
  768.  
  769. * Format: Mail Format.    Format of the mail being composed.
  770. * Headers: Mail Headers.  Details of allowed mail header fields.
  771. * Mode: Mail Mode.        Special commands for editing mail being composed.
  772.  
  773. 
  774. File: emacs,  Node: Mail Format,  Next: Mail Headers,  Prev: Sending Mail,  Up: Sending Mail
  775.  
  776. The Format of the Mail Buffer
  777. =============================
  778.  
  779.    In addition to the "text" or contents, a message has "header
  780. fields" which say who sent it, when, to whom, why, and so on.  Some
  781. header fields such as the date and sender are created automatically
  782. after the message is sent.  Others, such as the recipient names, must
  783. be specified by you in order to send the message properly.
  784.  
  785.    Mail mode provides a few commands to help you edit some header
  786. fields, and some are preinitialized in the buffer automatically at
  787. times.  You can insert or edit any header fields using ordinary
  788. editing commands.
  789.  
  790.    The line in the buffer that says
  791.  
  792.      --text follows this line--
  793.  
  794. is a special delimiter that separates the headers you have specified
  795. from the text.  Whatever follows this line is the text of the message;
  796. the headers precede it.  The delimiter line itself does not appear in
  797. the message actually sent.  The text used for the delimiter line is
  798. controlled by the variable `mail-header-separator'.
  799.  
  800.    Here is an example of what the headers and text in the `*mail*'
  801. buffer might look like.
  802.  
  803.      To: rms@mc
  804.      CC: mly@mc, rg@oz
  805.      Subject: The Emacs Manual
  806.      --Text follows this line--
  807.      Please ignore this message.
  808.  
  809. 
  810. File: emacs,  Node: Mail Headers,  Next: Mail Mode,  Prev: Mail Format,  Up: Sending Mail
  811.  
  812. Mail Header Fields
  813. ==================
  814.  
  815.    There are several header fields you can use in the `*mail*' buffer. 
  816. Each header field starts with a field name at the beginning of a line,
  817. terminated by a colon.  It does not matter whether you use upper or
  818. lower case in the field name.  After the colon and optional whitespace
  819. comes the contents of the field.
  820.  
  821. `To'
  822.      This field contains the mailing addresses to which the message is
  823.      addressed.
  824.  
  825. `Subject'
  826.      The contents of the `Subject' field should be a piece of text
  827.      that says what the message is about.  The reason `Subject' fields
  828.      are useful is that most mail-reading programs can provide a
  829.      summary of messages, listing the subject of each message but not
  830.      its text.
  831.  
  832. `CC'
  833.      This field contains additional mailing addresses to send the
  834.      message to, but whose readers should not regard the message as
  835.      addressed to them.
  836.  
  837. `BCC'
  838.      This field contains additional mailing addresses to send the
  839.      message to, but which should not appear in the header of the
  840.      message actually sent.
  841.  
  842. `FCC'
  843.      This field contains the name of one file (in Unix mail file
  844.      format) to which a copy of the message should be appended when
  845.      the message is sent.
  846.  
  847. `From'
  848.      Use the `From' field to say who you are, when the account you are
  849.      using to send the mail is not your own.  The contents of the
  850.      `From' field should be a valid mailing address, since replies
  851.      will normally go there.
  852.  
  853. `Reply-To'
  854.      Use the `Reply-to' field to direct replies to a different
  855.      address, not your own.  There is no difference between `From' and
  856.      `Reply-to' in their effect on where replies go, but they convey a
  857.      different meaning to the human who reads the message.
  858.  
  859. `In-Reply-To'
  860.      This field contains a piece of text describing a message you are
  861.      replying to.  Some mail systems can use this information to
  862.      correlate related pieces of mail.  Normally this field is filled
  863.      in by Rmail when you are replying to a message in Rmail, and you
  864.      never need to think about it (*note Rmail::.).
  865.  
  866. The `To', `CC', `BCC' and `FCC' fields can appear any number of times,
  867. to specify many places to send the message.
  868.  
  869. The `To', `CC', and `BCC' fields can have continuation lines.  All the
  870. lines starting with whitespace, following the line on which the field
  871. starts, are considered part of the field.  For example,
  872.  
  873.      To: foo@here, this@there,
  874.        me@gnu.cambridge.mass.usa.earth.spiral3281
  875.  
  876. If you have a `~/.mailrc' file, Emacs will scan it for mail aliases
  877. the first time you try to send mail in an Emacs session.  Aliases found
  878. in the `To', `CC', and `BCC' fields will be expanded where appropriate.
  879.  
  880.    If the variable `mail-archive-file-name' is non-`nil', it should be
  881. a string naming a file; every time you start to edit a message to send,
  882. an `FCC' field will be put in for that file.  Unless you remove the
  883. `FCC' field, every message will be written into that file when it is
  884. sent.
  885.  
  886. 
  887. File: emacs,  Node: Mail Mode,  Prev: Mail Headers,  Up: Sending Mail
  888.  
  889. Mail Mode
  890. =========
  891.  
  892.    The major mode used in the `*mail*' buffer is Mail mode, which is
  893. much like Text mode except that various special commands are provided
  894. on the `C-c' prefix.  These commands all have to do specifically with
  895. editing or sending the message.
  896.  
  897. `C-c C-s'
  898.      Send the message, and leave the `*mail*' buffer selected
  899.      (`mail-send').
  900.  
  901. `C-c C-c'
  902.      Send the message, and select some other buffer
  903.      (`mail-send-and-exit').
  904.  
  905. `C-c C-f C-t'
  906.      Move to the `To' header field, creating one if there is none
  907.      (`mail-to').
  908.  
  909. `C-c C-f C-s'
  910.      Move to the `Subject' header field, creating one if there is none
  911.      (`mail-subject').
  912.  
  913. `C-c C-f C-c'
  914.      Move to the `CC' header field, creating one if there is none
  915.      (`mail-cc').
  916.  
  917. `C-c C-w'
  918.      Insert the file `~/.signature' at the end of the message text
  919.      (`mail-signature').
  920.  
  921. `C-c C-y'
  922.      Yank the selected message from Rmail (`mail-yank-original'). 
  923.      This command does nothing unless your command to start sending a
  924.      message was issued with Rmail.
  925.  
  926. `C-c C-q'
  927.      Fill all paragraphs of yanked old messages, each individually
  928.      (`mail-fill-yanked-message').
  929.  
  930.    There are two ways to send the message.  `C-c C-s' (`mail-send')
  931. sends the message and marks the `*mail*' buffer unmodified, but leaves
  932. that buffer selected so that you can modify the message (perhaps with
  933. new recipients) and send it again.  `C-c C-c' (`mail-send-and-exit')
  934. sends and then deletes the window (if there is another window) or
  935. switches to another buffer.  It puts the `*mail*' buffer at the lowest
  936. priority for automatic reselection, since you are finished with using
  937. it.  This is the usual way to send the message.
  938.  
  939.    Mail mode provides some other special commands that are useful for
  940. editing the headers and text of the message before you send it.  There
  941. are three commands defined to move point to particular header fields,
  942. all based on the prefix `C-c C-f' (`C-f' is for "field").  They are
  943. `C-c C-f C-t' (`mail-to') to move to the `To' field, `C-c C-f C-s'
  944. (`mail-subject') for the `Subject' field, and `C-c C-f C-c'
  945. (`mail-cc') for the `CC' field.  These fields have special motion
  946. commands because they are the most common fields for the user to want
  947. to edit.
  948.  
  949.    `C-c C-w' (`mail-signature') adds a standard piece text at the end
  950. of the message to say more about who you are.  The text comes from the
  951. file `.signature' in your home directory.
  952.  
  953.    When mail sending is invoked from the Rmail mail reader using an
  954. Rmail command, `C-c C-y' can be used inside the `*mail*' buffer to
  955. insert the text of the message you are replying to.  Normally it
  956. indents each line of that message four spaces and eliminates most
  957. header fields.  A numeric argument specifies the number of spaces to
  958. indent.  An argument of just `C-u' says not to indent at all and not
  959. to eliminate anything.  `C-c C-y' always uses the current message from
  960. the `RMAIL' buffer, so you can insert several old messages by
  961. selecting one in `RMAIL', switching to `*mail*' and yanking it, then
  962. switching back to `RMAIL' to select another.
  963.  
  964.    After using `C-c C-y', the command `C-c C-q'
  965. (`mail-fill-yanked-message') can be used to fill the paragraphs of the
  966. yanked old message or messages.  One use of `C-c C-q' fills all such
  967. paragraphs, each one separately.
  968.  
  969.    Turning on Mail mode (which `C-x m' does automatically) calls the
  970. value of `text-mode-hook', if it is not void or `nil', and then calls
  971. the value of `mail-mode-hook' if that is not void or `nil'.
  972.  
  973. 
  974. File: emacs,  Node: Rmail,  Next: Recursive Edit,  Prev: Sending Mail,  Up: Top
  975.  
  976. Reading Mail with Rmail
  977. ***********************
  978.  
  979.    Rmail is an Emacs subsystem for reading and disposing of mail that
  980. you receive.  Rmail stores mail messages in files called Rmail files. 
  981. Reading the message in an Rmail file is done in a special major mode,
  982. Rmail mode, which redefines most letters to run commands for managing
  983. mail.  To enter Rmail, type `M-x rmail'.  This reads your primary mail
  984. file, merges new mail in from your inboxes, displays the first new
  985. message, and lets you begin reading.
  986.  
  987.    Using Rmail in the simplest fashion, you have one Rmail file
  988. `~/RMAIL' in which all of your mail is saved.  It is called your
  989. "primary mail file".  In more sophisticated usage, you can copy
  990. messages into other Rmail files and then edit those files with Rmail.
  991.  
  992.    Rmail displays only one message at a time.  It is called the
  993. "current message".  Rmail mode's special commands can do such things
  994. as move to another message, delete the message, copy the message into
  995. another file, or send a reply.
  996.  
  997.    Within the Rmail file, messages are arranged sequentially in order
  998. of receipt.  They are also assigned consecutive integers as their
  999. "message numbers".  The number of the current message is displayed in
  1000. Rmail's mode line, followed by the total number of messages in the
  1001. file.  You can move to a message by specifying its message number
  1002. using the `j' key (*note Rmail Motion::.).
  1003.  
  1004.    Following the usual conventions of Emacs, changes in an Rmail file
  1005. become permanent only when the file is saved.  You can do this with `s'
  1006. (`rmail-save'), which also expunges deleted messages from the file
  1007. first (*note Rmail Deletion::.).  To save the file without expunging,
  1008. use `C-x C-s'.  Rmail saves the Rmail file spontaneously when moving
  1009. new mail from an inbox file (*note Rmail Inbox::.).
  1010.  
  1011.    You can exit Rmail with `q' (`rmail-quit'); this expunges and saves
  1012. the Rmail file and then switches to another buffer.  But there is no
  1013. need to `exit' formally.  If you switch from Rmail to editing in other
  1014. buffers, and never happen to switch back, you have exited.  Just make
  1015. sure to save the Rmail file eventually (like any other file you have
  1016. changed).  `C-x s' is a good enough way to do this (*note Saving::.).
  1017.  
  1018. * Menu:
  1019.  
  1020. * Scroll: Rmail Scrolling.   Scrolling through a message.
  1021. * Motion: Rmail Motion.      Moving to another message.
  1022. * Deletion: Rmail Deletion.  Deleting and expunging messages.
  1023. * Inbox: Rmail Inbox.        How mail gets into the Rmail file.
  1024. * Files: Rmail Files.        Using multiple Rmail files.
  1025. * Output: Rmail Output.         Copying message out to files.
  1026. * Labels: Rmail Labels.      Classifying messages by labeling them.
  1027. * Summary: Rmail Summary.    Summaries show brief info on many messages.
  1028. * Reply: Rmail Reply.        Sending replies to messages you are viewing.
  1029. * Editing: Rmail Editing.    Editing message text and headers in Rmail.
  1030. * Digest: Rmail Digest.      Extracting the messages from a digest message.
  1031.  
  1032. 
  1033. File: emacs,  Node: Rmail Scrolling,  Next: Rmail Motion,  Prev: Rmail,  Up: Rmail
  1034.  
  1035. Scrolling Within a Message
  1036. ==========================
  1037.  
  1038.    When Rmail displays a message that does not fit on the screen, it is
  1039. necessary to scroll through it.  This could be done with `C-v', `M-v'
  1040. and `M-<', but in Rmail scrolling is so frequent that it deserves to be
  1041. easier to type.
  1042.  
  1043. `SPC'
  1044.      Scroll forward (`scroll-up').
  1045.  
  1046. `DEL'
  1047.      Scroll backward (`scroll-down').
  1048.  
  1049. `.'
  1050.      Scroll to start of message (`rmail-beginning-of-message').
  1051.  
  1052.    Since the most common thing to do while reading a message is to
  1053. scroll through it by screenfuls, Rmail makes SPC and DEL synonyms of
  1054. `C-v' (`scroll-up') and `M-v' (`scroll-down')
  1055.  
  1056.    The command `.' (`rmail-beginning-of-message') scrolls back to the
  1057. beginning of the selected message.  This is not quite the same as
  1058. `M-<': for one thing, it does not set the mark; for another, it resets
  1059. the buffer boundaries to the current message if you have changed them.
  1060.  
  1061. 
  1062. File: emacs,  Node: Rmail Motion,  Next: Rmail Deletion,  Prev: Rmail Scrolling,  Up: Rmail
  1063.  
  1064. Moving Among Messages
  1065. =====================
  1066.  
  1067.    The most basic thing to do with a message is to read it.  The way
  1068. to do this in Rmail is to make the message current.  You can make any
  1069. message current given its message number using the `j' command, but
  1070. the usual thing to do is to move sequentially through the file, since
  1071. this is the order of receipt of messages.  When you enter Rmail, you
  1072. are positioned at the first new message (new messages are those
  1073. received since the previous use of Rmail), or at the last message if
  1074. there are no new messages this time.  Move forward to see the other
  1075. new messages; move backward to reexamine old messages.
  1076.  
  1077. `n'
  1078.      Move to the next nondeleted message, skipping any intervening
  1079.      deleted 
  1080.       messages (`rmail-next-undeleted-message').
  1081.  
  1082. `p'
  1083.      Move to the previous nondeleted message 
  1084.       (`rmail-previous-undeleted-message').
  1085.  
  1086. `M-n'
  1087.      Move to the next message, including deleted messages
  1088.      (`rmail-next-message').
  1089.  
  1090. `M-p'
  1091.      Move to the previous message, including deleted messages
  1092.      (`rmail-previous-message').
  1093.  
  1094. `j'
  1095.      Move to the first message.  With argument N, move to message
  1096.      number N (`rmail-show-message').
  1097.  
  1098. `>'
  1099.      Move to the last message (`rmail-last-message').
  1100.  
  1101. `M-s REGEXP RET'
  1102.      Move to the next message containing a match for REGEXP
  1103.      (`rmail-search').  If REGEXP is empty, the last regexp used is
  1104.      used again.
  1105.  
  1106. `- M-s REGEXP RET'
  1107.      Move to the previous message containing a match for REGEXP.  If
  1108.      REGEXP is empty, the last regexp used is used again.
  1109.  
  1110.    `n' and `p' are the usual way of moving among messages in Rmail. 
  1111. They move through the messages sequentially, but skip over deleted
  1112. messages, which is usually what you want to do.  Their command
  1113. definitions are named `rmail-next-undeleted-message' and
  1114. `rmail-previous-undeleted-message'.  If you do not want to skip
  1115. deleted messages--for example, if you want to move to a message to
  1116. undelete it--use the variants `M-n' and `M-p' (`rmail-next-message'
  1117. and `rmail-previous-message').  A numeric argument to any of these
  1118. commands serves as a repeat count.
  1119.  
  1120.    In Rmail, you can specify a numeric argument by typing the digits. 
  1121. It is not necessary to type `C-u' first.
  1122.  
  1123.    The `M-s' (`rmail-search') command is Rmail's version of search. 
  1124. The usual incremental search command `C-s' works in Rmail, but it
  1125. searches only within the current message.  The purpose of `M-s' is to
  1126. search for another message.  It reads a regular expression (*note
  1127. Regexps::.) nonincrementally, then searches starting at the beginning
  1128. of the following message for a match.  The message containing the
  1129. match is selected.
  1130.  
  1131.    To search backward in the file for another message, give `M-s' a
  1132. negative argument.  In Rmail this can be done with `- M-s'.
  1133.  
  1134.    It is also possible to search for a message based on labels.  *Note
  1135. Rmail Labels::.
  1136.  
  1137.    To move to a message specified by absolute message number, use `j'
  1138. (`rmail-show-message') with the message number as argument.  With no
  1139. argument, `j' selects the first message.  `>' (`rmail-last-message')
  1140. selects the last message.
  1141.  
  1142.