summaryrefslogtreecommitdiff
path: root/man/files.texi
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-05-04 00:25:54 +0000
committerRichard M. Stallman <rms@gnu.org>2006-05-04 00:25:54 +0000
commit5004f8d371eacd841b6391aea091b5c5dd90d20d (patch)
tree1374bfad66e9ba607fdc10468efbc59a04d48fed /man/files.texi
parente4a9a1cfc72babe6d9931c4eb02ef2411c2a53e8 (diff)
downloademacs-5004f8d371eacd841b6391aea091b5c5dd90d20d.tar.gz
(Diff Mode): Node moved here.
(Comparing Files): Delete what duplicates new node. (Files): Put Diff Mode in menu.
Diffstat (limited to 'man/files.texi')
-rw-r--r--man/files.texi97
1 files changed, 83 insertions, 14 deletions
diff --git a/man/files.texi b/man/files.texi
index ab3fe7bb583..be9f4443418 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -30,6 +30,7 @@ on file directories.
* Version Control:: Version control systems (RCS, CVS and SCCS).
* Directories:: Creating, deleting, and listing file directories.
* Comparing Files:: Finding where two files differ.
+* Diff Mode:: Mode for editing file differences.
* Misc File Ops:: Other things you can do on files.
* Compressed Files:: Accessing compressed files.
* File Archives:: Operating on tar, zip, jar etc. archive files.
@@ -2159,6 +2160,8 @@ differences in an Emacs buffer named @samp{*diff*}. It works by
running the @code{diff} program, using options taken from the variable
@code{diff-switches}. The value of @code{diff-switches} should be a
string; the default is @code{"-c"} to specify a context diff.
+@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
+information about @command{diff} output formats.
@findex diff-backup
The command @kbd{M-x diff-backup} compares a specified file with its most
@@ -2166,20 +2169,6 @@ recent backup. If you specify the name of a backup file,
@code{diff-backup} compares it with the source file that it is a backup
of.
-@findex diff-goto-source
-@findex diff-mode
-@cindex Diff mode
- The @samp{*diff*} buffer uses Diff mode, which enables you to use
-@kbd{C-x `} to visit successive changed locations in the two source
-files, as in Compilation mode (@pxref{Compilation Mode}.) You can
-also move to a particular hunk of changes and type @kbd{C-c C-c}
-(@code{diff-goto-source}) to visit the corresponding source location.
-
-@cindex patches
- Differences between versions of files are often distributed as
-patches, which are the output from the @command{diff} program. You
-can use Diff mode to operate on a patch by typing @kbd{M-x diff-mode}.
-
@findex compare-windows
The command @kbd{M-x compare-windows} compares the text in the
current window with that in the next window. (For more information
@@ -2219,6 +2208,86 @@ changes.
@inforef{Emerge,, emacs-xtra} for the Emerge facility, which
provides a powerful interface for merging files.
+@node Diff Mode
+@section Diff Mode
+@cindex Diff mode
+@findex diff-mode
+@cindex patches, editing
+
+ The @samp{*diff*} buffer uses Diff mode (@pxref{Diff Mode}). Diff
+mode is also useful for editing patches and comparisons produced by
+the @command{diff} program. To select Diff mode manually, type
+@kbd{M-x diff-mode}.
+
+ One general feature of Diff mode is that manual edits to the patch
+automatically correct line numbers, including those in the hunk
+header, so that you can actually apply the edited patch. Diff mode
+also provides the following commands to navigate, manipulate and apply
+parts of patches:
+
+@table @kbd
+@item M-n
+Move to the next hunk-start (@code{diff-hunk-next}).
+
+@item M-p
+Move to the previous hunk-start (@code{diff-hunk-prev}).
+
+@item M-@}
+Move to the next file-start, in a multi-file patch
+(@code{diff-file-next}).
+
+@item M-@{
+Move to the previous file-start, in a multi-file patch
+(@code{diff-file-prev}).
+
+@item M-k
+Kill the hunk at point (@code{diff-hunk-kill}).
+
+@item M-K
+In a multi-file patch, kill the current file part.
+(@code{diff-file-kill}).
+
+@item C-c C-a
+Apply this hunk to its target file (@code{diff-apply-hunk}). With a
+prefix argument of @kbd{C-u}, revert this hunk.
+
+@item C-c C-c
+Go to the source corresponding to this hunk (@code{diff-goto-source}).
+
+@item C-c C-e
+Start an Ediff session with the patch (@code{diff-ediff-patch}).
+@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
+
+@item C-c C-n
+Restrict the view to the current hunk (@code{diff-restrict-view}).
+@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
+view to the current patch of a multiple file patch. To widen again,
+use @kbd{C-x n w}.
+
+@item C-c C-r
+Reverse the direction of comparison for the entire buffer
+(@code{diff-reverse-direction}).
+
+@item C-c C-s
+Split the hunk at point (@code{diff-split-hunk}). This is for
+manually editing patches, and only works with the unified diff format.
+
+@item C-c C-u
+Convert the entire buffer to unified format
+(@code{diff-context->unified}). With a prefix argument, convert
+unified format to context format. In Transient Mark mode, when the
+mark is active, this command operates only on the region.
+
+@item C-c C-w
+Refine the current hunk so that it disregards changes in whitespace
+(@code{diff-refine-hunk}).
+@end table
+
+ @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
+but gets the function name from the patch itself. @xref{Change Log}.
+This is useful for making log entries for functions that are deleted
+by the patch.
+
@node Misc File Ops
@section Miscellaneous File Operations