home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-User.iso / usr / lib / emacs / info / emacs-10 (.txt) < prev    next >
GNU Info File  |  1992-10-30  |  49KB  |  846 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.49 from the
  2. input file emacs.texi.
  3.    This file documents the GNU Emacs editor.
  4.    Copyright (C) 1985, 1986, 1988, 1992 Richard M. Stallman.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  11. General Public License" are included exactly as in the original, and
  12. provided that the entire resulting derived work is distributed under the
  13. terms of a permission notice identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "The GNU Manifesto",
  17. "Distribution" and "GNU General Public License" may be included in a
  18. translation approved by the author instead of in the original English.
  19. File: emacs,  Node: Rmail Motion,  Next: Rmail Deletion,  Prev: Rmail Scrolling,  Up: Rmail
  20. Moving Among Messages
  21. =====================
  22.    The most basic thing to do with a message is to read it.  The way to
  23. do this in Rmail is to make the message current.  You can make any
  24. message current given its message number using the `j' command, but the
  25. usual thing to do is to move sequentially through the file, since this
  26. is the order of receipt of messages.  When you enter Rmail, you are
  27. positioned at the first new message (new messages are those received
  28. since the previous use of Rmail), or at the last message if there are
  29. no new messages this time.  Move forward to see the other new messages;
  30. move backward to reexamine old messages.
  31.      Move to the next nondeleted message, skipping any intervening
  32.      deleted messages (`rmail-next-undeleted-message').
  33.      Move to the previous nondeleted message
  34.      (`rmail-previous-undeleted-message').
  35. `M-n'
  36.      Move to the next message, including deleted messages
  37.      (`rmail-next-message').
  38. `M-p'
  39.      Move to the previous message, including deleted messages
  40.      (`rmail-previous-message').
  41.      Move to the first message.  With argument N, move to message
  42.      number N (`rmail-show-message').
  43.      Move to the last message (`rmail-last-message').
  44. `M-s REGEXP RET'
  45.      Move to the next message containing a match for REGEXP
  46.      (`rmail-search').  If REGEXP is empty, the last regexp used is
  47.      used again.
  48. `- M-s REGEXP RET'
  49.      Move to the previous message containing a match for REGEXP. If
  50.      REGEXP is empty, the last regexp used is used again.
  51.    `n' and `p' are the usual way of moving among messages in Rmail. 
  52. They move through the messages sequentially, but skip over deleted
  53. messages, which is usually what you want to do.  Their command
  54. definitions are named `rmail-next-undeleted-message' and
  55. `rmail-previous-undeleted-message'.  If you do not want to skip deleted
  56. messages--for example, if you want to move to a message to undelete
  57. it--use the variants `M-n' and `M-p' (`rmail-next-message' and
  58. `rmail-previous-message').  A numeric argument to any of these commands
  59. serves as a repeat count.
  60.    In Rmail, you can specify a numeric argument by typing the digits.
  61. It is not necessary to type `C-u' first.
  62.    The `M-s' (`rmail-search') command is Rmail's version of search.  The
  63. usual incremental search command `C-s' works in Rmail, but it searches
  64. only within the current message.  The purpose of `M-s' is to search for
  65. another message.  It reads a regular expression (*note Regexps::.)
  66. nonincrementally, then searches starting at the beginning of the
  67. following message for a match.  The message containing the match is
  68. selected.
  69.    To search backward in the file for another message, give `M-s' a
  70. negative argument.  In Rmail this can be done with `- M-s'.
  71.    It is also possible to search for a message based on labels. *Note
  72. Rmail Labels::.
  73.    To move to a message specified by absolute message number, use `j'
  74. (`rmail-show-message') with the message number as argument.  With no
  75. argument, `j' selects the first message.  `>' (`rmail-last-message')
  76. selects the last message.
  77.    Each time Rmail selects a message, it calls (with no arguments) the
  78. value of the variable `rmail-show-message-hook', if that is non-`nil'.
  79. File: emacs,  Node: Rmail Deletion,  Next: Rmail Inbox,  Prev: Rmail Motion,  Up: Rmail
  80. Deleting Messages
  81. =================
  82.    When you no longer need to keep a message, you can "delete" it.  This
  83. flags it as ignorable, and some Rmail commands will pretend it is no
  84. longer present; but it still has its place in the Rmail file, and still
  85. has its message number.
  86.    "Expunging" the Rmail file actually removes the deleted messages.
  87. The remaining messages are renumbered consecutively.  Expunging is the
  88. only action that changes the message number of any message, except for
  89. undigestifying (*note Rmail Digest::.).
  90.      Delete the current message, and move to the next nondeleted message
  91.      (`rmail-delete-forward').
  92. `C-d'
  93.      Delete the current message, and move to the previous nondeleted
  94.      message (`rmail-delete-backward').
  95.      Undelete the current message, or move back to a deleted message and
  96.      undelete it (`rmail-undelete-previous-message').
  97.      Expunge the Rmail file (`rmail-expunge').  These two commands are
  98.      synonyms.
  99.    There are two Rmail commands for deleting messages.  Both delete the
  100. current message and select another message.  `d'
  101. (`rmail-delete-forward') moves to the following message, skipping
  102. messages already deleted, while `C-d' (`rmail-delete-backward') moves
  103. to the previous nondeleted message. If there is no nondeleted message
  104. to move to in the specified direction, the message that was just
  105. deleted remains current.
  106.    To make all the deleted messages finally vanish from the Rmail file,
  107. type `e' (`rmail-expunge').  Until you do this, you can still "undelete"
  108. the deleted messages.
  109.    To undelete, type `u' (`rmail-undelete-previous-message'), which is
  110. designed to cancel the effect of a `d' command (usually).  It undeletes
  111. the current message if the current message is deleted.  Otherwise it
  112. moves backward to previous messages until a deleted message is found,
  113. and undeletes that message.
  114.    You can usually undo a `d' with a `u' because the `u' moves back to
  115. and undeletes the message that the `d' deleted.  But this does not work
  116. when the `d' skips a few already-deleted messages that follow the
  117. message being deleted; then the `u' command will undelete the last of
  118. the messages that were skipped.  There is no clean way to avoid this
  119. problem.  However, by repeating the `u' command, you can eventually get
  120. back to the message that you intended to undelete.  You can also reach
  121. that message with `M-p' commands and then type `u'.
  122.    A deleted message has the `deleted' attribute, and as a result
  123. `deleted' appears in the mode line when the current message is deleted.
  124.  In fact, deleting or undeleting a message is nothing more than adding
  125. or removing this attribute.  *Note Rmail Labels::.
  126. File: emacs,  Node: Rmail Inbox,  Next: Rmail Files,  Prev: Rmail Deletion,  Up: Rmail
  127. Rmail Files and Inboxes
  128. =======================
  129.    Unix places incoming mail for you in a file that we call your
  130. "inbox". When you start up Rmail, it copies the new messages from your
  131. inbox into your primary mail file, an Rmail file, which also contains
  132. other messages saved from previous Rmail sessions.  It is in this file
  133. that you actually read the mail with Rmail.  This operation is called
  134. "getting new mail". It can be repeated at any time using the `g' key in
  135. Rmail.  The inbox file name is `/usr/spool/mail/USERNAME' in Berkeley
  136. Unix, `/usr/mail/USERNAME' in System V.
  137.    There are two reasons for having separate Rmail files and inboxes.
  138.   1. The format in which Unix delivers the mail in the inbox is not
  139.      adequate for Rmail mail storage.  It has no way to record
  140.      attributes (such as `deleted') or user-specified labels; it has no
  141.      way to record old headers and reformatted headers; it has no way
  142.      to record cached summary line information.
  143.   2. It is very cumbersome to access an inbox file without danger of
  144.      losing mail, because it is necessary to interlock with mail
  145.      delivery. Moreover, different Unix systems use different
  146.      interlocking techniques.  The strategy of moving mail out of the
  147.      inbox once and for all into a separate Rmail file avoids the need
  148.      for interlocking in all the rest of Rmail, since only Rmail
  149.      operates on the Rmail file.
  150.    When getting new mail, Rmail first copies the new mail from the inbox
  151. file to the Rmail file; then it saves the Rmail file; then it deletes
  152. the inbox file.  This way, a system crash may cause duplication of mail
  153. between the inbox and the Rmail file, but cannot lose mail.
  154.    Copying mail from an inbox in the system's mailer directory actually
  155. puts it in an intermediate file `~/.newmail'.  This is because the
  156. interlocking is done by a C program that copies to another file.
  157. `~/.newmail' is deleted after mail merging is successful.  If there is
  158. a crash at the wrong time, this file will continue to exist and will be
  159. used as an inbox the next time you get new mail.
  160. File: emacs,  Node: Rmail Files,  Next: Rmail Output,  Prev: Rmail Inbox,  Up: Rmail
  161. Multiple Mail Files
  162. ===================
  163.    Rmail operates by default on your "primary mail file", which is named
  164. `~/RMAIL' and receives your incoming mail from your system inbox file.
  165. But you can also have other mail files and edit them with Rmail.  These
  166. files can receive mail through their own inboxes, or you can move
  167. messages into them by explicit command in Rmail (*note Rmail Output::.).
  168. `i FILE RET'
  169.      Read FILE into Emacs and run Rmail on it (`rmail-input').
  170. `M-x set-rmail-inbox-list RET FILES RET'
  171.      Specify inbox file names for current Rmail file to get mail from.
  172.      Merge new mail from current Rmail file's inboxes
  173.      (`rmail-get-new-mail').
  174. `C-u g FILE'
  175.      Merge new mail from inbox file FILE.
  176.    To run Rmail on a file other than your primary mail file, you may
  177. use the `i' (`rmail-input') command in Rmail.  This visits the file,
  178. puts it in Rmail mode, and then gets new mail from the file's inboxes
  179. if any. You can also use `M-x rmail-input' even when not in Rmail.
  180.    The file you read with `i' does not have to be in Rmail file format.
  181. It could also be Unix mail format, or `mmdf' format; or it could be a
  182. mixture of all three, as long as each message belongs to one of the
  183. three formats.  Rmail recognizes all three and converts all the
  184. messages to proper Rmail format before showing you the file.
  185.    Each Rmail file can contain a list of inbox file names; you can
  186. specify this list with `M-x set-rmail-inbox-list RET FILES RET'.  The
  187. argument can contain any number of file names, separated by commas.  It
  188. can also be empty, which specifies that this file should have no
  189. inboxes.  Once a list of inboxes is specified, the Rmail file remembers
  190. it permanently until it is explicitly changed.
  191.    If an Rmail file has inboxes, new mail is merged in from the inboxes
  192. when the Rmail file is brought into Rmail, and when the `g'
  193. (`rmail-get-new-mail') command is used.  If the Rmail file specifies no
  194. inboxes, then no new mail is merged in at these times.  A special
  195. exception is made for your primary mail file in using the standard
  196. system inbox for it if it does not specify any.
  197.    To merge mail from a file that is not the usual inbox, give the `g'
  198. key a numeric argument, as in `C-u g'.  Then it reads a file name and
  199. merges mail from that file.  The inbox file is not deleted or changed in
  200. any way when `g' with an argument is used.  This is, therefore, a
  201. general way of merging one file of messages into another.
  202. File: emacs,  Node: Rmail Output,  Next: Rmail Labels,  Prev: Rmail Files,  Up: Rmail
  203. Copying Messages Out to Files
  204. =============================
  205. `o FILE RET'
  206.      Append a copy of the current message to the file FILE, writing it
  207.      in Rmail file format (`rmail-output-to-rmail-file').
  208. `C-o FILE RET'
  209.      Append a copy of the current message to the file FILE, writing it
  210.      in Unix mail file format (`rmail-output').
  211.    If an Rmail file has no inboxes, how does it get anything in it?  By
  212. explicit `o' commands.
  213.    `o' (`rmail-output-to-rmail-file') appends the current message in
  214. Rmail format to the end of the specified file.  This is the best command
  215. to use to move messages between Rmail files.  If the other Rmail file is
  216. currently visited, the copying is done into the other file's Emacs
  217. buffer instead.  You should eventually save it on disk.
  218.    The `C-o' (`rmail-output') command in Rmail appends a copy of the
  219. current message to a specified file, in Unix mail file format.  This is
  220. useful for moving messages into files to be read by other mail
  221. processors that do not understand Rmail format.
  222.    Copying a message with `o' or `C-o' gives the original copy of the
  223. message the `filed' attribute, so that `filed' appears in the mode line
  224. when such a message is current.
  225.    Normally you should use only `o' to output messages to other Rmail
  226. files, never `C-o'.  But it is also safe if you always use `C-o', never
  227. `o'.  When a file is visited in Rmail, the last message is checked, and
  228. if it is in Unix format, the entire file is scanned and all Unix-format
  229. messages are converted to Rmail format.  (The reason for checking the
  230. last message is that scanning the file is slow and most Rmail files
  231. have only Rmail format messages.)  If you use `C-o' consistently, the
  232. last message is sure to be in Unix format, so Rmail will convert all
  233. messages properly.
  234.    The case where you might want to use `C-o' always, instead of `o'
  235. always, is when you or other users want to append mail to the same file
  236. from other mail processors.  Other mail processors probably do not know
  237. Rmail format but do know Unix format.
  238.    In any case, always use `o' to add to an Rmail file that is being
  239. visited in Rmail.  Adding messages with `C-o' to the actual disk file
  240. will trigger a "simultaneous editing" warning when you ask to save the
  241. Emacs buffer, and will be lost if you do save.
  242. File: emacs,  Node: Rmail Labels,  Next: Rmail Summary,  Prev: Rmail Output,  Up: Rmail
  243. Labels
  244. ======
  245.    Each message can have various "labels" assigned to it as a means of
  246. classification.  A label has a name; different names mean different
  247. labels. Any given label is either present or absent on a particular
  248. message.  A few label names have standard meanings and are given to
  249. messages automatically by Rmail when appropriate; these special labels
  250. are called "attributes". All other labels are assigned by the user.
  251. `a LABEL RET'
  252.      Assign the label LABEL to the current message (`rmail-add-label').
  253. `k LABEL RET'
  254.      Remove the label LABEL from the current message
  255.      (`rmail-kill-label').
  256. `C-M-n LABELS RET'
  257.      Move to the next message that has one of the labels LABELS
  258.      (`rmail-next-labeled-message').
  259. `C-M-p LABELS RET'
  260.      Move to the previous message that has one of the labels LABELS
  261.      (`rmail-previous-labeled-message').
  262. `C-M-l LABELS RET'
  263.      Make a summary of all messages containing any of the labels LABELS
  264.      (`rmail-summary-by-labels').
  265. Specifying an empty string for one these commands means to use the last
  266. label specified for any of these commands.
  267.    The `a' (`rmail-add-label') and `k' (`rmail-kill-label') commands
  268. allow you to assign or remove any label on the current message.  If the
  269. LABEL argument is empty, it means to assign or remove the same label
  270. most recently assigned or removed.
  271.    Once you have given messages labels to classify them as you wish,
  272. there are two ways to use the labels: in moving and in summaries.
  273.    The command `C-M-n LABELS RET' (`rmail-next-labeled-message') moves
  274. to the next message that has one of the labels LABELS.  LABELS is one
  275. or more label names, separated by commas.  `C-M-p'
  276. (`rmail-previous-labeled-message') is similar, but moves backwards to
  277. previous messages.  A preceding numeric argument to either one serves
  278. as a repeat count.
  279.    The command `C-M-l LABELS RET' (`rmail-summary-by-labels') displays
  280. a summary containing only the messages that have at least one of a
  281. specified set of messages.  The argument LABELS is one or more label
  282. names, separated by commas. *Note Rmail Summary::, for information on
  283. summaries.
  284.    If the LABELS argument to `C-M-n', `C-M-p' or `C-M-l' is empty, it
  285. means to use the last set of labels specified for any of these commands.
  286.    Some labels such as `deleted' and `filed' have built-in meanings and
  287. are assigned to or removed from messages automatically at appropriate
  288. times; these labels are called "attributes".  Here is a list of Rmail
  289. attributes:
  290. `unseen'
  291.      Means the message has never been current.  Assigned to messages
  292.      when they come from an inbox file, and removed when a message is
  293.      made current.
  294. `deleted'
  295.      Means the message is deleted.  Assigned by deletion commands and
  296.      removed by undeletion commands (*note Rmail Deletion::.).
  297. `filed'
  298.      Means the message has been copied to some other file.  Assigned by
  299.      the file output commands (*note Rmail Files::.).
  300. `answered'
  301.      Means you have mailed an answer to the message.  Assigned by the
  302.      `r' command (`rmail-reply').  *Note Rmail Reply::.
  303. `forwarded'
  304.      Means you have forwarded the message to other users.  Assigned by
  305.      the `f' command (`rmail-forward').  *Note Rmail Reply::.
  306. `edited'
  307.      Means you have edited the text of the message within Rmail. *Note
  308.      Rmail Editing::.
  309.    All other labels are assigned or removed only by the user, and it is
  310. up to the user to decide what they mean.
  311. File: emacs,  Node: Rmail Summary,  Next: Rmail Reply,  Prev: Rmail Labels,  Up: Rmail
  312. Summaries
  313. =========
  314.    A "summary" is a buffer containing one line per message that Rmail
  315. can make and display to give you an overview of the mail in an Rmail
  316. file. Each line shows the message number, the sender, the labels, and
  317. the subject.  When the summary buffer is selected, various commands can
  318. be used to select messages by moving in the summary buffer, or delete
  319. or undelete messages.
  320.    A summary buffer applies to a single Rmail file only; if you are
  321. editing multiple Rmail files, they have separate summary buffers.  The
  322. summary buffer name is made by appending `-summary' to the Rmail
  323. buffer's name.  Only one summary buffer will be displayed at a time
  324. unless you make several windows and select the summary buffers by hand.
  325. * Menu:
  326. * Rmail Make Summary::  Making various sorts of summaries.
  327. * Rmail Summary Edit::  Manipulating messages from the summary.
  328. File: emacs,  Node: Rmail Make Summary,  Next: Rmail Summary Edit,  Prev: Rmail Summary,  Up: Rmail Summary
  329. Making Summaries
  330. ----------------
  331.    Here are the commands to create a summary for the current Rmail file.
  332. Summaries do not update automatically; to make an updated summary, you
  333. must use one of these commands again.
  334. `C-M-h'
  335.      Summarize all messages (`rmail-summary').
  336. `l LABELS RET'
  337. `C-M-l LABELS RET'
  338.      Summarize message that have one or more of the specified labels
  339.      (`rmail-summary-by-labels').
  340. `C-M-r RCPTS RET'
  341.      Summarize messages that have one or more of the specified
  342.      recipients (`rmail-summary-by-recipients').
  343.    The `h' or `C-M-h' (`rmail-summary') command fills the summary buffer
  344. for the current Rmail file with a summary of all the messages in the
  345. file. It then displays and selects the summary buffer in another window.
  346.    `C-M-l LABELS RET' (`rmail-summary-by-labels') makes a partial
  347. summary mentioning only the messages that have one or more of the
  348. labels LABELS.  LABELS should contain label names separated by commas.
  349.    `C-M-r RCPTS RET' (`rmail-summary-by-recipients') makes a partial
  350. summary mentioning only the messages that have one or more of the
  351. recipients RCPTS.  RCPTS should contain mailing addresses separated by
  352. commas.
  353.    Note that there is only one summary buffer for any Rmail file;
  354. making one kind of summary discards any previously made summary.
  355. File: emacs,  Node: Rmail Summary Edit,  Prev: Rmail Make Summary,  Up: Rmail Summary
  356. Editing in Summaries
  357. --------------------
  358.    Summary buffers are given the major mode Rmail Summary mode, which
  359. provides the following special commands:
  360.      Select the message described by the line that point is on
  361.      (`rmail-summary-goto-msg').
  362. `C-n'
  363.      Move to next line and select its message in Rmail
  364.      (`rmail-summary-next-all').
  365. `C-p'
  366.      Move to previous line and select its message
  367.      (`rmail-summary-previous-all').
  368.      Move to next line, skipping lines saying `deleted', and select its
  369.      message (`rmail-summary-next-msg').
  370.      Move to previous line, skipping lines saying `deleted', and select
  371.      its message (`rmail-summary-previous-msg').
  372.      Delete the current line's message, then do like `n'
  373.      (`rmail-summary-delete-forward').
  374.      Undelete and select this message or the previous deleted message in
  375.      the summary (`rmail-summary-undelete').
  376. `SPC'
  377.      Scroll the other window (presumably Rmail) forward
  378.      (`rmail-summary-scroll-msg-up').
  379. `DEL'
  380.      Scroll the other window backward (`rmail-summary-scroll-msg-down').
  381.      Kill the summary window (`rmail-summary-exit').
  382.      Exit Rmail (`rmail-summary-quit').
  383.    The keys `C-n' and `C-p' are modified in Rmail Summary mode so that
  384. in addition to moving point in the summary buffer they also cause the
  385. line's message to become current in the associated Rmail buffer.  That
  386. buffer is also made visible in another window if it is not already so.
  387.    `n' and `p' are similar to `C-n' and `C-p', but skip lines that say
  388. `message deleted'.  They are like the `n' and `p' keys of Rmail itself.
  389.  Note, however, that in a partial summary these commands move only
  390. among the message listed in the summary.
  391.    The other Emacs cursor motion commands are not changed in Rmail
  392. Summary mode, so it is easy to get the point on a line whose message is
  393. not selected in Rmail.  This can also happen if you switch to the Rmail
  394. window and switch messages there.  To get the Rmail buffer back in sync
  395. with the summary, use the `j' (`rmail-summary-goto-msg') command, which
  396. selects in Rmail the message of the current summary line.
  397.    Deletion and undeletion can also be done from the summary buffer. 
  398. They always work based on where point is located in the summary buffer,
  399. ignoring which message is selected in Rmail.  `d'
  400. (`rmail-summary-delete-forward') deletes the current line's message,
  401. then moves to the next line whose message is not deleted and selects
  402. that message.  The inverse of this is `u' (`rmail-summary-undelete'),
  403. which moves back (if necessary) to a line whose message is deleted,
  404. undeletes that message, and selects it in Rmail.
  405.    When moving through messages with the summary buffer, it is
  406. convenient to be able to scroll the message while remaining in the
  407. summary window. The commands SPC (`rmail-summary-scroll-msg-up') and DEL
  408. (`rmail-summary-scroll-msg-down') do this.  They scroll the message just
  409. as those same keys do when the Rmail buffer is selected.
  410.    When you are finished using the summary, type `x'
  411. (`rmail-summary-exit') to kill the summary buffer's window.
  412.    You can also exit Rmail while in the summary.  `q'
  413. (`rmail-summary-quit') kills the summary window, then saves the Rmail
  414. file and switches to another buffer.
  415. File: emacs,  Node: Rmail Reply,  Next: Rmail Editing,  Prev: Rmail Summary,  Up: Rmail
  416. Sending Replies
  417. ===============
  418.    Rmail has several commands that use Mail mode to send outgoing mail.
  419. *Note Sending Mail::, for information on using Mail mode.  What are
  420. documented here are the special commands of Rmail for entering Mail
  421. mode. Note that the usual keys for sending mail, `C-x m' and `C-x 4 m',
  422. are available in Rmail mode and work just as they usually do.
  423.      Send a message (`rmail-mail').
  424.      Continue editing already started outgoing message
  425.      (`rmail-continue').
  426.      Send a reply to the current Rmail message (`rmail-reply').
  427.      Forward current message to other users (`rmail-forward').
  428.    The most common reason to send a message while in Rmail is to reply
  429. to the message you are reading.  To do this, type `r' (`rmail-reply'). 
  430. This displays the `*mail*' buffer in another window, much like `C-x 4
  431. m', but preinitializes the `Subject', `To', `CC' and `In-reply-to'
  432. header fields based on the message being replied to.  The `To' field is
  433. given the sender of that message, and the `CC' gets all the recipients
  434. of that message (but recipients that match elements of the list
  435. `rmail-dont-reply-to' are omitted; by default, this list contains your
  436. own mailing address).
  437.    If you don't want to include the other recipients in the `cc' field,
  438. you can use a prefix argument to the `r' command.  In Rmail, you can do
  439. this with `1 r'.
  440.    Once you have initialized the `*mail*' buffer this way, sending the
  441. mail goes as usual (*note Sending Mail::.).  You can edit the
  442. presupplied header fields if they are not right for you.
  443.    One additional Mail mode command is available when mailing is invoked
  444. from Rmail: `C-c C-y' (`mail-yank-original') inserts into the outgoing
  445. message a copy of the current Rmail message; normally this is the
  446. message you are replying to, but you can also switch to the Rmail
  447. buffer, select a different message, switch back, and yank new current
  448. message.  Normally the yanked message is indented four spaces and has
  449. most header fields deleted from it; an argument to `C-c C-y' specifies
  450. the amount to indent, and `C-u C-c C-y' does not indent at all and does
  451. not delete any header fields.
  452.    Another frequent reason to send mail in Rmail is to forward the
  453. current message to other users.  `f' (`rmail-forward') makes this easy
  454. by preinitializing the `*mail*' buffer with the current message as the
  455. text, and a subject designating a forwarded message.  All you have to
  456. do is fill in the recipients and send.
  457.    The `m' (`rmail-mail') command is used to start editing an outgoing
  458. message that is not a reply.  It leaves the header fields empty. Its
  459. only difference from `C-x 4 m' is that it makes the Rmail buffer
  460. accessible for `C-c y', just as `r' does.  Thus, `m' can be used to
  461. reply to or forward a message; it can do anything `r' or `f' can do.
  462.    The `c' (`rmail-continue') command resumes editing the `*mail*'
  463. buffer, to finish editing an outgoing message you were already
  464. composing, or to alter a message you have sent.
  465. File: emacs,  Node: Rmail Editing,  Next: Rmail Digest,  Prev: Rmail Reply,  Up: Rmail
  466. Editing Within a Message
  467. ========================
  468.    Rmail mode provides a few special commands for moving within and
  469. editing the current message.  In addition, the usual Emacs commands are
  470. available (except for a few, such as `C-M-n' and `C-M-h', that are
  471. redefined by Rmail for other purposes).  However, the Rmail buffer is
  472. normally read-only, and to alter it you must use the Rmail command `w'
  473. described below.
  474.      Toggle display of original headers (`rmail-toggle-headers').
  475.      Edit current message (`rmail-edit-current-message').
  476.    Rmail reformats the header of each message before displaying it.
  477. Normally this involves deleting most header fields, on the grounds that
  478. they are not interesting.  The variable `rmail-ignored-headers' should
  479. contain a regexp that matches the header fields to discard in this way.
  480. The original headers are saved permanently, and to see what they look
  481. like, use the `t' (`rmail-toggle-headers') command.  This discards the
  482. reformatted headers of the current message and displays it with the
  483. original headers. Repeating `t' reformats the message again.  Selecting
  484. the message again also reformats.
  485.    The Rmail buffer is normally read-only, and most of the characters
  486. you would type to modify it (including most letters) are redefined as
  487. Rmail commands.  This is usually not a problem since it is rare to want
  488. to change the text of a message.  When you do want to do this, the way
  489. is to type `w' (`rmail-edit-current-message'), which changes from Rmail
  490. mode into Rmail Edit mode, another major mode which is nearly the same
  491. as Text mode. The mode line illustrates this change.
  492.    In Rmail Edit mode, letters insert themselves as usual and the Rmail
  493. commands are not available.  When you are finished editing the message
  494. and are ready to go back to Rmail, type `C-c C-c', which switches back
  495. to Rmail mode.  Alternatively, you can return to Rmail mode but cancel
  496. all the editing that you have done by typing `C-c C-]'.
  497.    Entering Rmail Edit mode calls with no arguments the value of the
  498. variable `text-mode-hook', if that value exists and is not `nil'; then
  499. it does the same with the variable `rmail-edit-mode-hook'.  It adds the
  500. attribute `edited' to the message.
  501. File: emacs,  Node: Rmail Digest,  Prev: Rmail Editing,  Up: Rmail
  502. Digest Messages
  503. ===============
  504.    A "digest message" is a message which exists to contain and carry
  505. several other messages.  Digests are used on moderated mailing lists;
  506. all the messages that arrive for the list during a period of time such
  507. as one day are put inside a single digest which is then sent to the
  508. subscribers. Transmitting the single digest uses much less computer
  509. time than transmitting the individual messages even though the total
  510. size is the same, because the per-message overhead in network mail
  511. transmission is considerable.
  512.    When you receive a digest message, the most convenient way to read
  513. it is to "undigestify" it: to turn it back into many individual
  514. messages. Then you can read and delete the individual messages as it
  515. suits you.
  516.    To undigestify a message, select it and then type `M-x
  517. undigestify-rmail-message'.  This copies each submessage as a separate
  518. Rmail message and inserts them all following the digest.  The digest
  519. message itself is flagged as deleted.
  520. File: emacs,  Node: Recursive Edit,  Next: Narrowing,  Prev: Rmail,  Up: Top
  521. Recursive Editing Levels
  522. ========================
  523.    A "recursive edit" is a situation in which you are using Emacs
  524. commands to perform arbitrary editing while in the middle of another
  525. Emacs command.  For example, when you type `C-r' inside of a
  526. `query-replace', you enter a recursive edit in which you can change the
  527. current buffer.  On exiting from the recursive edit, you go back to the
  528. `query-replace'.
  529.    "Exiting" the recursive edit means returning to the unfinished
  530. command, which continues execution.  For example, exiting the recursive
  531. edit requested by `C-r' in `query-replace' causes query replacing to
  532. resume.  Exiting is done with `C-M-c' (`exit-recursive-edit').
  533.    You can also "abort" the recursive edit.  This is like exiting, but
  534. also quits the unfinished command immediately.  Use the command `C-]'
  535. (`abort-recursive-edit') for this.  *Note Quitting::.
  536.    The mode line shows you when you are in a recursive edit by
  537. displaying square brackets around the parentheses that always surround
  538. the major and minor mode names.  Every window's mode line shows this,
  539. in the same way, since being in a recursive edit is true of Emacs as a
  540. whole rather than any particular buffer.
  541.    It is possible to be in recursive edits within recursive edits.  For
  542. example, after typing `C-r' in a `query-replace', you might type a
  543. command that entered the debugger.  In such circumstances, two or more
  544. sets of square brackets appear in the mode line.  Exiting the inner
  545. recursive edit (such as, with the debugger `c' command) would resume
  546. the command where it called the debugger.  After the end of this
  547. command, you would be able to exit the first recursive edit.  Aborting
  548. also gets out of only one level of recursive edit; it returns
  549. immediately to the command level of the previous recursive edit.  So
  550. you could immediately abort that one too.
  551.    Alternatively, the command `M-x top-level' aborts all levels of
  552. recursive edits, returning immediately to the top level command reader.
  553.    The text being edited inside the recursive edit need not be the same
  554. text that you were editing at top level.  It depends on what the
  555. recursive edit is for.  If the command that invokes the recursive edit
  556. selects a different buffer first, that is the buffer you will edit
  557. recursively.  In any case, you can switch buffers within the recursive
  558. edit in the normal manner (as long as the buffer-switching keys have
  559. not been rebound).  You could probably do all the rest of your editing
  560. inside the recursive edit, visiting files and all.  But this could have
  561. surprising effects (such as stack overflow) from time to time.  So
  562. remember to exit or abort the recursive edit when you no longer need it.
  563.    In general, GNU Emacs tries to avoid using recursive edits.  It is
  564. usually preferable to allow the user to switch among the possible
  565. editing modes in any order he likes.  With recursive edits, the only
  566. way to get to another state is to go "back" to the state that the
  567. recursive edit was invoked from.
  568. File: emacs,  Node: Narrowing,  Next: Sorting,  Prev: Recursive Edit,  Up: Top
  569. Narrowing
  570. =========
  571.    "Narrowing" means focusing in on some portion of the buffer, making
  572. the rest temporarily invisible and inaccessible.  Cancelling the
  573. narrowing, and making the entire buffer once again visible, is called
  574. "widening". The amount of narrowing in effect in a buffer at any time
  575. is called the buffer's "restriction".
  576. `C-x n'
  577.      Narrow down to between point and mark (`narrow-to-region').
  578. `C-x w'
  579.      Widen to make the entire buffer visible again (`widen').
  580.    When you have narrowed down to a part of the buffer, that part
  581. appears to be all there is.  You can't see the rest, you can't move
  582. into it (motion commands won't go outside the visible part), you can't
  583. change it in any way.  However, it is not gone, and if you save the
  584. file all the invisible text will be saved.  In addition to sometimes
  585. making it easier to concentrate on a single subroutine or paragraph by
  586. eliminating clutter, narrowing can be used to restrict the range of
  587. operation of a replace command or repeating keyboard macro.  The word
  588. `Narrow' appears in the mode line whenever narrowing is in effect.
  589.    The primary narrowing command is `C-x n' (`narrow-to-region'). It
  590. sets the current buffer's restrictions so that the text in the current
  591. region remains visible but all text before the region or after the
  592. region is invisible.  Point and mark do not change.
  593.    Because narrowing can easily confuse users who do not understand it,
  594. `narrow-to-region' is normally a disabled command.  Attempting to use
  595. this command asks for confirmation and gives you the option of enabling
  596. it; once you enable the command, confirmation will no longer be
  597. required for it.  *Note Disabling::.
  598.    The way to undo narrowing is to widen with `C-x w' (`widen'). This
  599. makes all text in the buffer accessible again.
  600.    You can get information on what part of the buffer you are narrowed
  601. down to using the `C-x =' command.  *Note Position Info::.
  602. File: emacs,  Node: Sorting,  Next: Shell,  Prev: Narrowing,  Up: Top
  603. Sorting Text
  604. ============
  605.    Emacs provides several commands for sorting text in the buffer.  All
  606. operate on the contents of the region (the text between point and the
  607. mark).  They divide the text of the region into many "sort records",
  608. identify a "sort key" for each record, and then reorder the records
  609. into the order determined by the sort keys.  The records are ordered so
  610. that their keys are in alphabetical order, or, for numeric sorting, in
  611. numeric order.  In alphabetic sorting, all upper case letters `A'
  612. through `Z' come before lower case `a', in accord with the ASCII
  613. character sequence.
  614.    The various sort commands differ in how they divide the text into
  615. sort records and in which part of each record is used as the sort key. 
  616. Most of the commands make each line a separate sort record, but some
  617. commands use paragraphs or pages as sort records.  Most of the sort
  618. commands use each entire sort record as its own sort key, but some use
  619. only a portion of the record as the sort key.
  620. `M-x sort-lines'
  621.      Divide the region into lines, and sort by comparing the entire
  622.      text of a line.  A prefix argument means sort into descending
  623.      order.
  624. `M-x sort-paragraphs'
  625.      Divide the region into paragraphs, and sort by comparing the entire
  626.      text of a paragraph (except for leading blank lines).  A prefix
  627.      argument means sort into descending order.
  628. `M-x sort-pages'
  629.      Divide the region into pages, and sort by comparing the entire
  630.      text of a page (except for leading blank lines).  A prefix
  631.      argument means sort into descending order.
  632. `M-x sort-fields'
  633.      Divide the region into lines, and sort by comparing the contents of
  634.      one field in each line.  Fields are defined as separated by
  635.      whitespace, so the first run of consecutive non-whitespace
  636.      characters in a line constitutes field 1, the second such run
  637.      constitutes field 2, etc.
  638.      You specify which field to sort by with a numeric argument: 1 to
  639.      sort by field 1, etc.  A negative argument means sort into
  640.      descending order.  Thus, minus 2 means sort by field 2 in
  641.      reverse-alphabetical order.
  642.      If two lines are equal in the field being compared, their relative
  643.      order in the text is not changed.  This enables you to sort by
  644.      multiple keys: sort first by the least significant key, then by
  645.      the next-to-least key, and so on, ending with the most important
  646.      key.
  647. `M-x sort-numeric-fields'
  648.      Like `M-x sort-fields' except the specified field is converted to
  649.      a number for each line, and the numbers are compared.  `10' comes
  650.      before `2' when considered as text, but after it when considered
  651.      as a number.
  652. `M-x sort-columns'
  653.      Like `M-x sort-fields' except that the text within each line used
  654.      for comparison comes from a fixed range of columns.  See below for
  655.      an explanation.
  656.    For example, if the buffer contains
  657.      On systems where clash detection (locking of files being edited) is
  658.      implemented, Emacs also checks the first time you modify a buffer
  659.      whether the file has changed on disk since it was last visited or
  660.      saved.  If it has, you are asked to confirm that you want to change
  661.      the buffer.
  662. then if you apply `M-x sort-lines' to the entire buffer you get
  663.      On systems where clash detection (locking of files being edited) is
  664.      implemented, Emacs also checks the first time you modify a buffer
  665.      saved.  If it has, you are asked to confirm that you want to change
  666.      the buffer.
  667.      whether the file has changed on disk since it was last visited or
  668. where the upper case `O' comes before all lower case letters.  If you
  669. apply instead `C-u 2 M-x sort-fields' you get
  670.      implemented, Emacs also checks the first time you modify a buffer
  671.      saved.  If it has, you are asked to confirm that you want to change
  672.      the buffer.
  673.      On systems where clash detection (locking of files being edited) is
  674.      whether the file has changed on disk since it was last visited or
  675. where the sort keys were `Emacs', `If', `buffer', `systems' and `the'.
  676.    `M-x sort-columns' requires more explanation.  You specify the
  677. columns by putting point at one of the columns and the mark at the other
  678. column.  Because this means you cannot put point or the mark at the
  679. beginning of the first line to sort, this command uses an unusual
  680. definition of `region': all of the line point is in is considered part
  681. of the region, and so is all of the line the mark is in.
  682.    For example, to sort a table by information found in columns 10 to
  683. 15, you could put the mark on column 10 in the first line of the table,
  684. and point on column 15 in the last line of the table, and then use this
  685. command. Or you could put the mark on column 15 in the first line and
  686. point on column 10 in the last line.
  687.    This can be thought of as sorting the rectangle specified by point
  688. and the mark, except that the text on each line to the left or right of
  689. the rectangle moves along with the text inside the rectangle. *Note
  690. Rectangles::.
  691. File: emacs,  Node: Shell,  Next: Hardcopy,  Prev: Sorting,  Up: Top
  692. Running Shell Commands from Emacs
  693. =================================
  694.    Emacs has commands for passing single command lines to inferior shell
  695. processes; it can also run a shell interactively with input and output
  696. to an Emacs buffer `*shell*'.
  697. `M-!'
  698.      Run a specified shell command line and display the output
  699.      (`shell-command').
  700. `M-|'
  701.      Run a specified shell command line with region contents as input;
  702.      optionally replace the region with the output
  703.      (`shell-command-on-region').
  704. `M-x shell'
  705.      Run a subshell with input and output through an Emacs buffer. You
  706.      can then give commands interactively.
  707. * Menu:
  708. * Single Shell::         How to run one shell command and return.
  709. * Interactive Shell::    Permanent shell taking input via Emacs.
  710. * Shell Mode::           Special Emacs commands used with permanent shell.
  711. File: emacs,  Node: Single Shell,  Next: Interactive Shell,  Prev: Shell,  Up: Shell
  712. Single Shell Commands
  713. ---------------------
  714.    `M-!' (`shell-command') reads a line of text using the minibuffer
  715. and creates an inferior shell to execute the line as a command.
  716. Standard input from the command comes from the null device.  If the
  717. shell command produces any output, the output goes into an Emacs buffer
  718. named `*Shell Command Output*', which is displayed in another window
  719. but not selected.  A numeric argument, as in `M-1 M-!', directs this
  720. command to insert any output into the current buffer.  In that case,
  721. point is left before the output and the mark is set after the output.
  722.    `M-|' (`shell-command-on-region') is like `M-!' but passes the
  723. contents of the region as input to the shell command, instead of no
  724. input.  If a numeric argument is used, meaning insert output in the
  725. current buffer, then the old region is deleted first and the output
  726. replaces it as the contents of the region.
  727.    Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
  728. use.  This variable is initialized based on your `SHELL' environment
  729. variable when Emacs is started.  If the file name does not specify a
  730. directory, the directories in the list `exec-path' are searched; this
  731. list is initialized based on the environment variable `PATH' when Emacs
  732. is started.  Your `.emacs' file can override either or both of these
  733. default initializations.
  734.    With `M-!' and `M-|', Emacs has to wait until the shell command
  735. completes.  You can quit with `C-g'; that terminates the shell command.
  736. File: emacs,  Node: Interactive Shell,  Next: Shell Mode,  Prev: Single Shell,  Up: Shell
  737. Interactive Inferior Shell
  738. --------------------------
  739.    To run a subshell interactively, putting its typescript in an Emacs
  740. buffer, use `M-x shell'.  This creates (or reuses) a buffer named
  741. `*shell*' and runs a subshell with input coming from and output going
  742. to that buffer.  That is to say, any "terminal output" from the subshell
  743. will go into the buffer, advancing point, and any "terminal input" for
  744. the subshell comes from text in the buffer.  To give input to the
  745. subshell, go to the end of the buffer and type the input, terminated by
  746.    Emacs does not wait for the subshell to do anything.  You can switch
  747. windows or buffers and edit them while the shell is waiting, or while
  748. it is running a command.  Output from the subshell waits until Emacs
  749. has time to process it; this happens whenever Emacs is waiting for
  750. keyboard input or for time to elapse.
  751.    If you would like multiple subshells, change the name of buffer
  752. `*shell*' to something different by using `M-x rename-buffer'.  The
  753. next use of `M-x shell' will create a new buffer `*shell*' with its own
  754. subshell.  By renaming this buffer as well you can create a third one,
  755. and so on.  All the subshells run independently and in parallel.
  756.    The file name used to load the subshell is the value of the variable
  757. `explicit-shell-file-name', if that is non-`nil'.  Otherwise, the
  758. environment variable `ESHELL' is used, or the environment variable
  759. `SHELL' if there is no `ESHELL'.  If the file name specified is
  760. relative, the directories in the list `exec-path' are searched (*note
  761. Single Shell Commands: Single Shell.).
  762.    As soon as the subshell is started, it is sent as input the contents
  763. of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME
  764. is the name of the file that the shell was loaded from.  For example,
  765. if you use `csh', the file sent to it is `~/.emacs_csh'; if you use the
  766. Bourne-Again shell, the file sent to it is `~/.emacs_bash'.
  767.    `cd', `pushd' and `popd' commands given to the inferior shell are
  768. watched by Emacs so it can keep the `*shell*' buffer's default
  769. directory the same as the shell's working directory.  These commands
  770. are recognized syntactically by examining lines of input that are sent.
  771.  If you use aliases for these commands, you can tell Emacs to recognize
  772. them also.  For example, if the value of the variable
  773. `shell-pushd-regexp' matches the beginning of a shell command line,
  774. that line is regarded as a `pushd' command.  Change this variable when
  775. you add aliases for `pushd'.  Likewise, `shell-popd-regexp' and
  776. `shell-cd-regexp' are used to recognize commands with the meaning of
  777. `popd' and `cd'.  These commands are recognized only at the beginning
  778. of a shell command line.
  779.    If Emacs gets an error while trying to handle what it believes is a
  780. `cd', `pushd' or `popd' command, and the value of
  781. `shell-set-directory-error-hook' is non-`nil', that value is called as
  782. a function with no arguments.
  783. File: emacs,  Node: Shell Mode,  Prev: Interactive Shell,  Up: Shell
  784. Shell Mode
  785. ----------
  786.    The shell buffer uses Shell mode, which defines several special keys
  787. attached to the `C-c' prefix.  They are chosen to resemble the usual
  788. editing and job control characters present in shells that are not under
  789. Emacs, except that you must type `C-c' first.  Here is a complete list
  790. of the special key bindings of Shell mode:
  791. `RET'
  792.      At end of buffer, send line as input; otherwise, copy current line
  793.      to end of buffer and send it (`send-shell-input').  When a line is
  794.      copied, any text at the beginning of the line that matches the
  795.      variable `shell-prompt-pattern' is left out; this variable's value
  796.      should be a regexp string that matches the prompts that you use in
  797.      your subshell.
  798. `C-c C-d'
  799.      Send end-of-file as input, probably causing the shell or its
  800.      current subjob to finish (`shell-send-eof').
  801. `C-c C-u'
  802.      Kill all text that has yet to be sent as input
  803.      (`kill-shell-input').
  804. `C-c C-w'
  805.      Kill a word before point (`backward-kill-word').
  806. `C-c C-c'
  807.      Interrupt the shell or its current subjob if any
  808.      (`interrupt-shell-subjob').
  809. `C-c C-z'
  810.      Stop the shell or its current subjob if any (`stop-shell-subjob').
  811. `C-c C-\'
  812.      Send quit signal to the shell or its current subjob if any
  813.      (`quit-shell-subjob').
  814. `C-c C-o'
  815.      Delete last batch of output from shell (`kill-output-from-shell').
  816. `C-c C-r'
  817.      Scroll top of last batch of output to top of window
  818.      (`show-output-from-shell').
  819. `C-c C-y'
  820.      Copy the previous bunch of shell input, and insert it into the
  821.      buffer before point (`copy-last-shell-input').  No final newline
  822.      is inserted, and the input copied is not resubmitted until you type
  823.      RET.
  824. File: emacs,  Node: Hardcopy,  Next: Dissociated Press,  Prev: Shell,  Up: Top
  825. Hardcopy Output
  826. ===============
  827.    The Emacs commands for making hardcopy derive their names from the
  828. Unix commands `print' and `lpr'.
  829. `M-x print-buffer'
  830.      Print hardcopy of current buffer using Unix command `print' (`lpr
  831.      -p').  This makes page headings containing the file name and page
  832.      number.
  833. `M-x lpr-buffer'
  834.      Print hardcopy of current buffer using Unix command `lpr'. This
  835.      makes no page headings.
  836. `M-x print-region'
  837.      Like `print-buffer' but prints only the current region.
  838. `M-x lpr-region'
  839.      Like `lpr-buffer' but prints only the current region.
  840.    All the hardcopy commands pass extra switches to the `lpr' program
  841. based on the value of the variable `lpr-switches'.  Its value should be
  842. a list of strings, each string a switch starting with `-'.  For
  843. example, the value could be `("-Pfoo")' to print on printer `foo'.  You
  844. can specify an alternative command to run instead of `lpr' by setting
  845. the variable `lpr-command'.
  846.