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

  1. This is Info file ../info/emacs, produced by Makeinfo-1.43 from the
  2. input file emacs.tex.
  3.  
  4.    This file documents the GNU Emacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  15. General Public License" are included exactly as in the original, and
  16. provided that the entire resulting derived work is distributed under
  17. the terms of a permission notice identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the sections entitled "The GNU Manifesto",
  22. "Distribution" and "GNU General Public License" may be included in a
  23. translation approved by the author instead of in the original English.
  24.  
  25. 
  26. File: emacs,  Node: Rmail Deletion,  Next: Rmail Inbox,  Prev: Rmail Motion,  Up: Rmail
  27.  
  28. Deleting Messages
  29. =================
  30.  
  31.    When you no longer need to keep a message, you can "delete" it. 
  32. This flags it as ignorable, and some Rmail commands will pretend it is
  33. no longer present; but it still has its place in the Rmail file, and
  34. still has its message number.
  35.  
  36.    "Expunging" the Rmail file actually removes the deleted messages. 
  37. The remaining messages are renumbered consecutively.  Expunging is the
  38. only action that changes the message number of any message, except for
  39. undigestifying (*note Rmail Digest::.).
  40.  
  41. `d'
  42.      Delete the current message, and move to the next nondeleted
  43.      message (`rmail-delete-forward').
  44.  
  45. `C-d'
  46.      Delete the current message, and move to the previous nondeleted
  47.      message (`rmail-delete-backward').
  48.  
  49. `u'
  50.      Undelete the current message, or move back to a deleted message
  51.      and undelete it (`rmail-undelete-previous-message').
  52.  
  53. `x'
  54. `e'
  55.      Expunge the Rmail file (`rmail-expunge').  These two commands are
  56.      synonyms.
  57.  
  58.    There are two Rmail commands for deleting messages.  Both delete the
  59. current message and select another message.  `d'
  60. (`rmail-delete-forward') moves to the following message, skipping
  61. messages already deleted, while `C-d' (`rmail-delete-backward') moves
  62. to the previous nondeleted message.  If there is no nondeleted message
  63. to move to in the specified direction, the message that was just
  64. deleted remains current.
  65.  
  66.    To make all the deleted messages finally vanish from the Rmail file,
  67. type `e' (`rmail-expunge').  Until you do this, you can still
  68. "undelete" the deleted messages.
  69.  
  70.    To undelete, type `u' (`rmail-undelete-previous-message'), which is
  71. designed to cancel the effect of a `d' command (usually).  It
  72. undeletes the current message if the current message is deleted. 
  73. Otherwise it moves backward to previous messages until a deleted
  74. message is found, and undeletes that message.
  75.  
  76.    You can usually undo a `d' with a `u' because the `u' moves back to
  77. and undeletes the message that the `d' deleted.  But this does not
  78. work when the `d' skips a few already-deleted messages that follow the
  79. message being deleted; then the `u' command will undelete the last of
  80. the messages that were skipped.  There is no clean way to avoid this
  81. problem.  However, by repeating the `u' command, you can eventually get
  82. back to the message that you intended to undelete.  You can also reach
  83. that message with `M-p' commands and then type `u'.
  84.  
  85.    A deleted message has the `deleted' attribute, and as a result
  86. `deleted' appears in the mode line when the current message is
  87. deleted.  In fact, deleting or undeleting a message is nothing more
  88. than adding or removing this attribute.  *Note Rmail Labels::.
  89.  
  90. 
  91. File: emacs,  Node: Rmail Inbox,  Next: Rmail Files,  Prev: Rmail Deletion,  Up: Rmail
  92.  
  93. Rmail Files and Inboxes
  94. =======================
  95.  
  96.    Unix places incoming mail for you in a file that we call your
  97. "inbox".  When you start up Rmail, it copies the new messages from
  98. your inbox into your primary mail file, an Rmail file, which also
  99. contains other messages saved from previous Rmail sessions.  It is in
  100. this file that you actually read the mail with Rmail.  This operation
  101. is called "getting new mail".  It can be repeated at any time using
  102. the `g' key in Rmail.  The inbox file name is
  103. `/usr/spool/mail/USERNAME' in Berkeley Unix, `/usr/mail/USERNAME' in
  104. system V.
  105.  
  106.    There are two reason for having separate Rmail files and inboxes.
  107.  
  108.   1. The format in which Unix delivers the mail in the inbox is not
  109.      adequate for Rmail mail storage.  It has no way to record
  110.      attributes (such as `deleted') or user-specified labels; it has
  111.      no way to record old headers and reformatted headers; it has no
  112.      way to record cached summary line information.
  113.  
  114.   2. It is very cumbersome to access an inbox file without danger of
  115.      losing mail, because it is necessary to interlock with mail
  116.      delivery.  Moreover, different Unix systems use different
  117.      interlocking techniques.  The strategy of moving mail out of the
  118.      inbox once and for all into a separate Rmail file avoids the need
  119.      for interlocking in all the rest of Rmail, since only Rmail
  120.      operates on the Rmail file.
  121.  
  122.    When getting new mail, Rmail first copies the new mail from the
  123. inbox file to the Rmail file; then it saves the Rmail file; then it
  124. deletes the inbox file.  This way, a system crash may cause
  125. duplication of mail between the inbox and the Rmail file, but cannot
  126. lose mail.
  127.  
  128.    Copying mail from an inbox in the system's mailer directory
  129. actually puts it in an intermediate file `~/.newmail'.  This is
  130. because the interlocking is done by a C program that copies to another
  131. file.  `~/.newmail' is deleted after mail merging is successful.  If
  132. there is a crash at the wrong time, this file will continue to exist
  133. and will be used as an inbox the next time you get new mail.
  134.  
  135. 
  136. File: emacs,  Node: Rmail Files,  Next: Rmail Output,  Prev: Rmail Inbox,  Up: Rmail
  137.  
  138. Multiple Mail Files
  139. ===================
  140.  
  141.    Rmail operates by default on your "primary mail file", which is
  142. named `~/RMAIL' and receives your incoming mail from your system inbox
  143. file.  But you can also have other mail files and edit them with
  144. Rmail.  These files can receive mail through their own inboxes, or you
  145. can move messages into them by explicit command in Rmail (*note Rmail
  146. Output::.).
  147.  
  148. `i FILE RET'
  149.      Read FILE into Emacs and run Rmail on it (`rmail-input').
  150.  
  151. `M-x set-rmail-inbox-list RET FILES RET'
  152.      Specify inbox file names for current Rmail file to get mail from.
  153.  
  154. `g'
  155.      Merge new mail from current Rmail file's inboxes
  156.      (`rmail-get-new-mail').
  157.  
  158. `C-u g FILE'
  159.      Merge new mail from inbox file FILE.
  160.  
  161.    To run Rmail on a file other than your primary mail file, you may
  162. use the `i' (`rmail-input') command in Rmail.  This visits the file,
  163. puts it in Rmail mode, and then gets new mail from the file's inboxes
  164. if any.  You can also use `M-x rmail-input' even when not in Rmail.
  165.  
  166.    The file you read with `i' does not have to be in Rmail file format. 
  167. It could also be Unix mail format, or mmdf format; or it could be a
  168. mixture of all three, as long as each message belongs to one of the
  169. three formats.  Rmail recognizes all three and converts all the
  170. messages to proper Rmail format before showing you the file.
  171.  
  172.    Each Rmail file can contain a list of inbox file names; you can
  173. specify this list with `M-x set-rmail-inbox-list RET FILES RET'.  The
  174. argument can contain any number of file names, separated by commas. 
  175. It can also be empty, which specifies that this file should have no
  176. inboxes.  Once a list of inboxes is specified, the Rmail file
  177. remembers it permanently until it is explicitly changed.
  178.  
  179.    If an Rmail file has inboxes, new mail is merged in from the
  180. inboxes when the Rmail file is brought into Rmail, and when the `g'
  181. (`rmail-get-new-mail') command is used.  If the Rmail file specifies
  182. no inboxes, then no new mail is merged in at these times.  A special
  183. exception is made for your primary mail file in using the standard
  184. system inbox for it if it does not specify any.
  185.  
  186.    To merge mail from a file that is not the usual inbox, give the `g'
  187. key a numeric argument, as in `C-u g'.  Then it reads a file name and
  188. merges mail from that file.  The inbox file is not deleted or changed
  189. in any way when `g' with an argument is used.  This is, therefore, a
  190. general way of merging one file of messages into another.
  191.  
  192. 
  193. File: emacs,  Node: Rmail Output,  Next: Rmail Labels,  Prev: Rmail Files,  Up: Rmail
  194.  
  195. Copying Messages Out to Files
  196. =============================
  197.  
  198. `o FILE RET'
  199.      Append a copy of the current message to the file FILE, writing it
  200.      in Rmail file format (`rmail-output-to-rmail-file').
  201.  
  202. `C-o FILE RET'
  203.      Append a copy of the current message to the file FILE, writing it
  204.      in Unix mail file format (`rmail-output').
  205.  
  206.    If an Rmail file has no inboxes, how does it get anything in it?  By
  207. explicit `o' commands.
  208.  
  209.    `o' (`rmail-output-to-rmail-file') appends the current message in
  210. Rmail format to the end of the specified file.  This is the best
  211. command to use to move messages between Rmail files.  If the other
  212. Rmail file is currently visited, the copying is done into the other
  213. file's Emacs buffer instead.  You should eventually save it on disk.
  214.  
  215.    The `C-o' (`rmail-output') command in Rmail appends a copy of the
  216. current message to a specified file, in Unix mail file format.  This
  217. is useful for moving messages into files to be read by other mail
  218. processors that do not understand Rmail format.
  219.  
  220.    Copying a message with `o' or `C-o' gives the original copy of the
  221. message the `filed' attribute, so that `filed' appears in the mode
  222. line when such a message is current.
  223.  
  224.    Normally you should use only `o' to output messages to other Rmail
  225. files, never `C-o'.  But it is also safe if you always use `C-o',
  226. never `o'.  When a file is visited in Rmail, the last message is
  227. checked, and if it is in Unix format, the entire file is scanned and
  228. all Unix-format messages are converted to Rmail format.  (The reason
  229. for checking the last message is that scanning the file is slow and
  230. most Rmail files have only Rmail format messages.)  If you use `C-o'
  231. consistently, the last message is sure to be in Unix format, so Rmail
  232. will convert all messages properly.
  233.  
  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.  
  239.    In any case, always use `o' to add to an Rmail file that is being
  240. visited in Rmail.  Adding messages with `C-o' to the actual disk file
  241. will trigger a "simultaneous editing" warning when you ask to save the
  242. Emacs buffer, and will be lost if you do save.
  243.  
  244. 
  245. File: emacs,  Node: Rmail Labels,  Next: Rmail Summary,  Prev: Rmail Output,  Up: Rmail
  246.  
  247. Labels
  248. ======
  249.  
  250.    Each message can have various "labels" assigned to it as a means of
  251. classification.  A label has a name; different names mean different
  252. labels.  Any given label is either present or absent on a particular
  253. message.  A few label names have standard meanings and are given to
  254. messages automatically by Rmail when appropriate; these special labels
  255. are called "attributes".  All other labels are assigned by the user.
  256.  
  257. `a LABEL RET'
  258.      Assign the label LABEL to the current message (`rmail-add-label').
  259.  
  260. `k LABEL RET'
  261.      Remove the label LABEL from the current message
  262.      (`rmail-kill-label').
  263.  
  264. `C-M-n LABELS RET'
  265.      Move to the next message that has one of the labels LABELS
  266.      (`rmail-next-labeled-message').
  267.  
  268. `C-M-p LABELS RET'
  269.      Move to the previous message that has one of the labels LABELS
  270.      (`rmail-previous-labeled-message').
  271.  
  272. `C-M-l LABELS RET'
  273.      Make a summary of all messages containing any of the labels LABELS
  274.      (`rmail-summary-by-labels').
  275.  
  276. Specifying an empty string for one these commands means to use the last
  277. label specified for any of these commands.
  278.  
  279.    The `a' (`rmail-add-label') and `k' (`rmail-kill-label') commands
  280. allow you to assign or remove any label on the current message.  If
  281. the LABEL argument is empty, it means to assign or remove the same
  282. label most recently assigned or removed.
  283.  
  284.    Once you have given messages labels to classify them as you wish,
  285. there are two ways to use the labels: in moving and in summaries.
  286.  
  287.    The command `C-M-n LABELS RET' (`rmail-next-labeled-message') moves
  288. to the next message that has one of the labels LABELS.  LABELS is one
  289. or more label names, separated by commas.  `C-M-p'
  290. (`rmail-previous-labeled-message') is similar, but moves backwards to
  291. previous messages.  A preceding numeric argument to either one serves
  292. as a repeat count.
  293.  
  294.    The command `C-M-l LABELS RET' (`rmail-summary-by-labels') displays
  295. a summary containing only the messages that have at least one of a
  296. specified set of messages.  The argument LABELS is one or more label
  297. names, separated by commas.  *Note Rmail Summary::, for information on
  298. summaries.
  299.  
  300.    If the LABELS argument to `C-M-n', `C-M-p' or `C-M-l' is empty, it
  301. means to use the last set of labels specified for any of these
  302. commands.
  303.  
  304.    Some labels such as `deleted' and `filed' have built-in meanings and
  305. are assigned to or removed from messages automatically at appropriate
  306. times; these labels are called "attributes".  Here is a list of Rmail
  307. attributes:
  308.  
  309. `unseen'
  310.      Means the message has never been current.  Assigned to messages
  311.      when they come from an inbox file, and removed when a message is
  312.      made current.
  313.  
  314. `deleted'
  315.      Means the message is deleted.  Assigned by deletion commands and
  316.      removed by undeletion commands (*note Rmail Deletion::.).
  317.  
  318. `filed'
  319.      Means the message has been copied to some other file.  Assigned
  320.      by the file output commands (*note Rmail Files::.).
  321.  
  322. `answered'
  323.      Means you have mailed an answer to the message.  Assigned by the
  324.      `r' command (`rmail-reply').  *Note Rmail Reply::.
  325.  
  326. `forwarded'
  327.      Means you have forwarded the message to other users.  Assigned by
  328.      the `f' command (`rmail-forward').  *Note Rmail Reply::.
  329.  
  330. `edited'
  331.      Means you have edited the text of the message within Rmail. 
  332.      *Note Rmail Editing::.
  333.  
  334.    All other labels are assigned or removed only by the user, and it
  335. is up to the user to decide what they mean.
  336.  
  337. 
  338. File: emacs,  Node: Rmail Summary,  Next: Rmail Reply,  Prev: Rmail Labels,  Up: Rmail
  339.  
  340. Summaries
  341. =========
  342.  
  343.    A "summary" is a buffer containing one line per message that Rmail
  344. can make and display to give you an overview of the mail in an Rmail
  345. file.  Each line shows the message number, the sender, the labels, and
  346. the subject.  When the summary buffer is selected, various commands
  347. can be used to select messages by moving in the summary buffer, or
  348. delete or undelete messages.
  349.  
  350.    A summary buffer applies to a single Rmail file only; if you are
  351. editing multiple Rmail files, they have separate summary buffers.  The
  352. summary buffer name is made by appending `-summary' to the Rmail
  353. buffer's name.  Only one summary buffer will be displayed at a time
  354. unless you make several windows and select the summary buffers by hand.
  355.  
  356. * Menu:
  357.  
  358. * Rmail Make Summary::  Making various sorts of summaries.
  359. * Rmail Summary Edit::  Manipulating messages from the summary.
  360.  
  361. 
  362. File: emacs,  Node: Rmail Make Summary,  Next: Rmail Summary Edit,  Prev: Rmail Summary,  Up: Rmail Summary
  363.  
  364. Making Summaries
  365. ----------------
  366.  
  367.    Here are the commands to create a summary for the current Rmail
  368. file.  Summaries do not update automatically; to make an updated
  369. summary, you must use one of these commands again.
  370.  
  371. `h'
  372. `C-M-h'
  373.      Summarize all messages (`rmail-summary').
  374.  
  375. `l LABELS RET'
  376. `C-M-l LABELS RET'
  377.      Summarize message that have one or more of the specified labels
  378.      (`rmail-summary-by-labels').
  379.  
  380. `C-M-r RCPTS RET'
  381.      Summarize messages that have one or more of the specified
  382.      recipients (`rmail-summary-by-recipients')
  383.  
  384.    The `h' or `C-M-h' (`rmail-summary') command fills the summary
  385. buffer for the current Rmail file with a summary of all the messages
  386. in the file.  It then displays and selects the summary buffer in
  387. another window.
  388.  
  389.    `C-M-l LABELS RET' (`rmail-summary-by-labels') makes a partial
  390. summary mentioning only the messages that have one or more of the
  391. labels LABELS.  LABELS should contain label names separated by commas.
  392.  
  393.    `C-M-r RCPTS RET' (`rmail-summary-by-recipients') makes a partial
  394. summary mentioning only the messages that have one or more of the
  395. recipients RCPTS.  RCPTS should contain mailing addresses separated by
  396. commas.
  397.  
  398.    Note that there is only one summary buffer for any Rmail file;
  399. making one kind of summary discards any previously made summary.
  400.  
  401. 
  402. File: emacs,  Node: Rmail Summary Edit,  Prev: Rmail Make Summary,  Up: Rmail Summary
  403.  
  404. Editing in Summaries
  405. --------------------
  406.  
  407.    Summary buffers are given the major mode Rmail Summary mode, which
  408. provides the following special commands:
  409.  
  410. `j'
  411.      Select the message described by the line that point is on
  412.      (`rmail-summary-goto-msg').
  413.  
  414. `C-n'
  415.      Move to next line and select its message in Rmail
  416.      (`rmail-summary-next-all').
  417.  
  418. `C-p'
  419.      Move to previous line and select its message
  420.      (`rmail-summary-previous-all').
  421.  
  422. `n'
  423.      Move to next line, skipping lines saying `deleted', and select its
  424.      message (`rmail-summary-next-msg').
  425.  
  426. `p'
  427.      Move to previous line, skipping lines saying `deleted', and select
  428.      its message (`rmail-summary-previous-msg').
  429.  
  430. `d'
  431.      Delete the current line's message, then do like `n'
  432.      (`rmail-summary-delete-forward').
  433.  
  434. `u'
  435.      Undelete and select this message or the previous deleted message
  436.      in the summary (`rmail-summary-undelete').
  437.  
  438. `SPC'
  439.      Scroll the other window (presumably Rmail) forward
  440.      (`rmail-summary-scroll-msg-up').
  441.  
  442. `DEL'
  443.      Scroll the other window backward
  444.      (`rmail-summary-scroll-msg-down').
  445.  
  446. `x'
  447.      Kill the summary window (`rmail-summary-exit').
  448.  
  449. `q'
  450.      Exit Rmail (`rmail-summary-quit').
  451.  
  452.    The keys `C-n' and `C-p' are modified in Rmail Summary mode so that
  453. in addition to moving point in the summary buffer they also cause the
  454. line's message to become current in the associated Rmail buffer.  That
  455. buffer is also made visible in another window if it is not already so.
  456.  
  457.    `n' and `p' are similar to `C-n' and `C-p', but skip lines that say
  458. `message deleted'.  They are like the `n' and `p' keys of Rmail
  459. itself.  Note, however, that in a partial summary these commands move
  460. only among the message listed in the summary.
  461.  
  462.    The other Emacs cursor motion commands are not changed in Rmail
  463. Summary mode, so it is easy to get the point on a line whose message
  464. is not selected in Rmail.  This can also happen if you switch to the
  465. Rmail window and switch messages there.  To get the Rmail buffer back
  466. in sync with the summary, use the `j' (`rmail-summary-goto-msg')
  467. command, which selects in Rmail the message of the current summary
  468. line.
  469.  
  470.    Deletion and undeletion can also be done from the summary buffer. 
  471. They always work based on where point is located in the summary
  472. buffer, ignoring which message is selected in Rmail.  `d'
  473. (`rmail-summary-delete-forward') deletes the current line's message,
  474. then moves to the next line whose message is not deleted and selects
  475. that message.  The inverse of this is `u' (`rmail-summary-undelete'),
  476. which moves back (if necessary) to a line whose message is deleted,
  477. undeletes that message, and selects it in Rmail.
  478.  
  479.    When moving through messages with the summary buffer, it is
  480. convenient to be able to scroll the message while remaining in the
  481. summary window.  The commands SPC (`rmail-summary-scroll-msg-up') and
  482. DEL (`rmail-summary-scroll-msg-down') do this.  They scroll the
  483. message just as those same keys do when the Rmail buffer is selected.
  484.  
  485.    When you are finished using the summary, type `x'
  486. (`rmail-summary-exit') to kill the summary buffer's window.
  487.  
  488.    You can also exit Rmail while in the summary.  `q'
  489. (`rmail-summary-quit') kills the summary window, then saves the Rmail
  490. file and switches to another buffer.
  491.  
  492. 
  493. File: emacs,  Node: Rmail Reply,  Next: Rmail Editing,  Prev: Rmail Summary,  Up: Rmail
  494.  
  495. Sending Replies
  496. ===============
  497.  
  498.    Rmail has several commands that use Mail mode to send outgoing mail. 
  499. *Note Sending Mail::, for information on using Mail mode.  What are
  500. documented here are the special commands of Rmail for entering Mail
  501. mode.  Note that the usual keys for sending mail, `C-x m' and `C-x 4
  502. m', are available in Rmail mode and work just as they usually do.
  503.  
  504. `m'
  505.      Send a message (`rmail-mail').
  506.  
  507. `c'
  508.      Continue editing already started outgoing message 
  509.      (`rmail-continue').
  510.  
  511. `r'
  512.      Send a reply to the current Rmail message (`rmail-reply').
  513.  
  514. `f'
  515.      Forward current message to other users (`rmail-forward').
  516.  
  517.    The most common reason to send a message while in Rmail is to reply
  518. to the message you are reading.  To do this, type `r' (`rmail-reply').
  519.  This displays the `*mail*' buffer in another window, much like `C-x 4
  520. m', but preinitializes the `Subject', `To', `CC' and `In-reply-to'
  521. header fields based on the message being replied to.  The `To' field
  522. is given the sender of that message, and the `CC' gets all the
  523. recipients of that message (but recipients that match elements of the
  524. list `rmail-dont-reply-to' are omitted; by default, this list contains
  525. your own mailing address).
  526.  
  527.    Once you have initialized the `*mail*' buffer this way, sending the
  528. mail goes as usual (*note Sending Mail::.).  You can edit the
  529. presupplied header fields if they are not right for you.
  530.  
  531.    One additional Mail mode command is available when mailing is
  532. invoked from Rmail: `C-c C-y' (`mail-yank-original') inserts into the
  533. outgoing message a copy of the current Rmail message; normally this is
  534. the message you are replying to, but you can also switch to the Rmail
  535. buffer, select a different message, switch back, and yank new current
  536. message.  Normally the yanked message is indented four spaces and has
  537. most header fields deleted from it; an argument to `C-c C-y' specifies
  538. the amount to indent, and `C-u C-c C-y' does not indent at all and
  539. does not delete any header fields.
  540.  
  541.    Another frequent reason to send mail in Rmail is to forward the
  542. current message to other users.  `f' (`rmail-forward') makes this easy
  543. by preinitializing the `*mail*' buffer with the current message as the
  544. text, and a subject designating a forwarded message.  All you have to
  545. do is fill in the recipients and send.
  546.  
  547.    The `m' (`rmail-mail') command is used to start editing an outgoing
  548. message that is not a reply.  It leaves the header fields empty.  Its
  549. only difference from `C-x 4 m' is that it makes the Rmail buffer
  550. accessible for `C-c y', just as `r' does.  Thus, `m' can be used to
  551. reply to or forward a message; it can do anything `r' or `f' can do.
  552.  
  553.    The `c' (`rmail-continue') command resumes editing the `*mail*'
  554. buffer, to finish editing an outgoing message you were already
  555. composing, or to alter a message you have sent.
  556.  
  557. 
  558. File: emacs,  Node: Rmail Editing,  Next: Rmail Digest,  Prev: Rmail Reply,  Up: Rmail
  559.  
  560. Editing Within a Message
  561. ========================
  562.  
  563.    Rmail mode provides a few special commands for moving within and
  564. editing the current message.  In addition, the usual Emacs commands
  565. are available (except for a few, such as `C-M-n' and `C-M-h', that are
  566. redefined by Rmail for other purposes).  However, the Rmail buffer is
  567. normally read-only, and to alter it you must use the Rmail command `w'
  568. described below.
  569.  
  570. `t'
  571.      Toggle display of original headers (`rmail-toggle-headers').
  572.  
  573. `w'
  574.      Edit current message (`rmail-edit-current-message').
  575.  
  576.    Rmail reformats the header of each message before displaying it. 
  577. Normally this involves deleting most header fields, on the grounds that
  578. they are not interesting.  The variable `rmail-ignored-headers' should
  579. contain a regexp that matches the header fields to discard in this way. 
  580. The original headers are saved permanently, and to see what they look
  581. like, use the `t' (`rmail-toggle-headers') command.  This discards the
  582. reformatted headers of the current message and displays it with the
  583. original headers.  Repeating `t' reformats the message again. 
  584. Selecting the message again also reformats.
  585.  
  586.    The Rmail buffer is normally read only, and most of the characters
  587. you would type to modify it (including most letters) are redefined as
  588. Rmail commands.  This is usually not a problem since it is rare to
  589. want to change the text of a message.  When you do want to do this,
  590. the way is to type `w' (`rmail-edit-current-message'), which changes
  591. from Rmail mode into Rmail Edit mode, another major mode which is
  592. nearly the same as Text mode.  The mode line illustrates this change.
  593.  
  594.    In Rmail Edit mode, letters insert themselves as usual and the Rmail
  595. commands are not available.  When you are finished editing the message
  596. and are ready to go back to Rmail, type `C-c C-c', which switches back
  597. to Rmail mode.  Alternatively, you can return to Rmail mode but cancel
  598. all the editing that you have done by typing `C-c C-]'.
  599.  
  600.    Entering Rmail Edit mode calls with no arguments the value of the
  601. variable `text-mode-hook', if that value exists and is not `nil'; then
  602. it does the same with the variable `rmail-edit-mode-hook'.  It adds the
  603. attribute `edited' to the message.
  604.  
  605. 
  606. File: emacs,  Node: Rmail Digest,  Prev: Rmail Editing,  Up: Rmail
  607.  
  608. Digest Messages
  609. ===============
  610.  
  611.    A "digest message" is a message which exists to contain and carry
  612. several other messages.  Digests are used on moderated mailing lists;
  613. all the messages that arrive for the list during a period of time such
  614. as one day are put inside a single digest which is then sent to the
  615. subscribers.  Transmitting the single digest uses much less computer
  616. time than transmitting the individual messages even though the total
  617. size is the same, because the per-message overhead in network mail
  618. transmission is considerable.
  619.  
  620.    When you receive a digest message, the most convenient way to read
  621. it is to "undigestify" it: to turn it back into many individual
  622. messages.  Then you can read and delete the individual messages as it
  623. suits you.
  624.  
  625.    To undigestify a message, select it and then type `M-x
  626. undigestify-rmail-message'.  This copies each submessage as a separate
  627. Rmail message and inserts them all following the digest.  The digest
  628. message itself is flagged as deleted.
  629.  
  630. 
  631. File: emacs,  Node: Recursive Edit,  Next: Narrowing,  Prev: Rmail,  Up: Top
  632.  
  633. Recursive Editing Levels
  634. ========================
  635.  
  636.    A "recursive edit" is a situation in which you are using Emacs
  637. commands to perform arbitrary editing while in the middle of another
  638. Emacs command.  For example, when you type `C-r' inside of a
  639. `query-replace', you enter a recursive edit in which you can change
  640. the current buffer.  On exiting from the recursive edit, you go back
  641. to the `query-replace'.
  642.  
  643.    "Exiting" the recursive edit means returning to the unfinished
  644. command, which continues execution.  For example, exiting the recursive
  645. edit requested by `C-r' in `query-replace' causes query replacing to
  646. resume.  Exiting is done with `C-M-c' (`exit-recursive-edit').
  647.  
  648.    You can also "abort" the recursive edit.  This is like exiting, but
  649. also quits the unfinished command immediately.  Use the command `C-]'
  650. (`abort-recursive-edit') for this.  *Note Quitting::.
  651.  
  652.    The mode line shows you when you are in a recursive edit by
  653. displaying square brackets around the parentheses that always surround
  654. the major and minor mode names.  Every window's mode line shows this,
  655. in the same way, since being in a recursive edit is true of Emacs as a
  656. whole rather than any particular buffer.
  657.  
  658.    It is possible to be in recursive edits within recursive edits.  For
  659. example, after typing `C-r' in a `query-replace', you might type a
  660. command that entered the debugger.  In such circumstances, two or more
  661. sets of square brackets appear in the mode line.  Exiting the inner
  662. recursive edit (such as, with the debugger `c' command) would resume
  663. the command where it called the debugger.  After the end of this
  664. command, you would be able to exit the first recursive edit.  Aborting
  665. also gets out of only one level of recursive edit; it returns
  666. immediately to the command level of the previous recursive edit.  So
  667. you could immediately abort that one too.
  668.  
  669.    Alternatively, the command `M-x top-level' aborts all levels of
  670. recursive edits, returning immediately to the top level command reader.
  671.  
  672.    The text being edited inside the recursive edit need not be the
  673. same text that you were editing at top level.  It depends on what the
  674. recursive edit is for.  If the command that invokes the recursive edit
  675. selects a different buffer first, that is the buffer you will edit
  676. recursively.  In any case, you can switch buffers within the recursive
  677. edit in the normal manner (as long as the buffer-switching keys have
  678. not been rebound).  You could probably do all the rest of your editing
  679. inside the recursive edit, visiting files and all.  But this could
  680. have surprising effects (such as stack overflow) from time to time. 
  681. So remember to exit or abort the recursive edit when you no longer
  682. need it.
  683.  
  684.    In general, GNU Emacs tries to avoid using recursive edits.  It is
  685. usually preferable to allow the user to switch among the possible
  686. editing modes in any order he likes.  With recursive edits, the only
  687. way to get to another state is to go "back" to the state that the
  688. recursive edit was invoked from.
  689.  
  690. 
  691. File: emacs,  Node: Narrowing,  Next: Sorting,  Prev: Recursive Edit,  Up: Top
  692.  
  693. Narrowing
  694. =========
  695.  
  696.    "Narrowing" means focusing in on some portion of the buffer, making
  697. the rest temporarily invisible and inaccessible.  Cancelling the
  698. narrowing, and making the entire buffer once again visible, is called
  699. "widening".  The amount of narrowing in effect in a buffer at any time
  700. is called the buffer's "restriction".
  701.  
  702. `C-x n'
  703.      Narrow down to between point and mark (`narrow-to-region').
  704.  
  705. `C-x w'
  706.      Widen to make the entire buffer visible again (`widen').
  707.  
  708.    When you have narrowed down to a part of the buffer, that part
  709. appears to be all there is.  You can't see the rest, you can't move
  710. into it (motion commands won't go outside the visible part), you can't
  711. change it in any way.  However, it is not gone, and if you save the
  712. file all the invisible text will be saved.  In addition to sometimes
  713. making it easier to concentrate on a single subroutine or paragraph by
  714. eliminating clutter, narrowing can be used to restrict the range of
  715. operation of a replace command or repeating keyboard macro.  The word
  716. `Narrow' appears in the mode line whenever narrowing is in effect.
  717.  
  718.    The primary narrowing command is `C-x n' (`narrow-to-region').  It
  719. sets the current buffer's restrictions so that the text in the current
  720. region remains visible but all text before the region or after the
  721. region is invisible.  Point and mark do not change.
  722.  
  723.    Because narrowing can easily confuse users who do not understand it,
  724. `narrow-to-region' is normally a disabled command.  Attempting to use
  725. this command asks for confirmation and gives you the option of
  726. enabling it; once you enable the command, confirmation will no longer
  727. be required for it.  *Note Disabling::.
  728.  
  729.    The way to undo narrowing is to widen with `C-x w' (`widen').  This
  730. makes all text in the buffer accessible again.
  731.  
  732.    You can get information on what part of the buffer you are narrowed
  733. down to using the `C-x =' command.  *Note Position Info::.
  734.  
  735. 
  736. File: emacs,  Node: Sorting,  Next: Shell,  Prev: Narrowing,  Up: Top
  737.  
  738. Sorting Text
  739. ============
  740.  
  741.    Emacs provides several commands for sorting text in the buffer.  All
  742. operate on the contents of the region (the text between point and the
  743. mark).  They divide the text of the region into many "sort records",
  744. identify a "sort key" for each record, and then reorder the records
  745. into the order determined by the sort keys.  The records are ordered so
  746. that their keys are in alphabetical order, or, for numeric sorting, in
  747. numeric order.  In alphabetic sorting, all upper case letters `A'
  748. through `Z' come before lower case `a', in accord with the ASCII
  749. character sequence.
  750.  
  751.    The various sort commands differ in how they divide the text into
  752. sort records and in which part of each record is used as the sort key.
  753.  Most of the commands make each line a separate sort record, but some
  754. commands use paragraphs or pages as sort records.  Most of the sort
  755. commands use each entire sort record as its own sort key, but some use
  756. only a portion of the record as the sort key.
  757.  
  758. `M-x sort-lines'
  759.      Divide the region into lines, and sort by comparing the entire
  760.      text of a line.  A prefix argument means sort into descending
  761.      order.
  762.  
  763. `M-x sort-paragraphs'
  764.      Divide the region into paragraphs, and sort by comparing the
  765.      entire text of a paragraph (except for leading blank lines).  A
  766.      prefix argument means sort into descending order.
  767.  
  768. `M-x sort-pages'
  769.      Divide the region into pages, and sort by comparing the entire
  770.      text of a page (except for leading blank lines).  A prefix
  771.      argument means sort into descending order.
  772.  
  773. `M-x sort-fields'
  774.      Divide the region into lines, and sort by comparing the contents
  775.      of one field in each line.  Fields are defined as separated by
  776.      whitespace, so the first run of consecutive non-whitespace
  777.      characters in a line constitutes field 1, the second such run
  778.      constitutes field 2, etc.
  779.  
  780.      You specify which field to sort by with a numeric argument: 1 to
  781.      sort by field 1, etc.  A negative argument means sort into
  782.      descending order.  Thus, minus 2 means sort by field 2 in
  783.      reverse-alphabetical order.
  784.  
  785. `M-x sort-numeric-fields'
  786.      Like `M-x sort-fields' except the specified field is converted to
  787.      a number for each line, and the numbers are compared.  `10' comes
  788.      before `2' when considered as text, but after it when considered
  789.      as a number.
  790.  
  791. `M-x sort-columns'
  792.      Like `M-x sort-fields' except that the text within each line used
  793.      for comparison comes from a fixed range of columns.  See below
  794.      for an explanation.
  795.  
  796.    For example, if the buffer contains
  797.  
  798.      On systems where clash detection (locking of files being edited) is
  799.      implemented, Emacs also checks the first time you modify a buffer
  800.      whether the file has changed on disk since it was last visited or
  801.      saved.  If it has, you are asked to confirm that you want to change
  802.      the buffer.
  803.  
  804. then if you apply `M-x sort-lines' to the entire buffer you get
  805.  
  806.      On systems where clash detection (locking of files being edited) is
  807.      implemented, Emacs also checks the first time you modify a buffer
  808.      saved.  If it has, you are asked to confirm that you want to change
  809.      the buffer.
  810.      whether the file has changed on disk since it was last visited or
  811.  
  812. where the upper case `O' comes before all lower case letters.  If you
  813. apply instead `C-u 2 M-x sort-fields' you get
  814.  
  815.      implemented, Emacs also checks the first time you modify a buffer
  816.      saved.  If it has, you are asked to confirm that you want to change
  817.      the buffer.
  818.      On systems where clash detection (locking of files being edited) is
  819.      whether the file has changed on disk since it was last visited or
  820.  
  821. where the sort keys were `Emacs', `If', `buffer', `systems' and `the'.
  822.  
  823.    `M-x sort-columns' requires more explanation.  You specify the
  824. columns by putting point at one of the columns and the mark at the
  825. other column.  Because this means you cannot put point or the mark at
  826. the beginning of the first line to sort, this command uses an unusual
  827. definition of `region': all of the line point is in is considered part
  828. of the region, and so is all of the line the mark is in.
  829.  
  830.    For example, to sort a table by information found in columns 10 to
  831. 15, you could put the mark on column 10 in the first line of the
  832. table, and point on column 15 in the last line of the table, and then
  833. use this command.  Or you could put the mark on column 15 in the first
  834. line and point on column 10 in the last line.
  835.  
  836.    This can be thought of as sorting the rectangle specified by point
  837. and the mark, except that the text on each line to the left or right
  838. of the rectangle moves along with the text inside the rectangle. 
  839. *Note Rectangles::.
  840.  
  841. 
  842. File: emacs,  Node: Shell,  Next: Hardcopy,  Prev: Sorting,  Up: Top
  843.  
  844. Running Shell Commands from Emacs
  845. =================================
  846.  
  847.    Emacs has commands for passing single command lines to inferior
  848. shell processes; it can also run a shell interactively with input and
  849. output to an Emacs buffer `*shell*'.
  850.  
  851. `M-!'
  852.      Run a specified shell command line and display the output
  853.      (`shell-command').
  854.  
  855. `M-|'
  856.      Run a specified shell command line with region contents as input;
  857.      optionally replace the region with the output
  858.      (`shell-command-on-region').
  859.  
  860. `M-x shell'
  861.      Run a subshell with input and output through an Emacs buffer. 
  862.      You can then give commands interactively.
  863.  
  864. * Menu:
  865.  
  866. * Single Shell::         How to run one shell command and return.
  867. * Interactive Shell::    Permanent shell taking input via Emacs.
  868. * Shell Mode::           Special Emacs commands used with permanent shell.
  869.  
  870. 
  871. File: emacs,  Node: Single Shell,  Next: Interactive Shell,  Prev: Shell,  Up: Shell
  872.  
  873. Single Shell Commands
  874. ---------------------
  875.  
  876.    `M-!' (`shell-command') reads a line of text using the minibuffer
  877. and creates an inferior shell to execute the line as a command. 
  878. Standard input from the command comes from the null device.  If the
  879. shell command produces any output, the output goes into an Emacs
  880. buffer named `*Shell Command Output*', which is displayed in another
  881. window but not selected.  A numeric argument, as in `M-1 M-!', directs
  882. this command to insert any output into the current buffer.  In that
  883. case, point is left before the output and the mark is set after the
  884. output.
  885.  
  886.    `M-|' (`shell-command-on-region') is like `M-!' but passes the
  887. contents of the region as input to the shell command, instead of no
  888. input.  If a numeric argument is used, meaning insert output in the
  889. current buffer, then the old region is deleted first and the output
  890. replaces it as the contents of the region.
  891.  
  892.    Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
  893. use.  This variable is initialized based on your `SHELL' environment
  894. variable when Emacs is started.  If the file name does not specify a
  895. directory, the directories in the list `exec-path' are searched; this
  896. list is initialized based on the environment variable `PATH' when
  897. Emacs is started.  Your `.emacs' file can override either or both of
  898. these default initializations.
  899.  
  900.    With `M-!' and `M-|', Emacs has to wait until the shell command
  901. completes.  You can quit with `C-g'; that terminates the shell command.
  902.  
  903. 
  904. File: emacs,  Node: Interactive Shell,  Next: Shell Mode,  Prev: Single Shell,  Up: Shell
  905.  
  906. Interactive Inferior Shell
  907. --------------------------
  908.  
  909.    To run a subshell interactively, putting its typescript in an Emacs
  910. buffer, use `M-x shell'.  This creates (or reuses) a buffer named
  911. `*shell*' and runs a subshell with input coming from and output going
  912. to that buffer.  That is to say, any "terminal output" from the
  913. subshell will go into the buffer, advancing point, and any "terminal
  914. input" for the subshell comes from text in the buffer.  To give input
  915. to the subshell, go to the end of the buffer and type the input,
  916. terminated by RET.
  917.  
  918.    Emacs does not wait for the subshell to do anything.  You can switch
  919. windows or buffers and edit them while the shell is waiting, or while
  920. it is running a command.  Output from the subshell waits until Emacs
  921. has time to process it; this happens whenever Emacs is waiting for
  922. keyboard input or for time to elapse.
  923.  
  924.    If you would like multiple subshells, change the name of buffer
  925. `*shell*' to something different by using `M-x rename-buffer'.  The
  926. next use of `M-x shell' will create a new buffer `*shell*' with its
  927. own subshell.  By renaming this buffer as well you can create a third
  928. one, and so on.  All the subshells run independently and in parallel.
  929.  
  930.    The file name used to load the subshell is the value of the variable
  931. `explicit-shell-file-name', if that is non-`nil'.  Otherwise, the
  932. environment variable `ESHELL' is used, or the environment variable
  933. `SHELL' if there is no `ESHELL'.  If the file name specified is
  934. relative, the directories in the list `exec-path' are searched (*note
  935. Single Shell Commands: Single Shell.).
  936.  
  937.    As soon as the subshell is started, it is sent as input the
  938. contents of the file `~/.emacs_SHELLNAME', if that file exists, where
  939. SHELLNAME is the name of the file that the shell was loaded from.  For
  940. example, if you use `csh', the file sent to it is `~/.emacs_csh'.
  941.  
  942.    `cd', `pushd' and `popd' commands given to the inferior shell are
  943. watched by Emacs so it can keep the `*shell*' buffer's default
  944. directory the same as the shell's working directory.  These commands
  945. are recognized syntactically by examining lines of input that are
  946. sent.  If you use aliases for these commands, you can tell Emacs to
  947. recognize them also.  For example, if the value of the variable
  948. `shell-pushd-regexp' matches the beginning of a shell command line,
  949. that line is regarded as a `pushd' command.  Change this variable when
  950. you add aliases for `pushd'.  Likewise, `shell-popd-regexp' and
  951. `shell-cd-regexp' are used to recognize commands with the meaning of
  952. `popd' and `cd'.  These commands are recognized only at the beginning
  953. of a shell command line.
  954.  
  955.    If Emacs gets an error while trying to handle what it believes is a
  956. `cd', `pushd' or `popd' command, and the value of
  957. `shell-set-directory-error-hook' is non-`nil', that value is called as
  958. a function with no arguments.
  959.  
  960. 
  961. File: emacs,  Node: Shell Mode,  Prev: Interactive Shell,  Up: Shell
  962.  
  963. Shell Mode
  964. ----------
  965.  
  966.    The shell buffer uses Shell mode, which defines several special keys
  967. attached to the `C-c' prefix.  They are chosen to resemble the usual
  968. editing and job control characters present in shells that are not under
  969. Emacs, except that you must type `C-c' first.  Here is a complete list
  970. of the special key bindings of Shell mode:
  971.  
  972. `RET'
  973.      At end of buffer send line as input; otherwise, copy current line
  974.      to end of buffer and send it (`send-shell-input').  When a line
  975.      is copied, any text at the beginning of the line that matches the
  976.      variable `shell-prompt-pattern' is left out; this variable's
  977.      value should be a regexp string that matches the prompts that you
  978.      use in your subshell.
  979.  
  980. `C-c C-d'
  981.      Send end-of-file as input, probably causing the shell or its
  982.      current subjob to finish (`shell-send-eof').
  983.  
  984. `C-c C-u'
  985.      Kill all text that has yet to be sent as input
  986.      (`kill-shell-input').
  987.  
  988. `C-c C-w'
  989.      Kill a word before point (`backward-kill-word').
  990.  
  991. `C-c C-c'
  992.      Interrupt the shell or its current subjob if any
  993.      (`interrupt-shell-subjob').
  994.  
  995. `C-c C-z'
  996.      Stop the shell or its current subjob if any (`stop-shell-subjob').
  997.  
  998. `C-c C-\'
  999.      Send quit signal to the shell or its current subjob if any
  1000.      (`quit-shell-subjob').
  1001.  
  1002. `C-c C-o'
  1003.      Delete last batch of output from shell (`kill-output-from-shell').
  1004.  
  1005. `C-c C-r'
  1006.      Scroll top of last batch of output to top of window
  1007.      (`show-output-from-shell').
  1008.  
  1009. `C-c C-y'
  1010.      Copy the previous bunch of shell input, and insert it into the
  1011.      buffer before point (`copy-last-shell-input').  No final newline
  1012.      is inserted, and the input copied is not resubmitted until you
  1013.      type RET.
  1014.  
  1015. 
  1016. File: emacs,  Node: Hardcopy,  Next: Dissociated Press,  Prev: Shell,  Up: Top
  1017.  
  1018. Hardcopy Output
  1019. ===============
  1020.  
  1021.    The Emacs commands for making hardcopy derive their names from the
  1022. Unix commands `print' and `lpr'.
  1023.  
  1024. `M-x print-buffer'
  1025.      Print hardcopy of current buffer using Unix command `print' (`lpr
  1026.      -p').  This makes page headings containing the file name and page
  1027.      number.
  1028.  
  1029. `M-x lpr-buffer'
  1030.      Print hardcopy of current buffer using Unix command `lpr'.  This
  1031.      makes no page headings.
  1032.  
  1033. `M-x print-region'
  1034.      Like `print-buffer' but prints only the current region.
  1035.  
  1036. `M-x lpr-region'
  1037.      Like `lpr-buffer' but prints only the current region.
  1038.  
  1039.    All the hardcopy commands pass extra switches to the `lpr' program
  1040. based on the value of the variable `lpr-switches'.  Its value should
  1041. be a list of strings, each string a switch starting with `-'.  For
  1042. example, the value could be `("-Pfoo")' to print on printer `foo'.
  1043.  
  1044. 
  1045. File: emacs,  Node: Dissociated Press,  Next: Amusements,  Prev: Hardcopy,  Up: Top
  1046.  
  1047. Dissociated Press
  1048. =================
  1049.  
  1050.    `M-x dissociated-press' is a command for scrambling a file of text
  1051. either word by word or character by character.  Starting from a buffer
  1052. of straight English, it produces extremely amusing output.  The input
  1053. comes from the current Emacs buffer.  Dissociated Press writes its
  1054. output in a buffer named `*Dissociation*', and redisplays that buffer
  1055. after every couple of lines (approximately) to facilitate reading it.
  1056.  
  1057.    `dissociated-press' asks every so often whether to continue
  1058. operating.  Answer `n' to stop it.  You can also stop at any time by
  1059. typing `C-g'.  The dissociation output remains in the `*Dissociation*'
  1060. buffer for you to copy elsewhere if you wish.
  1061.  
  1062.    Dissociated Press operates by jumping at random from one point in
  1063. the buffer to another.  In order to produce plausible output rather
  1064. than gibberish, it insists on a certain amount of overlap between the
  1065. end of one run of consecutive words or characters and the start of the
  1066. next.  That is, if it has just printed out `president' and then
  1067. decides to jump to a different point in the file, it might spot the
  1068. `ent' in `pentagon' and continue from there, producing
  1069. `presidentagon'.  Long sample texts produce the best results.
  1070.  
  1071.    A positive argument to `M-x dissociated-press' tells it to operate
  1072. character by character, and specifies the number of overlap
  1073. characters.  A negative argument tells it to operate word by word and
  1074. specifies the number of overlap words.  In this mode, whole words are
  1075. treated as the elements to be permuted, rather than characters.  No
  1076. argument is equivalent to an argument of two.  For your
  1077. againformation, the output goes only into the buffer `*Dissociation*'.
  1078.  The buffer you start with is not changed.
  1079.  
  1080.    Dissociated Press produces nearly the same results as a Markov chain
  1081. based on a frequency table constructed from the sample text.  It is,
  1082. however, an independent, ignoriginal invention.  Dissociated Press
  1083. techniquitously copies several consecutive characters from the sample
  1084. between random choices, whereas a Markov chain would choose randomly
  1085. for each word or character.  This makes for more plausible sounding
  1086. results, and runs faster.
  1087.  
  1088.    It is a mustatement that too much use of Dissociated Press can be a
  1089. developediment to your real work.  Sometimes to the point of outragedy. 
  1090. And keep dissociwords out of your documentation, if you want it to be
  1091. well userenced and properbose.  Have fun.  Your buggestions are
  1092. welcome.
  1093.  
  1094. 
  1095. File: emacs,  Node: Amusements,  Next: Emulation,  Prev: Dissociated Press,  Up: Top
  1096.  
  1097. Other Amusements
  1098. ================
  1099.  
  1100.    If you are a little bit bored, you can try `M-x hanoi'.  If you are
  1101. considerably bored, give it a numeric argument.  If you are very very
  1102. bored, try an argument of 9.  Sit back and watch.
  1103.  
  1104.    When you are frustrated, try the famous Eliza program.  Just do
  1105. `M-x doctor'.  End each input by typing `RET' twice.
  1106.  
  1107.    When you are feeling strange, type `M-x yow'.
  1108.  
  1109. 
  1110. File: emacs,  Node: Emulation,  Next: Customization,  Prev: Amusements,  Up: Top
  1111.  
  1112. Emulation
  1113. =========
  1114.  
  1115.    GNU Emacs can be programmed to emulate (more or less) most other
  1116. editors.  Standard facilities can emulate these:
  1117.  
  1118. EDT (DEC VMS editor)
  1119.      Turn on EDT emulation with `M-x edt-emulation-on'.  `M-x
  1120.      edt-emulation-off' restores normal Emacs command bindings.
  1121.  
  1122.      Most of the EDT emulation commands are keypad keys, and most
  1123.      standard Emacs key bindings are still available.  The EDT
  1124.      emulation rebindings are done in the global keymap, so there is
  1125.      no problem switching buffers or major modes while in EDT
  1126.      emulation.
  1127.  
  1128. Gosling Emacs
  1129.      Turn on emulation of Gosling Emacs (aka Unipress Emacs) with `M-x
  1130.      set-gosmacs-bindings'.  This redefines many keys, mostly on the
  1131.      `C-x' and `ESC' prefixes, to work as they do in Gosmacs.  `M-x
  1132.      set-gnu-bindings' returns to normal GNU Emacs by rebinding the
  1133.      same keys to the definitions they had at the time `M-x
  1134.      set-gosmacs-bindings' was done.
  1135.  
  1136.      It is also possible to run Mocklisp code written for Gosling
  1137.      Emacs.  *Note Mocklisp::.
  1138.  
  1139. vi (Berkeley Unix editor)
  1140.      Turn on vi emulation with `M-x vi-mode'.  This is a major mode
  1141.      that replaces the previously established major mode.  All of the
  1142.      vi commands that, in real vi, enter "input" mode are programmed
  1143.      in the Emacs emulator to return to the previous major mode.  Thus,
  1144.      ordinary Emacs serves as vi's "input" mode.
  1145.  
  1146.      Because vi emulation works through major modes, it does not work
  1147.      to switch buffers during emulation.  Return to normal Emacs first.
  1148.  
  1149.      If you plan to use vi emulation much, you probably want to bind a
  1150.      key to the `vi-mode' command.
  1151.  
  1152. vi (alternate emulator)
  1153.      Another vi emulator said to resemble real vi more thoroughly is
  1154.      invoked by `M-x vip-mode'.  "Input" mode in this emulator is
  1155.      changed from ordinary Emacs so you can use ESC to go back to
  1156.      emulated vi command mode.  To get from emulated vi command mode
  1157.      back to ordinary Emacs, type `C-z'.
  1158.  
  1159.      This emulation does not work through major modes, and it is
  1160.      possible to switch buffers in various ways within the emulator. 
  1161.      It is not so necessary to assign a key to the command `vip-mode'
  1162.      as it is with `vi-mode' because terminating insert mode does not
  1163.      use it.
  1164.  
  1165.      For full information, see the long comment at the beginning of the
  1166.      source file, which is `lisp/vip.el' in the Emacs distribution.
  1167.  
  1168.    I am interested in hearing which vi emulator users prefer, as well
  1169. as in receiving more complete user documentation for either or both
  1170. emulators.  Warning: loading both at once may cause name conficts; no
  1171. one has checked.
  1172.  
  1173.