home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / emacs.i05 < prev    next >
Encoding:
GNU Info File  |  1993-06-14  |  50.7 KB  |  1,152 lines

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