home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / GNU / emacs.inst / emacs19.idb / usr / gnu / info / emacs-7.z / emacs-7
Encoding:
GNU Info File  |  1994-08-02  |  48.2 KB  |  1,162 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.54 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: Editing with VC,  Next: Variables for Check-in/out,  Prev: Concepts of VC,  Up: Version Control
  6.  
  7. Editing with Version Control
  8. ----------------------------
  9.  
  10.    When you visit a file that is maintained using version control, the
  11. mode line displays `RCS' or `SCCS' to inform you that version control
  12. is in use, and also (in case you care) which low-level system the file
  13. is actually stored in.  Normally, such a source file is read-only, and
  14. the mode line indicates this with `%%'.  With RCS, the mode line also
  15. indicates the number of the head version, which is normally also the
  16. version you are looking at.
  17.  
  18.    These are the commands for editing a file maintained with version
  19. control:
  20.  
  21. `C-x C-q'
  22.      Check the visited file in or out.
  23.  
  24. `C-x v u'
  25.      Revert the buffer and the file to the last checked in version.
  26.  
  27. `C-x v c'
  28.      Remove the last-entered change from the master for the visited
  29.      file.  This undoes your last check-in.
  30.  
  31. `C-x v i'
  32.      Register the visited file in version control.
  33.  
  34. (`C-x v' is the prefix key for version control commands; all of these
  35. commands except for `C-x C-q' start with `C-x v'.)
  36.  
  37.    When you want to modify a file maintained with version control, type
  38. `C-x C-q' (`vc-toggle-read-only').  This "checks out" the file, and
  39. tells RCS or SCCS to lock the file.  This means making the file
  40. writable for you (but not for anyone else).
  41.  
  42.    When you are finished editing the file, type `C-x C-q' again.  When
  43. used on a file that is checked out, this command checks the file in.
  44. But check-in does not start immediately; first, you must enter the "log
  45. entry"--a description of the changes in the new version.  `C-x C-q'
  46. pops up a buffer for you to enter this in.  When you are finished
  47. typing in the log entry, type `C-c C-c' to terminate it; this is when
  48. actual check-in takes place.
  49.  
  50.    Once you have checked in your changes, the file is unlocked, so that
  51. other users can lock it and modify it.
  52.  
  53.    Emacs does not save backup files for source files that are maintained
  54. with version control.  If you want to make backup files despite version
  55. control, set the variable `vc-make-backup-files' to a non-`nil' value.
  56.  
  57.    Normally the work file exists all the time, whether it is locked or
  58. not.  If you set `vc-keep-workfiles' to `nil', then checking in a new
  59. version with `C-x C-q' deletes the work file; but any attempt to visit
  60. the file with Emacs creates it again.
  61.  
  62.    It is not impossible to lock a file that someone else has locked.  If
  63. you try to check out a file that is locked, `C-x C-q' asks you whether
  64. you want to "steal the lock."  If you say yes, the file becomes locked
  65. by you, but a message is sent to the person who had formerly locked the
  66. file, to inform him of what has happened.  The mode line indicates that
  67. a file is locked by someone else by displaying the login name of that
  68. person, before the version number.
  69.  
  70.    If you want to discard your current set of changes and revert to the
  71. last version checked in, use `C-x v u' (`vc-revert-buffer').  This
  72. cancels your last check-out, leaving the file unlocked.  If you want to
  73. make a different set of changes, you must first check the file out
  74. again.  `C-x v u' requires confirmation, unless it sees that you
  75. haven't made any changes since the last checked-in version.
  76.  
  77.    `C-x v u' is also the command to use if you lock a file and then
  78. don't actually change it.
  79.  
  80.    You can cancel a change after checking it in, with `C-x v c'
  81. (`vc-cancel-version').  This command discards all record of the most
  82. recent checked in version, so be careful about using it.  It requires
  83. confirmation with `yes'.  By default, `C-x v c' reverts your workfile
  84. and buffer to the previous version (the one that precedes the version
  85. that is deleted), but you can prevent the reversion by giving the
  86. command a prefix argument.  Then the buffer does not change.
  87.  
  88.    This command with a prefix argument is useful when you have checked
  89. in a change and then discover a trivial error in it; you can cancel the
  90. erroneous check-in, fix the error, and repeat the check-in.
  91.  
  92.    Be careful when invoking `C-x v c', as it is easy to throw away a
  93. lot of work with it.  To help you be careful, this command always asks
  94. for confirmation with `yes'.
  95.  
  96.    You can register the visited file for version control using
  97. `C-x v i' (`vc-register').  If the variable `vc-default-back-end' is
  98. non-`nil', it specifies which version control system to use; otherwise,
  99. this uses RCS if it is installed on your system and SCCS if not.  After
  100. `C-x v i', the file is unlocked and read-only.  Type `C-x C-q' if you
  101. wish to edit it.
  102.  
  103.    By default, the initial version number is 1.1.  If you want to use a
  104. different number, give `C-x v i' a prefix argument; then it reads the
  105. initial version number using the minibuffer.
  106.  
  107.    If `vc-initial-comment' is non-`nil', `C-x v i' reads an initial
  108. comment (much like a log entry) to describe the purpose of this source
  109. file.
  110.  
  111.    To specify the version number for a subsequent checkin, use the
  112. command `C-u C-x v v'.  `C-x v v' (`vc-next-action') is the command
  113. that `C-x C-q' uses to do the "real work" when the visited file uses
  114. version control.  When used for checkin, and given a prefix argument,
  115. it reads the version number with the minibuffer.
  116.  
  117. 
  118. File: emacs,  Node: Variables for Check-in/out,  Next: Log Entries,  Prev: Editing with VC,  Up: Version Control
  119.  
  120. Variables Affecting Check-in and Check-out
  121. ------------------------------------------
  122.  
  123.    If `vc-suppress-confirm' is non-`nil', then `C-x C-q' and `C-x v i'
  124. can save the current buffer without asking, and `C-x v u' also operates
  125. without asking for confirmation.  (This variable does not affect `C-x v
  126. c'; that is so drastic that it should always ask for confirmation.)
  127.  
  128.    VC mode does much of its work by running the shell commands for RCS
  129. and SCCS.  If `vc-command-messages' is non-`nil', VC displays messages
  130. to indicate which shell commands it runs, and additional messages when
  131. the commands finish.
  132.  
  133.    Normally, VC assumes that it can deduce the locked/unlocked state of
  134. files by looking at the file permissions of the work file; this is
  135. fast.  However, if the `RCS' or `SCCS' subdirectory is actually a
  136. symbolic link, then VC does not trust the file permissions to reflect
  137. this status.
  138.  
  139.    You can specify the criterion for whether to trust the file
  140. permissions by setting the variable `vc-mistrust-permissions'.  Its
  141. value may be `t' (always mistrust the file permissions and check the
  142. master file), `nil' (always trust the file permissions), or a function
  143. of one argument which makes the decision.  The argument is the directory
  144. name of the `RCS' or `SCCS' subdirectory.  A non-`nil' value from the
  145. function says to mistrust the file permissions.
  146.  
  147.    If you find that the file permissions of work files are changed
  148. erroneously, set `vc-mistrust-permissions' to `t'.  Then VC always
  149. checks the master file to determine the file's status.
  150.  
  151.    You can specify additional directories to search for version control
  152. programs by setting the variable `vc-path'.  These directories are
  153. searched before the usual search path.  The proper result usually
  154. happens automatically.
  155.  
  156. 
  157. File: emacs,  Node: Log Entries,  Next: Change Logs and VC,  Prev: Variables for Check-in/out,  Up: Version Control
  158.  
  159. Log Entries
  160. -----------
  161.  
  162.    When you're editing an initial comment or log entry for inclusion in
  163. a master file, finish your entry by typing `C-c C-c'.
  164.  
  165. `C-c C-c'
  166.      Finish the comment edit normally (`vc-finish-logentry').  This
  167.      finishes check-in.
  168.  
  169.    To abort check-in, just don't type `C-c C-c' in that buffer.  You
  170. can switch buffers and do other editing.  As long as you don't try to
  171. check in another file, the entry you were editing remains in its
  172. buffer, and you can go back to that buffer at any time to complete the
  173. check-in.
  174.  
  175.    If you change several source files for the same reason, it is often
  176. convenient to specify the same log entry for many of the files.  To do
  177. this, use the history of previous log entries.  The commands `M-n',
  178. `M-p', `M-s' and `M-r' for doing this work just like the minibuffer
  179. history commands (except that these versions are used outside the
  180. minibuffer).
  181.  
  182.    Each time you check in a file, the log entry buffer is put into VC
  183. Log mode, which involves running two hooks: `text-mode-hook' and
  184. `vc-log-mode-hook'.  *Note Hooks::.
  185.  
  186. 
  187. File: emacs,  Node: Change Logs and VC,  Next: Old Versions,  Prev: Log Entries,  Up: Version Control
  188.  
  189. Change Logs and VC
  190. ------------------
  191.  
  192.    If you use RCS for a program and also maintain a change log file for
  193. it (*note Change Log::.), you can generate change log entries
  194. automatically from the version control log entries:
  195.  
  196. `C-x v a'
  197.      Visit the current directory's change log file and create new
  198.      entries for versions checked in since the most recent entry in the
  199.      change log file (`vc-update-change-log').
  200.  
  201.      This command works with RCS only; it does not work with SCCS.
  202.  
  203.    For example, suppose the first line of `ChangeLog' is dated 10 April
  204. 1992, and that the only check-in since then was by Nathaniel Bowditch
  205. to `rcs2log' on 8 May 1992 with log text `Ignore log messages that
  206. start with `#'.'.  Then `C-x v a' visits `ChangeLog' and inserts text
  207. like this:
  208.  
  209.      Fri May  8 21:45:00 1992  Nathaniel Bowditch  (nat@apn.org)
  210.      
  211.              * rcs2log: Ignore log messages that start with `#'.
  212.  
  213. You can then edit the new change log entry further as you wish.
  214.  
  215.    Normally, the log entry for file `foo' is displayed as `* foo: TEXT
  216. OF LOG ENTRY'.  The `:' after `foo' is omitted if the text of the log
  217. entry starts with `(FUNCTIONNAME): '.  For example, if the log entry
  218. for `vc.el' is `(vc-do-command): Check call-process status.', then the
  219. text in `ChangeLog' looks like this:
  220.  
  221.      Wed May  6 10:53:00 1992  Nathaniel Bowditch  (nat@apn.org)
  222.      
  223.              * vc.el (vc-do-command): Check call-process status.
  224.  
  225.    When `C-x v a' adds several change log entries at once, it groups
  226. related log entries together if they all are checked in by the same
  227. author at nearly the same time.  If the log entries for several such
  228. files all have the same text, it coalesces them into a single entry.
  229. For example, suppose the most recent checkins have the following log
  230. entries:
  231.  
  232. For `vc.texinfo':
  233.      Fix expansion typos.
  234. For `vc.el':
  235.      Don't call expand-file-name.
  236. For `vc-hooks.el':
  237.      Don't call expand-file-name.
  238.  
  239.    They appear like this in `ChangeLog':
  240.  
  241.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  242.      
  243.              * vc.texinfo: Fix expansion typos.
  244.      
  245.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  246.  
  247.    Normally, `C-x v a' separates log entries by a blank line, but you
  248. can mark several related log entries to be clumped together (without an
  249. intervening blank line) by starting the text of each related log entry
  250. with a label of the form `{CLUMPNAME} '.  The label itself is not
  251. copied to `ChangeLog'.  For example, suppose the log entries are:
  252.  
  253. For `vc.texinfo':
  254.      {expand} Fix expansion typos.
  255. For `vc.el':
  256.      {expand} Don't call expand-file-name.
  257. For `vc-hooks.el':
  258.      {expand} Don't call expand-file-name.
  259.  
  260. Then the text in `ChangeLog' looks like this:
  261.  
  262.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  263.      
  264.              * vc.texinfo: Fix expansion typos.
  265.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  266.  
  267.    A log entry whose text begins with `#' is not copied to `ChangeLog'.
  268. For example, if you merely fix some misspellings in comments, you can
  269. log the change with an entry beginning with `#' to avoid putting such
  270. trivia into `ChangeLog'.
  271.  
  272. 
  273. File: emacs,  Node: Old Versions,  Next: VC Status,  Prev: Change Logs and VC,  Up: Version Control
  274.  
  275. Examining And Comparing Old Versions
  276. ------------------------------------
  277.  
  278. `C-x v ~ VERSION RET'
  279.      Examine version VERSION of the visited file, in a buffer of its
  280.      own (`vc-version-other-window').
  281.  
  282. `C-x v ='
  283.      Compare the current buffer contents with the latest checked-in
  284.      version of the file.
  285.  
  286. `C-u C-x v = FILE RET OLDVERS RET NEWVERS RET'
  287.      Compare the specified two versions of FILE.
  288.  
  289.    You can examine any version of a file by first visiting it, and then
  290. using `C-x v ~ VERSION RET' (`vc-version-other-window').  This puts the
  291. text of version VERSION in a file named `FILENAME.~VERSION~', then
  292. visits it in a separate window.
  293.  
  294.    To compare two versions of a file, use the command `C-x v ='
  295. (`vc-diff').
  296.  
  297.    Plain `C-x v =' compares the current buffer contents (saving them in
  298. the file if necessary) with the last checked-in version of the file.
  299. With a prefix argument, `C-x v =' reads a file name and two version
  300. numbers, then compares those versions of the specified file.
  301.  
  302.    If you supply a directory name instead of the name of a work file,
  303. this command compares the two specified versions of all registered files
  304. in that directory and its subdirectories.  You can also specify a
  305. snapshot name (*note Snapshots::.) instead of one or both version
  306. numbers.
  307.  
  308.    You can specify a checked-in version by its number; you can specify
  309. the most recent checked-in version with an empty version number.
  310.  
  311.    This command works by running the `diff' utility, getting the
  312. options from the variable `diff-switches'.  It displays the output in a
  313. special buffer in another window.  Unlike the `M-x diff' command, `C-x
  314. v =' does not try to find the changes in the old and new versions.
  315. This is because one or both versions normally do not exist as files.
  316. They exist only in the records of the master file.  *Note Comparing
  317. Files::, for more information about `M-x diff'.
  318.  
  319. 
  320. File: emacs,  Node: VC Status,  Next: Renaming and VC,  Prev: Old Versions,  Up: Version Control
  321.  
  322. VC Status Commands
  323. ------------------
  324.  
  325.    To view the detailed version control status and history of a file,
  326. type `C-x v l' (`vc-print-log').  It displays the history of changes to
  327. the current file, including the text of the log entries.  The output
  328. appears in a separate window.
  329.  
  330.    When you are working on a large program, it's often useful to find
  331. all the files that are currently locked, or all the files maintained in
  332. version control at all.  You can use `C-x v d' (`vc-directory') to show
  333. all the locked files in or beneath the current directory.  This
  334. includes all files that are locked by any user.  `C-u C-x v d' lists
  335. all files in or beneath the current directory that are maintained with
  336. version control.
  337.  
  338.    The list of files is displayed as a buffer that uses an augmented
  339. Dired mode.  The names of the users locking various files are shown (in
  340. parentheses) in place of the owner and group.  All the normal Dired
  341. commands work in this buffer.  Most interactive VC commands work also,
  342. and apply to the file name on the current line.
  343.  
  344.    The `C-x v v' command (`vc-next-action'), when used in the augmented
  345. Dired buffer, operates on all the marked files (or the file on the
  346. current line).  If it operates on more than one file, it handles each
  347. file according to its current state; thus, it may check out one file
  348. and check in another (because it is already checked out).  If it has to
  349. check in any files, it reads a single log entry, then uses that text
  350. for all the files being checked in.  This can be convenient for
  351. registering or checking in several files at once, as part of the same
  352. change.
  353.  
  354. 
  355. File: emacs,  Node: Renaming and VC,  Next: Snapshots,  Prev: VC Status,  Up: Version Control
  356.  
  357. Renaming VC Work Files and Master Files
  358. ---------------------------------------
  359.  
  360.    When you rename a registered file, you must also rename its master
  361. file correspondingly to get proper results.  Use `vc-rename-file' to
  362. rename the source file as you specify, and rename its master file
  363. accordingly.  It also updates any snapshots (*note Snapshots::.) that
  364. mention the file, so that they use the new name; despite this, the
  365. snapshot thus modified may not completely work (*note Snapshot
  366. Caveats::.).
  367.  
  368.    You cannot use `vc-rename-file' on a file that is locked by someone
  369. else.
  370.  
  371. 
  372. File: emacs,  Node: Snapshots,  Next: Version Headers,  Prev: Renaming and VC,  Up: Version Control
  373.  
  374. Snapshots
  375. ---------
  376.  
  377.    A "snapshot" is a named set of file versions (one for each
  378. registered file) that you can treat as a unit.  One important kind of
  379. snapshot is a "release", a (theoretically) stable version of the system
  380. that is ready for distribution to users.
  381.  
  382. * Menu:
  383.  
  384. * Making Snapshots::        The snapshot facilities.
  385. * Snapshot Caveats::        Things to be careful of when using snapshots.
  386.  
  387. 
  388. File: emacs,  Node: Making Snapshots,  Next: Snapshot Caveats,  Up: Snapshots
  389.  
  390. Making and Using Snapshots
  391. ..........................
  392.  
  393.    There are two basic commands for snapshots; one makes a snapshot
  394. with a given name, the other retrieves a named snapshot.
  395.  
  396. `C-x v s NAME RET'
  397.      Define the last saved versions of every registered file in or
  398.      under the current directory as a snapshot named NAME
  399.      (`vc-create-snapshot').
  400.  
  401. `C-x v r NAME RET'
  402.      Check out all registered files at or below the current directory
  403.      level using whatever versions correspond to the snapshot NAME
  404.      (`vc-retrieve-snapshot').
  405.  
  406.      This command reports an error if any files are locked at or below
  407.      the current directory, without changing anything; this is to avoid
  408.      overwriting work in progress.
  409.  
  410.    A snapshot uses a very small amount of resources--just enough to
  411. record the list of file names and which version belongs to the
  412. snapshot.  Thus, you need not hesitate to create snapshots whenever
  413. they are useful.
  414.  
  415.    You can give a snapshot name as an argument to `C-x v =' or `C-x v
  416. ~' (*note Old Versions::.).  Thus, you can use it to compare a snapshot
  417. against the current files, or two snapshots against each other, or a
  418. snapshot against a named version.
  419.  
  420. 
  421. File: emacs,  Node: Snapshot Caveats,  Prev: Making Snapshots,  Up: Snapshots
  422.  
  423. Snapshot Caveats
  424. ................
  425.  
  426.    VC's snapshot facilities are modeled on RCS's named-configuration
  427. support.  They use RCS's native facilities for this, so under VC
  428. snapshots made using RCS are visible even when you bypass VC.
  429.  
  430.    For SCCS, VC implements snapshots itself.  The files it uses contain
  431. name/file/version-number triples.  These snapshots are visible only
  432. through VC.
  433.  
  434.    File renaming and deletion can create some difficulties with
  435. snapshots.  This is not a VC-specific problem, but a general design
  436. issue in version control systems that no one has solved very well yet.
  437.  
  438.    If you rename a registered file, you need to rename its master along
  439. with it (the command `vc-rename-file' does this automatically).  If you
  440. are using SCCS, you must also update the records of the snapshot, to
  441. mention the file by its new name (`vc-rename-file' does this, too).  An
  442. old snapshot that refers to a master file that no longer exists under
  443. the recorded name is invalid; VC can no longer retrieve it.  It would
  444. be beyond the scope of this manual to explain enough about RCS and SCCS
  445. to explain how to update the snapshots by hand.
  446.  
  447.    Using `vc-rename-file' makes the snapshot remain valid for
  448. retrieval, but it does not solve all problems.  For example, some of the
  449. files in the program probably refer to others by name.  At the very
  450. least, the makefile probably mentions the file that you renamed.  If you
  451. retrieve an old snapshot, the renamed file is retrieved under its new
  452. name, which is not the name that the makefile expects.  So the program
  453. won't really work as retrieved.
  454.  
  455. 
  456. File: emacs,  Node: Version Headers,  Prev: Snapshots,  Up: Version Control
  457.  
  458. Inserting Version Control Headers
  459. ---------------------------------
  460.  
  461.    Sometimes it is convenient to put version identification strings
  462. directly into working files.  Certain special strings called "version
  463. headers" are replaced in each successive version by the number of that
  464. version.
  465.  
  466.    You can use the `C-x v h' command (`vc-insert-headers') to insert a
  467. suitable header string.
  468.  
  469. `C-x v h'
  470.      Insert headers in a file for use with your version-control system.
  471.  
  472.    The default header string is `$Id$' for RCS and `%W%' for SCCS.  You
  473. can specify other headers to insert by setting the variable
  474. `vc-header-alist'.  Its value is a list of elements of the form
  475. `(PROGRAM . STRING)' where PROGRAM is `RCS' or `SCCS' and STRING is the
  476. string to use.
  477.  
  478.    Instead of a single string, you can specify a list of strings; then
  479. each string in the list is inserted as a separate header on a line of
  480. its own.
  481.  
  482.    It is often necessary to use "superfluous" backslashes when writing
  483. the strings that you put in this variable.  This is to prevent the
  484. string in the constant from being interpreted as a header itself if the
  485. Emacs Lisp file containing it is maintained with version control.
  486.  
  487.    Each header is inserted surrounded by tabs, inside comment
  488. delimiters, on a new line at the start of the buffer.  Normally the
  489. ordinary comment start and comment end strings of the current mode are
  490. used, but for certain modes, there are special comment delimiters for
  491. this purpose; the variable `vc-comment-alist' specifies them.  Each
  492. element of this list has the form `(MODE STARTER ENDER)'.
  493.  
  494.    The variable `vc-static-header-alist' specifies further strings to
  495. add based on the name of the buffer.  Its value should be a list of
  496. elements of the form `(REGEXP . FORMAT)'.  Whenever REGEXP matches the
  497. buffer name, FORMAT is inserted as part of the header.  A header line
  498. is inserted for each element that matches the buffer name, and for each
  499. string specified by `vc-header-alist'.  The header line is made by
  500. processing the string from `vc-header-alist' with the format taken from
  501. the element.  The default value for `vc-static-header-alist' is:
  502.  
  503.      (("\\.c$" .
  504.        "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
  505.      #endif /* lint */\n"))
  506.  
  507. which specifies insertion of a string of this form:
  508.  
  509.  
  510.      #ifndef lint
  511.      static char vcid[] = "STRING";
  512.      #endif /* lint */
  513.  
  514. 
  515. File: emacs,  Node: ListDir,  Next: Comparing Files,  Prev: Version Control,  Up: Files
  516.  
  517. Listing a File Directory
  518. ========================
  519.  
  520.    The file system groups files into "directories".  A "directory
  521. listing" is a list of all the files in a directory.  Emacs provides
  522. directory listings in brief format (file names only) and verbose format
  523. (sizes, dates, and authors included).
  524.  
  525. `C-x C-d DIR-OR-PATTERN'
  526.      Print a brief directory listing (`list-directory').
  527.  
  528. `C-u C-x C-d DIR-OR-PATTERN'
  529.      Print a verbose directory listing.
  530.  
  531.    The command to display a directory listing is `C-x C-d'
  532. (`list-directory').  It reads using the minibuffer a file name which is
  533. either a directory to be listed or a wildcard-containing pattern for
  534. the files to be listed.  For example,
  535.  
  536.      C-x C-d /u2/emacs/etc RET
  537.  
  538. lists all the files in directory `/u2/emacs/etc'.  An example of
  539. specifying a file name pattern is
  540.  
  541.      C-x C-d /u2/emacs/src/*.c RET
  542.  
  543.    Normally, `C-x C-d' prints a brief directory listing containing just
  544. file names.  A numeric argument (regardless of value) tells it to print
  545. a verbose listing (like `ls -l').
  546.  
  547.    The text of a directory listing is obtained by running `ls' in an
  548. inferior process.  Two Emacs variables control the switches passed to
  549. `ls': `list-directory-brief-switches' is a string giving the switches
  550. to use in brief listings (`"-CF"' by default), and
  551. `list-directory-verbose-switches' is a string giving the switches to
  552. use in a verbose listing (`"-l"' by default).
  553.  
  554. 
  555. File: emacs,  Node: Comparing Files,  Next: Misc File Ops,  Prev: ListDir,  Up: Files
  556.  
  557. Comparing Files
  558. ===============
  559.  
  560.    The command `M-x diff' compares two files, displaying the
  561. differences in an Emacs buffer named `*Diff*'.  It works by running the
  562. `diff' program, using options taken from the variable `diff-switches',
  563. whose value should be a string.
  564.  
  565.    The buffer `*Diff*' has Compilation mode as its major mode, so you
  566. can use `C-x `' to visit successive changed locations in the two source
  567. files.  You can also move to a particular hunk of changes and type `C-c
  568. C-c' to find the corresponding source location.  You can also use the
  569. other special commands of Compilation mode: SPC and DEL for scrolling,
  570. and `M-p' and `M-n' for cursor motion.  *Note Compilation::.
  571.  
  572.    The command `M-x diff-backup' compares a specified file with its most
  573. recent backup.  If you specify the name of a backup file, `diff-backup'
  574. compares it with the source file that it is a backup of.
  575.  
  576.    The command `M-x compare-windows' compares the text in the current
  577. window with that in the next window.  Comparison starts at point in each
  578. window.  Point moves forward in each window, a character at a time in
  579. each window, until the next characters in the two windows are
  580. different.  Then the command is finished.  For more information about
  581. windows in Emacs, *Note Windows::.
  582.  
  583.    With a numeric argument, `compare-windows' ignores changes in
  584. whitespace.  If the variable `compare-ignore-case' is non-`nil', it
  585. ignores differences in case as well.
  586.  
  587.    See also *Note Emerge::, for convenient facilities for merging two
  588. similar files.
  589.  
  590. 
  591. File: emacs,  Node: Misc File Ops,  Prev: Comparing Files,  Up: Files
  592.  
  593. Miscellaneous File Operations
  594. =============================
  595.  
  596.    Emacs has commands for performing many other operations on files.
  597. All operate on one file; they do not accept wild card file names.
  598.  
  599.    `M-x view-file' allows you to scan or read a file by sequential
  600. screenfuls.  It reads a file name argument using the minibuffer.  After
  601. reading the file into an Emacs buffer, `view-file' displays the
  602. beginning.  You can then type SPC to scroll forward one windowful, or
  603. DEL to scroll backward.  Various other commands are provided for moving
  604. around in the file, but none for changing it; type `C-h' while viewing
  605. for a list of them.  They are mostly the same as normal Emacs cursor
  606. motion commands.  To exit from viewing, type `C-c'.  The commands for
  607. viewing are defined by a special major mode called View mode.
  608.  
  609.    A related command, `M-x view-buffer', views a buffer already present
  610. in Emacs.  *Note Misc Buffer::.
  611.  
  612.    `M-x insert-file' inserts a copy of the contents of the specified
  613. file into the current buffer at point, leaving point unchanged before
  614. the contents and the mark after them.
  615.  
  616.    `M-x write-region' is the inverse of `M-x insert-file'; it copies
  617. the contents of the region into the specified file.  `M-x
  618. append-to-file' adds the text of the region to the end of the specified
  619. file.  *Note Accumulating Text::.
  620.  
  621.    `M-x delete-file' deletes the specified file, like the `rm' command
  622. in the shell.  If you are deleting many files in one directory, it may
  623. be more convenient to use Dired (*note Dired::.).
  624.  
  625.    `M-x rename-file' reads two file names OLD and NEW using the
  626. minibuffer, then renames file OLD as NEW.  If a file named NEW already
  627. exists, you must confirm with `yes' or renaming is not done; this is
  628. because renaming causes the old meaning of the name NEW to be lost.  If
  629. OLD and NEW are on different file systems, the file OLD is copied and
  630. deleted.
  631.  
  632.    The similar command `M-x add-name-to-file' is used to add an
  633. additional name to an existing file without removing its old name.  The
  634. new name must belong on the same file system that the file is on.
  635.  
  636.    `M-x copy-file' reads the file OLD and writes a new file named NEW
  637. with the same contents.  Confirmation is required if a file named NEW
  638. already exists, because copying has the consequence of overwriting the
  639. old contents of the file NEW.
  640.  
  641.    `M-x make-symbolic-link' reads two file names OLD and LINKNAME, then
  642. creates a symbolic link named LINKNAME and pointing at OLD.  The effect
  643. is that future attempts to open file LINKNAME will refer to whatever
  644. file is named OLD at the time the opening is done, or will get an error
  645. if the name OLD is not in use at that time.  This command does not
  646. expand the argument FILENAME, so that it allows you to specify a
  647. relative name as the target of the link.
  648.  
  649.    Confirmation is required when creating the link if LINKNAME is in
  650. use.  Note that not all systems support symbolic links.
  651.  
  652. 
  653. File: emacs,  Node: Buffers,  Next: Windows,  Prev: Files,  Up: Top
  654.  
  655. Using Multiple Buffers
  656. **********************
  657.  
  658.    The text you are editing in Emacs resides in an object called a
  659. "buffer".  Each time you visit a file, a buffer is created to hold the
  660. file's text.  Each time you invoke Dired, a buffer is created to hold
  661. the directory listing.  If you send a message with `C-x m', a buffer
  662. named `*mail*' is used to hold the text of the message.  When you ask
  663. for a command's documentation, that appears in a buffer called `*Help*'.
  664.  
  665.    At any time, one and only one buffer is "selected".  It is also
  666. called the "current buffer".  Often we say that a command operates on
  667. "the buffer" as if there were only one; but really this means that the
  668. command operates on the selected buffer (most commands do).
  669.  
  670.    When Emacs has multiple windows, each window has a chosen buffer
  671. which is displayed there, but at any time only one of the windows is
  672. selected and its chosen buffer is the selected buffer.  Each window's
  673. mode line displays the name of the buffer that the window is displaying
  674. (*note Windows::.).
  675.  
  676.    Each buffer has a name, which can be of any length, and you can
  677. select any buffer by giving its name.  Most buffers are made by
  678. visiting files, and their names are derived from the files' names.  But
  679. you can also create an empty buffer with any name you want.  A newly
  680. started Emacs has a buffer named `*scratch*' which can be used for
  681. evaluating Lisp expressions in Emacs.  The distinction between upper
  682. and lower case matters in buffer names.
  683.  
  684.    Each buffer records individually what file it is visiting, whether
  685. it is modified, and what major mode and minor modes are in effect in it
  686. (*note Major Modes::.).  Any Emacs variable can be made "local to" a
  687. particular buffer, meaning its value in that buffer can be different
  688. from the value in other buffers.  *Note Locals::.
  689.  
  690. * Menu:
  691.  
  692. * Select Buffer::   Creating a new buffer or reselecting an old one.
  693. * List Buffers::    Getting a list of buffers that exist.
  694. * Misc Buffer::     Renaming; changing read-onliness; copying text.
  695. * Kill Buffer::     Killing buffers you no longer need.
  696. * Several Buffers:: How to go through the list of all buffers
  697.                       and operate variously on several of them.
  698.  
  699. 
  700. File: emacs,  Node: Select Buffer,  Next: List Buffers,  Up: Buffers
  701.  
  702. Creating and Selecting Buffers
  703. ==============================
  704.  
  705. `C-x b BUFFER RET'
  706.      Select or create a buffer named BUFFER (`switch-to-buffer').
  707.  
  708. `C-x 4 b BUFFER RET'
  709.      Similar, but select BUFFER in another window
  710.      (`switch-to-buffer-other-window').
  711.  
  712.    To select the buffer named BUFNAME, type `C-x b BUFNAME RET'.  This
  713. runs the command `switch-to-buffer' with argument BUFNAME.  You can use
  714. completion on an abbreviation for the buffer name you want (*note
  715. Completion::.).  An empty argument to `C-x b' specifies the most
  716. recently selected buffer that is not displayed in any window.
  717.  
  718.    Most buffers are created by visiting files, or by Emacs commands that
  719. want to display some text, but you can also create a buffer explicitly
  720. by typing `C-x b BUFNAME RET'.  This makes a new, empty buffer which is
  721. not visiting any file, and selects it for editing.  Such buffers are
  722. used for making notes to yourself.  If you try to save one, you are
  723. asked for the file name to use.  The new buffer's major mode is
  724. determined by the value of `default-major-mode' (*note Major Modes::.).
  725.  
  726.    Note that `C-x C-f', and any other command for visiting a file, can
  727. also be used to switch buffers.  *Note Visiting::.
  728.  
  729. 
  730. File: emacs,  Node: List Buffers,  Next: Misc Buffer,  Prev: Select Buffer,  Up: Buffers
  731.  
  732. Listing Existing Buffers
  733. ========================
  734.  
  735. `C-x C-b'
  736.      List the existing buffers (`list-buffers').
  737.  
  738.    To print a list of all the buffers that exist, type `C-x C-b'.  Each
  739. line in the list shows one buffer's name, major mode and visited file.
  740. The buffers are listed in the order, most recently visited first.
  741.  
  742.    `*' at the beginning of a line indicates the buffer is "modified".
  743. If several buffers are modified, it may be time to save some with `C-x
  744. s' (*note Saving::.).  `%' indicates a read-only buffer.  `.' marks the
  745. selected buffer.  Here is an example of a buffer list:
  746.  
  747.       MR Buffer         Size  Mode           File
  748.       -- ------         ----  ----           ----
  749.      .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  750.          *Help*         1287  Fundamental
  751.          files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  752.        % RMAIL          64042 RMAIL          /u/rms/RMAIL
  753.       *% man            747   Dired          /u2/emacs/man/
  754.          net.emacs      343885 Fundamental   /u/rms/net.emacs
  755.          fileio.c       27691 C              /u2/emacs/src/fileio.c
  756.          NEWS           67340 Text           /u2/emacs/etc/NEWS
  757.          *scratch*       0     Lisp Interaction
  758.  
  759. Note that the buffer `*Help*' was made by a help request; it is not
  760. visiting any file.  The buffer `man' was made by Dired on the directory
  761. `/u2/emacs/man/'.
  762.  
  763. 
  764. File: emacs,  Node: Misc Buffer,  Next: Kill Buffer,  Prev: List Buffers,  Up: Buffers
  765.  
  766. Miscellaneous Buffer Operations
  767. ===============================
  768.  
  769. `C-x C-q'
  770.      Toggle read-only status of buffer (`toggle-read-only').
  771.  
  772. `M-x rename-buffer RET NAME RET'
  773.      Change the name of the current buffer.
  774.  
  775. `M-x rename-uniquely'
  776.      Rename the current buffer by adding `<NUMBER>' to the end.
  777.  
  778. `M-x view-buffer RET BUFFER RET'
  779.      Scroll through buffer BUFFER.
  780.  
  781.    A buffer can be "read-only", which means that commands to change its
  782. contents are not allowed.  The mode line indicates read-only buffers
  783. with `%%' near the left margin.
  784.  
  785.    Read-only buffers are made by subsystems such as Dired and Rmail that
  786. have special commands to operate on the text; also if you visit a file
  787. that is protected so you cannot write it.  If you wish to make changes
  788. in a read-only buffer, use the command `C-x C-q'
  789. (`vc-toggle-read-only').  It makes a read-only buffer writable, and
  790. makes a writable buffer read-only.  This works by setting the variable
  791. `buffer-read-only', which has a local value in each buffer and makes
  792. the buffer read-only if its value is non-`nil'.
  793.  
  794.    If the file is maintained with version control, `C-x C-q' works
  795. through the version control system to change the read-only status of
  796. the buffer.
  797.  
  798.    `M-x rename-buffer' changes the name of the current buffer.  Specify
  799. the new name as a minibuffer argument.  There is no default.  If you
  800. specify a name that is in use for some other buffer, an error happens
  801. and no renaming is done.
  802.  
  803.    `M-x rename-uniquely' renames the current buffer to a similar name
  804. with a numeric suffix added to make it both different and unique.  This
  805. command does not need an argument.  It is useful for creating multiple
  806. shell buffers: if you rename the `*Shell*', then do `M-x shell' again,
  807. it makes a new shell buffer named `*Shell*'; meanwhile, the old shell
  808. buffer continues to exist under its altered name.  This method is also
  809. good for mail buffers, compilation buffers, and any Emacs feature which
  810. creates a special buffer with a particular name.
  811.  
  812.    `M-x view-buffer' is much like `M-x view-file' (*note Misc File
  813. Ops::.) except that it examines an already existing Emacs buffer.  View
  814. mode provides commands for scrolling through the buffer conveniently
  815. but not for changing it.  When you exit View mode, the value of point
  816. that resulted from your perusal remains in effect.
  817.  
  818.    The commands `M-x append-to-buffer' and `M-x insert-buffer' can be
  819. used to copy text from one buffer to another.  *Note Accumulating
  820. Text::.
  821.  
  822. 
  823. File: emacs,  Node: Kill Buffer,  Next: Several Buffers,  Prev: Misc Buffer,  Up: Buffers
  824.  
  825. Killing Buffers
  826. ===============
  827.  
  828.    If you continue an Emacs session for a while, you may accumulate a
  829. large number of buffers.  You may then find it convenient to "kill" the
  830. buffers you no longer need.  On most operating systems, killing a
  831. buffer releases its space back to the operating system so that other
  832. programs can use it.  There are several commands for killing buffers:
  833.  
  834. `C-x k BUFNAME RET'
  835.      Kill buffer BUFNAME (`kill-buffer').
  836.  
  837. `M-x kill-some-buffers'
  838.      Offer to kill each buffer, one by one.
  839.  
  840.    `C-x k' (`kill-buffer') kills one buffer, whose name you specify in
  841. the minibuffer.  The default, used if you type just RET in the
  842. minibuffer, is to kill the current buffer.  If you kill the current
  843. buffer, another buffer is selected; one that has been selected recently
  844. but does not appear in any window now.  If you ask to kill a buffer
  845. that is modified (has unsaved editing), then you must confirm with
  846. `yes' before the buffer is killed.
  847.  
  848.    The command `M-x kill-some-buffers' asks about each buffer, one by
  849. one.  An answer of `y' means to kill the buffer.  Killing the current
  850. buffer or a buffer containing unsaved changes selects a new buffer or
  851. asks for confirmation just like `kill-buffer'.
  852.  
  853.    If you want to do something special every time a buffer is killed,
  854. you can add hook functions to the hook `kill-buffer-hook' (*note
  855. Hooks::.).
  856.  
  857. 
  858. File: emacs,  Node: Several Buffers,  Prev: Kill Buffer,  Up: Buffers
  859.  
  860. Operating on Several Buffers
  861. ============================
  862.  
  863.    The "buffer-menu" facility is like a "Dired for buffers"; it allows
  864. you to request operations on various Emacs buffers by editing an Emacs
  865. buffer containing a list of them.  You can save buffers, kill them
  866. (here called "deleting" them, for consistency with Dired), or display
  867. them.
  868.  
  869. `M-x buffer-menu'
  870.      Begin editing a buffer listing all Emacs buffers.
  871.  
  872.    The command `buffer-menu' writes a list of all Emacs buffers into
  873. the buffer `*Buffer List*', and selects that buffer in Buffer Menu
  874. mode.  The buffer is read-only, and can be changed only through the
  875. special commands described in this section.  The usual Emacs cursor
  876. motion commands can be used in the `*Buffer List*' buffer.  The
  877. following commands apply to the buffer described on the current line.
  878.  
  879. `d'
  880.      Request to delete (kill) the buffer, then move down.  The request
  881.      shows as a `D' on the line, before the buffer name.  Requested
  882.      deletions take place when you type the `x' command.
  883.  
  884. `C-d'
  885.      Like `d' but move up afterwards instead of down.
  886.  
  887. `s'
  888.      Request to save the buffer.  The request shows as an `S' on the
  889.      line.  Requested saves take place when you type the `x' command.
  890.      You may request both saving and deletion for the same buffer.
  891.  
  892. `x'
  893.      Perform previously requested deletions and saves.
  894.  
  895. `u'
  896.      Remove any request made for the current line, and move down.
  897.  
  898. `DEL'
  899.      Move to previous line and remove any request made for that line.
  900.  
  901.    The `d', `s' and `u' commands to add or remove flags also move down
  902. a line.  They accept a numeric argument as a repeat count.
  903.  
  904.    These commands operate immediately on the buffer listed on the
  905. current line:
  906.  
  907. `~'
  908.      Mark the buffer "unmodified".  The command `~' does this
  909.      immediately when you type it.
  910.  
  911. `%'
  912.      Toggle the buffer's read-only flag.  The command `%' does this
  913.      immediately when you type it.
  914.  
  915. `t'
  916.      Visit the buffer as a tag table.
  917.  
  918.    There are also commands to select another buffer or buffers:
  919.  
  920. `q'
  921.      Quit the buffer menu--immediately display the most recent formerly
  922.      visible buffer in its place.
  923.  
  924. `f'
  925.      Immediately select this line's buffer in place of the `*Buffer
  926.      List*' buffer.
  927.  
  928. `o'
  929.      Immediately select this line's buffer in another window as if by
  930.      `C-x 4 b', leaving `*Buffer List*' visible.
  931.  
  932. `C-o'
  933.      Immediately display this line's buffer in another window, but don't
  934.      select the window.
  935.  
  936. `1'
  937.      Immediately select this line's buffer in a full-screen window.
  938.  
  939. `2'
  940.      Immediately set up two windows, with this line's buffer in one,
  941.      and the previously selected buffer (aside from the buffer `*Buffer
  942.      List*') in the other.
  943.  
  944. `m'
  945.      Mark this line's buffer to be displayed in another window if the
  946.      `q' command is used.  The request shows as a `>' at the beginning
  947.      of the line.  The same buffer may not have both a delete request
  948.      and a display request.
  949.  
  950. `v'
  951.      Immediately select this line's buffer, and also display in other
  952.      windows any buffers previously marked with the `m' command.  If
  953.      you have not marked any buffers, this command is equivalent to `1'.
  954.  
  955.    All that `buffer-menu' does directly is create and select a suitable
  956. buffer, and turn on Buffer Menu mode.  Everything else described above
  957. is implemented by the special commands provided in Buffer Menu mode.
  958. One consequence of this is that you can switch from the `*Buffer List*'
  959. buffer to another Emacs buffer, and edit there.  You can reselect the
  960. `buffer-menu' buffer later, to perform the operations already
  961. requested, or you can kill it, or pay no further attention to it.
  962.  
  963.    The only difference between `buffer-menu' and `list-buffers' is that
  964. `buffer-menu' selects the `*Buffer List*' buffer and `list-buffers'
  965. does not.  If you run `list-buffers' (that is, type `C-x C-b') and
  966. select the buffer list manually, you can use all of the commands
  967. described here.
  968.  
  969.    The buffer `*Buffer List*' is not updated automatically; its
  970. contents are just text.  If you have created, deleted or renamed
  971. buffers, the way to update `*Buffer List*' to show what you have done
  972. is to repeat the `buffer-menu' command.
  973.  
  974. 
  975. File: emacs,  Node: Windows,  Next: Frames,  Prev: Buffers,  Up: Top
  976.  
  977. Multiple Windows
  978. ****************
  979.  
  980.    Emacs can split a frame into two or many windows.  Multiple windows
  981. can display parts of different buffers, or different parts of one
  982. buffer.  Multiple frames always imply multiple windows, because each
  983. window belongs to one and only one frame.
  984.  
  985. * Menu:
  986.  
  987. * Basic Window::     Introduction to Emacs windows.
  988. * Split Window::     New windows are made by splitting existing windows.
  989. * Other Window::     Moving to another window or doing something to it.
  990. * Pop Up Window::    Finding a file or buffer in another window.
  991. * Change Window::    Deleting windows and changing their sizes.
  992.  
  993. 
  994. File: emacs,  Node: Basic Window,  Next: Split Window,  Prev: Windows,  Up: Windows
  995.  
  996. Concepts of Emacs Windows
  997. =========================
  998.  
  999.    When multiple windows are being displayed, each window has an Emacs
  1000. buffer designated for display in it.  The same buffer may appear in more
  1001. than one window; if it does, any changes in its text are displayed in
  1002. all the windows where it appears.  But the windows showing the same
  1003. buffer can show different parts of it, because each window has its own
  1004. value of point.
  1005.  
  1006.    At any time, one of the windows is the "selected window"; the buffer
  1007. this window is displaying is the current buffer.  The terminal's cursor
  1008. shows the location of point in this window.  Each other window has a
  1009. location of point as well, but since the terminal has only one cursor
  1010. there is no way to show where those locations are.  When you make
  1011. multiple frames, each frame has a cursor which appears in the frame's
  1012. selected window.
  1013.  
  1014.    Commands to move point affect the value of point for the selected
  1015. Emacs window only.  They do not change the value of point in any other
  1016. Emacs window, even one showing the same buffer.  The same is true for
  1017. commands such as `C-x b' to change the selected buffer in the selected
  1018. window; they do not affect other windows at all.  However, there are
  1019. other commands such as `C-x 4 b' that select a different window and
  1020. switch buffers in it.  Also, all commands that display information in a
  1021. window, including (for example) `C-h f' (`describe-function') and `C-x
  1022. C-b' (`list-buffers'), work by switching buffers in a nonselected window
  1023. without affecting the selected window.
  1024.  
  1025.    When multiple windows show the same buffer, they can have different
  1026. regions, because they can have different values of point.  This means
  1027. that in Transient Mark mode, each window highlights a different part of
  1028. the buffer.  The part that is highlighted in the selected window is the
  1029. region that editing commands use.
  1030.  
  1031.    Each window has its own mode line, which displays the buffer name,
  1032. modification status and major and minor modes of the buffer that is
  1033. displayed in the window.  *Note Mode Line::, for full details on the
  1034. mode line.
  1035.  
  1036. 
  1037. File: emacs,  Node: Split Window,  Next: Other Window,  Prev: Basic Window,  Up: Windows
  1038.  
  1039. Splitting Windows
  1040. =================
  1041.  
  1042. `C-x 2'
  1043.      Split the selected window into two windows, one above the other
  1044.      (`split-window-vertically').
  1045.  
  1046. `C-x 3'
  1047.      Split the selected window into two windows positioned side by side
  1048.      (`split-window-horizontally').
  1049.  
  1050.    The command `C-x 2' (`split-window-vertically') breaks the selected
  1051. window into two windows, one above the other.  Both windows start out
  1052. displaying the same buffer, with the same value of point.  By default
  1053. the two windows each get half the height of the window that was split; a
  1054. numeric argument specifies how many lines to give to the top window.
  1055.  
  1056.    `C-x 3' (`split-window-horizontally') breaks the selected window
  1057. into two side-by-side windows.  A numeric argument specifies how many
  1058. columns to give the one on the left.  A line of vertical bars separates
  1059. the two windows.  Windows that are not the full width of the screen
  1060. have mode lines, but they are truncated; also, they do not always
  1061. appear in inverse video, because the Emacs display routines have not
  1062. been taught how to display a region of inverse video that is only part
  1063. of a line on the screen.
  1064.  
  1065.    When a window is less than the full width, text lines too long to
  1066. fit are frequent.  Continuing all those lines might be confusing.  The
  1067. variable `truncate-partial-width-windows' can be set non-`nil' to force
  1068. truncation in all windows less than the full width of the screen,
  1069. independent of the buffer being displayed and its value for
  1070. `truncate-lines'.  *Note Continuation Lines::.
  1071.  
  1072.    Horizontal scrolling is often used in side-by-side windows.  *Note
  1073. Display::.
  1074.  
  1075.    If `split-window-keep-point' is non-nil, `C-x 2' tries to avoid
  1076. shifting any text on the screen by putting point in whichever window
  1077. happens to contain the screen line the cursor is already on.  The
  1078. default is that `split-window-keep-point' is non-nil on slow terminals.
  1079.  
  1080. 
  1081. File: emacs,  Node: Other Window,  Next: Pop Up Window,  Prev: Split Window,  Up: Windows
  1082.  
  1083. Using Other Windows
  1084. ===================
  1085.  
  1086. `C-x o'
  1087.      Select another window (`other-window').  That is `o', not zero.
  1088.  
  1089. `C-M-v'
  1090.      Scroll the next window (`scroll-other-window').
  1091.  
  1092. `M-x compare-windows'
  1093.      Find next place where the text in the selected window does not
  1094.      match the text in the next window.
  1095.  
  1096.    To select a different window, use `C-x o' (`other-window').  That is
  1097. an `o', for `other', not a zero.  When there are more than two windows,
  1098. this command moves through all the windows in a cyclic order, generally
  1099. top to bottom and left to right.  After the rightmost and bottommost
  1100. window, it goes back to the one at the upper left corner.  A numeric
  1101. argument means to move several steps in the cyclic order of windows.  A
  1102. negative argument moves around the cycle in the opposite order.  When
  1103. the minibuffer is active, the minibuffer is the last window in the
  1104. cycle; you can switch from the minibuffer window to one of the other
  1105. windows, and later switch back and finish supplying the minibuffer
  1106. argument that is requested.  *Note Minibuffer Edit::.
  1107.  
  1108.    The usual scrolling commands (*note Display::.) apply to the selected
  1109. window only, but there is one command to scroll the next window.
  1110. `C-M-v' (`scroll-other-window') scrolls the window that `C-x o' would
  1111. select.  It takes arguments, positive and negative, like `C-v'.  (In
  1112. the minibuffer, `C-M-v' scrolls the window that contains the minibuffer
  1113. help display, if any, rather than the next window in the standard
  1114. cyclic order.)
  1115.  
  1116.    The command `M-x compare-windows' lets you compare two files or
  1117. buffers visible in two windows, by moving through them to the next
  1118. mismatch.  *Note Comparing Files::.
  1119.  
  1120. 
  1121. File: emacs,  Node: Pop Up Window,  Next: Change Window,  Prev: Other Window,  Up: Windows
  1122.  
  1123. Displaying in Another Window
  1124. ============================
  1125.  
  1126.    `C-x 4' is a prefix key for commands that select another window
  1127. (splitting the window if there is only one) and select a buffer in that
  1128. window.  Different `C-x 4' commands have different ways of finding the
  1129. buffer to select.
  1130.  
  1131. `C-x 4 b BUFNAME RET'
  1132.      Select buffer BUFNAME in another window.  This runs
  1133.      `switch-to-buffer-other-window'.
  1134.  
  1135. `C-x 4 C-o BUFNAME RET'
  1136.      Display buffer BUFNAME in another window, but don't select that
  1137.      buffer or that window.  This runs `display-buffer'.
  1138.  
  1139. `C-x 4 f FILENAME RET'
  1140.      Visit file FILENAME and select its buffer in another window.  This
  1141.      runs `find-file-other-window'.  *Note Visiting::.
  1142.  
  1143. `C-x 4 d DIRECTORY RET'
  1144.      Select a Dired buffer for directory DIRECTORY in another window.
  1145.      This runs `dired-other-window'.  *Note Dired::.
  1146.  
  1147. `C-x 4 m'
  1148.      Start composing a mail message in another window.  This runs
  1149.      `mail-other-window'; its same-window analogue is `C-x m' (*note
  1150.      Sending Mail::.).
  1151.  
  1152. `C-x 4 .'
  1153.      Find a tag in the current tag table in another window.  This runs
  1154.      `find-tag-other-window', the multiple-window variant of `M-.'
  1155.      (*note Tags::.).
  1156.  
  1157. `C-x 4 r FILENAME RET'
  1158.      Visit file FILENAME read-only, and select its buffer in another
  1159.      window.  This runs `find-file-read-only-other-window'.  *Note
  1160.      Visiting::.
  1161.  
  1162.