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