aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-02-16 21:08:46 +0000
committerRichard M. Stallman2001-02-16 21:08:46 +0000
commitf02d86a3fa0b0ea132755c0c0fae81bba409943b (patch)
tree8ae3b757a3bd82accc59f2b95a7c912aadeb9589
parentf3f053f31fd1ee7a71aa839a4461a94632d64fd2 (diff)
downloademacs-f02d86a3fa0b0ea132755c0c0fae81bba409943b.tar.gz
emacs-f02d86a3fa0b0ea132755c0c0fae81bba409943b.zip
Many small clarifications.
New node File Name Cache, broken out of the File Convenience node. Use @command. Eliminate invalid @vindex. Delete duplicate index entries. Delete vc-ignore-vc-files and vc-handle-cvs. Add vc-handled-backends. Clarify Auto Compression mode, Tar mode, Diff mode, Smerge mode, and Archive mode. Rewrite Shadow File node. Rewrite Timestamp text.
-rw-r--r--man/files.texi471
1 files changed, 217 insertions, 254 deletions
diff --git a/man/files.texi b/man/files.texi
index 4369251398d..0de8040123c 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -34,6 +34,7 @@ on file directories.
34* File Archives:: Operating on tar, zip, jar etc. archive files. 34* File Archives:: Operating on tar, zip, jar etc. archive files.
35* Remote Files:: Accessing files on other sites. 35* Remote Files:: Accessing files on other sites.
36* Quoted File Names:: Quoting special characters in file names. 36* Quoted File Names:: Quoting special characters in file names.
37* File Name Cache:: Completion against a list of files you often use.
37* File Conveniences:: Convenience Features for Finding Files. 38* File Conveniences:: Convenience Features for Finding Files.
38@end menu 39@end menu
39 40
@@ -97,7 +98,7 @@ first slash in the double slash; the result is @samp{/x1/rms/foo}.
97@xref{Minibuffer File}. 98@xref{Minibuffer File}.
98 99
99 @samp{$} in a file name is used to substitute environment variables. 100 @samp{$} in a file name is used to substitute environment variables.
100For example, if you have used the shell command @samp{export 101For example, if you have used the shell command @command{export
101FOO=rms/hacks} to set up an environment variable named @env{FOO}, then 102FOO=rms/hacks} to set up an environment variable named @env{FOO}, then
102you can use @file{/u/$FOO/test.c} or @file{/u/$@{FOO@}/test.c} as an 103you can use @file{/u/$FOO/test.c} or @file{/u/$@{FOO@}/test.c} as an
103abbreviation for @file{/u/rms/hacks/test.c}. The environment variable 104abbreviation for @file{/u/rms/hacks/test.c}. The environment variable
@@ -230,11 +231,11 @@ to try to visit a directory.
230 231
231@cindex wildcard characters in file names 232@cindex wildcard characters in file names
232@vindex find-file-wildcards 233@vindex find-file-wildcards
233 If the file name you specify contains @code{sh}-style wildcard 234 If the file name you specify contains shell-style wildcard
234characters, Emacs visits all the files that match it. @xref{Quoted File 235characters, Emacs visits all the files that match it. Wildcards
235Names}, if you want to visit a file whose name actually contains 236comprise @samp{?}, @samp{*} and @samp{[@dots{}]} sequences.
236wildcard characters. Wildcards comprise @samp{?}, @samp{*} and 237@xref{Quoted File Names}, for how to visit a file whose name actually
237@samp{[@dots{}]} sequences. The wildcard feature can be disabled by 238contains wildcard characters. You can disable the wildcard feature by
238customizing @code{find-file-wildcards}. 239customizing @code{find-file-wildcards}.
239 240
240 If you visit a file that the operating system won't let you modify, 241 If you visit a file that the operating system won't let you modify,
@@ -281,8 +282,7 @@ seek. This feature is available only when you are using a window
281system. @xref{Frames}. 282system. @xref{Frames}.
282 283
283@findex find-file-literally 284@findex find-file-literally
284@vindex require-final-newline@r{, and }find-file-literally 285 If you wish to edit a file as a sequence of ASCII characters with no special
285 If you wish to edit a file as a sequence of characters with no special
286encoding or conversion, use the @kbd{M-x find-file-literally} command. 286encoding or conversion, use the @kbd{M-x find-file-literally} command.
287It visits a file, like @kbd{C-x C-f}, but does not do format conversion 287It visits a file, like @kbd{C-x C-f}, but does not do format conversion
288(@pxref{Formatted Text}), character code conversion (@pxref{Coding 288(@pxref{Formatted Text}), character code conversion (@pxref{Coding
@@ -440,7 +440,8 @@ every time a file is saved or written. The default is @code{nil}.
440* Backup:: How Emacs saves the old version of your file. 440* Backup:: How Emacs saves the old version of your file.
441* Interlocking:: How Emacs protects against simultaneous editing 441* Interlocking:: How Emacs protects against simultaneous editing
442 of one file by two users. 442 of one file by two users.
443* Shadowing: File Shadowing. Copying files to `shadows' automatically. 443* Shadowing: File Shadowing.
444 Copying files to `shadows' automatically.
444* Time Stamps:: Emacs can update time stamps on saved files. 445* Time Stamps:: Emacs can update time stamps on saved files.
445@end menu 446@end menu
446 447
@@ -449,7 +450,6 @@ every time a file is saved or written. The default is @code{nil}.
449@cindex backup file 450@cindex backup file
450@vindex make-backup-files 451@vindex make-backup-files
451@vindex vc-make-backup-files 452@vindex vc-make-backup-files
452@vindex backup-enable-predicate
453 453
454 On most operating systems, rewriting a file automatically destroys all 454 On most operating systems, rewriting a file automatically destroys all
455record of what the file used to contain. Thus, saving a file from Emacs 455record of what the file used to contain. Thus, saving a file from Emacs
@@ -471,8 +471,9 @@ control system. @xref{VC Workfile Handling}.
471@vindex temporary-file-directory 471@vindex temporary-file-directory
472@vindex small-temporary-file-directory 472@vindex small-temporary-file-directory
473 The default value of the @code{backup-enable-predicate} variable 473 The default value of the @code{backup-enable-predicate} variable
474prevents backup files being written for files in the directories named 474prevents backup files being written for files in the directories used
475by @code{temporary-file-directory} or @code{small-temporary-file-directory}. 475for temporary files, specified by @code{temporary-file-directory} or
476@code{small-temporary-file-directory}.
476 477
477 At your option, Emacs can keep either a single backup file or a series of 478 At your option, Emacs can keep either a single backup file or a series of
478numbered backup files for each file that you edit. 479numbered backup files for each file that you edit.
@@ -513,28 +514,29 @@ be @file{eval.c~}.
513 You can change this behaviour by defining the variable 514 You can change this behaviour by defining the variable
514@code{make-backup-file-name-function} to a suitable function. 515@code{make-backup-file-name-function} to a suitable function.
515Alternatively you can customize the variable 516Alternatively you can customize the variable
516@code{backup-directory-alist} to specify that files matching certain 517@var{backup-directory-alist} to specify that files matching certain
517patterns should be backed up in specific directories. A typical use is 518patterns should be backed up in specific directories.
518to add an element @code{("." . @var{dir})} to make all backups in the 519
519directory with absolute name @var{dir}; the names will be mangled to 520 A typical use is to add an element @code{("." . @var{dir})} to make
520prevent clashes between files with the same names originating in 521all backups in the directory with absolute name @var{dir}; Emacs
521different directories. Alternatively, adding, say, @code{("." ".~")} 522modifies the backup file names to avoid clashes between files with the
522would make backups in the invisible sub-directory @file{.~} of the 523same names originating in different directories. Alternatively,
523original file's directory. The directories are created if necessary 524adding, say, @code{("." ".~")} would make backups in the invisible
524when the backup is made. 525subdirectory @file{.~} of the original file's directory. Emacs
526creates the directory, if necessary, to make the backup.
527
528 If access control stops Emacs from writing backup files under the usual
529names, it writes the backup file as @file{%backup%~} in your home
530directory. Only one such file can exist, so only the most recently
531made such backup is available.
525 532
526 If you choose to have a series of numbered backup files, backup file 533 If you choose to have a series of numbered backup files, backup file
527names are made by appending @samp{.~}, the number, and another @samp{~} 534names contain @samp{.~}, the number, and another @samp{~} after the
528to the original file name. Thus, the backup files of @file{eval.c} 535original file name. Thus, the backup files of @file{eval.c} would be
529would be called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, through 536called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, all the way
530names like @file{eval.c.~259~} and beyond. As for single backups, 537through names like @file{eval.c.~259~} and beyond. The variable
531@code{backup-directory-alist} can be used to control the location of 538@code{backup-directory-alist} applies to numbered backups just as
532numbered backups. 539usual.
533
534 If protection stops you from writing backup files under the usual names,
535the backup file is written as @file{%backup%~} in your home directory.
536Only one such file can exist, so only the most recently made such backup is
537available.
538 540
539@vindex version-control 541@vindex version-control
540 The choice of single backup or numbered backups is controlled by the 542 The choice of single backup or numbered backups is controlled by the
@@ -620,7 +622,7 @@ locally (@pxref{File Variables}).
620@vindex backup-by-copying-when-mismatch 622@vindex backup-by-copying-when-mismatch
621@vindex backup-by-copying-when-privileged-mismatch 623@vindex backup-by-copying-when-privileged-mismatch
622@cindex file ownership, and backup 624@cindex file ownership, and backup
623@cindex backup, and user's uid 625@cindex backup, and user-id
624 The choice of renaming or copying is controlled by four variables. 626 The choice of renaming or copying is controlled by four variables.
625Renaming is the default choice. If the variable 627Renaming is the default choice. If the variable
626@code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise, 628@code{backup-by-copying} is non-@code{nil}, copying is used. Otherwise,
@@ -632,8 +634,8 @@ copying is used if renaming would cause the file's owner or group to
632change. @code{backup-by-copying-when-mismatch} is @code{t} by default 634change. @code{backup-by-copying-when-mismatch} is @code{t} by default
633if you start Emacs as the superuser. The fourth variable, 635if you start Emacs as the superuser. The fourth variable,
634@code{backup-by-copying-when-privileged-mismatch}, gives the highest 636@code{backup-by-copying-when-privileged-mismatch}, gives the highest
635numeric user id for which @code{backup-by-copying-when-mismatch} will be 637numeric user-id for which @code{backup-by-copying-when-mismatch} will be
636forced on. This is useful when low-numbered uid's are assigned to 638forced on. This is useful when low-numbered user-id are assigned to
637special system users, such as @code{root}, @code{bin}, @code{daemon}, 639special system users, such as @code{root}, @code{bin}, @code{daemon},
638etc., which must maintain ownership of files. 640etc., which must maintain ownership of files.
639 641
@@ -732,43 +734,44 @@ different name, and use @code{diff} to compare the two files.@refill
732@table @kbd 734@table @kbd
733@item M-x shadow-initialize 735@item M-x shadow-initialize
734Set up file shadowing. 736Set up file shadowing.
735@item M-x shadow-define-cluster @key{RET} @var{name} @key{RET}
736Define a shadow file cluster @var{name}.
737@item M-x shadow-define-regexp-group
738Make each of a group of files be shared between hosts.
739@item M-x shadow-define-literal-group 737@item M-x shadow-define-literal-group
740Declare a single file to be shared between sites. 738Declare a single file to be shared between sites.
739@item M-x shadow-define-regexp-group
740Make all files that match each of a group of files be shared between hosts.
741@item M-x shadow-define-cluster @key{RET} @var{name} @key{RET}
742Define a shadow file cluster @var{name}.
741@item M-x shadow-copy-files 743@item M-x shadow-copy-files
742Copy all pending shadow files. 744Copy all pending shadow files.
743@item M-x shadow-cancel () 745@item M-x shadow-cancel
744Cancel the instruction to copy some files. 746Cancel the instruction to shadow some files.
745@end table 747@end table
746 748
747You can arrange to keep identical copies of files in more than one 749You can arrange to keep identical @dfn{shadow} copies of certain files
748place---possibly on different machines. When you save a file, Emacs can 750in more than one place---possibly on different machines. To do this,
749check whether it is on the list of files with @dfn{shadows}, and if so, 751first you must set up a @dfn{shadow file group}, which is a set of
750it tries to copy it when you exit Emacs (or use the @kbd{M-x 752identically-named files shared between a list of sites. The file
751shadow-copy-files} command). 753group is permanent and applies to further Emacs sessions as well as
752 754the current one. Once the group is set up, every time you exit Emacs,
753A @dfn{cluster} is a group of hosts that share directories, so that 755it will copy the file you edited to the other files in its group. You
754copying to or from one of them is sufficient to update the file on all 756can also do the copying without exiting Emacs, by typing @kbd{M-x
755of them. Clusters are defined by a name, the network address of a 757shadow-copy-files}.
756primary host (the one we copy files to), and a regular expression that 758
757matches the hostnames of all the sites in the cluster. A @dfn{file 759To set up a file group, use @kbd{M-x shadow-define-literal-group} or
758group} is a set of identically-named files shared between a list of 760@kbd{M-x shadow-define-regexp-group}. See their documentation strings
759sites. 761for further information.
760 762
761Add clusters (if necessary) and file groups with @kbd{M-x 763Before copying a file to its shadows, Emacs asks for confirmation.
762shadow-define-cluster}, @kbd{M-x shadow-define-literal-group}, and 764You can answer ``no'' to bypass copying of this file, this time. If
763@kbd{M-x shadow-define-regexp-group} (see the documentation for these 765you want to cancel the shadowing permanently for a certain file, use
764functions for information on how and when to use them). After doing 766@kbd{M-x shadow-cancel} to eliminate or change the shadow file group.
765this once, everything should be automatic. The lists of clusters and 767
766shadows are remembered from one emacs session to another. 768A @dfn{shadow cluster} is a group of hosts that share directories, so
767 769that copying to or from one of them is sufficient to update the file
768If you do not want to copy a particular file, you can answer "no" and be 770on all of them. Each shadow cluster has a name, and specifies the
769asked again next time you hit @kbd{C-x 4 s} or exit Emacs. If you do 771network address of a primary host (the one we copy files to), and a
770not want to be asked again, use @kbd{M-x shadow-cancel}, and you will 772regular expression that matches the hostnames of all the other hosts
771not be asked until you change the file and save it again. 773in the cluster. You can define a shadow cluster with @kbd{M-x
774shadow-define-cluster}.
772 775
773@node Time Stamps 776@node Time Stamps
774@subsection Updating Time Stamps Automatically 777@subsection Updating Time Stamps Automatically
@@ -777,27 +780,29 @@ not be asked until you change the file and save it again.
777@cindex modification dates 780@cindex modification dates
778@cindex locale, date format 781@cindex locale, date format
779 782
780You can arrange to have time stamp text in a file updated 783You can arrange put a time stamp in a file, so that it will be updated
781automatically to reflect the modification time when you save the 784automatically each time you edit and save the file. The time stamp
782file. To do this, include in the first eight lines a template like 785has to be in the first eight lines of the file, and you should
786insert it like this:
787
783@example 788@example
784Time-stamp: <> 789Time-stamp: <>
785@end example 790@end example
791
786@noindent 792@noindent
787or 793or like this:
794
788@example 795@example
789Time-stamp: "" 796Time-stamp: ""
790@end example 797@end example
791@noindent
792and customize the value of the hook @code{write-file-hooks} to add
793@code{time-stamp}. Such a template is updated with the current time
794and date when the file is written. You can also use the command
795@kbd{M-x time-stamp} to update the time stamp manually.
796 798
797You can customize the form of the template and the time string used 799 Then add the hook function @code{time-stamp} to the hook
798along with other parameters in the Custom group @code{time-stamp}. 800@code{write-file-hooks}; that hook function will automatically update
799Note that non-numeric fields in the time stamp are printed according 801the time stamp, inserting the current date and time when you save the
800to your locale setting. 802file. You can also use the command @kbd{M-x time-stamp} to update the
803time stamp manually. For other customizations, see the Custom group
804@code{time-stamp}. Note that non-numeric fields in the time stamp are
805formatted according to your locale setting (@pxref{Environment}).
801 806
802@node Reverting 807@node Reverting
803@section Reverting a Buffer 808@section Reverting a Buffer
@@ -986,14 +991,13 @@ recover are present in Emacs buffers. You should then save them. Only
986this---saving them---updates the files themselves. 991this---saving them---updates the files themselves.
987 992
988@vindex auto-save-list-file-prefix 993@vindex auto-save-list-file-prefix
989 Interrupted sessions are recorded for later recovery in files named 994 Emacs records interrupted sessions for later recovery in files named
990@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. The 995@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. The
991@samp{~/.emacs.d/auto-save-list/.saves-} portion of these names comes 996@samp{~/.emacs.d/auto-save-list/.saves-} portion of these names comes
992from the value of @code{auto-save-list-file-prefix}. You can arrange 997from the value of @code{auto-save-list-file-prefix}. You can record
993to record sessions in a different place by setting that variable in 998sessions in a different place by customizing that variable. If you
994your @file{.emacs} file. If you set @code{auto-save-list-file-prefix} 999set @code{auto-save-list-file-prefix} to @code{nil} in your
995to @code{nil} in your @file{.emacs} file, sessions are not recorded 1000@file{.emacs} file, sessions are not recorded for recovery.
996for recovery.
997 1001
998@node File Aliases 1002@node File Aliases
999@section File Name Aliases 1003@section File Name Aliases
@@ -1011,18 +1015,14 @@ links point to directories.
1011two different buffers, but it warns you about the situation. 1015two different buffers, but it warns you about the situation.
1012 1016
1013@vindex find-file-existing-other-name 1017@vindex find-file-existing-other-name
1014 Normally, if you visit a file which Emacs is already visiting under a 1018 Normally, if you visit a file which Emacs is already visiting under
1015different name, Emacs prints a message in the echo area and uses an 1019a different name, Emacs displays a message in the echo area and uses
1016existing buffer, where that file is visited under another name. This 1020the existing buffer visiting that file. This can happen on systems
1017can happen on systems that support symbolic links, or if you use a long 1021that support symbolic links, or if you use a long file name on a
1018file name on a system which truncates long file names. 1022system that truncates long file names. You can disable this feature
1019 1023by setting the variable @code{find-file-existing-other-name} to
1020 If Emacs should use different buffers when visiting the same file 1024@code{nil}. Then if you visit the same file under two different names,
1021under different names, set the variable 1025you get a separate buffer for each file name.
1022@code{find-file-existing-other-name} to @code{nil}. A non-@code{nil}
1023value, which is the default, means @code{find-file} uses the existing
1024buffer visiting the file, no matter which of the file's names you
1025specify.
1026 1026
1027@vindex find-file-visit-truename 1027@vindex find-file-visit-truename
1028@cindex truenames of files 1028@cindex truenames of files
@@ -1044,12 +1044,11 @@ such as the creation time of each version, who created it, and a
1044description of what was changed in that version. 1044description of what was changed in that version.
1045 1045
1046 The Emacs version control interface is called VC. Its commands work 1046 The Emacs version control interface is called VC. Its commands work
1047with three version control systems---RCS, CVS and SCCS. The GNU project 1047with three version control systems---RCS, CVS and SCCS. The GNU
1048recommends RCS and CVS, which are free software and available from the 1048project recommends RCS and CVS, which are free software and available
1049Free Software Foundation. 1049from the Free Software Foundation. We also have free software to
1050@cindex CSSC 1050replace SCCS, known as CSSC; if you are using SCCS and don't want to
1051There is a GNU clone of SCCS called CSSC, but RCS is technically 1051make the incompatible change to RCS or CVS, you can switch to CSSC.
1052superior.
1053 1052
1054@menu 1053@menu
1055* Introduction to VC:: How version control works in general. 1054* Introduction to VC:: How version control works in general.
@@ -1504,10 +1503,10 @@ with CVS.
1504@cindex PCL-CVS 1503@cindex PCL-CVS
1505@pindex cvs 1504@pindex cvs
1506@cindex CVS Dired Mode 1505@cindex CVS Dired Mode
1507The VC Dired Mode described here works with all the VC-supported version 1506 The VC Dired Mode described here works with all the version control
1508control systems. There is a similar facility specialized for use with 1507systems that VC supports. Another more powerful facility, designed
1509CVS, called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The 1508specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
1510Emacs Front-End to CVS}. 1509pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
1511 1510
1512@kindex C-x v d 1511@kindex C-x v d
1513@findex vc-directory 1512@findex vc-directory
@@ -2153,16 +2152,6 @@ headers.
2153 There are many ways of customizing VC. The options you can set fall 2152 There are many ways of customizing VC. The options you can set fall
2154into four categories, described in the following sections. 2153into four categories, described in the following sections.
2155 2154
2156@vindex vc-ignore-vc-files
2157@cindex Version control, deactivating
2158 In addition, it is possible to turn VC on and off generally by setting
2159the variable @code{vc-ignore-vc-files}. Normally VC will notice the
2160presence of version control on a file you visit and automatically invoke
2161the relevant program to check the file's state. Change
2162@code{vc-ignore-vc-files} if this isn't the right thing, for instance,
2163if you edit files under version control but don't have the relevant
2164version control programs available.
2165
2166@menu 2155@menu
2167* Backend Options:: Customizing the back-end to your needs. 2156* Backend Options:: Customizing the back-end to your needs.
2168* VC Workfile Handling:: Various options concerning working files. 2157* VC Workfile Handling:: Various options concerning working files.
@@ -2174,6 +2163,13 @@ version control programs available.
2174@node Backend Options 2163@node Backend Options
2175@subsubsection Options for VC Backends 2164@subsubsection Options for VC Backends
2176 2165
2166@vindex vc-handled-backends
2167 By default, VC detects automatically which files are managed by RCS,
2168which by CVS, and which by SCCS, and it tries to do the right thing in
2169all three cases. If you want VC to ignore one or more of these
2170backends, set @code{vc-handled-backends} to the list of backends that
2171@emph{should} be handled.
2172
2177@cindex backend options (VC) 2173@cindex backend options (VC)
2178@cindex locking under version control 2174@cindex locking under version control
2179 You can tell RCS and CVS whether to use locking for a file or not 2175 You can tell RCS and CVS whether to use locking for a file or not
@@ -2212,12 +2208,6 @@ and CVS takes care to notify other developers of the fact that you
2212intend to change the file. See the CVS documentation for details on 2208intend to change the file. See the CVS documentation for details on
2213using the watch feature. 2209using the watch feature.
2214 2210
2215@vindex vc-handle-cvs
2216 You can turn off use of VC for CVS-managed files by setting the
2217variable @code{vc-handle-cvs} to @code{nil}. If you do this, Emacs
2218treats these files as if they were not registered, and the VC commands
2219are not available for them. You must do all CVS operations manually.
2220
2221@node VC Workfile Handling 2211@node VC Workfile Handling
2222@subsubsection VC Workfile Handling 2212@subsubsection VC Workfile Handling
2223 2213
@@ -2405,24 +2395,26 @@ non-@code{nil}, it ignores differences in case as well.
2405@cindex diffs 2395@cindex diffs
2406@cindex patches 2396@cindex patches
2407@cindex Diff mode 2397@cindex Diff mode
2408Differences between versions of files are often distributed as 2398 Differences between versions of files are often distributed as
2409@dfn{patches} output by @command{diff} or a version control system. 2399@dfn{patches}, which are the output from @command{diff} or a version
2410@kbd{M-x diff-mode} turns on Diff mode, a major mode for viewing and 2400control system that uses @command{diff}. @kbd{M-x diff-mode} turns on
2411editing patches, either as `unified diffs' or `context diffs'. 2401Diff mode, a major mode for viewing and editing patches, either as
2412 2402``unified diffs'' or ``context diffs.''
2413 See also @ref{Emerge} and @ref{Top,,, ediff, The Ediff Manual}, for
2414convenient facilities for merging two similar files.
2415 2403
2416@cindex Smerge mode 2404@cindex Smerge mode
2417@findex smerge-mode 2405@findex smerge-mode
2418@cindex failed merges 2406@cindex failed merges
2419@cindex merges, failed 2407@cindex merges, failed
2420@pindex diff3 2408@pindex diff3
2421Use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor mode for 2409 You can use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor
2422editing output from the @command{diff3} program. This is typically the 2410mode for editing output from the @command{diff3} program. This is
2423result of a failed merge from a version control system `update' outside 2411typically the result of a failed merge from a version control system
2424VC, due to conflicting changes to a file. Smerge mode provides commands 2412``update'' outside VC, due to conflicting changes to a file. Smerge
2425to resolve conflicts by selecting specific changes. 2413mode provides commands to resolve conflicts by selecting specific
2414changes.
2415
2416 See also @ref{Emerge}, and @ref{Top,,, ediff, The Ediff Manual}, for
2417convenient facilities for merging two similar files.
2426 2418
2427@node Misc File Ops 2419@node Misc File Ops
2428@section Miscellaneous File Operations 2420@section Miscellaneous File Operations
@@ -2530,11 +2522,16 @@ compiling it.
2530@cindex Tar mode 2522@cindex Tar mode
2531@pindex tar 2523@pindex tar
2532 2524
2533 If you visit a file with extension @samp{.tar}, it is assumed to be an 2525 A file whose name ends in @samp{.tar} is normally an @dfn{archive}
2534@dfn{archive} made by the @code{tar} program and it is viewed in a Tar 2526made by the @code{tar} program. Emacs views these files in a special
2535mode buffer. This provides a Dired-like listing of the contents. 2527mode called Tar mode which provides a Dired-like list of the contents
2536@xref{Dired}. You can move around the component files as in Dired to 2528(@pxref{Dired}). You can move around through the list just as you
2537visit and manipulate them. 2529would in Dired, and visit the subfiles contained in the archive.
2530However, not all Dired commands are available in Tar mode.
2531
2532 If you enable Auto Compression mode (@pxref{Compressed Files}), then
2533Tar mode is used also for compressed archives---files with extensions
2534@samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}.
2538 2535
2539 The keys @kbd{e}, @kbd{f} and @kbd{RET} all extract a component file 2536 The keys @kbd{e}, @kbd{f} and @kbd{RET} all extract a component file
2540into its own buffer. You can edit it there and when you save the buffer 2537into its own buffer. You can edit it there and when you save the buffer
@@ -2557,17 +2554,9 @@ name extracts the file into a buffer and displays that buffer.
2557 Saving the Tar buffer writes a new version of the archive to disk with 2554 Saving the Tar buffer writes a new version of the archive to disk with
2558the changes you made to the components. 2555the changes you made to the components.
2559 2556
2560 If you enable Auto Compression mode (@pxref{Compressed Files}), then 2557 You don't need the @code{tar} program to use Tar mode---Emacs reads
2561Tar mode will be used also for compressed archives in files with 2558the archives directly. However, accessing compressed archives
2562extensions @samp{.tgz}, @code{.tar.Z} and @code{.tar.gz}. 2559requires the appropriate uncompression program.
2563
2564 It is not necessary to have the @code{tar} program available to use
2565Tar mode or Archive mode---Emacs reads the archives directly. For
2566compressed archives such as @code{.tar.gz}, you need the appropriate
2567uncompress program to be available to Emacs.
2568
2569It is not necessary to have the @code{tar} program available to use Tar
2570mode or Archive mode---Emacs reads the archives directly.
2571 2560
2572@cindex Archive mode 2561@cindex Archive mode
2573@cindex mode, archive 2562@cindex mode, archive
@@ -2584,24 +2573,22 @@ mode or Archive mode---Emacs reads the archives directly.
2584@cindex Java class archives 2573@cindex Java class archives
2585@cindex unzip archives 2574@cindex unzip archives
2586 A separate but similar Archive mode is used for archives produced by 2575 A separate but similar Archive mode is used for archives produced by
2587the programs @code{arc}, @code{zip}, @code{lzh} and @code{zoo} which 2576the programs @code{arc}, @code{jar}, @code{lzh}, @code{zip}, and
2588have extensions corresponding to the program names. These archiving 2577@code{zoo}, which have extensions corresponding to the program names.
2589programs are typically used on MS-DOS and MS-Windows systems. Java
2590class archives with extension @samp{.jar} are also recognized.
2591 2578
2592 The keybindings in Archive mode are similar to those in Tar mode, with 2579 The keybindings of Archive mode are similar to those in Tar mode,
2593the addition of the @kbd{m} key which marks a file for subsequent 2580with the addition of the @kbd{m} key which marks a file for subsequent
2594operations, and @kbd{M-@key{DEL}} which unmarks all the marked files. 2581operations, and @kbd{M-@key{DEL}} which unmarks all the marked files.
2595Also, the @kbd{a} key toggles the display of file information in those 2582Also, the @kbd{a} key toggles the display of detailed file
2596archive types where all of of the info is too long to be displayed on a 2583information, for those archive types where it won't fit in a single
2597single line. Operations such as @samp{change mode}, @samp{change owner} 2584line. Operations such as renaming a subfile, or changing its mode or
2598and @samp{rename} are supported only for some of the archive formats. 2585owner, are supported only for some of the archive formats.
2599 2586
2600 Unlike Tar mode, Archive mode runs the appropriate program to unpack 2587 Unlike Tar mode, Archive mode runs the archiving program to unpack
2601and repack archives. Details of the program names and their options can 2588and repack archives. Details of the program names and their options
2602be set in the @samp{Archive} Customize group. However, you don't need 2589can be set in the @samp{Archive} Customize group. However, you don't
2603these programs to @emph{view} the archive contents, only to extract and 2590need these programs to the archive table of contents, only to extract
2604delete archived files. 2591or manipulate the subfiles in the archive.
2605 2592
2606@node Remote Files 2593@node Remote Files
2607@section Remote Files 2594@section Remote Files
@@ -2655,26 +2642,19 @@ for a password as normal.
2655@vindex ange-ftp-smart-gateway 2642@vindex ange-ftp-smart-gateway
2656@vindex ange-ftp-gateway-host 2643@vindex ange-ftp-gateway-host
2657 Sometimes you may be unable to access files on a remote machine 2644 Sometimes you may be unable to access files on a remote machine
2658because some machine in between (usually called a @dfn{firewall}) 2645because a @dfn{firewall} in between blocks the connection for security
2659blocks the connection for security reasons. However, you might have 2646reasons. If you can log in on a @dfn{gateway} machine from which the
2660account on another machine, called a @dfn{gateway}, from which the 2647target files @emph{are} accessible, and whose FTP server supports
2661target files @strong{are} accessible. Instead of logging into the 2648gatewaying features, you can still use remote file names; all you have
2662gateway, downloading the files, then copying them to your local 2649to do is specify the name of the gateway machine by setting the
2663machine, you can set the variable @code{ange-ftp-smart-gateway} to a 2650variable @code{ange-ftp-gateway-host}, and set
2664non-@code{nil} value, and Emacs will use advanced FTP features to 2651@code{ange-ftp-smart-gateway} to @code{t}. Otherwise you may be able
2665access the remote machine. If this doesn't work, try setting the 2652to make remote file names work, but the procedure is complex. You can
2666variable @code{ange-ftp-gateway-host} to the name of the gateway 2653read the instructions by typing @kbd{M-x finder-commentary @key{RET}
2667machine (which is the name you use to log into the gateway). Then 2654ange-ftp @key{RET}}.
2668Emacs will try to run the FTP process on the gateway for you. If that
2669doesn't work either (because the FTP program on your machine doesn't
2670support some of the required features), read the instructions in the
2671@file{ange-ftp.el} file about working with gateways. You can read
2672these instructions by typing @kbd{M-x finder-commentary @key{RET}
2673ange-ftp @key{RET}}. Those instructions include various additional
2674tips for using @code{ange-ftp}.
2675 2655
2676@vindex file-name-handler-alist 2656@vindex file-name-handler-alist
2677@cindex disabling ange-ftp 2657@cindex disabling remote files
2678 You can entirely turn off the FTP file name feature by removing the 2658 You can entirely turn off the FTP file name feature by removing the
2679entries @var{ange-ftp-completion-hook-function} and 2659entries @var{ange-ftp-completion-hook-function} and
2680@var{ange-ftp-hook-function} from the variable 2660@var{ange-ftp-hook-function} from the variable
@@ -2712,78 +2692,57 @@ starts with @samp{foo} and ends with @samp{bar} is @file{foo*bar}, then
2712specifying @file{/tmp/foo*bar} will visit just @file{/tmp/foo*bar}. 2692specifying @file{/tmp/foo*bar} will visit just @file{/tmp/foo*bar}.
2713Another way is to specify @file{/tmp/foo[*]bar}. 2693Another way is to specify @file{/tmp/foo[*]bar}.
2714 2694
2715@node File Conveniences 2695@node File Name Cache
2716@section Convenience Features for Finding Files 2696@section File Name Cache
2697
2698@cindex file name caching
2699@cindex cache of file names
2700@pindex find
2701@kindex C-@key{TAB}
2702@findex file-cache-minibuffer-complete
2703 You can use the @dfn{file name cache} to make it easy to locate a
2704file by name, without having to remember exactly where it is located.
2705When typing a file name in the minibuffer, @kbd{C-@key{tab}}
2706(@code{file-cache-minibuffer-complete}) completes it using the file
2707name cache. If you repeat @kbd{C-@key{tab}}, that cycles through the
2708possible completions of what you had originally typed. Note that the
2709@kbd{C-@key{tab}} character cannot be typed on most text-only
2710terminals.
2711
2712 The file name cache does not fill up automatically. Instead, you
2713load file names into the cache using these commands:
2717 2714
2715@findex file-cache-add-directory
2718@table @kbd 2716@table @kbd
2719@item M-x ff-find-other-file
2720Find the header or source file corresponding to the current buffer's
2721file.
2722@item M-x file-cache-add-directory @key{RET} @var{directory} @key{RET} 2717@item M-x file-cache-add-directory @key{RET} @var{directory} @key{RET}
2723Add @var{directory} to the file cache. 2718Add each file name in @var{directory} to the file name cache.
2724@item M-x locate @key{RET} @var{pattern} @key{RET} 2719@item M-x file-cache-add-directory-using-find @key{RET} @var{directory} @key{RET}
2725Run the program @command{locate} to match @var{pattern} in the database, 2720Add each file name in @var{directory} and all of its nested
2726putting results in a buffer. 2721subdirectories to the file name cache.
2727@item M-x locate-with-filter @key{RET} @var{pattern} @key{RET} @var{filter} @key{RET} 2722@item M-x file-cache-add-directory-using-locate @key{RET} @var{directory} @key{RET}
2728Like @code{locate}, but use a @var{filter} on the results. 2723Add each file name in @var{directory} and all of its nested
2729@item M-x auto-image-file-mode 2724subdirectories to the file name cache, using @command{locate} to find
2730Toggle visiting of image files as images. 2725them all.
2726@item M-x file-cache-add-directory-list @key{RET} @var{variable} @key{RET}
2727Add each file name in each directory listed in @var{variable}
2728to the file name cache. @var{variable} should be a Lisp variable
2729such as @code{load-path} or @code{exec-path}, whose value is a list
2730of directory names.
2731@item M-x file-cache-clear-cache @key{RET}
2732Clear the cache; that is, remove all file names from it.
2731@end table 2733@end table
2732 2734
2733@findex ff-find-other-file 2735@node File Conveniences
2734@vindex ff-other-file-alist 2736@section Convenience Features for Finding Files
2735The command @kbd{ff-find-other-file} finds a file related to the one
2736visited by the current buffer, based on customizable patterns.
2737Typically this will be the header file corresponding to a C/C++ source
2738file, or vice versa. The patterns describing the corresponding files
2739are customizable via @code{ff-other-file-alist}.
2740
2741@cindex filename caching
2742@cindex cache of file names
2743@pindex find
2744@pindex locate
2745@vindex file-cache-delete-regexps
2746@findex file-cache-add-directory
2747You can use a cache to make it easy to locate files by name without
2748having to remember exactly where they are. When typing a filename in
2749the minibuffer you can @kbd{C-tab} will complete it using the filename
2750cache and cycle through possible completions. (The @kbd{C-tab} key
2751can't be distinguished from @kbd{TAB} on all terminals.) The command
2752@kbd{M-x file-cache-add-directory} adds the files in a directory to the
2753cache and @kbd{M-x file-cache-add-directory-list} acts on a list of
2754directories like @code{load-path} or @code{exec-path}. @kbd{M-x
2755file-cache-add-directory-using-find} uses the @command{find} program to
2756add a directory tree to the cache and @kbd{M-x
2757file-cache-add-directory-using-locate} uses the @command{locate} program
2758to add files matching a pattern. Use @kbd{M-x file-cache-clear-cache}
2759to remove all items from the cache; @kbd{M-x file-cache-delete-regexps}
2760and similar functions remove items from it selectively.
2761
2762@pindex locate
2763@findex locate
2764@findex locate-with-filter
2765@cindex file database (locate)
2766@vindex locate-command
2767@kbd{M-x locate} runs an interface to the @code{locate} program for
2768searching a pre-built database of file names; most Dired commands are
2769avilable for use on the result. @xref{, ,Find , find, GNU Findutils}.
2770@kbd{M-x locate-with-filter} is similar, but keeps only lines matching a
2771regular expression. Customize the option @code{locate-command} to use
2772another program than the default, GNU @code{locate}.
2773
2774The @kbd{M-x ffap} command generalizes @kbd{M-x find-file}. @xref{FFAP}.
2775Partial Completion mode offers other features extending @kbd{M-x
2776find-file} which can be used with @code{ffap}. @xref{Completion
2777Options}.
2778 2737
2779@findex recentf-mode 2738@findex recentf-mode
2780@vindex recentf-mode 2739@vindex recentf-mode
2781@findex recentf-save-list 2740@findex recentf-save-list
2782@findex recentf-edit-list 2741@findex recentf-edit-list
2783The command @kbd{M-x recentf-mode} or the Customize option of the same 2742 If you enable Recentf mode, with @kbd{M-x recentf-mode}, the
2784name adds to the Files menu a submenu containing a list of recently 2743@samp{Files} menu includes a submenu containing a list of recently
2785opened files. @kbd{recentf-save-list} saves the current file list to a 2744opened files. @kbd{M-x recentf-save-list} saves the current
2786file and @kbd{recentf-edit-list} edits it. 2745recent-file-list to a file, and @kbd{M-x recentf-edit-list} edits it.
2787 2746
2788@findex auto-image-file-mode 2747@findex auto-image-file-mode
2789@findex mode, auto-image-file 2748@findex mode, auto-image-file
@@ -2791,11 +2750,15 @@ file and @kbd{recentf-edit-list} edits it.
2791@cindex visiting image files 2750@cindex visiting image files
2792@vindex image-file-name-regexps 2751@vindex image-file-name-regexps
2793@vindex image-file-name-extensions 2752@vindex image-file-name-extensions
2794When Auto-image-file minor mode is enabled, image files are displayed as 2753 When Auto-image-file minor mode is enabled, visiting an image file
2795images when they are visited or inserted into buffers if Emacs can 2754displays it as an image, not as text. Likewise, inserting an image
2796display the relevant image type. File names matching 2755file into a buffer inserts it as an image. This works only when Emacs
2797@code{image-file-name-extensions} or @code{image-file-name-regexps} are 2756can display the relevant image type. The variables
2798considered to contain images. Note that Emacs can only display images 2757@code{image-file-name-extensions} or @code{image-file-name-regexps}
2799of the types for which the appropriate support libraries were linked 2758control which file names are recognized as containing images.
2800into Emacs when it was built. In particular, the MS-Windows version 2759
2801of Emacs doesn't support image files as of version 21.1. 2760 The @kbd{M-x ffap} command generalizes @code{find-file} with more
2761powerful heuristic defaults (@pxref{FFAP}), often based on the text at
2762point. Partial Completion mode offers other features extending
2763@code{find-file}, which can be used with @code{ffap}.
2764@xref{Completion Options}.