]> code.delx.au - gnu-emacs/commitdiff
(Diff Mode): New node.
authorRichard M. Stallman <rms@gnu.org>
Tue, 2 May 2006 01:42:55 +0000 (01:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 2 May 2006 01:42:55 +0000 (01:42 +0000)
man/ChangeLog
man/misc.texi

index 450442989094741c5847f1367fde39e59b186f6d..7337b1de8483ef9b88dcfcd7ab002888ca4ba01d 100644 (file)
@@ -1,3 +1,7 @@
+2006-05-01  Aaron S. Hawley  <Aaron.Hawley@uvm.edu>
+
+       * misc.texi (Diff Mode): New node.
+
 2006-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macos.texi (Mac International): Now Carbon Emacs has ATSUI support.
index 0b07e04ed68140b27824ae34d30c4743ec79ced1..71f4aba2b4932e166fb37c7d44963840413f46e7 100644 (file)
@@ -1761,7 +1761,7 @@ rectangle moves along with the text inside the rectangle.
   Many of the sort commands ignore case differences when comparing, if
 @code{sort-fold-case} is non-@code{nil}.
 
-@node Narrowing, Two-Column, Sorting, Top
+@node Narrowing, Diff Mode, Sorting, Top
 @section Narrowing
 @cindex widening
 @cindex restriction
@@ -1827,7 +1827,86 @@ this command asks for confirmation and gives you the option of enabling it;
 if you enable the command, confirmation will no longer be required for
 it.  @xref{Disabling}.
 
-@node Two-Column, Editing Binary Files, Narrowing, Top
+@node Diff Mode, Two-Column, Narrowing, Top
+@section Diff Mode
+@cindex Diff mode
+
+  Diff mode is useful for editing patches and comparisons produced by
+the @command{diff} program.  You can select Diff mode by typing
+@kbd{M-x diff-mode}; Emacs commands that compare files automatically
+select Diff mode.  @xref{Top,, Diff, diff, Comparing and Merging Files},
+for more information about @command{diff} output formats.
+
+  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 Two-Column, Editing Binary Files, Diff Mode, Top
 @section Two-Column Editing
 @cindex two-column editing
 @cindex splitting columns