diff options
| author | Dave Love | 2000-08-22 18:38:47 +0000 |
|---|---|---|
| committer | Dave Love | 2000-08-22 18:38:47 +0000 |
| commit | fa474484c87205705178d776e749f5d47b635252 (patch) | |
| tree | 63465b3e9b74de0ccd94491308574d4491fa2e66 | |
| parent | c9f2d80c7b43892135f943a139f5614729a631f1 (diff) | |
| download | emacs-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.texi | 208 |
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 | |||
| 513 | when the backup is made. | 514 | when 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 |
| 516 | names are made by appending @samp{.~}, the number, and another @samp{~} to | 517 | names are made by appending @samp{.~}, the number, and another @samp{~} |
| 517 | the original file name. Thus, the backup files of @file{eval.c} would be | 518 | to the original file name. Thus, the backup files of @file{eval.c} |
| 518 | called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, through names | 519 | would be called @file{eval.c.~1~}, @file{eval.c.~2~}, and so on, through |
| 519 | like @file{eval.c.~259~} and beyond. @code{backup-directory-alist} can | 520 | names like @file{eval.c.~259~} and beyond. As for single backups, |
| 520 | be used to control their location as for single backups. | 521 | @code{backup-directory-alist} can be used to control the location of |
| 522 | numbered 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, |
| 523 | the backup file is written as @file{%backup%~} in your home directory. | 525 | the 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. | |||
| 712 | Often the next step is to save the contents of your Emacs buffer under a | 714 | Often the next step is to save the contents of your Emacs buffer under a |
| 713 | different name, and use @code{diff} to compare the two files.@refill | 715 | different 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 | ||
| 724 | Set up file shadowing. | ||
| 725 | @item M-x shadow-define-cluster @key{RET} @var{name} @key{RET} | ||
| 726 | Define a shadow file cluster @var{name}. | ||
| 727 | @item M-x shadow-define-regexp-group | ||
| 728 | Make each of a group of files be shared between hosts. | ||
| 729 | @item M-x shadow-define-literal-group | ||
| 730 | Declare a single file to be shared between sites. | ||
| 731 | @item M-x shadow-copy-files | ||
| 732 | Copy all pending shadow files. | ||
| 733 | @item M-x shadow-cancel () | ||
| 734 | Cancel the instruction to copy some files. | ||
| 735 | @end table | ||
| 736 | |||
| 737 | You can arrange to keep identical copies of files in more than one | ||
| 738 | place---possibly on different machines. When you save a file, Emacs can | ||
| 739 | check whether it is on the list of files with @dfn{shadows}, and if so, | ||
| 740 | it tries to copy it when you exit Emacs (or use the @kbd{M-x | ||
| 741 | shadow-copy-files} command). | ||
| 742 | |||
| 743 | A @dfn{cluster} is a group of hosts that share directories, so that | ||
| 744 | copying to or from one of them is sufficient to update the file on all | ||
| 745 | of them. Clusters are defined by a name, the network address of a | ||
| 746 | primary host (the one we copy files to), and a regular expression that | ||
| 747 | matches the hostnames of all the sites in the cluster. A @dfn{file | ||
| 748 | group} is a set of identically-named files shared between a list of | ||
| 749 | sites. | ||
| 750 | |||
| 751 | Add clusters (if necessary) and file groups with @kbd{M-x | ||
| 752 | shadow-define-cluster}, @kbd{M-x shadow-define-literal-group}, and | ||
| 753 | @kbd{M-x shadow-define-regexp-group} (see the documentation for these | ||
| 754 | functions for information on how and when to use them). After doing | ||
| 755 | this once, everything should be automatic. The lists of clusters and | ||
| 756 | shadows are remembered from one emacs session to another. | ||
| 757 | |||
| 758 | If you do not want to copy a particular file, you can answer "no" and be | ||
| 759 | asked again next time you hit @kbd{C-x 4 s} or exit Emacs. If you do | ||
| 760 | not want to be asked again, use @kbd{M-x shadow-cancel}, and you will | ||
| 761 | not 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 | ||
| 904 | these names comes from the value of @code{auto-save-list-file-prefix}. | 953 | these names comes from the value of @code{auto-save-list-file-prefix}. |
| 905 | You can arrange to record sessions in a different place by setting that | 954 | You can arrange to record sessions in a different place by setting that |
| 906 | variable in your @file{.emacs} file, but you'll have to redefine | 955 | variable in your @file{.emacs} file, but you'll have to redefine |
| @@ -953,6 +1002,9 @@ description of what was changed in that version. | |||
| 953 | with three version control systems---RCS, CVS and SCCS. The GNU project | 1002 | with three version control systems---RCS, CVS and SCCS. The GNU project |
| 954 | recommends RCS and CVS, which are free software and available from the | 1003 | recommends RCS and CVS, which are free software and available from the |
| 955 | Free Software Foundation. | 1004 | Free Software Foundation. |
| 1005 | @cindex CSSC | ||
| 1006 | There is a GNU clone of SCCS called CSSC, but RCS is technically | ||
| 1007 | superior. | ||
| 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 | ||
| 1462 | The VC Dired Mode described here works with all the VC-supported version | ||
| 1463 | control systems. There is a similar facility specialized for use with | ||
| 1464 | CVS, called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The | ||
| 1465 | Emacs 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, | |||
| 2296 | whitespace. If the variable @code{compare-ignore-case} is | 2356 | whitespace. If the variable @code{compare-ignore-case} is |
| 2297 | non-@code{nil}, it ignores differences in case as well. | 2357 | non-@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 |
| 2300 | similar files. | 2360 | @cindex diffs |
| 2361 | @cindex patches | ||
| 2362 | @cindex Diff mode | ||
| 2363 | Differences 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 | ||
| 2366 | editing patches, either as `unified diffs' or `context diffs'. | ||
| 2367 | |||
| 2368 | See also @ref{Emerge} and @ref{Top,,, ediff, The Ediff Manual}, for | ||
| 2369 | convenient 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 | ||
| 2376 | Use @kbd{M-x smerge-mode} to turn on Smerge mode, a minor mode for | ||
| 2377 | editing output from the @command{diff3} program. This is typically the | ||
| 2378 | result of a failed merge from a version control system `update' outside | ||
| 2379 | VC, due to conflicting changes to a file. Smerge mode provides commands | ||
| 2380 | to 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 | |||
| 2441 | compressed archives such as @code{.tar.gz}, you need the appropriate | 2521 | compressed archives such as @code{.tar.gz}, you need the appropriate |
| 2442 | uncompress program to be available to Emacs. | 2522 | uncompress program to be available to Emacs. |
| 2443 | 2523 | ||
| 2524 | It is not necessary to have the @code{tar} program available to use Tar | ||
| 2525 | mode 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 | 2634 | Find the header or source file corresponding to the current buffer's |
| 2552 | @findex recentf-edit-list | 2635 | file. |
| 2553 | The 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} |
| 2554 | name adds to the Files menu a submenu containing a list of recently | 2637 | Add @var{directory} to the file cache. |
| 2555 | opened files. @kbd{recentf-save-list} saves the current file list to a | 2638 | @item M-x locate @key{RET} @var{pattern} @key{RET} |
| 2556 | file and @kbd{recentf-edit-list} edits it. | 2639 | Run the program @command{locate} to match @var{pattern} in the database, |
| 2640 | putting results in a buffer. | ||
| 2641 | @item M-x locate-with-filter @key{RET} @var{pattern} @key{RET} @var{filter} @key{RET} | ||
| 2642 | Like @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 | |||
| 2563 | file, or vice versa. The patterns describing the corresponding files | 2650 | file, or vice versa. The patterns describing the corresponding files |
| 2564 | are customizable via @code{ff-other-file-alist}. | 2651 | are customizable via @code{ff-other-file-alist}. |
| 2565 | 2652 | ||
| 2566 | @findex ffap | ||
| 2567 | @findex find-file-at-point | ||
| 2568 | @cindex finding file at point | ||
| 2569 | The command @kbd{M-x find-file-at-point} (or @kbd{M-x ffap}) can be used | ||
| 2570 | as a replacement for @kbd{M-x find-file}. With a prefix argument it | ||
| 2571 | behaves as @kbd{M-x find-file}. Otherwise it tries to guess a default | ||
| 2572 | file or URL from the text around point. This is useful for following | ||
| 2573 | references in mail or news buffers, @file{README}s, @file{MANIFEST}s, | ||
| 2574 | and 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 | ||
| 2585 | of a mouse click; | ||
| 2586 | @item C-S-mouse-3 | ||
| 2587 | @kbd{ffap-menu} puts up a selectable menu of files and URLs mentioned in | ||
| 2588 | the current buffer. | ||
| 2589 | @end table | ||
| 2590 | |||
| 2591 | Partial Completion mode offers other features extending @kbd{M-x | ||
| 2592 | find-file} which can be used with @code{ffap}. @xref{Completion | ||
| 2593 | Options}. | ||
| 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 |
| 2600 | The Filecache package attempts to make it easy to locate files by name | 2658 | @findex file-cache-add-directory |
| 2601 | without having to remember exactly where they are. When typing a | 2659 | You can use a cache to make it easy to locate files by name without |
| 2602 | filename in the minibuffer you can use @kbd{C-tab} to complete it using | 2660 | having to remember exactly where they are. When typing a filename in |
| 2603 | the filename cache and to cycle through possible completions. (The | 2661 | the 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 | 2662 | cache and cycle through possible completions. (The @kbd{C-tab} key |
| 2605 | another binding for @code{file-cache-minibuffer-complete}.) @kbd{M-x | 2663 | can't be distinguished from @kbd{TAB} on all terminals.) The command |
| 2606 | file-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 | 2665 | cache and @kbd{M-x file-cache-add-directory-list} acts on a list of |
| 2608 | @kbd{load-path} or @kbd{exec-path}. | 2666 | directories like @code{load-path} or @code{exec-path}. @kbd{M-x |
| 2609 | @kbd{file-cache-add-directory-using-find} uses the @code{find} program | 2667 | file-cache-add-directory-using-find} uses the @command{find} program to |
| 2610 | to add a directory tree to the cache and | 2668 | add a directory tree to the cache and @kbd{M-x |
| 2611 | @kbd{file-cache-add-directory-using-locate} uses the @kbd{locate} | 2669 | file-cache-add-directory-using-locate} uses the @command{locate} program |
| 2612 | program to add files matching a pattern. Use @kbd{M-x | 2670 | to add files matching a pattern. Use @kbd{M-x file-cache-clear-cache} |
| 2613 | file-cache-clear-cache} to remove all items from the cache and @kbd{M-x | 2671 | to remove all items from the cache; @kbd{M-x file-cache-delete-regexps} |
| 2614 | file-cache-delete-regexps} and similar functions to remove items from it | 2672 | and similar functions remove items from it selectively. |
| 2615 | selectively. | ||
| 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 |
| 2623 | searching a pre-built database of file names; most Dired commands are | 2680 | searching a pre-built database of file names; most Dired commands are |
| 2624 | avilable for use on the result. @xref{Top, , Overview, find, GNU | 2681 | avilable for use on the result. @xref{, ,Find , find, GNU Findutils}. |
| 2625 | Findutils}. @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 |
| 2626 | lines matching a regular expression. Customize the option | 2683 | regular expression. Customize the option @code{locate-command} to use |
| 2627 | @code{locate-command} to use another program than the default, GNU | 2684 | another program than the default, GNU @code{locate}. |
| 2628 | @code{locate}. | 2685 | |
| 2629 | 2686 | The @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 | 2687 | Partial Completion mode offers other features extending @kbd{M-x |
| 2631 | @c keep identical copies of files in more than one place---possibly on | 2688 | find-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 | 2689 | Options}. |
| 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 | ||
| 2695 | The command @kbd{M-x recentf-mode} or the Customize option of the same | ||
| 2696 | name adds to the Files menu a submenu containing a list of recently | ||
| 2697 | opened files. @kbd{recentf-save-list} saves the current file list to a | ||
| 2698 | file and @kbd{recentf-edit-list} edits it. | ||