home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / utility / misc / e1858src.lha / emacs-18.58 / info / emacs-5 < prev    next >
Encoding:
GNU Info File  |  1992-02-21  |  49.6 KB  |  1,163 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: Visiting,  Next: Saving,  Prev: File Names,  Up: Files
  27.  
  28. Visiting Files
  29. ==============
  30.  
  31. `C-x C-f'
  32.      Visit a file (`find-file').
  33.  
  34. `C-x C-v'
  35.      Visit a different file instead of the one visited last
  36.      (`find-alternate-file').
  37.  
  38. `C-x 4 C-f'
  39.      Visit a file, in another window (`find-file-other-window').  Don't
  40.      change this window.
  41.  
  42.    "Visiting" a file means copying its contents into Emacs where you
  43. can edit them.  Emacs makes a new buffer for each file that you visit.
  44.  We say that the buffer is visiting the file that it was created to
  45. hold.  Emacs constructs the buffer name from the file name by throwing
  46. away the directory, keeping just the name proper.  For example, a file
  47. named `/usr/rms/emacs.tex' would get a buffer named `emacs.tex'.  If
  48. there is already a buffer with that name, a unique name is constructed
  49. by appending `<2>', `<3>', or so on, using the lowest number that
  50. makes a name that is not already in use.
  51.  
  52.    Each window's mode line shows the name of the buffer that is being
  53. displayed in that window, so you can always tell what buffer you are
  54. editing.
  55.  
  56.    The changes you make with Emacs are made in the Emacs buffer.  They
  57. do not take effect in the file that you visited, or any place
  58. permanent, until you "save" the buffer.  Saving the buffer means that
  59. Emacs writes the current contents of the buffer into its visited file.
  60.  *Note Saving::.
  61.  
  62.    If a buffer contains changes that have not been saved, the buffer
  63. is said to be "modified".  This is important because it implies that
  64. some changes will be lost if the buffer is not saved.  The mode line
  65. displays two stars near the left margin if the buffer is modified.
  66.  
  67.    To visit a file, use the command `C-x C-f' (`find-file').  Follow
  68. the command with the name of the file you wish to visit, terminated by
  69. a RET.
  70.  
  71.    The file name is read using the minibuffer (*note Minibuffer::.),
  72. with defaulting and completion in the standard manner (*note File
  73. Names::.).  While in the minibuffer, you can abort `C-x C-f' by typing
  74. `C-g'.
  75.  
  76.    Your confirmation that `C-x C-f' has completed successfully is the
  77. appearance of new text on the screen and a new buffer name in the mode
  78. line.  If the specified file does not exist and could not be created,
  79. or cannot be read, then an error results.  The error message is
  80. printed in the echo area, and includes the file name which Emacs was
  81. trying to visit.
  82.  
  83.    If you visit a file that is already in Emacs, `C-x C-f' does not
  84. make another copy.  It selects the existing buffer containing that
  85. file.  However, before doing so, it checks that the file itself has
  86. not changed since you visited or saved it last.  If the file has
  87. changed, a warning message is printed.  *Note Simultaneous Editing:
  88. Interlocking.
  89.  
  90.    What if you want to create a file?  Just visit it.  Emacs prints
  91. `(New File)' in the echo area, but in other respects behaves as if you
  92. had visited an existing empty file.  If you make any changes and save
  93. them, the file is created.
  94.  
  95.    If you visit a nonexistent file unintentionally (because you typed
  96. the wrong file name), use the `C-x C-v' (`find-alternate-file')
  97. command to visit the file you wanted.  `C-x C-v' is similar to `C-x
  98. C-f', but it kills the current buffer (after first offering to save it
  99. if it is modified).  `C-x C-v' is allowed even if the current buffer
  100. is not visiting a file.
  101.  
  102.    If the file you specify is actually a directory, Dired is called on
  103. that directory (*note Dired::.).  This can be inhibited by setting the
  104. variable `find-file-run-dired' to `nil'; then it is an error to try to
  105. visit a directory.
  106.  
  107.    `C-x 4 f' (`find-file-other-window') is like `C-x C-f' except that
  108. the buffer containing the specified file is selected in another
  109. window.  The window that was selected before `C-x 4 f' continues to
  110. show the same buffer it was already showing.  If this command is used
  111. when only one window is being displayed, that window is split in two,
  112. with one window showing the same before as before, and the other one
  113. showing the newly requested file.  *Note Windows::.
  114.  
  115.    There are two hook variables that allow extensions to modify the
  116. operation of visiting files.  Visiting a file that does not exist runs
  117. the functions in the list `find-file-not-found-hooks'; the value of
  118. this variable is expected to be a list of functions, and the functions
  119. are called one by one until one of them returns non-`nil'.  Any
  120. visiting of a file, whether extant or not, expects `find-file-hooks' to
  121. contain list of functions and calls them all, one by one.  In both
  122. cases the functions receive no arguments.  Visiting a nonexistent file
  123. runs the `find-file-not-found-hooks' first.
  124.  
  125. 
  126. File: emacs,  Node: Saving,  Next: Reverting,  Prev: Visiting,  Up: Files
  127.  
  128. Saving Files
  129. ============
  130.  
  131.    "Saving" a buffer in Emacs means writing its contents back into the
  132. file that was visited in the buffer.
  133.  
  134. `C-x C-s'
  135.      Save the current buffer in its visited file (`save-buffer').
  136.  
  137. `C-x s'
  138.      Save any or all buffers in their visited files
  139.      (`save-some-buffers').
  140.  
  141. `M-~'
  142.      Forget that the current buffer has been changed (`not-modified').
  143.  
  144. `C-x C-w'
  145.      Save the current buffer in a specified file, and record that file
  146.      as the one visited in the buffer (`write-file').
  147.  
  148. `M-x set-visited-file-name'
  149.      Change file the name under which the current buffer will be saved.
  150.  
  151.    When you wish to save the file and make your changes permanent, type
  152. `C-x C-s' (`save-buffer').  After saving is finished, `C-x C-s' prints
  153. a message such as
  154.  
  155.      Wrote /u/rms/gnu/gnu.tasks
  156.  
  157. If the selected buffer is not modified (no changes have been made in it
  158. since the buffer was created or last saved), saving is not really done,
  159. because it would have no effect.  Instead, `C-x C-s' prints a message
  160. in the echo area saying
  161.  
  162.      (No changes need to be written)
  163.  
  164.    The command `C-x s' (`save-some-buffers') can save any or all
  165. modified buffers.  First it asks, for each modified buffer, whether to
  166. save it.  These questions should be answered with `y' or `n'.  `C-x
  167. C-c', the key that kills Emacs, invokes `save-some-buffers' and
  168. therefore asks the same questions.
  169.  
  170.    If you have changed a buffer and do not want the changes to be
  171. saved, you should take some action to prevent it.  Otherwise, each
  172. time you use `save-some-buffers' you are liable to save it by mistake.
  173.  One thing you can do is type `M-~' (`not-modified'), which clears out
  174. the indication that the buffer is modified.  If you do this, none of
  175. the save commands will believe that the buffer needs to be saved. 
  176. (`~' is often used as a mathematical symbol for `not'; thus `Meta-~'
  177. is `not', metafied.) You could also use `set-visited-file-name' (see
  178. below) to mark the buffer as visiting a different file name, one which
  179. is not in use for anything important.  Alternatively, you can undo all
  180. the changes made since the file was visited or saved, by reading the
  181. text from the file again.  This is called "reverting".  *Note
  182. Reverting::.  You could also undo all the changes by repeating the
  183. undo command `C-x u' until you have undone all the changes; but this
  184. only works if you have not made more changes than the undo mechanism
  185. can remember.
  186.  
  187.    `M-x set-visited-file-name' alters the name of the file that the
  188. current buffer is visiting.  It reads the new file name using the
  189. minibuffer.  It can be used on a buffer that is not visiting a file,
  190. too.  The buffer's name is changed to correspond to the file it is now
  191. visiting in the usual fashion (unless the new name is in use already
  192. for some other buffer; in that case, the buffer name is not changed). 
  193. `set-visited-file-name' does not save the buffer in the newly visited
  194. file; it just alters the records inside Emacs so that, if you save the
  195. buffer, it will be saved in that file.  It also marks the buffer as
  196. "modified" so that `C-x C-s' will save.
  197.  
  198.    If you wish to mark the buffer as visiting a different file and
  199. save it right away, use `C-x C-w' (`write-file').  It is precisely
  200. equivalent to `set-visited-file-name' followed by `C-x C-s'.  `C-x
  201. C-s' used on a buffer that is not visiting with a file has the same
  202. effect as `C-x C-w'; that is, it reads a file name, marks the buffer
  203. as visiting that file, and saves it there.  The default file name in a
  204. buffer that is not visiting a file is made by combining the buffer name
  205. with the buffer's default directory.
  206.  
  207.    If Emacs is about to save a file and sees that the date of the
  208. latest version on disk does not match what Emacs last read or wrote,
  209. Emacs notifies you of this fact, because it probably indicates a
  210. problem caused by simultaneous editing and requires your immediate
  211. attention.  *Note Simultaneous Editing: Interlocking.
  212.  
  213.    If the variable `require-final-newline' is non-`nil', Emacs puts a
  214. newline at the end of any file that doesn't already end in one, every
  215. time a file is saved or written.
  216.  
  217.    You can implement other ways to write files, and other things to be
  218. done before writing them, using the hook variable `write-file-hooks'. 
  219. The value of this variable should be a list of Lisp functions.  When a
  220. file is to be written, the functions in the list are called, one by
  221. one, with no arguments.  If one of them returns a non-`nil' value,
  222. Emacs takes this to mean that the file has been written in some
  223. suitable fashion; the rest of the functions are not called, and normal
  224. writing is not done.
  225.  
  226. * Menu:
  227.  
  228. * Backup::       How Emacs saves the old version of your file.
  229. * Interlocking:: How Emacs protects against simultaneous editing
  230.                   of one file by two users.
  231.  
  232. 
  233. File: emacs,  Node: Backup,  Next: Interlocking,  Prev: Saving,  Up: Saving
  234.  
  235. Backup Files
  236. ------------
  237.  
  238.    Because Unix does not provide version numbers in file names,
  239. rewriting a file in Unix automatically destroys all record of what the
  240. file used to contain.  Thus, saving a file from Emacs throws away the
  241. old contents of the file--or it would, except that Emacs carefully
  242. copies the old contents to another file, called the "backup" file,
  243. before actually saving.  (Provided the variable `make-backup-files' is
  244. non-`nil'.  Backup files are not written if this variable is `nil').
  245.  
  246.    At your option, Emacs can keep either a single backup file or a
  247. series of numbered backup files for each file that you edit.
  248.  
  249.    Emacs makes a backup for a file only the first time the file is
  250. saved from one buffer.  No matter how many times you save a file, its
  251. backup file continues to contain the contents from before the file was
  252. visited.  Normally this means that the backup file contains the
  253. contents from before the current editing session; however, if you kill
  254. the buffer and then visit the file again, a new backup file will be
  255. made by the next save.
  256.  
  257. * Menu:
  258.  
  259. * Names: Backup Names.        How backup files are named;
  260.                 Choosing single or numbered backup files.
  261. * Deletion: Backup Deletion.    Emacs deletes excess numbered backups.
  262. * Copying: Backup Copying.    Backups can be made by copying or renaming.
  263.  
  264. 
  265. File: emacs,  Node: Backup Names,  Next: Backup Deletion,  Prev: Backup,  Up: Backup
  266.  
  267. Single or Numbered Backups
  268. ..........................
  269.  
  270.    If you choose to have a single backup file (this is the default),
  271. the backup file's name is constructed by appending `~' to the file
  272. name being edited; thus, the backup file for `eval.c' would be
  273. `eval.c~'.
  274.  
  275.    If you choose to have a series of numbered backup files, backup file
  276. names are made by appending `.~', the number, and another `~' to the
  277. original file name.  Thus, the backup files of `eval.c' would be
  278. called `eval.c.~1~', `eval.c.~2~', and so on, through names like
  279. `eval.c.~259~' and beyond.
  280.  
  281.    If protection stops you from writing backup files under the usual
  282. names, the backup file is written as `%backup%~' in your home
  283. directory.  Only one such file can exist, so only the most recently
  284. made such backup is available.
  285.  
  286.    The choice of single backup or numbered backups is controlled by the
  287. variable `version-control'.  Its possible values are
  288.  
  289. `t'
  290.      Make numbered backups.
  291.  
  292. `nil'
  293.      Make numbered backups for files that have numbered backups
  294.      already.  Otherwise, make single backups.
  295.  
  296. `never'
  297.      Do not in any case make numbered backups; always make single
  298.      backups.
  299.  
  300. `version-control' may be set locally in an individual buffer to
  301. control the making of backups for that buffer's file.  For example,
  302. Rmail mode locally sets `version-control' to `never' to make sure that
  303. there is only one backup for an Rmail file.  *Note Locals::.
  304.  
  305. 
  306. File: emacs,  Node: Backup Deletion,  Next: Backup Copying,  Prev: Backup Names,  Up: Backup
  307.  
  308. Automatic Deletion of Backups
  309. .............................
  310.  
  311.    To prevent unlimited consumption of disk space, Emacs can delete
  312. numbered backup versions automatically.  Generally Emacs keeps the
  313. first few backups and the latest few backups, deleting any in between.
  314.  This happens every time a new backup is made.  The two variables that
  315. control the deletion are `kept-old-versions' and `kept-new-versions'. 
  316. Their values are, respectively the number of oldest (lowest-numbered)
  317. backups to keep and the number of newest (highest-numbered) ones to
  318. keep, each time a new backup is made.  Recall that these values are
  319. used just after a new backup version is made; that newly made backup
  320. is included in the count in `kept-new-versions'.  By default, both
  321. variables are 2.
  322.  
  323.    If `trim-versions-without-asking' is non-`nil', the excess middle
  324. versions are deleted without a murmur.  If it is `nil', the default,
  325. then you are asked whether the excess middle versions should really be
  326. deleted.
  327.  
  328.    Dired's `.' (Period) command can also be used to delete old
  329. versions.  *Note Dired::.
  330.  
  331. 
  332. File: emacs,  Node: Backup Copying,  Prev: Backup Deletion,  Up: Backup
  333.  
  334. Copying vs. Renaming
  335. ....................
  336.  
  337.    Backup files can be made by copying the old file or by renaming it.
  338.  This makes a difference when the old file has multiple names.  If the
  339. old file is renamed into the backup file, then the alternate names
  340. become names for the backup file.  If the old file is copied instead,
  341. then the alternate names remain names for the file that you are
  342. editing, and the contents accessed by those names will be the new
  343. contents.
  344.  
  345.    The method of making a backup file may also affect the file's owner
  346. and group.  If copying is used, these do not change.  If renaming is
  347. used, you become the file's owner, and the file's group becomes the
  348. default (different operating systems have different defaults for the
  349. group).
  350.  
  351.    Having the owner change is usually a good idea, because then the
  352. owner always shows who last edited the file.  Also, the owners of the
  353. backups show who produced those versions.  Occasionally there is a
  354. file whose owner should not change; it is a good idea for such files
  355. to contain local variable lists to set
  356. `backup-by-copying-when-mismatch' for them alone (*note File
  357. Variables::.).
  358.  
  359.    The choice of renaming or copying is controlled by three variables. 
  360. Normally, renaming is done.  If the variable `backup-by-copying' is
  361. non-`nil', copying is used.  Otherwise, if the variable
  362. `backup-by-copying-when-linked' is non-`nil', then copying is done for
  363. files that have multiple names, but renaming may still done when the
  364. file being edited has only one name.  If the variable
  365. `backup-by-copying-when-mismatch' is non-`nil', then copying is done
  366. if renaming would cause the file's owner or group to change.
  367.  
  368. 
  369. File: emacs,  Node: Interlocking,  Prev: Backup,  Up: Saving
  370.  
  371. Protection against Simultaneous Editing
  372. ---------------------------------------
  373.  
  374.    Simultaneous editing occurs when two users visit the same file,
  375. both make changes, and then both save them.  If nobody were informed
  376. that this was happening, whichever user saved first would later find
  377. that his changes were lost.  On some systems, Emacs notices
  378. immediately when the second user starts to change the file, and issues
  379. an immediate warning.  When this is not possible, or if the second
  380. user has gone on to change the file despite the warning, Emacs checks
  381. later when the file is saved, and issues a second warning when a user
  382. is about to overwrite a file containing another user's changes.  If
  383. the editing user takes the proper corrective action at this point, he
  384. can prevent actual loss of work.
  385.  
  386.    When you make the first modification in an Emacs buffer that is
  387. visiting a file, Emacs records that you have locked the file.  (It
  388. does this by writing another file in a directory reserved for this
  389. purpose.)  The lock is removed when you save the changes.  The idea is
  390. that the file is locked whenever the buffer is modified.  If you begin
  391. to modify the buffer while the visited file is locked by someone else,
  392. this constitutes a collision, and Emacs asks you what to do.  It does
  393. this by calling the Lisp function `ask-user-about-lock', which you can
  394. redefine for the sake of customization.  The standard definition of
  395. this function asks you a question and accepts three possible answers:
  396.  
  397. `s'
  398.      Steal the lock.  Whoever was already changing the file loses the
  399.      lock, and you gain the lock.
  400.  
  401. `p'
  402.      Proceed.  Go ahead and edit the file despite its being locked by
  403.      someone else.
  404.  
  405. `q'
  406.      Quit.  This causes an error (`file-locked') and the modification
  407.      you were trying to make in the buffer does not actually take
  408.      place.
  409.  
  410.    Note that locking works on the basis of a file name; if a file has
  411. multiple names, Emacs does not realize that the two names are the same
  412. file and cannot prevent two user from editing it simultaneously under
  413. different names.  However, basing locking on names means that Emacs
  414. can interlock the editing of new files that will not really exist
  415. until they are saved.
  416.  
  417.    Some systems are not configured to allow Emacs to make locks.  On
  418. these systems, Emacs cannot detect trouble in advance, but it still can
  419. detect it in time to prevent you from overwriting someone else's
  420. changes.
  421.  
  422.    Every time Emacs saves a buffer, it first checks the
  423. last-modification date of the existing file on disk to see that it has
  424. not changed since the file was last visited or saved.  If the date
  425. does not match, it implies that changes were made in the file in some
  426. other way, and these changes are about to be lost if Emacs actually
  427. does save.  To prevent this, Emacs prints a warning message and asks
  428. for confirmation before saving.  Occasionally you will know why the
  429. file was changed and know that it does not matter; then you can answer
  430. `yes' and proceed.  Otherwise, you should cancel the save with `C-g'
  431. and investigate the situation.
  432.  
  433.    The first thing you should do when notified that simultaneous
  434. editing has already taken place is to list the directory with `C-u C-x
  435. C-d' (*note Directory Listing: ListDir.).  This will show the file's
  436. current author.  You should attempt to contact him to warn him not to
  437. continue editing.  Often the next step is to save the contents of your
  438. Emacs buffer under a different name, and use `diff' to compare the two
  439. files.
  440.  
  441.    Simultaneous editing checks are also made when you visit with `C-x
  442. C-f' a file that is already visited and when you start to modify a
  443. file.  This is not strictly necessary, but it can cause you to find
  444. out about the problem earlier, when perhaps correction takes less work.
  445.  
  446. 
  447. File: emacs,  Node: Reverting,  Next: Auto Save,  Prev: Saving,  Up: Files
  448.  
  449. Reverting a Buffer
  450. ==================
  451.  
  452.    If you have made extensive changes to a file and then change your
  453. mind about them, you can get rid of them by reading in the previous
  454. version of the file.  To do this, use `M-x revert-buffer', which
  455. operates on the current buffer.  Since this is a very dangerous thing
  456. to do, you must confirm it with `yes'.
  457.  
  458.    If the current buffer has been auto-saved more recently than it has
  459. been saved for real, `revert-buffer' offers to read the auto save file
  460. instead of the visited file (*note Auto Save::.).  This question comes
  461. before the usual request for confirmation, and demands `y' or `n' as
  462. an answer.  If you have started to type `yes' for confirmation without
  463. realizing that the other question was going to be asked, the `y' will
  464. answer that question, but the `es' will not be valid confirmation.  So
  465. you will have a chance to cancel the operation with `C-g' and try it
  466. again with the answers that you really intend.
  467.  
  468.    `revert-buffer' keeps point at the same distance (measured in
  469. characters) from the beginning of the file.  If the file was edited
  470. only slightly, you will be at approximately the same piece of text
  471. after reverting as before.  If you have made drastic changes, the same
  472. value of point in the old file may address a totally different piece
  473. of text.
  474.  
  475.    A buffer reverted from its visited file is marked "not modified"
  476. until another change is made.
  477.  
  478.    Some kinds of buffers whose contents reflect data bases other than
  479. files, such as Dired buffers, can also be reverted.  For them,
  480. reverting means recalculating their contents from the appropriate data
  481. base.  Buffers created randomly with `C-x b' cannot be reverted;
  482. `revert-buffer' reports an error when asked to do so.
  483.  
  484. 
  485. File: emacs,  Node: Auto Save,  Next: ListDir,  Prev: Reverting,  Up: Files
  486.  
  487. Auto-Saving: Protection Against Disasters
  488. =========================================
  489.  
  490.    Emacs saves all the visited files from time to time (based on
  491. counting your keystrokes) without being asked.  This is called
  492. "auto-saving".  It prevents you from losing more than a limited amount
  493. of work if the system crashes.
  494.  
  495.    When Emacs determines that it is time for auto-saving, each buffer
  496. is considered, and is auto-saved if auto-saving is turned on for it
  497. and it has been changed since the last time it was auto-saved.  If any
  498. auto-saving is done, the message `Auto-saving...' is displayed in the
  499. echo area until auto-saving is finished.  Errors occurring during
  500. auto-saving are caught so that they do not interfere with the
  501. execution of commands you have been typing.
  502.  
  503. * Menu:
  504.  
  505. * Files: Auto Save Files.
  506. * Control: Auto Save Control.
  507. * Recover::        Recovering text from auto-save files.
  508.  
  509. 
  510. File: emacs,  Node: Auto Save Files,  Next: Auto Save Control,  Prev: Auto Save,  Up: Auto Save
  511.  
  512. Auto-Save Files
  513. ---------------
  514.  
  515.    Auto-saving does not normally save in the files that you visited,
  516. because it can be very undesirable to save a program that is in an
  517. inconsistent state when you have made half of a planned change. 
  518. Instead, auto-saving is done in a different file called the "auto-save
  519. file", and the visited file is changed only when you request saving
  520. explicitly (such as with `C-x C-s').
  521.  
  522.    Normally, the auto-save file name is made by appending `#' to the
  523. front and rear of the visited file name.  Thus, a buffer visiting file
  524. `foo.c' would be auto-saved in a file `#foo.c#'.  Most buffers that
  525. are not visiting files are auto-saved only if you request it
  526. explicitly; when they are auto-saved, the auto-save file name is made
  527. by appending `#%' to the front and `#' to the rear of buffer name. 
  528. For example, the `*mail*' buffer in which you compose messages to be
  529. sent is auto-saved in a file named `#%*mail*#'.  Auto-save file names
  530. are made this way unless you reprogram parts of Emacs to do something
  531. different (the functions `make-auto-save-file-name' and
  532. `auto-save-file-name-p').  The file name to be used for auto-saving in
  533. a buffer is calculated when auto-saving is turned on in that buffer.
  534.  
  535.    If you want auto-saving to be done in the visited file, set the
  536. variable `auto-save-visited-file-name' to be non-`nil'.  In this mode,
  537. there is really no difference between auto-saving and explicit saving.
  538.  
  539.    A buffer's auto-save file is deleted when you save the buffer in its
  540. visited file.  To inhibit this, set the variable
  541. `delete-auto-save-files' to `nil'.  Changing the visited file name
  542. with `C-x C-w' or `set-visited-file-name' renames any auto-save file
  543. to go with the new visited name.
  544.  
  545. 
  546. File: emacs,  Node: Auto Save Control,  Next: Recover,  Prev: Auto Save Files,  Up: Auto Save
  547.  
  548. Controlling Auto-Saving
  549. -----------------------
  550.  
  551.    Each time you visit a file, auto-saving is turned on for that file's
  552. buffer if the variable `auto-save-default' is non-`nil' (but not in
  553. batch mode; *note Entering Emacs::.).  The default for this variable is
  554. `t', so auto-saving is the usual practice for file-visiting buffers. 
  555. Auto-saving can be turned on or off for any existing buffer with the
  556. command `M-x auto-save-mode'.  Like other minor mode commands, `M-x
  557. auto-save-mode' turns auto-saving on with a positive argument, off
  558. with a zero or negative argument; with no argument, it toggles.
  559.  
  560.    Emacs does auto-saving periodically based on counting how many
  561. characters you have typed since the last time auto-saving was done. 
  562. The variable `auto-save-interval' specifies how many characters there
  563. are between auto-saves.  By default, it is 300.  Emacs also auto-saves
  564. whenever you call the function `do-auto-save'.
  565.  
  566.    Emacs also does auto-saving whenever it gets a fatal error.  This
  567. includes killing the Emacs job with a shell command such as `kill
  568. %emacs', or disconnecting a phone line or network connection.
  569.  
  570. 
  571. File: emacs,  Node: Recover,  Prev: Auto Save Control,  Up: Auto Save
  572.  
  573. Recovering Data from Auto-Saves
  574. -------------------------------
  575.  
  576.    The way to use the contents of an auto-save file to recover from a
  577. loss of data is with the command `M-x recover-file RET FILE RET'. 
  578. This visits FILE and then (after your confirmation) restores the
  579. contents from from its auto-save file `#FILE#'.  You can then save
  580. with `C-x C-s' to put the recovered text into FILE itself.  For
  581. example, to recover file `foo.c' from its auto-save file `#foo.c#', do:
  582.  
  583.      M-x recover-file RET foo.c RET
  584.      C-x C-s
  585.  
  586.    Before asking for confirmation, `M-x recover-file' displays a
  587. directory listing describing the specified file and the auto-save file,
  588. so you can compare their sizes and dates.  If the auto-save file is
  589. older, `M-x recover-file' does not offer to read it.
  590.  
  591.    Auto-saving is disabled by `M-x recover-file' because using this
  592. command implies that the auto-save file contains valuable data from a
  593. past session.  If you save the data in the visited file and then go on
  594. to make new changes, you should turn auto-saving back on with `M-x
  595. auto-save-mode'.
  596.  
  597. 
  598. File: emacs,  Node: ListDir,  Next: Dired,  Prev: Auto Save,  Up: Files
  599.  
  600. Listing a File Directory
  601. ========================
  602.  
  603.    Files are classified by Unix into "directories".  A "directory
  604. listing" is a list of all the files in a directory.  Emacs provides
  605. directory listings in brief format (file names only) and verbose format
  606. (sizes, dates, and authors included).
  607.  
  608. `C-x C-d DIR-OR-PATTERN'
  609.      Print a brief directory listing (`list-directory').
  610.  
  611. `C-u C-x C-d DIR-OR-PATTERN'
  612.      Print a verbose directory listing.
  613.  
  614.    The command to print a directory listing is `C-x C-d'
  615. (`list-directory').  It reads using the minibuffer a file name which
  616. is either a directory to be listed or a wildcard-containing pattern
  617. for the files to be listed.  For example,
  618.  
  619.      C-x C-d /u2/emacs/etc RET
  620.  
  621. lists all the files in directory `/u2/emacs/etc'.  An example of
  622. specifying a file name pattern is
  623.  
  624.      C-x C-d /u2/emacs/src/*.c RET
  625.  
  626.    Normally, `C-x C-d' prints a brief directory listing containing just
  627. file names.  A numeric argument (regardless of value) tells it to
  628. print a verbose listing (like `ls -l').
  629.  
  630.    The text of a directory listing is obtained by running `ls' in an
  631. inferior process.  Two Emacs variables control the switches passed to
  632. `ls': `list-directory-brief-switches' is a string giving the switches
  633. to use in brief listings (`"-CF"' by default), and
  634. `list-directory-verbose-switches' is a string giving the switches to
  635. use in a verbose listing (`"-l"' by default).
  636.  
  637. 
  638. File: emacs,  Node: Dired,  Next: Misc File Ops,  Prev: ListDir,  Up: Files
  639.  
  640. Dired, the Directory Editor
  641. ===========================
  642.  
  643.    Dired makes it easy to delete or visit many of the files in a single
  644. directory at once.  It makes an Emacs buffer containing a listing of
  645. the directory.  You can use the normal Emacs commands to move around
  646. in this buffer, and special Dired commands to operate on the files.
  647.  
  648. * Menu:
  649.  
  650. * Enter: Dired Enter.         How to invoke Dired.
  651. * Edit: Dired Edit.           Editing the Dired buffer.
  652. * Deletion: Dired Deletion.   Deleting files with Dired.
  653. * Immed: Dired Immed.         Other file operations through Dired.
  654.  
  655. 
  656. File: emacs,  Node: Dired Enter,  Next: Dired Edit,  Prev: Dired,  Up: Dired
  657.  
  658. Entering Dired
  659. --------------
  660.  
  661.    To invoke dired, do `C-x d' or `M-x dired'.  The command reads a
  662. directory name or wildcard file name pattern as a minibuffer argument
  663. just like the `list-directory' command, `C-x C-d'.  Where `dired'
  664. differs from `list-directory' is in naming the buffer after the
  665. directory name or the wildcard pattern used for the listing, and
  666. putting the buffer into Dired mode so that the special commands of
  667. Dired are available in it.  The variable `dired-listing-switches' is a
  668. string used as an argument to `ls' in making the directory; this string
  669. must contain `-l'.
  670.  
  671.    To display the Dired buffer in another window rather than in the
  672. selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x
  673. d'.
  674.  
  675. 
  676. File: emacs,  Node: Dired Edit,  Next: Dired Deletion,  Prev: Dired Enter,  Up: Dired
  677.  
  678. Editing in Dired
  679. ----------------
  680.  
  681.    Once the Dired buffer exists, you can switch freely between it and
  682. other Emacs buffers.  Whenever the Dired buffer is selected, certain
  683. special commands are provided that operate on files that are listed. 
  684. The Dired buffer is "read-only", and inserting text in it is not
  685. useful, so ordinary printing characters such as `d' and `x' are used
  686. for Dired commands.  Most Dired commands operate on the file described
  687. by the line that point is on.  Some commands perform operations
  688. immediately; others "flag" the file to be operated on later.
  689.  
  690.    Most Dired commands that operate on the current line's file also
  691. treat a numeric argument as a repeat count, meaning to act on the
  692. files of the next few lines.  A negative argument means to operate on
  693. the files of the preceding lines, and leave point on the first of
  694. those lines.
  695.  
  696.    All the usual Emacs cursor motion commands are available in Dired
  697. buffers.  Some special purpose commands are also provided.  The keys
  698. `C-n' and `C-p' are redefined so that they try to position the cursor
  699. at the beginning of the filename on the line, rather than at the
  700. beginning of the line.
  701.  
  702.    For extra convenience, SPC and `n' in Dired are equivalent to
  703. `C-n'.  `p' is equivalent to `C-p'.  Moving by lines is done so often
  704. in Dired that it deserves to be easy to type.  DEL (move up and
  705. unflag) is often useful simply for moving up.
  706.  
  707.    The `g' command in Dired runs `revert-buffer' to reinitialize the
  708. buffer from the actual disk directory and show any changes made in the
  709. directory by programs other than Dired.  All deletion flags in the
  710. Dired buffer are lost when this is done.
  711.  
  712. 
  713. File: emacs,  Node: Dired Deletion,  Next: Dired Immed,  Prev: Dired Edit,  Up: Dired
  714.  
  715. Deleting Files with Dired
  716. -------------------------
  717.  
  718.    The primary use of Dired is to flag files for deletion and then
  719. delete them.
  720.  
  721. `d'
  722.      Flag this file for deletion.
  723.  
  724. `u'
  725.      Remove deletion-flag on this line.
  726.  
  727. `DEL'
  728.      Remove deletion-flag on previous line, moving point to that line.
  729.  
  730. `x'
  731.      Delete the files that are flagged for deletion.
  732.  
  733. `#'
  734.      Flag all auto-save files (files whose names start and end with
  735.      `#') for deletion (*note Auto Save::.).
  736.  
  737. `~'
  738.      Flag all backup files (files whose names end with `~') for
  739.      deletion (*note Backup::.).
  740.  
  741. `. (Period)'
  742.      Flag excess numeric backup files for deletion.  The oldest and
  743.      newest few backup files of any one file are exempt; the middle
  744.      ones are flagged.
  745.  
  746.    You can flag a file for deletion by moving to the line describing
  747. the file and typing `d' or `C-d'.  The deletion flag is visible as a
  748. `D' at the beginning of the line.  Point is moved to the beginning of
  749. the next line, so that repeated `d' commands flag successive files.
  750.  
  751.    The files are flagged for deletion rather than deleted immediately
  752. to avoid the danger of deleting a file accidentally.  Until you direct
  753. Dired to delete the flagged files, you can remove deletion flags using
  754. the commands `u' and DEL.  `u' works just like `d', but removes flags
  755. rather than making flags.  DEL moves upward, removing flags; it is
  756. like `u' with numeric argument automatically negated.
  757.  
  758.    To delete the flagged files, type `x'.  This command first displays
  759. a list of all the file names flagged for deletion, and requests
  760. confirmation with `yes'.  Once you confirm, all the flagged files are
  761. deleted, and their lines are deleted from the text of the Dired
  762. buffer.  The shortened Dired buffer remains selected.  If you answer
  763. `no' or quit with `C-g', you return immediately to Dired, with the
  764. deletion flags still present and no files actually deleted.
  765.  
  766.    The `#', `~' and `.' commands flag many files for deletion, based
  767. on their names.  These commands are useful precisely because they do
  768. not actually delete any files; you can remove the deletion flags from
  769. any flagged files that you really wish to keep.
  770.  
  771.    `#' flags for deletion all files that appear to have been made by
  772. auto-saving (that is, files whose names begin and end with `#').  `~'
  773. flags for deletion all files that appear to have been made as backups
  774. for files that were edited (that is, files whose names end with `~').
  775.  
  776.    `.' (Period) flags just some of the backup files for deletion: only
  777. numeric backups that are not among the oldest few nor the newest few
  778. backups of any one file.  Normally `dired-kept-versions' (not
  779. `kept-new-versions'; that applies only when saving) specifies the
  780. number of newest versions of each file to keep, and
  781. `kept-old-versions' specifies the number of oldest versions to keep. 
  782. Period with a positive numeric argument, as in `C-u 3 .', specifies the
  783. number of newest versions to keep, overriding `dired-kept-versions'. 
  784. A negative numeric argument overrides `kept-old-versions', using minus
  785. the value of the argument to specify the number of oldest versions of
  786. each file to keep.
  787.  
  788. 
  789. File: emacs,  Node: Dired Immed,  Prev: Dired Deletion,  Up: Dired
  790.  
  791. Immediate File Operations in Dired
  792. ----------------------------------
  793.  
  794.    Some file operations in Dired take place immediately when they are
  795. requested.
  796.  
  797. `c'
  798.      Copies the file described on the current line.  You must supply a
  799.      file name to copy to, using the minibuffer.
  800.  
  801. `f'
  802.      Visits the file described on the current line.  It is just like
  803.      typing `C-x C-f' and supplying that file name.  If the file on
  804.      this line is a subdirectory, `f' actually causes Dired to be
  805.      invoked on that subdirectory.  *Note Visiting::.
  806.  
  807. `o'
  808.      Like `f', but uses another window to display the file's buffer. 
  809.      The Dired buffer remains visible in the first window.  This is
  810.      like using `C-x 4 C-f' to visit the file.  *Note Windows::.
  811.  
  812. `r'
  813.      Renames the file described on the current line.  You must supply
  814.      a file name to rename to, using the minibuffer.
  815.  
  816. `v'
  817.      Views the file described on this line using `M-x view-file'. 
  818.      Viewing a file is like visiting it, but is slanted toward moving
  819.      around in the file conveniently and does not allow changing the
  820.      file.  *Note View File: Misc File Ops.  Viewing a file that is a
  821.      directory runs Dired on that directory.
  822.  
  823. 
  824. File: emacs,  Node: Misc File Ops,  Prev: Dired,  Up: Files
  825.  
  826. Miscellaneous File Operations
  827. =============================
  828.  
  829.    Emacs has commands for performing many other operations on files. 
  830. All operate on one file; they do not accept wild card file names.
  831.  
  832.    `M-x view-file' allows you to scan or read a file by sequential
  833. screenfuls.  It reads a file name argument using the minibuffer.  After
  834. reading the file into an Emacs buffer, `view-file' reads and displays
  835. one windowful.  You can then type SPC to scroll forward one windowful,
  836. or DEL to scroll backward.  Various other commands are provided for
  837. moving around in the file, but none for changing it; type `C-h' while
  838. viewing for a list of them.  They are mostly the same as normal Emacs
  839. cursor motion commands.  To exit from viewing, type `C-c'.
  840.  
  841.    `M-x insert-file' inserts a copy of the contents of the specified
  842. file into the current buffer at point, leaving point unchanged before
  843. the contents and the mark after them.  *Note Mark::.
  844.  
  845.    `M-x write-region' is the inverse of `M-x insert-file'; it copies
  846. the contents of the region into the specified file.  `M-x
  847. append-to-file' adds the text of the region to the end of the
  848. specified file.
  849.  
  850.    `M-x delete-file' deletes the specified file, like the `rm' command
  851. in the shell.  If you are deleting many files in one directory, it may
  852. be more convenient to use Dired (*note Dired::.).
  853.  
  854.    `M-x rename-file' reads two file names OLD and NEW using the
  855. minibuffer, then renames file OLD as NEW.  If a file named NEW already
  856. exists, you must confirm with `yes' or renaming is not done; this is
  857. because renaming causes the old meaning of the name NEW to be lost. 
  858. If OLD and NEW are on different file systems, the file OLD is copied
  859. and deleted.
  860.  
  861.    The similar command `M-x add-name-to-file' is used to add an
  862. additional name to an existing file without removing its old name. 
  863. The new name must belong on the same file system that the file is on.
  864.  
  865.    `M-x copy-file' reads the file OLD and writes a new file named NEW
  866. with the same contents.  Confirmation is required if a file named NEW
  867. already exists, because copying has the consequence of overwriting the
  868. old contents of the file NEW.
  869.  
  870.    `M-x make-symbolic-link' reads two file names OLD and LINKNAME, and
  871. then creates a symbolic link named LINKNAME and pointing at OLD.  The
  872. effect is that future attempts to open file LINKNAME will refer to
  873. whatever file is named OLD at the time the opening is done, or will
  874. get an error if the name OLD is not in use at that time.  Confirmation
  875. is required when creating the link if LINKNAME is in use.  Note that
  876. not all systems support symbolic links.
  877.  
  878. 
  879. File: emacs,  Node: Buffers,  Next: Windows,  Prev: Files,  Up: Top
  880.  
  881. Using Multiple Buffers
  882. **********************
  883.  
  884.    The text you are editing in Emacs resides in an object called a
  885. "buffer".  Each time you visit a file, a buffer is created to hold the
  886. file's text.  Each time you invoke Dired, a buffer is created to hold
  887. the directory listing.  If you send a message with `C-x m', a buffer
  888. named `*mail*' is used to hold the text of the message.  When you ask
  889. for a command's documentation, that appears in a buffer called
  890. `*Help*'.
  891.  
  892.    At any time, one and only one buffer is "selected".  It is also
  893. called the "current buffer".  Often we say that a command operates on
  894. "the buffer" as if there were only one; but really this means that the
  895. command operates on the selected buffer (most commands do).
  896.  
  897.    When Emacs makes multiple windows, each window has a chosen buffer
  898. which is displayed there, but at any time only one of the windows is
  899. selected and its chosen buffer is the selected buffer.  Each window's
  900. mode line displays the name of the buffer that the window is
  901. displaying (*note Windows::.).
  902.  
  903.    Each buffer has a name, which can be of any length, and you can
  904. select any buffer by giving its name.  Most buffers are made by
  905. visiting files, and their names are derived from the files' names. 
  906. But you can also create an empty buffer with any name you want.  A
  907. newly started Emacs has a buffer named `*scratch*' which can be used
  908. for evaluating Lisp expressions in Emacs.  The distinction between
  909. upper and lower case matters in buffer names.
  910.  
  911.    Each buffer records individually what file it is visiting, whether
  912. it is modified, and what major mode and minor modes are in effect in it
  913. (*note Major Modes::.).  Any Emacs variable can be made "local to" a
  914. particular buffer, meaning its value in that buffer can be different
  915. from the value in other buffers.  *Note Locals::.
  916.  
  917. * Menu:
  918.  
  919. * Select Buffer::   Creating a new buffer or reselecting an old one.
  920. * List Buffers::    Getting a list of buffers that exist.
  921. * Misc Buffer::     Renaming; changing read-onliness; copying text.
  922. * Kill Buffer::     Killing buffers you no longer need.
  923. * Several Buffers:: How to go through the list of all buffers
  924.                      and operate variously on several of them.
  925.  
  926. 
  927. File: emacs,  Node: Select Buffer,  Next: List Buffers,  Prev: Buffers,  Up: Buffers
  928.  
  929. Creating and Selecting Buffers
  930. ==============================
  931.  
  932. `C-x b BUFFER RET'
  933.      Select or create a buffer named BUFFER (`switch-to-buffer').
  934.  
  935. `C-x 4 b BUFFER RET'
  936.      Similar but select a buffer named BUFFER in another window
  937.      (`switch-to-buffer-other-window').
  938.  
  939.    To select the buffer named BUFNAME, type `C-x b BUFNAME RET'.  This
  940. is the command `switch-to-buffer' with argument BUFNAME.  You can use
  941. completion on an abbreviation for the buffer name you want (*note
  942. Completion::.).  An empty argument to `C-x b' specifies the most
  943. recently selected buffer that is not displayed in any window.
  944.  
  945.    Most buffers are created by visiting files, or by Emacs commands
  946. that want to display some text, but you can also create a buffer
  947. explicitly by typing `C-x b BUFNAME RET'.  This makes a new, empty
  948. buffer which is not visiting any file, and selects it for editing. 
  949. Such buffers are used for making notes to yourself.  If you try to
  950. save one, you are asked for the file name to use.  The new buffer's
  951. major mode is determined by the value of `default-major-mode' (*note
  952. Major Modes::.).
  953.  
  954.    Note that `C-x C-f', and any other command for visiting a file, can
  955. also be used to switch buffers.  *Note Visiting::.
  956.  
  957. 
  958. File: emacs,  Node: List Buffers,  Next: Misc Buffer,  Prev: Select Buffer,  Up: Buffers
  959.  
  960. Listing Existing Buffers
  961. ========================
  962.  
  963. `C-x C-b'
  964.      List the existing buffers (`list-buffers').
  965.  
  966.    To print a list of all the buffers that exist, type `C-x C-b'. 
  967. Each line in the list shows one buffer's name, major mode and visited
  968. file.  `*' at the beginning of a line indicates the buffer is
  969. "modified".  If several buffers are modified, it may be time to save
  970. some with `C-x s' (*note Saving::.).  `%' indicates a read-only
  971. buffer.  `.' marks the selected buffer.  Here is an example of a
  972. buffer list:
  973.  
  974.       MR Buffer         Size  Mode           File
  975.       -- ------         ----  ----           ----
  976.      .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  977.          *Help*         1287  Fundamental
  978.          files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  979.        % RMAIL          64042 RMAIL          /u/rms/RMAIL
  980.       *% man            747   Dired
  981.          net.emacs      343885 Fundamental   /u/rms/net.emacs
  982.          fileio.c       27691 C              /u2/emacs/src/fileio.c
  983.          NEWS           67340 Text           /u2/emacs/etc/NEWS
  984.          *scratch*       0     Lisp Interaction
  985.  
  986. Note that the buffer `*Help*' was made by a help request; it is not
  987. visiting any file.  The buffer `man' was made by Dired on the
  988. directory `/u2/emacs/man/'.
  989.  
  990. 
  991. File: emacs,  Node: Misc Buffer,  Next: Kill Buffer,  Prev: List Buffers,  Up: Buffers
  992.  
  993. Miscellaneous Buffer Operations
  994. ===============================
  995.  
  996. `C-x C-q'
  997.      Toggle read-only status of buffer (`toggle-read-only').
  998.  
  999. `M-x rename-buffer'
  1000.      Change the name of the current buffer.
  1001.  
  1002. `M-x view-buffer'
  1003.      Scroll through a buffer.
  1004.  
  1005.    A buffer can be "read-only", which means that commands to change its
  1006. text are not allowed.  Normally, read-only buffers are made by
  1007. subsystems such as Dired and Rmail that have special commands to
  1008. operate on the text; a read-only buffer is also made if you visit a
  1009. file that is protected so you cannot write it.  If you wish to make
  1010. changes in a read-only buffer, use the command `C-x C-q'
  1011. (`toggle-read-only').  It makes a read-only buffer writable, and makes
  1012. a writable buffer read-only.  This works by setting the variable
  1013. `buffer-read-only', which has a local value in each buffer and makes
  1014. the buffer read-only if its value is non-`nil'.
  1015.  
  1016.    `M-x rename-buffer' changes the name of the current buffer.  Specify
  1017. the new name as a minibuffer argument.  There is no default.  If you
  1018. specify a name that is in use for some other buffer, an error happens
  1019. and no renaming is done.
  1020.  
  1021.    `M-x view-buffer' is much like `M-x view-file' (*note Misc File
  1022. Ops::.) except that it examines an already existing Emacs buffer. 
  1023. View mode provides commands for scrolling through the buffer
  1024. conveniently but not for changing it. When you exit View mode, the
  1025. value of point that resulted from your perusal remains in effect.
  1026.  
  1027.    The commands `C-x a' (`append-to-buffer') and `M-x insert-buffer'
  1028. can be used to copy text from one buffer to another.  *Note
  1029. Accumulating Text::.
  1030.  
  1031. 
  1032. File: emacs,  Node: Kill Buffer,  Next: Several Buffers,  Prev: Misc Buffer,  Up: Buffers
  1033.  
  1034. Killing Buffers
  1035. ===============
  1036.  
  1037.    After you use Emacs for a while, you may accumulate a large number
  1038. of buffers.  You may then find it convenient to eliminate the ones you
  1039. no longer need.  There are several commands provided for doing this.
  1040.  
  1041. `C-x k'
  1042.      Kill a buffer, specified by name (`kill-buffer').
  1043.  
  1044. `M-x kill-some-buffers'
  1045.      Offer to kill each buffer, one by one.
  1046.  
  1047.    `C-x k' (`kill-buffer') kills one buffer, whose name you specify in
  1048. the minibuffer.  The default, used if you type just RET in the
  1049. minibuffer, is to kill the current buffer.  If the current buffer is
  1050. killed, another buffer is selected; a buffer that has been selected
  1051. recently but does not appear in any window now is chosen to be
  1052. selected.  If the buffer being killed is modified (has unsaved
  1053. editing) then you are asked to confirm with `yes' before the buffer is
  1054. killed.
  1055.  
  1056.    The command `M-x kill-some-buffers' asks about each buffer, one by
  1057. one.  An answer of `y' means to kill the buffer.  Killing the current
  1058. buffer or a buffer containing unsaved changes selects a new buffer or
  1059. asks for confirmation just like `kill-buffer'.
  1060.  
  1061. 
  1062. File: emacs,  Node: Several Buffers,  Prev: Kill Buffer,  Up: Buffers
  1063.  
  1064. Operating on Several Buffers
  1065. ============================
  1066.  
  1067.    The "buffer-menu" facility is like a "Dired for buffers"; it allows
  1068. you to request operations on various Emacs buffers by editing an Emacs
  1069. buffer containing a list of them.  You can save buffers, kill them
  1070. (here called "deleting" them, for consistency with Dired), or display
  1071. them.
  1072.  
  1073. `M-x buffer-menu'
  1074.      Begin editing a buffer listing all Emacs buffers.
  1075.  
  1076.    The command `buffer-menu' writes a list of all Emacs buffers into
  1077. the buffer `*Buffer List*', and selects that buffer in Buffer Menu
  1078. mode.  The buffer is read-only, and can only be changed through the
  1079. special commands described in this section.  Most of these commands
  1080. are graphic characters.  The usual Emacs cursor motion commands can be
  1081. used in the `*Buffer List*' buffer.  The following special commands
  1082. apply to the buffer described on the current line.
  1083.  
  1084. `d'
  1085.      Request to delete (kill) the buffer, then move down.  The request
  1086.      shows as a `D' on the line, before the buffer name.  Requested
  1087.      deletions take place when the `x' command is used.
  1088.  
  1089. `k'
  1090.      Synonym for `d'.
  1091.  
  1092. `C-d'
  1093.      Like `d' but move up afterwards instead of down.
  1094.  
  1095. `s'
  1096.      Request to save the buffer.  The request shows as an `S' on the
  1097.      line.  Requested saves take place when the `x' command is used. 
  1098.      You may request both saving and deletion for the same buffer.
  1099.  
  1100. `~'
  1101.      Mark buffer "unmodified".  The command `~' does this immediately
  1102.      when typed.
  1103.  
  1104. `x'
  1105.      Perform previously requested deletions and saves.
  1106.  
  1107. `u'
  1108.      Remove any request made for the current line, and move down.
  1109.  
  1110. `DEL'
  1111.      Move to previous line and remove any request made for that line.
  1112.  
  1113.    All the commands that put in or remove flags to request later
  1114. operations also move down a line, and accept a numeric argument as a
  1115. repeat count, unless otherwise specified.
  1116.  
  1117.    There are also special commands to use the buffer list to select
  1118. another buffer, and to specify one or more other buffers for display
  1119. in additional windows.
  1120.  
  1121. `1'
  1122.      Select the buffer in a full-screen window.  This command takes
  1123.      effect immediately.
  1124.  
  1125. `2'
  1126.      Immediately set up two windows, with this buffer in one, and the
  1127.      previously selected buffer (aside from the buffer `*Buffer List*')
  1128.      in the other.
  1129.  
  1130. `f'
  1131.      Immediately select the buffer in place of the `*Buffer List*'
  1132.      buffer.
  1133.  
  1134. `o'
  1135.      Immediately select the buffer in another window as if by `C-x 4
  1136.      b', leaving `*Buffer List*' visible.
  1137.  
  1138. `q'
  1139.      Immediately select this buffer, and also display in other windows
  1140.      any buffers previously flagged with the `m' command.  If there
  1141.      are no such buffers, this command is equivalent to `1'.
  1142.  
  1143. `m'
  1144.      Flag this buffer to be displayed in another window if the `q'
  1145.      command is used.  The request shows as a `>' at the beginning of
  1146.      the line.  The same buffer may not have both a delete request and
  1147.      a display request.
  1148.  
  1149.    All that `buffer-menu' does directly is create and select a suitable
  1150. buffer, and turn on Buffer Menu mode.  Everything else described above
  1151. is implemented by the special commands provided in Buffer Menu mode. 
  1152. One consequence of this is that you can switch from the `*Buffer List*'
  1153. buffer to another Emacs buffer, and edit there.  You can reselect the
  1154. `buffer-menu' buffer later, to perform the operations already
  1155. requested, or you can kill it, or pay no further attention to it.
  1156.  
  1157.    The only difference between `buffer-menu' and `list-buffers' is
  1158. that `buffer-menu' selects the `*Buffer List*' buffer and
  1159. `list-buffers' does not.  If you run `list-buffers' (that is, type
  1160. `C-x C-b') and select the buffer list manually, you can use all of the
  1161. commands described here.
  1162.  
  1163.