This commit was generated by cvs2svn to compensate for changes in r6453,
[chise/xemacs-chise.git.1] / info / xemacs.info-7
1 This is Info file ../../info/xemacs.info, produced by Makeinfo version
2 1.68 from the input file xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
25
26    Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
31
32 \1f
33 File: xemacs.info,  Node: Backup Copying,  Prev: Backup Deletion,  Up: Backup
34
35 Copying vs. Renaming
36 ....................
37
38    You can make backup files by copying the old file or by renaming it.
39 This makes a difference when the old file has multiple names.  If you
40 rename the old file into the backup file, the alternate names become
41 names for the backup file.  If you copy the old file instead, the
42 alternate names remain names for the file that you are editing, and the
43 contents accessed by those names will be the new contents.
44
45    How you make a backup file may also affect the file's owner and
46 group.  If you use copying, they do not change.  If renaming is used,
47 you become the file's owner, and the file's group becomes the default
48 (different operating systems have different defaults for the group).
49
50    Having the owner change is usually a good idea, because then the
51 owner is always the person who last edited the file.  Occasionally
52 there is a file whose owner should not change.  Since most files should
53 change owners, it is a good idea to use local variable lists to set
54 `backup-by-copying-when-mismatch' for the special cases where the owner
55 should not change (*note File Variables::.).
56
57    Three variables control the choice of renaming or copying.
58 Normally, renaming is done.  If the variable `backup-by-copying' is
59 non-`nil', copying is used.  Otherwise, if the variable
60 `backup-by-copying-when-linked' is non-`nil', copying is done for files
61 that have multiple names, but renaming may still be done when the file
62 being edited has only one name.  If the variable
63 `backup-by-copying-when-mismatch' is non-`nil', copying is done if
64 renaming would cause the file's owner or group to change.
65
66 \1f
67 File: xemacs.info,  Node: Interlocking,  Prev: Backup,  Up: Saving
68
69 Protection Against Simultaneous Editing
70 ---------------------------------------
71
72    Simultaneous editing occurs when two users visit the same file, both
73 make changes, and both save their changes.  If no one was informed that
74 this was happening, and you saved first, you would later find that your
75 changes were lost.  On some systems, Emacs notices immediately when the
76 second user starts to change a file already being edited, and issues a
77 warning.  When this is not possible, or if the second user has started
78 to change the file despite the warning, Emacs checks when the file is
79 saved, and issues a second warning when a user is about to overwrite a
80 file containing another user's changes.  If you are the user editing the
81 file, you can take corrective action at this point and prevent actual
82 loss of work.
83
84    When you make the first modification in an Emacs buffer that is
85 visiting a file, Emacs records that you have locked the file.  (It does
86 this by writing another file in a directory reserved for this purpose.)
87 The lock is removed when you save the changes.  The idea is that the
88 file is locked whenever the buffer is modified.  If you begin to modify
89 the buffer while the visited file is locked by someone else, this
90 constitutes a collision, and Emacs asks you what to do.  It does this
91 by calling the Lisp function `ask-user-about-lock', which you can
92 redefine to customize what it does.  The standard definition of this
93 function asks you a question and accepts three possible answers:
94
95 `s'
96      Steal the lock.  Whoever was already changing the file loses the
97      lock, and you get the lock.
98
99 `p'
100      Proceed.  Go ahead and edit the file despite its being locked by
101      someone else.
102
103 `q'
104      Quit.  This causes an error (`file-locked') and the modification
105      you were trying to make in the buffer does not actually take place.
106
107    Note that locking works on the basis of a file name; if a file has
108 multiple names, Emacs does not realize that the two names are the same
109 file and cannot prevent two users from editing it simultaneously under
110 different names.  However, basing locking on names means that Emacs can
111 interlock the editing of new files that do not really exist until they
112 are saved.
113
114    Some systems are not configured to allow Emacs to make locks.  On
115 these systems, Emacs cannot detect trouble in advance, but it can still
116 detect it in time to prevent you from overwriting someone else's
117 changes.
118
119    Every time Emacs saves a buffer, it first checks the
120 last-modification date of the existing file on disk to see that it has
121 not changed since the file was last visited or saved.  If the date does
122 not match, it implies that changes were made in the file in some other
123 way, and these changes are about to be lost if Emacs actually does
124 save.  To prevent this, Emacs prints a warning message and asks for
125 confirmation before saving.  Occasionally you will know why the file
126 was changed and know that it does not matter; then you can answer `yes'
127 and proceed.  Otherwise, you should cancel the save with `C-g' and
128 investigate the situation.
129
130    The first thing you should do when notified that simultaneous editing
131 has already taken place is to list the directory with `C-u C-x C-d'
132 (*note Directory Listing: ListDir.).  This will show the file's current
133 author.  You should attempt to contact that person and ask him not to
134 continue editing.  Often the next step is to save the contents of your
135 Emacs buffer under a different name, and use `diff' to compare the two
136 files.
137
138    Simultaneous editing checks are also made when you visit a file that
139 is already visited with `C-x C-f' and when you start to modify a file.
140 This is not strictly necessary, but it is useful to find out about such
141 a problem as early as possible, when corrective action takes less work.
142
143    Another way to protect your file is to set the read, write, and
144 executable permissions for the file. Use the function
145 `set-default-file-modes' to set the UNIX `umask' value to the NMASK
146 argument. The `umask' value is the default protection mode for new
147 files.
148
149 \1f
150 File: xemacs.info,  Node: Reverting,  Next: Auto Save,  Prev: Saving,  Up: Files
151
152 Reverting a Buffer
153 ==================
154
155    If you have made extensive changes to a file and then change your
156 mind about them, you can get rid of all changes by reading in the
157 previous version of the file.  To do this, use `M-x revert-buffer',
158 which operates on the current buffer.  Since reverting a buffer can
159 result in very extensive changes, you must confirm it with `yes'.
160
161    If the current buffer has been auto-saved more recently than it has
162 been saved explicitly, `revert-buffer' offers to read the auto save file
163 instead of the visited file (*note Auto Save::.).  Emacs asks you about
164 the auto-save file before the request for confirmation of the
165 `revert-buffer' operation, and demands `y' or `n' as an answer.  If you
166 have started to type `yes' for confirmation without realizing that the
167 auto-save question was going to be asked, the `y' will answer that
168 question, but the `es' will not be valid confirmation.  This gives you
169 a chance to cancel the operation with `C-g' and try again with the
170 answers you really intend.
171
172    `revert-buffer' keeps point at the same distance (measured in
173 characters) from the beginning of the file.  If the file was edited only
174 slightly, you will be at approximately the same piece of text after
175 reverting as before.  If you have made more extensive changes, the
176 value of point in the old file may bring you to a totally different
177 piece of text than your last editing point.
178
179    A buffer reverted from its visited file is marked "not modified"
180 until you make a change.
181
182    Some kinds of buffers whose contents reflect data bases other than
183 files, such as Dired buffers, can also be reverted.  For them,
184 reverting means recalculating their contents from the appropriate data.
185 Buffers created randomly with `C-x b' cannot be reverted;
186 `revert-buffer' reports an error when asked to do so.
187
188 \1f
189 File: xemacs.info,  Node: Auto Save,  Next: Version Control,  Prev: Reverting,  Up: Files
190
191 Auto-Saving: Protection Against Disasters
192 =========================================
193
194    Emacs saves all the visited files from time to time (based on
195 counting your keystrokes) without being asked.  This is called
196 "auto-saving".  It prevents you from losing more than a limited amount
197 of work if the system crashes.
198
199    When Emacs determines it is time for auto-saving, each buffer is
200 considered and is auto-saved if auto-saving is turned on for it and it
201 has changed since the last time it was auto-saved.  If any auto-saving
202 is done, the message `Auto-saving...' is displayed in the echo area
203 until auto-saving is finished.  Errors occurring during auto-saving are
204 caught so that they do not interfere with the execution of commands you
205 have been typing.
206
207 * Menu:
208
209 * Files: Auto Save Files.
210 * Control: Auto Save Control.
211 * Recover::             Recovering text from auto-save files.
212
213 \1f
214 File: xemacs.info,  Node: Auto Save Files,  Next: Auto Save Control,  Prev: Auto Save,  Up: Auto Save
215
216 Auto-Save Files
217 ---------------
218
219    Auto-saving does not normally write to the files you visited, because
220 it can be undesirable to save a program that is in an inconsistent
221 state when you have made only half of a planned change.  Instead,
222 auto-saving is done in a different file called the "auto-save file",
223 and the visited file is changed only when you save explicitly, for
224 example, with `C-x C-s'.
225
226    Normally, the name of the auto-save file is generated by appending
227 `#' to the front and back of the visited file name.  Thus, a buffer
228 visiting file `foo.c' would be auto-saved in a file `#foo.c#'.  Most
229 buffers that are not visiting files are auto-saved only if you request
230 it explicitly; when they are auto-saved, the auto-save file name is
231 generated by appending `#%' to the front and `#' to the back of buffer
232 name.  For example, the `*mail*' buffer in which you compose messages
233 to be sent is auto-saved in a file named `#%*mail*#'.  Names of
234 auto-save files are generated this way unless you customize the
235 functions `make-auto-save-file-name' and `auto-save-file-name-p' to do
236 something different.  The file name to be used for auto-saving a buffer
237 is calculated at the time auto-saving is turned on in that buffer.
238
239    If you want auto-saving to be done in the visited file, set the
240 variable `auto-save-visited-file-name' to be non-`nil'.  In this mode,
241 there is really no difference between auto-saving and explicit saving.
242
243    Emacs deletes a buffer's auto-save file when you explicitly save the
244 buffer.  To inhibit the deletion, set the variable
245 `delete-auto-save-files' to `nil'.  Changing the visited file name with
246 `C-x C-w' or `set-visited-file-name' renames any auto-save file to
247 correspond to the new visited name.
248
249 \1f
250 File: xemacs.info,  Node: Auto Save Control,  Next: Recover,  Prev: Auto Save Files,  Up: Auto Save
251
252 Controlling Auto-Saving
253 -----------------------
254
255    Each time you visit a file, auto-saving is turned on for that file's
256 buffer if the variable `auto-save-default' is non-`nil' (but not in
257 batch mode; *note Entering Emacs::.).  The default for this variable is
258 `t', so Emacs auto-saves buffers that visit files by default.  You can
259 use the command `M-x auto-save-mode' to turn auto-saving for a buffer
260 on or off.  Like other minor mode commands, `M-x auto-save-mode' turns
261 auto-saving on with a positive argument, off with a zero or negative
262 argument; with no argument, it toggles.
263
264    Emacs performs auto-saving periodically based on counting how many
265 characters you have typed since the last time auto-saving happened.  The
266 variable `auto-save-interval' specifies the number of characters
267 between auto-saves.  By default, it is 300.  Emacs also auto-saves
268 whenever you call the function `do-auto-save'.
269
270    Emacs also does auto-saving whenever it gets a fatal error.  This
271 includes killing the Emacs job with a shell command such as `kill
272 -emacs', or disconnecting a phone line or network connection.
273
274    You can set the number of seconds of idle time before an auto-save is
275 done. Setting the value of the variable `auto-save-timeout' to zero or
276 `nil' will  disable auto-saving due to idleness.
277
278    The actual amount of idle time between auto-saves is logarithmically
279 related to the size of the current buffer.  This variable is the number
280 of seconds after which an auto-save will happen when the current buffer
281 is 50k or less; the timeout will be 2 1/4 times this in a 200k buffer, 3
282 3/4 times this in a 1000k buffer, and 4 1/2 times this in a 2000k
283 buffer.
284
285    For this variable to have any effect, you must do `(require 'timer)'.
286
287 \1f
288 File: xemacs.info,  Node: Recover,  Prev: Auto Save Control,  Up: Auto Save
289
290 Recovering Data from Auto-Saves
291 -------------------------------
292
293    If you want to use the contents of an auto-save file to recover from
294 a loss of data, use the command `M-x recover-file <RET> FILE <RET>'.
295 Emacs visits FILE and then (after your confirmation) restores the
296 contents from the auto-save file `#FILE#'.  You can then save the file
297 with `C-x C-s' to put the recovered text into FILE itself.  For
298 example, to recover file `foo.c' from its auto-save file `#foo.c#', do:
299
300      M-x recover-file <RET> foo.c <RET>
301      C-x C-s
302
303    Before asking for confirmation, `M-x recover-file' displays a
304 directory listing describing the specified file and the auto-save file,
305 so you can compare their sizes and dates.  If the auto-save file is
306 older, `M-x recover-file' does not offer to read it.
307
308    Auto-saving is disabled by `M-x recover-file' because using this
309 command implies that the auto-save file contains valuable data from a
310 past session.  If you save the data in the visited file and then go on
311 to make new changes, turn auto-saving back on with `M-x auto-save-mode'.
312
313 \1f
314 File: xemacs.info,  Node: Version Control,  Next: ListDir,  Prev: Auto Save,  Up: Files
315
316 Version Control
317 ===============
318
319    "Version control systems" are packages that can record multiple
320 versions of a source file, usually storing the unchanged parts of the
321 file just once.  Version control systems also record history information
322 such as the creation time of each version, who created it, and a
323 description of what was changed in that version.
324
325    The GNU project recommends the version control system known as RCS,
326 which is free software and available from the Free Software Foundation.
327 Emacs supports use of either RCS or SCCS (a proprietary, but widely
328 used, version control system that is not quite as powerful as RCS)
329 through a facility called VC.  The same Emacs commands work with either
330 RCS or SCCS, so you hardly have to know which one of them you are using.
331
332 * Menu:
333
334 * Concepts of VC::              Basic version control information;
335                                   checking files in and out.
336 * Editing with VC::             Commands for editing a file maintained
337                                   with version control.
338 * Variables for Check-in/out::  Variables that affect the commands used
339                                   to check files in or out.
340 * Log Entries::                 Logging your changes.
341 * Change Logs and VC::          Generating a change log file from log
342                                   entries.
343 * Old Versions::                Examining and comparing old versions.
344 * VC Status::                   Commands to view the VC status of files and
345                                   look at log entries.
346 * Renaming and VC::             A command to rename both the source and
347                                   master file correctly.
348 * Snapshots::                   How to make and use snapshots, a set of
349                                   file versions that can be treated as a unit.
350 * Version Headers::             Inserting version control headers into
351                                   working files.
352
353 \1f
354 File: xemacs.info,  Node: Concepts of VC,  Next: Editing with VC,  Prev: Version Control,  Up: Version Control
355
356 Concepts of Version Control
357 ---------------------------
358
359    When a file is under version control, we also say that it is
360 "registered" in the version control system.  Each registered file has a
361 corresponding "master file" which represents the file's present state
362 plus its change history, so that you can reconstruct from it either the
363 current version or any specified earlier version.  Usually the master
364 file also records a "log entry" for each version describing what was
365 changed in that version.
366
367    The file that is maintained under version control is sometimes called
368 the "work file" corresponding to its master file.
369
370    To examine a file, you "check it out".  This extracts a version of
371 the source file (typically, the most recent) from the master file.  If
372 you want to edit the file, you must check it out "locked".  Only one
373 user can do this at a time for any given source file.  (This kind of
374 locking is completely unrelated to the locking that Emacs uses to
375 detect simultaneous editing of a file.)
376
377    When you are done with your editing, you must "check in" the new
378 version.  This records the new version in the master file, and unlocks
379 the source file so that other people can lock it and thus modify it.
380
381    Checkin and checkout are the basic operations of version control.
382 You can do both of them with a single Emacs command: `C-x C-q'
383 (`vc-toggle-read-only').
384
385    A "snapshot" is a coherent collection of versions of the various
386 files that make up a program.  *Note Snapshots::.
387
388 \1f
389 File: xemacs.info,  Node: Editing with VC,  Next: Variables for Check-in/out,  Prev: Concepts of VC,  Up: Version Control
390
391 Editing with Version Control
392 ----------------------------
393
394    When you visit a file that is maintained using version control, the
395 mode line displays `RCS' or `SCCS' to inform you that version control
396 is in use, and also (in case you care) which low-level system the file
397 is actually stored in.  Normally, such a source file is read-only, and
398 the mode line indicates this with `%%'.  With RCS, the mode line also
399 indicates the number of the head version, which is normally also the
400 version you are looking at.
401
402    These are the commands for editing a file maintained with version
403 control:
404
405 `C-x C-q'
406      Check the visited file in or out.
407
408 `C-x v u'
409      Revert the buffer and the file to the last checked in version.
410
411 `C-x v c'
412      Remove the last-entered change from the master for the visited
413      file.  This undoes your last check-in.
414
415 `C-x v i'
416      Register the visited file in version control.
417
418 (`C-x v' is the prefix key for version control commands; all of these
419 commands except for `C-x C-q' start with `C-x v'.)
420
421    When you want to modify a file maintained with version control, type
422 `C-x C-q' (`vc-toggle-read-only').  This "checks out" the file, and
423 tells RCS or SCCS to lock the file.  This means making the file
424 writable for you (but not for anyone else).
425
426    When you are finished editing the file, type `C-x C-q' again.  When
427 used on a file that is checked out, this command checks the file in.
428 But check-in does not start immediately; first, you must enter the "log
429 entry"--a description of the changes in the new version.  `C-x C-q'
430 pops up a buffer for you to enter this in.  When you are finished
431 typing in the log entry, type `C-c C-c' to terminate it; this is when
432 actual check-in takes place.
433
434    Once you have checked in your changes, the file is unlocked, so that
435 other users can lock it and modify it.
436
437    Emacs does not save backup files for source files that are maintained
438 with version control.  If you want to make backup files despite version
439 control, set the variable `vc-make-backup-files' to a non-`nil' value.
440
441    Normally the work file exists all the time, whether it is locked or
442 not.  If you set `vc-keep-workfiles' to `nil', then checking in a new
443 version with `C-x C-q' deletes the work file; but any attempt to visit
444 the file with Emacs creates it again.
445
446    It is not impossible to lock a file that someone else has locked.  If
447 you try to check out a file that is locked, `C-x C-q' asks you whether
448 you want to "steal the lock."  If you say yes, the file becomes locked
449 by you, but a message is sent to the person who had formerly locked the
450 file, to inform him of what has happened.  The mode line indicates that
451 a file is locked by someone else by displaying the login name of that
452 person, before the version number.
453
454    If you want to discard your current set of changes and revert to the
455 last version checked in, use `C-x v u' (`vc-revert-buffer').  This
456 cancels your last check-out, leaving the file unlocked.  If you want to
457 make a different set of changes, you must first check the file out
458 again.  `C-x v u' requires confirmation, unless it sees that you
459 haven't made any changes since the last checked-in version.
460
461    `C-x v u' is also the command to use if you lock a file and then
462 don't actually change it.
463
464    You can cancel a change after checking it in, with `C-x v c'
465 (`vc-cancel-version').  This command discards all record of the most
466 recent checked in version, so be careful about using it.  It requires
467 confirmation with `yes'.  By default, `C-x v c' reverts your workfile
468 and buffer to the previous version (the one that precedes the version
469 that is deleted), but you can prevent the reversion by giving the
470 command a prefix argument.  Then the buffer does not change.
471
472    This command with a prefix argument is useful when you have checked
473 in a change and then discover a trivial error in it; you can cancel the
474 erroneous check-in, fix the error, and repeat the check-in.
475
476    Be careful when invoking `C-x v c', as it is easy to throw away a
477 lot of work with it.  To help you be careful, this command always
478 requires confirmation with `yes'.
479
480    You can register the visited file for version control using
481 `C-x v i' (`vc-register').  If the variable `vc-default-back-end' is
482 non-`nil', it specifies which version control system to use; otherwise,
483 this uses RCS if it is installed on your system and SCCS if not.  After
484 `C-x v i', the file is unlocked and read-only.  Type `C-x C-q' if you
485 wish to edit it.
486
487    By default, the initial version number is 1.1.  If you want to use a
488 different number, give `C-x v i' a prefix argument; then it reads the
489 initial version number using the minibuffer.
490
491    If `vc-initial-comment' is non-`nil', `C-x v i' reads an initial
492 comment (much like a log entry) to describe the purpose of this source
493 file.
494
495    To specify the version number for a subsequent checkin, use the
496 command `C-u C-x v v'.  `C-x v v' (`vc-next-action') is the command
497 that `C-x C-q' uses to do the "real work" when the visited file uses
498 version control.  When used for checkin, and given a prefix argument,
499 it reads the version number with the minibuffer.
500
501 \1f
502 File: xemacs.info,  Node: Variables for Check-in/out,  Next: Log Entries,  Prev: Editing with VC,  Up: Version Control
503
504 Variables Affecting Check-in and Check-out
505 ------------------------------------------
506
507    If `vc-suppress-confirm' is non-`nil', then `C-x C-q' and `C-x v i'
508 can save the current buffer without asking, and `C-x v u' also operates
509 without asking for confirmation.  (This variable does not affect `C-x v
510 c'; that is so drastic that it should always ask for confirmation.)
511
512    VC mode does much of its work by running the shell commands for RCS
513 and SCCS.  If `vc-command-messages' is non-`nil', VC displays messages
514 to indicate which shell commands it runs, and additional messages when
515 the commands finish.
516
517    Normally, VC assumes that it can deduce the locked/unlocked state of
518 files by looking at the file permissions of the work file; this is
519 fast.  However, if the `RCS' or `SCCS' subdirectory is actually a
520 symbolic link, then VC does not trust the file permissions to reflect
521 this status.
522
523    You can specify the criterion for whether to trust the file
524 permissions by setting the variable `vc-mistrust-permissions'.  Its
525 value may be `t' (always mistrust the file permissions and check the
526 master file), `nil' (always trust the file permissions), or a function
527 of one argument which makes the decision.  The argument is the directory
528 name of the `RCS' or `SCCS' subdirectory.  A non-`nil' value from the
529 function says to mistrust the file permissions.
530
531    If you find that the file permissions of work files are changed
532 erroneously, set `vc-mistrust-permissions' to `t'.  Then VC always
533 checks the master file to determine the file's status.
534
535    You can specify additional directories to search for version control
536 programs by setting the variable `vc-path'.  These directories are
537 searched before the usual search path.  The proper result usually
538 happens automatically.
539
540 \1f
541 File: xemacs.info,  Node: Log Entries,  Next: Change Logs and VC,  Prev: Variables for Check-in/out,  Up: Version Control
542
543 Log Entries
544 -----------
545
546    When you're editing an initial comment or log entry for inclusion in
547 a master file, finish your entry by typing `C-c C-c'.
548
549 `C-c C-c'
550      Finish the comment edit normally (`vc-finish-logentry').  This
551      finishes check-in.
552
553    To abort check-in, just don't type `C-c C-c' in that buffer.  You
554 can switch buffers and do other editing.  As long as you don't try to
555 check in another file, the entry you were editing remains in its
556 buffer, and you can go back to that buffer at any time to complete the
557 check-in.
558
559    If you change several source files for the same reason, it is often
560 convenient to specify the same log entry for many of the files.  To do
561 this, use the history of previous log entries.  The commands `M-n',
562 `M-p', `M-s' and `M-r' for doing this work just like the minibuffer
563 history commands (except that these versions are used outside the
564 minibuffer).
565
566    Each time you check in a file, the log entry buffer is put into VC
567 Log mode, which involves running two hooks: `text-mode-hook' and
568 `vc-log-mode-hook'.
569
570 \1f
571 File: xemacs.info,  Node: Change Logs and VC,  Next: Old Versions,  Prev: Log Entries,  Up: Version Control
572
573 Change Logs and VC
574 ------------------
575
576    If you use RCS for a program and also maintain a change log file for
577 it (*note Change Log::.), you can generate change log entries
578 automatically from the version control log entries:
579
580 `C-x v a'
581      Visit the current directory's change log file and create new
582      entries for versions checked in since the most recent entry in the
583      change log file (`vc-update-change-log').
584
585      This command works with RCS only; it does not work with SCCS.
586
587    For example, suppose the first line of `ChangeLog' is dated 10 April
588 1992, and that the only check-in since then was by Nathaniel Bowditch
589 to `rcs2log' on 8 May 1992 with log text `Ignore log messages that
590 start with `#'.'.  Then `C-x v a' visits `ChangeLog' and inserts text
591 like this:
592
593      Fri May  8 21:45:00 1992  Nathaniel Bowditch  (nat@apn.org)
594      
595              * rcs2log: Ignore log messages that start with `#'.
596
597 You can then edit the new change log entry further as you wish.
598
599    Normally, the log entry for file `foo' is displayed as `* foo: TEXT
600 OF LOG ENTRY'.  The `:' after `foo' is omitted if the text of the log
601 entry starts with `(FUNCTIONNAME): '.  For example, if the log entry
602 for `vc.el' is `(vc-do-command): Check call-process status.', then the
603 text in `ChangeLog' looks like this:
604
605      Wed May  6 10:53:00 1992  Nathaniel Bowditch  (nat@apn.org)
606      
607              * vc.el (vc-do-command): Check call-process status.
608
609    When `C-x v a' adds several change log entries at once, it groups
610 related log entries together if they all are checked in by the same
611 author at nearly the same time.  If the log entries for several such
612 files all have the same text, it coalesces them into a single entry.
613 For example, suppose the most recent checkins have the following log
614 entries:
615
616 For `vc.texinfo':
617      Fix expansion typos.
618 For `vc.el':
619      Don't call expand-file-name.
620 For `vc-hooks.el':
621      Don't call expand-file-name.
622
623    They appear like this in `ChangeLog':
624
625      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
626      
627              * vc.texinfo: Fix expansion typos.
628      
629              * vc.el, vc-hooks.el: Don't call expand-file-name.
630
631    Normally, `C-x v a' separates log entries by a blank line, but you
632 can mark several related log entries to be clumped together (without an
633 intervening blank line) by starting the text of each related log entry
634 with a label of the form `{CLUMPNAME} '.  The label itself is not
635 copied to `ChangeLog'.  For example, suppose the log entries are:
636
637 For `vc.texinfo':
638      {expand} Fix expansion typos.
639 For `vc.el':
640      {expand} Don't call expand-file-name.
641 For `vc-hooks.el':
642      {expand} Don't call expand-file-name.
643
644 Then the text in `ChangeLog' looks like this:
645
646      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
647      
648              * vc.texinfo: Fix expansion typos.
649              * vc.el, vc-hooks.el: Don't call expand-file-name.
650
651    A log entry whose text begins with `#' is not copied to `ChangeLog'.
652 For example, if you merely fix some misspellings in comments, you can
653 log the change with an entry beginning with `#' to avoid putting such
654 trivia into `ChangeLog'.
655
656 \1f
657 File: xemacs.info,  Node: Old Versions,  Next: VC Status,  Prev: Change Logs and VC,  Up: Version Control
658
659 Examining And Comparing Old Versions
660 ------------------------------------
661
662 `C-x v ~ VERSION <RET>'
663      Examine version VERSION of the visited file, in a buffer of its
664      own (`vc-version-other-window').
665
666 `C-x v ='
667      Compare the current buffer contents with the latest checked-in
668      version of the file.
669
670 `C-u C-x v = FILE <RET> OLDVERS <RET> NEWVERS <RET>'
671      Compare the specified two versions of FILE.
672
673    You can examine any version of a file by first visiting it, and then
674 using `C-x v ~ VERSION <RET>' (`vc-version-other-window').  This puts
675 the text of version VERSION in a file named `FILENAME.~VERSION~', then
676 visits it in a separate window.
677
678    To compare two versions of a file, use the command `C-x v ='
679 (`vc-diff').
680
681    Plain `C-x v =' compares the current buffer contents (saving them in
682 the file if necessary) with the last checked-in version of the file.
683 With a prefix argument, `C-x v =' reads a file name and two version
684 numbers, then compares those versions of the specified file.
685
686    If you supply a directory name instead of the name of a work file,
687 this command compares the two specified versions of all registered files
688 in that directory and its subdirectories.  You can also specify a
689 snapshot name (*note Snapshots::.) instead of one or both version
690 numbers.
691
692    You can specify a checked-in version by its number; you can specify
693 the most recent checked-in version with an empty version number.
694
695    This command works by running the `vcdiff' utility, getting the
696 options from the variable `diff-switches'.  It displays the output in a
697 special buffer in another window.  Unlike the `M-x diff' command, `C-x
698 v =' does not try to find the changes in the old and new versions.
699 This is because one or both versions normally do not exist as files.
700 They exist only in the records of the master file.  *Note Comparing
701 Files::, for more information about `M-x diff'.
702
703 \1f
704 File: xemacs.info,  Node: VC Status,  Next: Renaming and VC,  Prev: Old Versions,  Up: Version Control
705
706 VC Status Commands
707 ------------------
708
709    To view the detailed version control status and history of a file,
710 type `C-x v l' (`vc-print-log').  It displays the history of changes to
711 the current file, including the text of the log entries.  The output
712 appears in a separate window.
713
714    When you are working on a large program, it's often useful to find
715 all the files that are currently locked, or all the files maintained in
716 version control at all.  You can use `C-x v d' (`vc-directory') to show
717 all the locked files in or beneath the current directory.  This
718 includes all files that are locked by any user.  `C-u C-x v d' lists
719 all files in or beneath the current directory that are maintained with
720 version control.
721
722    The list of files is displayed as a buffer that uses an augmented
723 Dired mode.  The names of the users locking various files are shown (in
724 parentheses) in place of the owner and group.  All the normal Dired
725 commands work in this buffer.  Most interactive VC commands work also,
726 and apply to the file name on the current line.
727
728    The `C-x v v' command (`vc-next-action'), when used in the augmented
729 Dired buffer, operates on all the marked files (or the file on the
730 current line).  If it operates on more than one file, it handles each
731 file according to its current state; thus, it may check out one file
732 and check in another (because it is already checked out).  If it has to
733 check in any files, it reads a single log entry, then uses that text
734 for all the files being checked in.  This can be convenient for
735 registering or checking in several files at once, as part of the same
736 change.
737
738 \1f
739 File: xemacs.info,  Node: Renaming and VC,  Next: Snapshots,  Prev: VC Status,  Up: Version Control
740
741 Renaming VC Work Files and Master Files
742 ---------------------------------------
743
744    When you rename a registered file, you must also rename its master
745 file correspondingly to get proper results.  Use `vc-rename-file' to
746 rename the source file as you specify, and rename its master file
747 accordingly.  It also updates any snapshots (*note Snapshots::.) that
748 mention the file, so that they use the new name; despite this, the
749 snapshot thus modified may not completely work (*note Snapshot
750 Caveats::.).
751
752    You cannot use `vc-rename-file' on a file that is locked by someone
753 else.
754
755 \1f
756 File: xemacs.info,  Node: Snapshots,  Next: Version Headers,  Prev: Renaming and VC,  Up: Version Control
757
758 Snapshots
759 ---------
760
761    A "snapshot" is a named set of file versions (one for each
762 registered file) that you can treat as a unit.  One important kind of
763 snapshot is a "release", a (theoretically) stable version of the system
764 that is ready for distribution to users.
765
766 * Menu:
767
768 * Making Snapshots::            The snapshot facilities.
769 * Snapshot Caveats::            Things to be careful of when using snapshots.
770
771 \1f
772 File: xemacs.info,  Node: Making Snapshots,  Next: Snapshot Caveats,  Prev: Snapshots,  Up: Snapshots
773
774 Making and Using Snapshots
775 ..........................
776
777    There are two basic commands for snapshots; one makes a snapshot
778 with a given name, the other retrieves a named snapshot.
779
780 `C-x v s NAME <RET>'
781      Define the last saved versions of every registered file in or
782      under the current directory as a snapshot named NAME
783      (`vc-create-snapshot').
784
785 `C-x v r NAME <RET>'
786      Check out all registered files at or below the current directory
787      level using whatever versions correspond to the snapshot NAME
788      (`vc-retrieve-snapshot').
789
790      This command reports an error if any files are locked at or below
791      the current directory, without changing anything; this is to avoid
792      overwriting work in progress.
793
794    A snapshot uses a very small amount of resources--just enough to
795 record the list of file names and which version belongs to the
796 snapshot.  Thus, you need not hesitate to create snapshots whenever
797 they are useful.
798
799    You can give a snapshot name as an argument to `C-x v =' or `C-x v
800 ~' (*note Old Versions::.).  Thus, you can use it to compare a snapshot
801 against the current files, or two snapshots against each other, or a
802 snapshot against a named version.
803
804 \1f
805 File: xemacs.info,  Node: Snapshot Caveats,  Prev: Making Snapshots,  Up: Snapshots
806
807 Snapshot Caveats
808 ................
809
810    VC's snapshot facilities are modeled on RCS's named-configuration
811 support.  They use RCS's native facilities for this, so under VC
812 snapshots made using RCS are visible even when you bypass VC.
813
814    For SCCS, VC implements snapshots itself.  The files it uses contain
815 name/file/version-number triples.  These snapshots are visible only
816 through VC.
817
818    A snapshot is a set of checked-in versions.  So make sure that all
819 the files are checked in and not locked when you make a snapshot.
820
821    File renaming and deletion can create some difficulties with
822 snapshots.  This is not a VC-specific problem, but a general design
823 issue in version control systems that no one has solved very well yet.
824
825    If you rename a registered file, you need to rename its master along
826 with it (the command `vc-rename-file' does this automatically).  If you
827 are using SCCS, you must also update the records of the snapshot, to
828 mention the file by its new name (`vc-rename-file' does this, too).  An
829 old snapshot that refers to a master file that no longer exists under
830 the recorded name is invalid; VC can no longer retrieve it.  It would
831 be beyond the scope of this manual to explain enough about RCS and SCCS
832 to explain how to update the snapshots by hand.
833
834    Using `vc-rename-file' makes the snapshot remain valid for
835 retrieval, but it does not solve all problems.  For example, some of the
836 files in the program probably refer to others by name.  At the very
837 least, the makefile probably mentions the file that you renamed.  If you
838 retrieve an old snapshot, the renamed file is retrieved under its new
839 name, which is not the name that the makefile expects.  So the program
840 won't really work as retrieved.
841
842 \1f
843 File: xemacs.info,  Node: Version Headers,  Prev: Snapshots,  Up: Version Control
844
845 Inserting Version Control Headers
846 ---------------------------------
847
848    Sometimes it is convenient to put version identification strings
849 directly into working files.  Certain special strings called "version
850 headers" are replaced in each successive version by the number of that
851 version.
852
853    You can use the `C-x v h' command (`vc-insert-headers') to insert a
854 suitable header string.
855
856 `C-x v h'
857      Insert headers in a file for use with your version-control system.
858
859    The default header string is `\$Id\$' for RCS and `\%W\%' for SCCS.
860 (The actual strings inserted do not have the backslashes in them.  They
861 were placed in the Info source file so that the strings don't get
862 interpreted as version-control headers when the Info source files are
863 maintained under version control.) You can specify other headers to
864 insert by setting the variable `vc-header-alist'.  Its value is a list
865 of elements of the form `(PROGRAM . STRING)' where PROGRAM is `RCS' or
866 `SCCS' and STRING is the string to use.
867
868    Instead of a single string, you can specify a list of strings; then
869 each string in the list is inserted as a separate header on a line of
870 its own.
871
872    It is often necessary to use "superfluous" backslashes when writing
873 the strings that you put in this variable.  This is to prevent the
874 string in the constant from being interpreted as a header itself if the
875 Emacs Lisp file containing it is maintained with version control.
876
877    Each header is inserted surrounded by tabs, inside comment
878 delimiters, on a new line at the start of the buffer.  Normally the
879 ordinary comment start and comment end strings of the current mode are
880 used, but for certain modes, there are special comment delimiters for
881 this purpose; the variable `vc-comment-alist' specifies them.  Each
882 element of this list has the form `(MODE STARTER ENDER)'.
883
884    The variable `vc-static-header-alist' specifies further strings to
885 add based on the name of the buffer.  Its value should be a list of
886 elements of the form `(REGEXP . FORMAT)'.  Whenever REGEXP matches the
887 buffer name, FORMAT is inserted as part of the header.  A header line
888 is inserted for each element that matches the buffer name, and for each
889 string specified by `vc-header-alist'.  The header line is made by
890 processing the string from `vc-header-alist' with the format taken from
891 the element.  The default value for `vc-static-header-alist' is:
892
893      (("\\.c$" .
894        "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
895      #endif /* lint */\n"))
896
897 which specifies insertion of a string of this form:
898
899
900      #ifndef lint
901      static char vcid[] = "STRING";
902      #endif /* lint */
903
904 \1f
905 File: xemacs.info,  Node: ListDir,  Next: Comparing Files,  Prev: Version Control,  Up: Files
906
907 Listing a File Directory
908 ========================
909
910    Files are organized by Unix into "directories".  A "directory
911 listing" is a list of all the files in a directory.  Emacs provides
912 directory listings in brief format (file names only) and verbose format
913 (sizes, dates, and authors included).
914
915 `C-x C-d DIR-OR-PATTERN'
916      Print a brief directory listing (`list-directory').
917
918 `C-u C-x C-d DIR-OR-PATTERN'
919      Print a verbose directory listing.
920
921    To print a directory listing, use `C-x C-d' (`list-directory').
922 This command prompts in the minibuffer for a file name which is either
923 a  directory to be listed or pattern containing wildcards for the files
924 to be listed.  For example,
925
926      C-x C-d /u2/emacs/etc <RET>
927
928 lists all the files in directory `/u2/emacs/etc'.  An example of
929 specifying a file name pattern is:
930
931      C-x C-d /u2/emacs/src/*.c <RET>
932
933    Normally, `C-x C-d' prints a brief directory listing containing just
934 file names.  A numeric argument (regardless of value) tells it to print
935 a verbose listing (like `ls -l').
936
937    Emacs obtains the text of a directory listing by running `ls' in an
938 inferior process.  Two Emacs variables control the switches passed to
939 `ls': `list-directory-brief-switches' is a string giving the switches
940 to use in brief listings (`"-CF"' by default).
941 `list-directory-verbose-switches' is a string giving the switches to
942 use in a verbose listing (`"-l"' by default).
943
944    The variable `directory-abbrev-alist' is an alist of abbreviations
945 for file directories.  The list consists of elements of the form `(FROM
946 .  TO)', each meaning to replace `FROM' with `TO' when it appears in a
947 directory name.  This replacement is done when setting up the default
948 directory of a newly visited file.  Every `FROM' string should start
949 with ``^''.
950
951    Use this feature when you have directories which you normally refer
952 to via absolute symbolic links.  Make `TO' the name of the link, and
953 `FROM' the name it is linked to.
954
955 \1f
956 File: xemacs.info,  Node: Comparing Files,  Next: Dired,  Prev: ListDir,  Up: Files
957
958 Comparing Files
959 ===============
960
961    The command `M-x diff' compares two files, displaying the
962 differences in an Emacs buffer named `*Diff*'.  It works by running the
963 `diff' program, using options taken from the variable `diff-switches',
964 whose value should be a string.
965
966    The buffer `*Diff*' has Compilation mode as its major mode, so you
967 can use `C-x `' to visit successive changed locations in the two source
968 files.  You can also move to a particular hunk of changes and type `C-c
969 C-c' to find the corresponding source location.  You can also use the
970 other special commands of Compilation mode: <SPC> and <DEL> for
971 scrolling, and `M-p' and `M-n' for cursor motion.  *Note Compilation::.
972
973    The command `M-x diff-backup' compares a specified file with its most
974 recent backup.  If you specify the name of a backup file, `diff-backup'
975 compares it with the source file that it is a backup of.
976
977    The command `M-x compare-windows' compares the text in the current
978 window with that in the next window.  Comparison starts at point in each
979 window.  Point moves forward in each window, a character at a time in
980 each window, until the next characters in the two windows are
981 different.  Then the command is finished.  For more information about
982 windows in Emacs, *Note Windows::.
983
984    With a numeric argument, `compare-windows' ignores changes in
985 whitespace.  If the variable `compare-ignore-case' is non-`nil', it
986 ignores differences in case as well.
987
988 \1f
989 File: xemacs.info,  Node: Dired,  Next: Misc File Ops,  Prev: Comparing Files,  Up: Files
990
991 Dired, the Directory Editor
992 ===========================
993
994    Dired makes it easy to delete or visit many of the files in a single
995 directory at once.  It creates an Emacs buffer containing a listing of
996 the directory.  You can use the normal Emacs commands to move around in
997 this buffer and special Dired commands to operate on the files.
998
999 * Menu:
1000
1001 * Enter: Dired Enter.         How to invoke Dired.
1002 * Edit: Dired Edit.           Editing the Dired buffer.
1003 * Deletion: Dired Deletion.   Deleting files with Dired.
1004 * Immed: Dired Immed.         Other file operations through Dired.
1005
1006 \1f
1007 File: xemacs.info,  Node: Dired Enter,  Next: Dired Edit,  Prev: Dired,  Up: Dired
1008
1009 Entering Dired
1010 --------------
1011
1012    To invoke dired, type `C-x d' or `M-x dired'.  The command reads a
1013 directory name or wildcard file name pattern as a minibuffer argument
1014 just like the `list-directory' command, `C-x C-d'.  Where `dired'
1015 differs from `list-directory' is in naming the buffer after the
1016 directory name or the wildcard pattern used for the listing, and putting
1017 the buffer into Dired mode so that the special commands of Dired are
1018 available in it.  The variable `dired-listing-switches' is a string
1019 used as an argument to `ls' in making the directory; this string must
1020 contain `-l'.
1021
1022    To display the Dired buffer in another window rather than in the
1023 selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x
1024 d'.
1025
1026 \1f
1027 File: xemacs.info,  Node: Dired Edit,  Next: Dired Deletion,  Prev: Dired Enter,  Up: Dired
1028
1029 Editing in Dired
1030 ----------------
1031
1032    Once the Dired buffer exists, you can switch freely between it and
1033 other Emacs buffers.  Whenever the Dired buffer is selected, certain
1034 special commands are provided that operate on files that are listed.
1035 The Dired buffer is "read-only", and inserting text in it is not
1036 useful, so ordinary printing characters such as `d' and `x' are used
1037 for Dired commands.  Most Dired commands operate on the file described
1038 by the line that point is on.  Some commands perform operations
1039 immediately; others "flag" a file to be operated on later.
1040
1041    Most Dired commands that operate on the current line's file also
1042 treat a numeric argument as a repeat count, meaning to act on the files
1043 of the next few lines.  A negative argument means to operate on the
1044 files of the preceding lines, and leave point on the first of those
1045 lines.
1046
1047    All the usual Emacs cursor motion commands are available in Dired
1048 buffers.  Some special purpose commands are also provided.  The keys
1049 `C-n' and `C-p' are redefined so that they try to position the cursor
1050 at the beginning of the filename on the line, rather than at the
1051 beginning of the line.
1052
1053    For extra convenience, <SPC> and `n' in Dired are equivalent to
1054 `C-n'.  `p' is equivalent to `C-p'.  Moving by lines is done so often
1055 in Dired that it deserves to be easy to type.  <DEL> (move up and
1056 unflag) is often useful simply for moving up.
1057
1058    The `g' command in Dired runs `revert-buffer' to reinitialize the
1059 buffer from the actual disk directory and show any changes made in the
1060 directory by programs other than Dired.  All deletion flags in the Dired
1061 buffer are lost when this is done.
1062
1063 \1f
1064 File: xemacs.info,  Node: Dired Deletion,  Next: Dired Immed,  Prev: Dired Edit,  Up: Dired
1065
1066 Deleting Files With Dired
1067 -------------------------
1068
1069    The primary use of Dired is to flag files for deletion and then
1070 delete them.
1071
1072 `d'
1073      Flag this file for deletion.
1074
1075 `u'
1076      Remove deletion-flag on this line.
1077
1078 `<DEL>'
1079      Remove deletion-flag on previous line, moving point to that line.
1080
1081 `x'
1082      Delete the files that are flagged for deletion.
1083
1084 `#'
1085      Flag all auto-save files (files whose names start and end with `#')
1086      for deletion (*note Auto Save::.).
1087
1088 `~'
1089      Flag all backup files (files whose names end with `~') for deletion
1090      (*note Backup::.).
1091
1092 `. (Period)'
1093      Flag excess numeric backup files for deletion.  The oldest and
1094      newest few backup files of any one file are exempt; the middle
1095      ones are flagged.
1096
1097    You can flag a file for deletion by moving to the line describing the
1098 file and typing `d' or `C-d'.  The deletion flag is visible as a `D' at
1099 the beginning of the line.  Point is moved to the beginning of the next
1100 line, so that repeated `d' commands flag successive files.
1101
1102    The files are flagged for deletion rather than deleted immediately to
1103 avoid the danger of deleting a file accidentally.  Until you direct
1104 Dired to delete the flagged files, you can remove deletion flags using
1105 the commands `u' and <DEL>.  `u' works just like `d', but removes flags
1106 rather than making flags.  <DEL> moves upward, removing flags; it is
1107 like `u' with numeric argument automatically negated.
1108
1109    To delete the flagged files, type `x'.  This command first displays a
1110 list of all the file names flagged for deletion, and requests
1111 confirmation with `yes'.  Once you confirm, all the flagged files are
1112 deleted, and their lines are deleted from the text of the Dired buffer.
1113 The shortened Dired buffer remains selected.  If you answer `no' or
1114 quit with `C-g', you return immediately to Dired, with the deletion
1115 flags still present and no files actually deleted.
1116
1117    The `#', `~', and `.' commands flag many files for deletion, based
1118 on their names.  These commands are useful precisely because they do
1119 not actually delete any files; you can remove the deletion flags from
1120 any flagged files that you really wish to keep.
1121
1122    `#' flags for deletion all files that appear to have been made by
1123 auto-saving (that is, files whose names begin and end with `#').  `~'
1124 flags for deletion all files that appear to have been made as backups
1125 for files that were edited (that is, files whose names end with `~').
1126
1127    `.' (Period) flags just some of the backup files for deletion: only
1128 numeric backups that are not among the oldest few nor the newest few
1129 backups of any one file.  Normally `dired-kept-versions' (not
1130 `kept-new-versions'; that applies only when saving) specifies the
1131 number of newest versions of each file to keep, and `kept-old-versions'
1132 specifies the number of oldest versions to keep.  Period with a
1133 positive numeric argument, as in `C-u 3 .', specifies the number of
1134 newest versions to keep, overriding `dired-kept-versions'.  A negative
1135 numeric argument overrides `kept-old-versions', using minus the value
1136 of the argument to specify the number of oldest versions of each file
1137 to keep.
1138