aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-08-22 18:38:47 +0000
committerDave Love2000-08-22 18:38:47 +0000
commitfa474484c87205705178d776e749f5d47b635252 (patch)
tree63465b3e9b74de0ccd94491308574d4491fa2e66
parentc9f2d80c7b43892135f943a139f5614729a631f1 (diff)
downloademacs-fa474484c87205705178d776e749f5d47b635252.tar.gz
emacs-fa474484c87205705178d776e749f5d47b635252.zip
(File Shadowing): New.
(Recover): auto-save-list-file-prefix fix. (Version Control): Mention CSSC. (VC Dired Mode): Ref pcl-cvs. (Comparing Files): Diff mode, smerge mode. (File Conveniences): find-file. Redo bits.
-rw-r--r--man/files.texi208
1 files changed, 136 insertions, 72 deletions
diff --git a/man/files.texi b/man/files.texi
index f0f64597c61..a374e7124f9 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -431,6 +431,7 @@ every time a file is saved or written. The default is @code{nil}.
431* Backup:: How Emacs saves the old version of your file. 431* Backup:: How Emacs saves the old version of your file.
432* Interlocking:: How Emacs protects against simultaneous editing 432* Interlocking:: How Emacs protects against simultaneous editing
433 of one file by two users. 433 of one file by two users.
434* Shadowing: File Shadowing. Copying files to `shadows' automatically.
434@end menu 435@end menu
435 436
436@node Backup 437@node Backup
@@ -513,11 +514,12 @@ original file's directory. The directories are created if necessary
513when the backup is made. 514when the backup is made.
514 515
515 If you choose to have a series of numbered backup files, backup file 516 If you choose to have a series of numbered backup files, backup file
516names are made by appending @samp{.~}, the number, and another @samp{~} to 517names are made by appending @samp{.~}, the number, and another @samp{~}
517the original file name. Thus, the backup files of @file{eval.c} would be 518to the original file name. Thus, the backup files of @file{eval.c}
518called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, through names 519would be called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, through
519like @file{eval.c.~259~} and beyond. @code{backup-directory-alist} can 520names like @file{eval.c.~259~} and beyond. As for single backups,
520be used to control their location as for single backups. 521@code{backup-directory-alist} can be used to control the location of
522numbered backups.
521 523
522 If protection stops you from writing backup files under the usual names, 524 If protection stops you from writing backup files under the usual names,
523the backup file is written as @file{%backup%~} in your home directory. 525the backup file is written as @file{%backup%~} in your home directory.
@@ -712,6 +714,52 @@ should attempt to contact him to warn him not to continue editing.
712Often the next step is to save the contents of your Emacs buffer under a 714Often the next step is to save the contents of your Emacs buffer under a
713different name, and use @code{diff} to compare the two files.@refill 715different name, and use @code{diff} to compare the two files.@refill
714 716
717@node File Shadowing
718@subsection Shadowing Files
719@cindex shadow files
720@cindex file shadows
721
722@table @kbd
723@item M-x shadow-initialize
724Set up file shadowing.
725@item M-x shadow-define-cluster @key{RET} @var{name} @key{RET}
726Define a shadow file cluster @var{name}.
727@item M-x shadow-define-regexp-group
728Make each of a group of files be shared between hosts.
729@item M-x shadow-define-literal-group
730Declare a single file to be shared between sites.
731@item M-x shadow-copy-files
732Copy all pending shadow files.
733@item M-x shadow-cancel ()
734Cancel the instruction to copy some files.
735@end table
736
737You can arrange to keep identical copies of files in more than one
738place---possibly on different machines. When you save a file, Emacs can
739check whether it is on the list of files with @dfn{shadows}, and if so,
740it tries to copy it when you exit Emacs (or use the @kbd{M-x
741shadow-copy-files} command).
742
743A @dfn{cluster} is a group of hosts that share directories, so that
744copying to or from one of them is sufficient to update the file on all
745of them. Clusters are defined by a name, the network address of a
746primary host (the one we copy files to), and a regular expression that
747matches the hostnames of all the sites in the cluster. A @dfn{file
748group} is a set of identically-named files shared between a list of
749sites.
750
751Add clusters (if necessary) and file groups with @kbd{M-x
752shadow-define-cluster}, @kbd{M-x shadow-define-literal-group}, and
753@kbd{M-x shadow-define-regexp-group} (see the documentation for these
754functions for information on how and when to use them). After doing
755this once, everything should be automatic. The lists of clusters and
756shadows are remembered from one emacs session to another.
757
758If you do not want to copy a particular file, you can answer "no" and be
759asked again next time you hit @kbd{C-x 4 s} or exit Emacs. If you do
760not want to be asked again, use @kbd{M-x shadow-cancel}, and you will
761not be asked until you change the file and save it again.
762
715@node Reverting 763@node Reverting
716@section Reverting a Buffer 764@section Reverting a Buffer
717@findex revert-buffer 765@findex revert-buffer
@@ -900,7 +948,8 @@ this---saving them---updates the files themselves.
900 948
901@vindex auto-save-list-file-prefix 949@vindex auto-save-list-file-prefix
902 Interrupted sessions are recorded for later recovery in files named 950 Interrupted sessions are recorded for later recovery in files named
903@file{~/.saves-@var{pid}-@var{hostname}}. The @samp{~/.saves} portion of 951@file{~/.emacs.d/auto-save-list/.saves-@var{pid}-@var{hostname}}. The
952@samp{~/.emacs.d/auto-save-list/.saves-} portion of
904these names comes from the value of @code{auto-save-list-file-prefix}. 953these names comes from the value of @code{auto-save-list-file-prefix}.
905You can arrange to record sessions in a different place by setting that 954You can arrange to record sessions in a different place by setting that
906variable in your @file{.emacs} file, but you'll have to redefine 955variable in your @file{.emacs} file, but you'll have to redefine
@@ -953,6 +1002,9 @@ description of what was changed in that version.
953with three version control systems---RCS, CVS and SCCS. The GNU project 1002with three version control systems---RCS, CVS and SCCS. The GNU project
954recommends RCS and CVS, which are free software and available from the 1003recommends RCS and CVS, which are free software and available from the
955Free Software Foundation. 1004Free Software Foundation.
1005@cindex CSSC
1006There is a GNU clone of SCCS called CSSC, but RCS is technically
1007superior.
956 1008
957@menu 1009@menu
958* Introduction to VC:: How version control works in general. 1010* Introduction to VC:: How version control works in general.
@@ -1404,6 +1456,14 @@ with CVS.
1404@node VC Dired Mode 1456@node VC Dired Mode
1405@subsubsection Dired under VC 1457@subsubsection Dired under VC
1406 1458
1459@cindex PCL-CVS
1460@pindex cvs
1461@cindex CVS Dired Mode
1462The VC Dired Mode described here works with all the VC-supported version
1463control systems. There is a similar facility specialized for use with
1464CVS, called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The
1465Emacs Front-End to CVS}.
1466
1407@kindex C-x v d 1467@kindex C-x v d
1408@findex vc-directory 1468@findex vc-directory
1409 When you are working on a large program, it is often useful to find 1469 When you are working on a large program, it is often useful to find
@@ -2296,8 +2356,28 @@ the command is finished. For more information about windows in Emacs,
2296whitespace. If the variable @code{compare-ignore-case} is 2356whitespace. If the variable @code{compare-ignore-case} is
2297non-@code{nil}, it ignores differences in case as well. 2357non-@code{nil}, it ignores differences in case as well.
2298 2358
2299 See also @ref{Emerge}, for convenient facilities for merging two 2359@findex diff-mode
2300similar files. 2360@cindex diffs
2361@cindex patches
2362@cindex Diff mode
2363Differences between versions of files are often distributed as
2364@dfn{patches} output by @command{diff} or a version control system.
2365@kbd{M-x diff-mode} turns on Diff mode, a major mode for viewing and
2366editing patches, either as `unified diffs' or `context diffs'.
2367
2368 See also @ref{Emerge} and @ref{Top,,, ediff, The Ediff Manual}, for
2369convenient facilities for merging two similar files.
2370
2371@cindex Smerge mode
2372@findex smerge-mode
2373@cindex failed merges
2374@cindex merges, failed
2375@pindex diff3
2376Use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor mode for
2377editing output from the @command{diff3} program. This is typically the
2378result of a failed merge from a version control system `update' outside
2379VC, due to conflicting changes to a file. Smerge mode provides commands
2380to resolve conflicts by selecting specific changes.
2301 2381
2302@node Misc File Ops 2382@node Misc File Ops
2303@section Miscellaneous File Operations 2383@section Miscellaneous File Operations
@@ -2441,6 +2521,9 @@ Tar mode or Archive mode---Emacs reads the archives directly. For
2441compressed archives such as @code{.tar.gz}, you need the appropriate 2521compressed archives such as @code{.tar.gz}, you need the appropriate
2442uncompress program to be available to Emacs. 2522uncompress program to be available to Emacs.
2443 2523
2524It is not necessary to have the @code{tar} program available to use Tar
2525mode or Archive mode---Emacs reads the archives directly.
2526
2444@cindex Archive mode 2527@cindex Archive mode
2445@cindex mode, archive 2528@cindex mode, archive
2446@cindex @code{arc} 2529@cindex @code{arc}
@@ -2546,14 +2629,18 @@ Another way is to specify @file{/tmp/foo[*]bar}.
2546@node File Conveniences 2629@node File Conveniences
2547@section Convenience Features for Finding Files 2630@section Convenience Features for Finding Files
2548 2631
2549@findex recentf-mode 2632@table @kbd
2550@vindex recentf-mode 2633@item M-x ff-find-other-file
2551@findex recentf-save-list 2634Find the header or source file corresponding to the current buffer's
2552@findex recentf-edit-list 2635file.
2553The command @kbd{M-x recentf-mode} or the Customize option of the same 2636@item M-x file-cache-add-directory @key{RET} @var{directory} @key{RET}
2554name adds to the Files menu a submenu containing a list of recently 2637Add @var{directory} to the file cache.
2555opened files. @kbd{recentf-save-list} saves the current file list to a 2638@item M-x locate @key{RET} @var{pattern} @key{RET}
2556file and @kbd{recentf-edit-list} edits it. 2639Run the program @command{locate} to match @var{pattern} in the database,
2640putting results in a buffer.
2641@item M-x locate-with-filter @key{RET} @var{pattern} @key{RET} @var{filter} @key{RET}
2642Like @code{locate}, but use a @var{filter} on the results.
2643@end table
2557 2644
2558@findex ff-find-other-file 2645@findex ff-find-other-file
2559@vindex ff-other-file-alist 2646@vindex ff-other-file-alist
@@ -2563,56 +2650,26 @@ Typically this will be the header file corresponding to a C/C++ source
2563file, or vice versa. The patterns describing the corresponding files 2650file, or vice versa. The patterns describing the corresponding files
2564are customizable via @code{ff-other-file-alist}. 2651are customizable via @code{ff-other-file-alist}.
2565 2652
2566@findex ffap
2567@findex find-file-at-point
2568@cindex finding file at point
2569The command @kbd{M-x find-file-at-point} (or @kbd{M-x ffap}) can be used
2570as a replacement for @kbd{M-x find-file}. With a prefix argument it
2571behaves as @kbd{M-x find-file}. Otherwise it tries to guess a default
2572file or URL from the text around point. This is useful for following
2573references in mail or news buffers, @file{README}s, @file{MANIFEST}s,
2574and so on. @kbd{M-x ffap-bindings} makes these global key bindings:
2575
2576@table @kbd
2577@item C-x C-f
2578@kbd{find-file-at-point};
2579@item C-x 4 f
2580@kbd{ffap-other-window}, analagous to @kbd{find-file-other-window};
2581@item C-x 5 f
2582@kbd{ffap-other-frame}, analagous to @kbd{find-file-other-frame};
2583@item S-mouse-3
2584@kbd{ffap-at-mouse} finds the file guessed from text around the position
2585of a mouse click;
2586@item C-S-mouse-3
2587@kbd{ffap-menu} puts up a selectable menu of files and URLs mentioned in
2588the current buffer.
2589@end table
2590
2591Partial Completion mode offers other features extending @kbd{M-x
2592find-file} which can be used with @code{ffap}. @xref{Completion
2593Options}.
2594
2595@cindex filename caching 2653@cindex filename caching
2596@cindex cache of file names 2654@cindex cache of file names
2597@pindex find 2655@pindex find
2598@pindex locate 2656@pindex locate
2599@vindex file-cache-delete-regexps 2657@vindex file-cache-delete-regexps
2600The Filecache package attempts to make it easy to locate files by name 2658@findex file-cache-add-directory
2601without having to remember exactly where they are. When typing a 2659You can use a cache to make it easy to locate files by name without
2602filename in the minibuffer you can use @kbd{C-tab} to complete it using 2660having to remember exactly where they are. When typing a filename in
2603the filename cache and to cycle through possible completions. (The 2661the minibuffer you can @kbd{C-tab} will complete it using the filename
2604@kbd{C-tab} binding assumes a window system; otherwise you can make 2662cache and cycle through possible completions. (The @kbd{C-tab} key
2605another binding for @code{file-cache-minibuffer-complete}.) @kbd{M-x 2663can't be distinguished from @kbd{TAB} on all terminals.) The command
2606file-cache-add-directory} adds the files in a directory to the cache and 2664@kbd{M-x file-cache-add-directory} adds the files in a directory to the
2607@kbd{file-cache-add-directory-list} acts on a list of directories like 2665cache and @kbd{M-x file-cache-add-directory-list} acts on a list of
2608@kbd{load-path} or @kbd{exec-path}. 2666directories like @code{load-path} or @code{exec-path}. @kbd{M-x
2609@kbd{file-cache-add-directory-using-find} uses the @code{find} program 2667file-cache-add-directory-using-find} uses the @command{find} program to
2610to add a directory tree to the cache and 2668add a directory tree to the cache and @kbd{M-x
2611@kbd{file-cache-add-directory-using-locate} uses the @kbd{locate} 2669file-cache-add-directory-using-locate} uses the @command{locate} program
2612program to add files matching a pattern. Use @kbd{M-x 2670to add files matching a pattern. Use @kbd{M-x file-cache-clear-cache}
2613file-cache-clear-cache} to remove all items from the cache and @kbd{M-x 2671to remove all items from the cache; @kbd{M-x file-cache-delete-regexps}
2614file-cache-delete-regexps} and similar functions to remove items from it 2672and similar functions remove items from it selectively.
2615selectively.
2616 2673
2617@pindex locate 2674@pindex locate
2618@findex locate 2675@findex locate
@@ -2621,14 +2678,21 @@ selectively.
2621@vindex locate-command 2678@vindex locate-command
2622@kbd{M-x locate} runs an interface to the @code{locate} program for 2679@kbd{M-x locate} runs an interface to the @code{locate} program for
2623searching a pre-built database of file names; most Dired commands are 2680searching a pre-built database of file names; most Dired commands are
2624avilable for use on the result. @xref{Top, , Overview, find, GNU 2681avilable for use on the result. @xref{, ,Find , find, GNU Findutils}.
2625Findutils}. @kbd{M-x locate-with-filter} is similar, but keeps only 2682@kbd{M-x locate-with-filter} is similar, but keeps only lines matching a
2626lines matching a regular expression. Customize the option 2683regular expression. Customize the option @code{locate-command} to use
2627@code{locate-command} to use another program than the default, GNU 2684another program than the default, GNU @code{locate}.
2628@code{locate}. 2685
2629 2686The @kbd{M-x ffap} command generalizes @kbd{M-x find-file}. @xref{FFAP}.
2630@c The Shadowfile package provides automatic file copying, allowing you to 2687Partial Completion mode offers other features extending @kbd{M-x
2631@c keep identical copies of files in more than one place---possibly on 2688find-file} which can be used with @code{ffap}. @xref{Completion
2632@c different machines. When you save a file, it checks whether it is on 2689Options}.
2633@c the list of files with `shadows', and if so, it tries to copy it when 2690
2634@c you exit emacs (or use the @kbd{M-x shadow-copy-files} command). 2691@findex recentf-mode
2692@vindex recentf-mode
2693@findex recentf-save-list
2694@findex recentf-edit-list
2695The command @kbd{M-x recentf-mode} or the Customize option of the same
2696name adds to the Files menu a submenu containing a list of recently
2697opened files. @kbd{recentf-save-list} saves the current file list to a
2698file and @kbd{recentf-edit-list} edits it.