home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / os2 / e17info.zip / EMACS / 19.17 / INFO / EMACS-13 (.txt) < prev    next >
GNU Info File  |  1993-07-18  |  49KB  |  879 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Rmail Reply,  Next: Rmail Summary,  Prev: Rmail Labels,  Up: Rmail
  4. Sending Replies
  5. ===============
  6.    Rmail has several commands that use Mail mode to send outgoing mail.
  7. *Note Sending Mail::, for information on using Mail mode.  What are
  8. documented here are the special commands of Rmail for entering Mail
  9. mode.  Note that the usual keys for sending mail, `C-x m' and `C-x 4 m',
  10. are available in Rmail mode and work just as they usually do.
  11.      Send a message (`rmail-mail').
  12.      Continue editing already started outgoing message
  13.      (`rmail-continue').
  14.      Send a reply to the current Rmail message (`rmail-reply').
  15.      Forward current message to other users (`rmail-forward').
  16. `C-u f'
  17.      Resend the current message to other users (`rmail-resend').
  18. `M-m'
  19.      Try sending a bounced message a second time
  20.      (`rmail-retry-failure').
  21.    The most common reason to send a message while in Rmail is to reply
  22. to the message you are reading.  To do this, type `r' (`rmail-reply').
  23. This displays the `*mail*' buffer in another window, much like `C-x 4
  24. m', but preinitializes the `Subject', `To', `CC' and `In-reply-to'
  25. header fields based on the message you are replying to.  The `To' field
  26. is starts out as the address of the person who sent the message you
  27. received, and the `CC' field starts out with all the other recipients
  28. of that message.
  29.    You can exclude certain recipients from being placed automatically in
  30. the `CC', using the variable `rmail-dont-reply-to-names'.  Its value
  31. should be a regular expression (as a string); any recipient that the
  32. regular expression matches, is excluded from the `CC' field.  The
  33. default value matches your own name, and any name starting with
  34. `info-'.  (Those names are excluded because there is a convention of
  35. using them for large mailing lists to broadcast announcements.)
  36.    To omit the `CC' field completely for a particular reply, enter the
  37. reply command with a prefix argument: `C-u r'.
  38.    Once the `*mail*' buffer has been initialized, editing and sending
  39. the mail goes as usual (*note Sending Mail::.).  You can edit the
  40. presupplied header fields if they are not right for you.  You can also
  41. use the commands of Mail mode, including `C-c C-y' to yank in the
  42. message that you are replying to, and `C-c C-q' to fill what was thus
  43. yanked.  You can also switch to the Rmail buffer, select a different
  44. message, switch back, and yank the new current message.
  45.    Sometimes a message does not reach its destination.  Mailers usually
  46. send the failed message back to you, enclosed in a "failure message".
  47. The Rmail command `M-m' (`rmail-retry-failure') prepares to send the
  48. same message a second time: it sets up a `*mail*' buffer with the same
  49. text and header fields as before.  If you type `C-c C-c' right away,
  50. you send the message again exactly the same as the first time.
  51. Alternatively, you can edit the text or headers and then send it.
  52.    Another frequent reason to send mail in Rmail is to "forward" the
  53. current message to other users.  `f' (`rmail-forward') makes this easy
  54. by preinitializing the `*mail*' buffer with the current message as the
  55. text, and a subject designating a forwarded message.  All you have to
  56. do is fill in the recipients and send.  When you forward a message,
  57. recipients get a message which is "from" you, and which has the
  58. original message in its contents.
  59.    "Resending" is an alternative similar to forwarding; the difference
  60. is that resending sends a message that is "from" the original sender,
  61. just as it reached you--with a few added header fields `Resent-from'
  62. and `Resent-to' to indicate that it came via you.  To resend a message
  63. in Rmail, use `C-u f'.  (`f' runs `rmail-forward', which is programmed
  64. to invoke `rmail-resend' if you provide a numeric argument.)
  65.    The `m' (`rmail-mail') command is used to start editing an outgoing
  66. message that is not a reply.  It leaves the header fields empty.  Its
  67. only difference from `C-x 4 m' is that it makes the Rmail buffer
  68. accessible for `C-c C-y', just as `r' does.  Thus, `m' can be used to
  69. reply to or forward a message; it can do anything `r' or `f' can do.
  70.    The `c' (`rmail-continue') command resumes editing the `*mail*'
  71. buffer, to finish editing an outgoing message you were already
  72. composing, or to alter a message you have sent.
  73.    If you set the variable `rmail-mail-new-frame' to a non-`nil' value,
  74. then all the Rmail commands to start sending a message create a new
  75. frame to edit it in.  This frame is deleted when you send the message,
  76. or when you use the `Don't Send' item in the `Mail' menu.
  77. File: emacs,  Node: Rmail Summary,  Next: Rmail Editing,  Prev: Rmail Reply,  Up: Rmail
  78. Summaries
  79. =========
  80.    A "summary" is a buffer containing one line per message to give you
  81. an overview of the mail in an Rmail file.  Each line shows the message
  82. number, the sender, the labels, and the subject.  When the summary
  83. buffer is selected, you can use almost all Rmail commands; these apply
  84. to the message described by the current line of the summary.  Moving
  85. point in the summary buffer selects messages as you move to their
  86. summary lines.
  87.    A summary buffer applies to a single Rmail file only; if you are
  88. editing multiple Rmail files, each one has its own summary buffer (if
  89. you have asked for one).  The summary buffer name is made by appending
  90. `-summary' to the Rmail buffer's name.  Normally only one summary
  91. buffer is displayed at a time.
  92. * Menu:
  93. * Rmail Make Summary::  Making various sorts of summaries.
  94. * Rmail Summary Edit::  Manipulating messages from the summary.
  95. File: emacs,  Node: Rmail Make Summary,  Next: Rmail Summary Edit,  Up: Rmail Summary
  96. Making Summaries
  97. ----------------
  98.    Here are the commands to create a summary for the current Rmail file.
  99. Once the Rmail file has a summary buffer, changes in the Rmail file
  100. (such as deleting or expunging messages, and getting new mail)
  101. automatically update the summary.
  102. `C-M-h'
  103.      Summarize all messages (`rmail-summary').
  104. `l LABELS RET'
  105. `C-M-l LABELS RET'
  106.      Summarize message that have one or more of the specified labels
  107.      (`rmail-summary-by-labels').
  108. `C-M-r RCPTS RET'
  109.      Summarize messages that have one or more of the specified
  110.      recipients (`rmail-summary-by-recipients').
  111. `C-M-t TOPIC RET'
  112.      Summarize messages that have a match for the specified regexp
  113.      TOPIC in their subjects (`rmail-summary-by-topic').
  114.    The `h' or `C-M-h' (`rmail-summary') command fills the summary buffer
  115. for the current Rmail file with a summary of all the messages in the
  116. file.  It then displays and selects the summary buffer in another
  117. window.
  118.    `C-M-l LABELS RET' (`rmail-summary-by-labels') makes a partial
  119. summary mentioning only the messages that have one or more of the
  120. labels LABELS.  LABELS should contain label names separated by commas.
  121.    `C-M-r RCPTS RET' (`rmail-summary-by-recipients') makes a partial
  122. summary mentioning only the messages that have one or more of the
  123. recipients RCPTS.  RCPTS should contain mailing addresses separated by
  124. commas.
  125.    `C-M-t TOPIC RET' (`rmail-summary-by-topic') makes a partial summary
  126. mentioning only the messages whose subjects have a match for the
  127. regular expression TOPIC.
  128.    Note that there is only one summary buffer for any Rmail file;
  129. making one kind of summary discards any previously made summary.
  130. File: emacs,  Node: Rmail Summary Edit,  Prev: Rmail Make Summary,  Up: Rmail Summary
  131. Editing in Summaries
  132. --------------------
  133.    You can use the Rmail summary buffer to do almost anything you can do
  134. in the Rmail buffer itself.  In fact, once you have a summary buffer,
  135. there's no need to switch back to the Rmail buffer.
  136.    You can select and display various messages in the Rmail buffer, from
  137. the summary buffer, just by moving point in the summary buffer to
  138. different lines.  It doesn't matter what Emacs command you use to move
  139. point; whichever line point is on at the end of the command, that
  140. message is selected in the Rmail buffer.
  141.    Almost all Rmail commands work in the summary buffer as well as in
  142. the Rmail buffer.  Thus, `d' in the summary buffer deletes the current
  143. message, `u' undeletes, and `x' expunges.  `o' and `C-o' output the
  144. current message to a file; `r' starts a reply to it.  You can scroll
  145. the current message while remaining in the summary buffer using SPC and
  146.    The Rmail commands to move between messages also work in the summary
  147. buffer, but with a twist: they move through the set of messages included
  148. in the summary.  They also redisplay the Rmail buffer on the screen
  149. (unlike cursor motion commands, which update the contents of the Rmail
  150. buffer but don't display it in a window unless it already appears).
  151. Here is a list of these commands:
  152.      Move to next line, skipping lines saying `deleted', and select its
  153.      message.
  154.      Move to previous line, skipping lines saying `deleted', and select
  155.      its message.
  156. `M-n'
  157.      Move to next line and select its message.
  158. `M-p'
  159.      Move to previous line and select its message.
  160.      Move to the last line, and select its message.
  161.      Move to the first line, and select its message.
  162. `M-s PATTERN RET'
  163.      Search through messages for PATTERN starting with the current
  164.      message; select the message found, and move point in the summary
  165.      buffer to that message's line.
  166.    Deletion, undeletion, and getting new mail, and even selection of a
  167. different message all update the summary buffer when you do them in the
  168. Rmail buffer.  If the variable `rmail-redisplay-summary' is non-`nil',
  169. these actions also bring the summary buffer back onto the screen.
  170.    When you are finished using the summary, type `w'
  171. (`rmail-summary-wipe') to kill the summary buffer's window.  You can
  172. also exit Rmail while in the summary.  `q' (`rmail-summary-quit') kills
  173. the summary window, then saves the Rmail file and switches to another
  174. buffer.
  175. File: emacs,  Node: Rmail Editing,  Next: Rmail Digest,  Prev: Rmail Summary,  Up: Rmail
  176. Editing Within a Message
  177. ========================
  178.    Rmail mode provides a few special commands for moving within and
  179. editing the current message.  In addition, the usual Emacs commands are
  180. available (except for a few, such as `C-M-n' and `C-M-h', that are
  181. redefined by Rmail for other purposes).  However, the Rmail buffer is
  182. normally read-only, and to alter it you must use the Rmail command `e'
  183. described below.
  184.      Toggle display of original headers (`rmail-toggle-headers').
  185.      Edit current message (`rmail-edit-current-message').
  186.    Rmail reformats the header of each message before displaying it.
  187. Normally this involves deleting most header fields, on the grounds that
  188. they are not interesting.  The variable `rmail-ignored-headers'
  189. specifies a regexp that matches the header fields to discard in this
  190. way.  The original headers are saved permanently, and to see what they
  191. look like, use the `t' command (`rmail-toggle-headers').  This discards
  192. the reformatted headers of the current message and displays it with the
  193. original headers.  Repeating `t' reformats the message again.
  194. Selecting the message again also reformats.
  195.    The Rmail buffer is normally read only, and most of the characters
  196. you would type to modify it (including most letters) are redefined as
  197. Rmail commands.  This is usually not a problem since it is rare to want
  198. to change the text of a message.  When you do want to do this, the way
  199. is to type `e' (`rmail-edit-current-message'), which changes from Rmail
  200. mode into Rmail Edit mode, another major mode which is nearly the same
  201. as Text mode.  The mode line indicates this change.
  202.    In Rmail Edit mode, letters insert themselves as usual and the Rmail
  203. commands are not available.  When you are finished editing the message
  204. and are ready to go back to Rmail, type `C-c C-c', which switches back
  205. to Rmail mode.  Alternatively, you can return to Rmail mode but cancel
  206. all the editing that you have done by typing `C-c C-]'.
  207.    Entering Rmail Edit mode runs the hook `text-mode-hook'; then it
  208. runs the hook `rmail-edit-mode-hook' (*note Hooks::.).  It adds the
  209. attribute `edited' to the message.
  210. File: emacs,  Node: Rmail Digest,  Next: Out of Rmail,  Prev: Rmail Editing,  Up: Rmail
  211. Digest Messages
  212. ===============
  213.    A "digest message" is a message which exists to contain and carry
  214. several other messages.  Digests are used on some moderated mailing
  215. lists; all the messages that arrive for the list during a period of time
  216. such as one day are put inside a single digest which is then sent to the
  217. subscribers.  Transmitting the single digest uses much less computer
  218. time than transmitting the individual messages even though the total
  219. size is the same, because the per-message overhead in network mail
  220. transmission is considerable.
  221.    When you receive a digest message, the most convenient way to read
  222. it is to "undigestify" it: to turn it back into many individual
  223. messages.  Then you can read and delete the individual messages as it
  224. suits you.
  225.    To do this, type `M-x undigestify-rmail-message' after selecting the
  226. digest message.  This extracts the submessages as separate Rmail
  227. messages, and inserts them following the digest.  The digest message
  228. itself is flagged as deleted.
  229. File: emacs,  Node: Out of Rmail,  Next: Rmail Rot13,  Prev: Rmail Digest,  Up: Rmail
  230. Converting an Rmail File to Mailbox Format
  231. ==========================================
  232.    The command `M-x unrmail' converts a file in Rmail format to
  233. ordinary system mailbox format, so that you can use it with other
  234. mail-editing tools.  You must specify two arguments, the name of the
  235. Rmail file and the name to use for the converted file.  `M-x unrmail'
  236. does not alter the Rmail file itself.
  237. File: emacs,  Node: Rmail Rot13,  Prev: Out of Rmail,  Up: Rmail
  238. Reading Rot13 Messages
  239. ======================
  240.    Mailing list messages that might offend some readers are sometimes
  241. encoded in a simple code called "rot13"--so named because it rotates
  242. the alphabet by 13 letters.  This code is not for secrecy, as it
  243. provides none; rather, it enables those who might be offended to avoid
  244. ever seeing the real text of the message.
  245.    To view a buffer using the rot13 code, use the command `M-x
  246. rot13-other-window'.  This displays the current buffer in another window
  247. which applies the code when displaying the text.
  248. File: emacs,  Node: Dired,  Next: Calendar/Diary,  Prev: Rmail,  Up: Top
  249. Dired, the Directory Editor
  250. ***************************
  251.    Dired makes an Emacs buffer containing a listing of a directory, and
  252. optionally some of its subdirectories as well.  You can use the normal
  253. Emacs commands to move around in this buffer, and special Dired commands
  254. to operate on the files listed.
  255. * Menu:
  256. * Enter: Dired Enter.         How to invoke Dired.
  257. * Commands: Dired Commands.   Commands in the Dired buffer.
  258. * Deletion: Dired Deletion.   Deleting files with Dired.
  259. * Visit: Dired Visiting.      Other file operations through Dired.
  260. * Marks vs Flags::          Flagging for deletion vs marking.
  261. * Operating on Files::          How to copy, rename, print, compress, etc.
  262.                     either one file or several files.
  263. * Shell Commands in Dired::   Running a shell command on the marked files.
  264. * Transforming File Names::   Using patterns to rename multiple files.
  265. * Comparison in Dired::          Running `diff' by way of Dired.
  266. * Subdirectories in Dired::   Adding subdirectories to the Dired buffer.
  267. * Subdirectory Motion::          Moving across subdirectories, and up and down.
  268. * Hiding Subdirectories::     Making subdirectories visible or invisible.
  269. * Updating: Dired Updating.   Discarding lines for files of no interest.
  270. * Find: Dired and Find.          Using `find' to choose the files for Dired.
  271. File: emacs,  Node: Dired Enter,  Next: Dired Commands,  Up: Dired
  272. Entering Dired
  273. ==============
  274.    To invoke Dired, do `C-x d' or `M-x dired'.  The command reads a
  275. directory name or wildcard file name pattern as a minibuffer argument
  276. to specify which files to list.  Where `dired' differs from
  277. `list-directory' is in putting the buffer into Dired mode so that the
  278. special commands of Dired are available.
  279.    The variable `dired-listing-switches' specifies the options to give
  280. to `ls' for listing directory; this string *must* contain `-l'.  If you
  281. use a numeric prefix argument with the `dired' command, you can specify
  282. the `ls' switches with the minibuffer after you finish entering the
  283. directory specification.
  284.    To display the Dired buffer in another window rather than in the
  285. selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x
  286. File: emacs,  Node: Dired Commands,  Next: Dired Deletion,  Prev: Dired Enter,  Up: Dired
  287. Commands in the Dired Buffer
  288. ============================
  289.    The Dired buffer is "read-only", and inserting text in it is not
  290. useful, so ordinary printing characters such as `d' and `x' are used
  291. for special Dired commands.  Some Dired commands "mark" or "flag" the
  292. "current file" (that is, the file on the current line); other commands
  293. operate on the marked files or on the flagged files.
  294.    All the usual Emacs cursor motion commands are available in Dired
  295. buffers.  Some special purpose cursor motion commands are also
  296. provided.  The keys `C-n' and `C-p' are redefined to put the cursor at
  297. the beginning of the file name on the line, rather than at the
  298. beginning of the line.
  299.    For extra convenience, SPC and `n' in Dired are equivalent to `C-n'.
  300. `p' is equivalent to `C-p'.  (Moving by lines is so common in Dired
  301. that it deserves to be easy to type.)  DEL (move up and unflag) is
  302. often useful simply for moving up.
  303. File: emacs,  Node: Dired Deletion,  Next: Dired Visiting,  Prev: Dired Commands,  Up: Dired
  304. Deleting Files with Dired
  305. =========================
  306.    The primary use of Dired is to "flag" files for deletion and then
  307. delete the files previously flagged.
  308.      Flag this file for deletion.
  309.      Remove deletion flag on this line.
  310. `DEL'
  311.      Move point to previous line and remove the deletion flag on that
  312.      line.
  313.      Delete the files that are flagged for deletion.
  314.      Flag all auto-save files (files whose names start and end with `#')
  315.      for deletion (*note Auto Save::.).
  316.      Flag all backup files (files whose names end with `~') for deletion
  317.      (*note Backup::.).
  318. `. (Period)'
  319.      Flag excess numeric backup files for deletion.  The oldest and
  320.      newest few backup files of any one file are exempt; the middle
  321.      ones are flagged.
  322. `% d REGEXP RET'
  323.      Flag for deletion all files whose names match the regular
  324.      expression REGEXP (`dired-flag-files-regexp').  This is just like
  325.      `% m' except that it uses `D' instead of `*' to mark the files.
  326.      Only the non-directory part of the file name is used in matching.
  327.      Use `^' and `$' to anchor matches.  Exclude subdirectories by
  328.      hiding them (*note Hiding Subdirectories::.).
  329.    You can flag a file for deletion by moving to the line describing the
  330. file and typing `d'.  The deletion flag is visible as a `D' at the
  331. beginning of the line.  This command moves point to the beginning of
  332. the next line, so that repeated `d' commands flag successive files.
  333.    The files are flagged for deletion rather than deleted immediately to
  334. reduce the danger of deleting a file accidentally.  Until you direct
  335. Dired to expunge the flagged files, you can remove deletion flags using
  336. the commands `u' and DEL.  `u' works just like `d', but removes flags
  337. rather than making flags.  DEL moves upward, removing flags; it is like
  338. `u' with numeric argument automatically negated.
  339.    To delete the flagged files, type `x' (`dired-expunge').  This
  340. command first displays a list of all the file names flagged for
  341. deletion, and requests confirmation with `yes'.  Once you confirm, `x'
  342. deletes all the flagged files, then deletes their lines from the text
  343. of the Dired buffer.  The shortened Dired buffer remains selected.
  344.    If you answer `no' or quit with `C-g' when asked to confirm, you
  345. return immediately to Dired, with the deletion flags still present in
  346. the buffer, and no files actually deleted.
  347.    The `#', `~' and `.' commands flag many files for deletion, based on
  348. their file names.  These commands are useful precisely because they do
  349. not actually delete any files; you can remove the deletion flags from
  350. any flagged files that you really wish to keep.
  351.    `#' flags for deletion all files whose names look like auto-save
  352. files (*note Auto Save::.)--that is, files whose names begin and end
  353. with `#'.  `~' flags for deletion all files whose names say they are
  354. backup files (*note Backup::.)--that is, whose names end in `~'.
  355.    `.' (Period) flags just some of the backup files for deletion: all
  356. but the oldest few and newest few backups of any one file.  Normally
  357. `dired-kept-versions' (*not* `kept-new-versions'; that applies only
  358. when saving) specifies the number of newest versions of each file to
  359. keep, and `kept-old-versions' specifies the number of oldest versions
  360. to keep.
  361.    Period with a positive numeric argument, as in `C-u 3 .', specifies
  362. the number of newest versions to keep, overriding
  363. `dired-kept-versions'.  A negative numeric argument overrides
  364. `kept-old-versions', using minus the value of the argument to specify
  365. the number of oldest versions of each file to keep.
  366.    The `% d' command flags all files whose names match a specified
  367. regular expression (`dired-flag-files-regexp').  Only the non-directory
  368. part of the file name is used in matching.  You can use `^' and `$' to
  369. anchor matches.  You can exclude subdirectories by hiding them (*note
  370. Hiding Subdirectories::.).
  371. File: emacs,  Node: Dired Visiting,  Next: Marks vs Flags,  Prev: Dired Deletion,  Up: Dired
  372. Visiting Files in Dired
  373. =======================
  374.    There are several Dired commands for visiting or examining the files
  375. listed in the Dired buffer.  All of them apply to the current line's
  376. file; if that file is really a directory, these commands invoke Dired on
  377. that subdirectory (using a separate Dired buffer).
  378.      Visit the file described on the current line, like typing `C-x C-f'
  379.      and supplying that file name (`dired-find-file').  *Note
  380.      Visiting::.
  381.      Like `f', but uses another window to display the file's buffer
  382.      (`dired-find-file-other-window').  The Dired buffer remains visible
  383.      in the first window.  This is like using `C-x 4 C-f' to visit the
  384.      file.  *Note Windows::.
  385. `C-o'
  386.      Visit the file described on the current line, and display the
  387.      buffer in another window, but do not select that window
  388.      (`dired-display-file').
  389.      View the file described on the current line, using `M-x view-file'
  390.      (`dired-view-file').
  391.      Viewing a file is like visiting it, but is slanted toward moving
  392.      around in the file conveniently and does not allow changing the
  393.      file.  *Note View File: Misc File Ops.
  394. File: emacs,  Node: Marks vs Flags,  Next: Operating on Files,  Prev: Dired Visiting,  Up: Dired
  395. Dired Marks vs. Flags
  396. =====================
  397.    Instead of flagging a file with `D', you can "mark" the file with
  398. some other character (usually `*').  Most Dired commands other than
  399. "expunge" (`x') operate on files marked with `*'.
  400.    Here are some commands for marking with `*' (and also for
  401. unmarking).  (*Note Dired Deletion::, for commands to flag and unflag
  402. files.)
  403.      Mark the current file with `*' (`dired-mark').  With a numeric
  404.      argument N, mark the next N files starting with the current file.
  405.      (If N is negative, mark the previous -N files.)
  406.      Mark all executable files with `*' (`dired-mark-executables').
  407.      With a prefix argument, unmark all those files.
  408.      Mark all symbolic links with `*' (`dired-mark-symlinks').  With a
  409.      prefix argument, unmark all those files.
  410.      Mark with `*' all files which are actually directories, except for
  411.      `.' and `..' (`dired-mark-directories').  With a prefix argument,
  412.      unmark all those files.
  413. `M-DEL MARKCHAR'
  414.      Remove all marks that use the character MARKCHAR
  415.      (`dired-unmark-all-files').  If you specify RET as MARKCHAR, this
  416.      command removes all marks, no matter what the marker character is.
  417.      With a numeric argument, this command queries about each marked
  418.      file, asking whether to remove its mark.  You can answer `y'
  419.      meaning yes, `n' meaning no, `!' to remove the marks from the
  420.      remaining files without asking about them.
  421. `c OLD NEW'
  422.      Replace all marks that use the character OLD with marks that use
  423.      the character NEW (`dired-change-marks').  This command is the
  424.      only way to create or use marks other than `*' or `D'.  The
  425.      arguments are single characters--do not use RET to terminate them.
  426.      You can use almost any character as a mark character by means of
  427.      this command, to distinguish various classes of files.  If OLD is a
  428.      space (` '), then the command operates on all unmarked files; if
  429.      NEW is a space, then the command unmarks the files it acts on.
  430.      To illustrate the power of this command, here is how to put `*'
  431.      marks on all the files that are unmarked, while unmarking all
  432.      those that have `*' marks:
  433.           c * t  c SPC *  c t SPC
  434. `% m REGEXP RET'
  435.      Mark (with `*') all files whose names match the regular expression
  436.      REGEXP (`dired-mark-files-regexp').
  437.      Only the non-directory part of the file name is used in matching.
  438.      Use `^' and `$' to anchor matches.  Exclude subdirectories by
  439.      hiding them (*note Hiding Subdirectories::.).
  440. File: emacs,  Node: Operating on Files,  Next: Shell Commands in Dired,  Prev: Marks vs Flags,  Up: Dired
  441. Operating on Files
  442. ==================
  443.    This section describes the basic Dired commands to operate on one
  444. file or several files.  All of these commands are capital letters; all
  445. of them use the minibuffer, either to read an argument or to ask for
  446. confirmation, before they act.  All use the following convention to
  447. decide which files to manipulate:
  448.    * If you give the command a numeric prefix argument N, it operates
  449.      on the next N files, starting with the current file.  (If N is
  450.      negative, the command operates on the -N files preceding the
  451.      current line.)
  452.    * Otherwise, if some files are marked with `*', the command operates
  453.      on all those files.
  454.    * Otherwise, the command operates on the current file only.
  455.    Here are the commands that operate on files in this way:
  456. `C NEW RET'
  457.      Copy the specified files (`dired-do-copy').  The argument NEW is
  458.      the directory to copy into, or (if copying a single file) the new
  459.      name.
  460.      If `dired-copy-preserve-time' is non-`nil', then copying with this
  461.      command sets the modification time of the new file to be the same
  462.      as that of the old file.
  463. `R NEW RET'
  464.      Rename the specified files (`dired-do-rename').  The argument NEW
  465.      is the directory to rename into, or (if renaming a single file)
  466.      the new name.
  467.      Dired automatically changes the visited file name of buffers
  468.      associated with renamed files so that they refer to the new names.
  469. `H NEW RET'
  470.      Make hard links to the specified files (`dired-do-hardlink').  The
  471.      argument NEW is the directory to make the links in, or (if making
  472.      just one link) the name to give the link.
  473. `S NEW RET'
  474.      Make symbolic links to the specified files (`dired-do-symlink').
  475.      The argument NEW is the directory to make the links in, or (if
  476.      making just one link) the name to give the link.
  477. `M MODESPEC RET'
  478.      Change the mode (also called "permission bits") of the specified
  479.      files (`dired-do-chmod').  This calls the `chmod' program, so
  480.      MODESPEC can be any argument that `chmod' can handle.
  481. `G NEWGROUP RET'
  482.      Change the group of the specified files to NEWGROUP
  483.      (`dired-do-chgrp').
  484. `O NEWOWNER RET'
  485.      Change the owner of the specified files to NEWOWNER
  486.      (`dired-do-chown').  (On most systems, only the superuser can do
  487.      this.)
  488.      The variable `dired-chown-program' specifies the name of the
  489.      program to use to do the work (different systems put `chown' in
  490.      different places).
  491. `P COMMAND RET'
  492.      Print the specified files (`dired-do-print').  You must specify the
  493.      command to print them with, but the minibuffer starts out with a
  494.      suitable guess made using the variables `lpr-command' and
  495.      `lpr-switches' (the same variables that `lpr-file' uses; *note
  496.      Hardcopy::.).
  497.      Compress or uncompress the specified files (`dired-do-compress').
  498.      If the file appears to be a compressed file, it is uncompressed;
  499.      otherwise, it is compressed.
  500.      Load the specified Emacs Lisp files (`dired-do-load').  *Note Lisp
  501.      Libraries::.
  502.      Byte compile the specified Emacs Lisp files
  503.      (`dired-do-byte-compile').  *Note Byte Compilation: (elisp)Byte
  504.      Compilation.
  505. File: emacs,  Node: Shell Commands in Dired,  Next: Transforming File Names,  Prev: Operating on Files,  Up: Dired
  506. Shell Commands in Dired
  507. =======================
  508.    The dired command `!' (`dired-do-shell-command') reads a shell
  509. command string in the minibuffer and runs the shell command on all the
  510. specified files.  There are two ways of applying a shell command to
  511. multiple files:
  512.    * If you use `*' in the shell command, then it runs just once, with
  513.      the list of file names substituted for the `*'.  The order of file
  514.      names is the order of appearance in the Dired buffer.
  515.      Thus, `! tar cf foo.tar * RET' runs `tar' on the entire list of
  516.      file names, putting them into one tar file `foo.tar'.
  517.    * If the command string doesn't contain `*', then it runs once *for
  518.      each file*, with the file name added at the end.
  519.      For example, `! uudecode RET' runs `uudecode' on each file.
  520.    What if you want to run the shell command once for each file but with
  521. the file name inserted in the middle?  Or if you want to use the file
  522. names in a more complicated fashion?  Use a shell loop.  For example,
  523. this shell command would run `uuencode' on each of the specified files,
  524. writing the output into a corresponding `.uu' file:
  525.      for file in *; uuencode $file $file >$file.uu; done
  526.    The working directory for the shell command is the top level
  527. directory of the Dired buffer.
  528.    The `!' command does not attempt to update the Dired buffer to show
  529. new or modified files, because it doesn't really understand shell
  530. commands, and does not know what files the shell command changed.  Use
  531. the `g' command to update the Dired buffer (*note Dired Updating::.).
  532. File: emacs,  Node: Transforming File Names,  Next: Comparison in Dired,  Prev: Shell Commands in Dired,  Up: Dired
  533. Transforming File Names in Dired
  534. ================================
  535.    Here are commands that alter file names in a systematic way:
  536. `% u'
  537.      Rename each of the selected files to an upper case name
  538.      (`dired-upcase').  If the old file names are `Foo' and `bar', the
  539.      new names are `FOO' and `BAR'.
  540. `% l'
  541.      Rename each of the selected files to a lower case name
  542.      (`dired-downcase').  If the old file names are `Foo' and `bar',
  543.      the new names are `foo' and `bar'.
  544. `% R FROM RET TO RET'
  545. `% C FROM RET TO RET'
  546. `% H FROM RET TO RET'
  547. `% S FROM RET TO RET'
  548.      These four commands rename, copy, make hard links and make soft
  549.      links, in each case computing the new name by regular expression
  550.      substitution from the name of the old file.
  551.    The four regular expression substitution commands effectively perform
  552. `query-replace-regexp' on the selected file names in the Dired buffer.
  553. They read two arguments: a regular expression FROM, and a substitution
  554. pattern TO.
  555.    The commands match each "old" file name against the regular
  556. expression FROM, and then replace the matching part with TO.  You can
  557. use `\&' and `\DIGIT' in TO to refer to all or part of the old file
  558. name, as in `query-replace' (*note Query Replace::.).
  559.    For example, `% R ^.*$ RET x-\& RET' renames each selected file by
  560. prepending `x-' to its name.  The inverse of this, removing `x-' from
  561. the front of each file name, is also possible: one method is `% R
  562. ^x-.*$ RET \& RET'; another is `% R ^x- RET RET'.  (Use `^' and `$' to
  563. anchor matches that should span the whole filename.)
  564.    If the regular expression matches more than once in a file name, only
  565. the first match is replaced.
  566.    Normally, the replacement process does not consider the files'
  567. directory names; it operates on the file name within the directory.  If
  568. you specify a prefix argument of zero, then replacement affects the
  569. entire absolute file name including directory name.
  570.    Often you will want to apply the command to all files matching the
  571. same REGEXP that you use in the command.  To do this, mark those files
  572. with `% m REGEXP RET', then use the same regular expression in the
  573. command to operate on the files.  To make this easier, the commands to
  574. operate use the last regular expression specified in a `%' command as a
  575. default.
  576. File: emacs,  Node: Comparison in Dired,  Next: Subdirectories in Dired,  Prev: Transforming File Names,  Up: Dired
  577. File Comparison with Dired
  578. ==========================
  579.    Here are two Dired commands that compare specified files using
  580. `diff'.
  581.      Compare the current file (the file at point) with another file
  582.      (the file at the mark) using the `diff' program (`dired-diff').
  583.      The file at the mark is the first argument of `diff', and the file
  584.      at point is the second argument.
  585. `M-='
  586.      Compare the current file with its latest backup file
  587.      (`dired-backup-diff').  If the current file is itself a backup,
  588.      compare it with the file it is a backup of; this way, you can
  589.      compare a file with any backup version of your choice.
  590.      The backup file is the first file given to `diff'.
  591. File: emacs,  Node: Subdirectories in Dired,  Next: Subdirectory Motion,  Prev: Comparison in Dired,  Up: Dired
  592. Subdirectories in Dired
  593. =======================
  594.    A Dired buffer displays just one directory in the normal case; but
  595. you can optionally include its subdirectories as well.
  596.    The simplest way to include multiple directories in one Dired buffer
  597. is to specify the options `-lR' for running `ls'.  (If you give a
  598. numeric argument when you run Dired, then you can specify these options
  599. in the minibuffer.)  That produces a recursive directory listing showing
  600. all subdirectories at all levels.
  601.    But usually all the subdirectories are too many; usually you will
  602. prefer to include specific subdirectories only.  You can do this with
  603. the `i' command:
  604.      Insert the contents of a subdirectory later in the buffer.
  605.      Use the `i' (`dired-maybe-insert-subdir') command on a line that
  606.      describes a file which is a directory.  It inserts the contents of
  607.      that directory into the same Dired buffer, and moves there.
  608.      Inserted subdirectory contents follow the top-level directory of
  609.      the Dired buffer, just as they do in `ls -lR' output.
  610.      If the subdirectory's contents are already present in the buffer,
  611.      the `i' command just moves to it.
  612.      In either case, `i' sets the Emacs mark before moving, so `C-x
  613.      C-x' takes you back to the old position in the buffer (the line
  614.      describing that subdirectory).
  615.      Use the `l' command (`dired-do-redisplay') to update the
  616.      subdirectory's contents.  Use `k' to delete the subdirectory.
  617.      *Note Dired Updating::.
  618. File: emacs,  Node: Subdirectory Motion,  Next: Hiding Subdirectories,  Prev: Subdirectories in Dired,  Up: Dired
  619. Moving Over Subdirectories
  620. ==========================
  621.    When a Dired buffer lists subdirectories, you can use the page motion
  622. commands `C-x [' and `C-x ]' to move by entire directories.
  623.    The following commands move across, up and down in the tree of
  624. directories within one Dired buffer.  They move to "directory header
  625. lines", which are the lines that give a directory's name, at the
  626. beginning of the directory's contents.
  627. `C-M-n'
  628.      Go to next subdirectory header line, regardless of level
  629.      (`dired-next-subdir').
  630. `C-M-p'
  631.      Go to previous subdirectory header line, regardless of level
  632.      (`dired-prev-subdir').
  633. `C-M-u'
  634.      Go up to the parent directory's header line (`dired-tree-up').
  635. `C-M-d'
  636.      Go down in the directory tree, to the first subdirectory's header
  637.      line (`dired-tree-down').
  638. File: emacs,  Node: Hiding Subdirectories,  Next: Dired Updating,  Prev: Subdirectory Motion,  Up: Dired
  639. Hiding Subdirectories
  640. =====================
  641.    "Hiding" a subdirectory means to make it invisible, except for its
  642. header line, via selective display (*note Selective Display::.).
  643.      Hide or reveal the subdirectory that point is in, and move point
  644.      to the next subdirectory (`dired-hide-subdir').  A numeric
  645.      argument serves as a repeat count.
  646. `M-$'
  647.      Hide all subdirectories in this Dired buffer, leaving only their
  648.      header lines (`dired-hide-all').  Or, if any subdirectory is
  649.      currently hidden, make all subdirectories visible again.  You can
  650.      use this command to get an overview in very deep directory trees
  651.      or to move quickly to subdirectories far away.
  652.    Ordinary Dired commands never consider files inside a hidden
  653. subdirectory.  For example, the commands to operate on marked files
  654. ignore files in hidden directories even if they are marked.  Thus you
  655. can use hiding to temporarily exclude subdirectories from operations
  656. without having to remove the markers.
  657.    The subdirectory hiding commands toggle; that is they unhide what was
  658. hidden and vice versa.
  659. File: emacs,  Node: Dired Updating,  Next: Dired and Find,  Prev: Hiding Subdirectories,  Up: Dired
  660. Updating the Dired Buffer
  661. =========================
  662.    This section describes commands to update the Dired buffer to reflect
  663. outside (non-Dired) changes in the directories and files, and to delete
  664. part of the Dired buffer.
  665.      Update the entire contents of the Dired buffer (`revert-buffer').
  666.      Update the specified files (`dired-do-redisplay').
  667.      Delete the specified *file lines*--not the files, just the lines
  668.      (`dired-do-kill-lines').
  669.    Type `g' (`revert-buffer') to update the contents of the Dired
  670. buffer, based on changes in the files and directories listed.  This
  671. preserves all marks except for those on files that have vanished.
  672. Hidden subdirectories are updated but remain hidden.
  673.    To update only some of the files, type `l' (`dired-do-redisplay').
  674. This command applies to the next N files, or to the marked files if
  675. any, or to the current file.  Updating them means reading their current
  676. status from the file system and changing the buffer to reflect it
  677. properly.
  678.    If you use `l' on a subdirectory header line, it updates the
  679. contents of the corresponding subdirectory.
  680.    To delete the specified *file lines*--not the files, just the
  681. lines--type `k' (`dired-do-kill-lines').  This command applies to the
  682. next N files, or to the marked files if any, or to the current file.
  683.    If you kill the line for a file that is a directory, the directory's
  684. contents are also deleted from the buffer.  Typing `C-u k' on the
  685. header line for a subdirectory is another way to delete a subdirectory
  686. from the Dired buffer.
  687.    The `g' command brings back any individual lines that you have
  688. killed in this way, but not subdirectories--you must use `i' to
  689. reinsert each subdirectory.
  690. File: emacs,  Node: Dired and Find,  Prev: Dired Updating,  Up: Dired
  691. Dired and `find'
  692. ================
  693.    You can select a set of files for display in a Dired buffer more
  694. flexibly by using the `find' utility to choose the files.
  695.    To search for files with names matching a wildcard pattern use `M-x
  696. find-name-dired'.  It reads arguments DIRECTORY and PATTERN, and
  697. chooses all the files in DIRECTORY or its subdirectories whose
  698. individual names match PATTERN.
  699.    The files thus chosen are displayed in a Dired buffer in which the
  700. ordinary Dired commands are available.
  701.    If you want to test the contents of files, rather than their names,
  702. use `M-x find-grep-dired'.  This command reads two minibuffer
  703. arguments, DIRECTORY and REGEXP; it chooses all the files in DIRECTORY
  704. or its subdirectories that contain a match for REGEXP.  It works by
  705. running the programs `find' and `grep'.
  706.    The most general command in this series is `M-x find-dired', which
  707. lets you specify any condition that `find' can test.  It takes two
  708. minibuffer arguments, DIRECTORY and FIND-ARGS; it runs `find' in
  709. DIRECTORY, passing FIND-ARGS to tell `find' what condition to test.  To
  710. use this command, you need to know how to use `find'.
  711. File: emacs,  Node: Calendar/Diary,  Next: GNUS,  Prev: Dired,  Up: Top
  712. The Calendar and the Diary
  713. **************************
  714.    Emacs provides the functions of a desk calendar, with a diary of
  715. planned or past events.  To enter the calendar, type `M-x calendar';
  716. this displays a three-month calendar centered on the current month, with
  717. point on the current date.  If you use prefix argument as in `C-u M-x
  718. calendar', it prompts you for the month and year to be the center of
  719. the three-month calendar.  The calendar uses its own buffer and the
  720. major mode is Calendar mode.
  721.    To exit the calendar, type `q'.
  722. * Menu:
  723. * Calendar Motion::       Moving through the calendar; selecting a date.
  724. * Scroll Calendar::       Bringing earlier or later months onto the screen.
  725. * Counting Days::         How many days are there between two dates?
  726. * General Calendar::      Exiting or recomputing the calendar.
  727. * Holidays::              Displaying dates of holidays.
  728. * Sunrise/Sunset::        Displaying local times of sunrise and sunset.
  729. * Lunar Phases::          Displaying phases of the moon.
  730. * Other Calendars::       Converting dates to other calendar systems.
  731. * Diary::                 Displaying events from your diary.
  732. * Appointments::      Reminders when it's time to do something.
  733. * Daylight Savings::      How to specify when daylight savings time is active.
  734. File: emacs,  Node: Calendar Motion,  Next: Scroll Calendar,  Up: Calendar/Diary
  735. Movement in the Calendar
  736. ========================
  737.    Calendar mode lets you move in logical units of time such as days,
  738. weeks, months, and years.  If you move outside the three months
  739. originally displayed, the calendar display scrolls automatically through
  740. time.  Moving to a date lets you view its holidays or diary entries,
  741. convert it to other calendars; moving longer time periods is useful
  742. simply to scroll the calendar.
  743. * Menu:
  744. * Calendar Unit Motion::       Moving by days, weeks, months, and years.
  745. * Move to Beginning or End::   Moving to start/end of weeks, months, and
  746.                                  years.
  747. * Specified Dates::            Moving to the current date or another
  748.                                  specific date.
  749. File: emacs,  Node: Calendar Unit Motion,  Next: Move to Beginning or End,  Up: Calendar Motion
  750. Motion by Integral Days, Weeks, Months, Years
  751. ---------------------------------------------
  752.    The commands for movement in the calendar buffer parallel the
  753. commands for movement in text.  You can move forward and backward by
  754. days, weeks, months, and years.
  755. `C-f'
  756.      Move point one day forward (`calendar-forward-day').
  757. `C-b'
  758.      Move point one day backward (`calendar-backward-day').
  759. `C-n'
  760.      Move point one week forward (`calendar-forward-week').
  761. `C-p'
  762.      Move point one week backward (`calendar-backward-week').
  763. `M-}'
  764.      Move point one month forward (`calendar-forward-month').
  765. `M-{'
  766.      Move point one month backward (`calendar-backward-month').
  767. `C-x ]'
  768.      Move point one year forward (`calendar-forward-year').
  769. `C-x ['
  770.      Move point one year backward (`calendar-forward-year').
  771.    The day and week commands are natural analogues of the usual Emacs
  772. commands for moving by characters and by lines.  Just as `C-n' usually
  773. moves to the same column in the following line, in Calendar mode it
  774. moves to the same day in the following week.  And `C-p' moves to the
  775. same day in the previous week.
  776.    The arrow keys are equivalent to `C-f', `C-b', `C-n' and `C-p', just
  777. as they normally are in other modes.
  778.    The commands for motion by months and years work like those for
  779. weeks, but move a larger distance.  The month commands `M-}' and `M-{'
  780. move forward or backward by an entire month's time.  The year commands
  781. `C-x ]' and `C-x [' move forward or backward a whole year.
  782.    The easiest way to remember these commands is to consider months and
  783. years analogous to paragraphs and pages of text, respectively.  But the
  784. commands themselves are not quite analogous.  The ordinary Emacs
  785. paragraph commands move to the beginning or end of a paragraph, whereas
  786. these month and year commands move by an entire month or an entire
  787. year, which usually involves skipping across the end of a month or year.
  788.    All these commands accept a numeric argument as a repeat count.  For
  789. convenience, the digit keys and the minus sign specify numeric
  790. arguments in Calendar mode even without the Meta modifier.  For example,
  791. `100 C-f' moves point 100 days forward from its present location.
  792. File: emacs,  Node: Move to Beginning or End,  Next: Specified Dates,  Prev: Calendar Unit Motion,  Up: Calendar Motion
  793. Beginning or End of Week, Month or Year
  794. ---------------------------------------
  795.    A week (or month, or year) is not just a quantity of days; we think
  796. of new weeks (months, years) as starting on particular days.  So
  797. Calendar mode provides commands to move to the beginning or end of a
  798. week, month or year:
  799. `C-a'
  800.      Move point to beginning of week (`calendar-beginning-of-week').
  801. `C-e'
  802.      Move point to end of week (`calendar-end-of-week').
  803. `M-a'
  804.      Move point to beginning of month (`calendar-beginning-of-month').
  805. `M-e'
  806.      Move point to end of month (`calendar-end-of-month').
  807. `M-<'
  808.      Move point to beginning of year (`calendar-beginning-of-year').
  809. `M->'
  810.      Move point to end of year (`calendar-end-of-year').
  811.    These commands also take numeric arguments as repeat counts, with the
  812. repeat count indicating how many weeks, months, or years to move
  813. backward or forward.
  814. File: emacs,  Node: Specified Dates,  Prev: Move to Beginning or End,  Up: Calendar Motion
  815. Particular Dates
  816. ----------------
  817.    Calendar mode provides commands for getting to a particular date
  818. specified absolutely.
  819. `g d'
  820.      Move point to specified date (`calendar-goto-date').
  821.      Center calendar around specified month (`calendar-other-month').
  822.      Move point to today's date (`calendar-current-month').
  823.    `g d' (`calendar-goto-date') prompts for a year, a month, and a day
  824. of the month, and then moves to that date.  Because the calendar
  825. includes all dates from the beginning of the current era, you must type
  826. the year in its entirety; that is, type `1990', not `90'.
  827.    `o' (`calendar-other-month') prompts for a month and year, then
  828. centers the three-month calendar around that month.
  829.    You can return to today's date with `.' (`calendar-current-month').
  830. File: emacs,  Node: Scroll Calendar,  Next: Counting Days,  Prev: Calendar Motion,  Up: Calendar/Diary
  831. Scrolling in the Calendar
  832. =========================
  833.    The calendar display scrolls automatically through time when you
  834. move out of the visible portion.  You can also scroll it manually.
  835. Imagine that the calendar window contains a long strip of paper with
  836. the months on it.  Scrolling it means moving the strip so that new
  837. months become visible in the window.
  838. `C-x <'
  839.      Scroll calendar one month forward (`scroll-calendar-left').
  840. `C-x >'
  841.      Scroll calendar one month backward (`scroll-calendar-right').
  842. `C-v'
  843. `NEXT'
  844.      Scroll calendar three months forward
  845.      (`scroll-calendar-left-three-months').
  846. `M-v'
  847. `PRIOR'
  848.      Scroll calendar three months backward
  849.      (`scroll-calendar-right-three-months').
  850. `SPC'
  851.      Scroll the next window (`scroll-other-window').
  852.    The most basic calendar scroll commands scroll by one month at a
  853. time.  This means that there are two months of overlap between the
  854. display before the command and the display after.  `C-x <' scrolls the
  855. calendar contents one month to the left; that is, it moves the display
  856. forward in time.  `C-x >' scrolls the contents to the right, which
  857. moves backwards in time.
  858.    The commands `C-v' and `M-v' scroll the calendar by an entire
  859. "screenful"--three months--in analogy with the usual meaning of these
  860. commands.  `C-v' makes later dates visible and `M-v' makes earlier
  861. dates visible.  These commands take a numeric argument as a repeat
  862. count; in particular, since `C-u' (`universal-argument') multiplies the
  863. next command by four, typing `C-u C-v' scrolls the calendar forward by
  864. a year and typing `C-u M-v' scrolls the calendar backward by a year.
  865.    The function keys NEXT and PRIOR are equivalent to `C-v' and `M-v',
  866. just as they are in other modes.
  867.    In Calendar mode, you can use `SPC' (`scroll-other-window') to
  868. scroll the other window.  This is handy when you display a list of
  869. holidays or diary entries in another window.
  870. File: emacs,  Node: Counting Days,  Next: General Calendar,  Prev: Scroll Calendar,  Up: Calendar/Diary
  871. Counting Days
  872. =============
  873. `M-='
  874.      Display the number of days in the current region
  875.      (`calendar-count-days-region').
  876.    To determine the number of days in the region, type `M-='
  877. (`calendar-count-days-region').  The numbers of days printed is
  878. *inclusive*; that is, it includes the days specified by mark and point.
  879.