--- files.texi 06 Mar 2006 22:56:44 -0500 1.133 +++ files.texi 07 Mar 2006 18:27:41 -0500 @@ -2999,7 +2999,87 @@ @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}. +can use the same Diff mode to operate on a patch by typing @kbd{M-x +diff-mode}. Any manual edits you make to a patch with Diff mode will +automatically correct the hunk header including insert, delete and +file line numbers. Also, the following commands help to navigate, +manipulate and apply patches in Diff mode: + +@table @kbd +@item M-n +@findex diff-hunk-next +Move to the next hunk in the patch. + +@item M-p +@findex diff-hunk-prev +Move to the previous hunk in the patch. + +@item M-@} +@findex diff-file-next +Move to the next file hunk in a multiple file patch. + +@item M-@{ +@findex diff-file-prev +Move to the previous file hunk in a multiple file patch. + +@item M-k +@findex diff-hunk-kill +Kill the current hunk at point. + +@item M-K +@findex diff-file-kill +In a patch with multiple files, kill the current patch to a file. + +@item C-c C-s +@findex diff-split-hunk +Split the hunk at point. This is useful when manually editing a patch +and only works with the unified diff format. + +@item C-c C-r +@findex diff-refine-hunk +Recomputes the current hunk by ignoring changes in whitespace. + +@item M-R +@findex diff-reverse-direction +Convert the patch to a patch that reverts. +@xref{Reversed Patches, Applying Reversed Patches, Patch, diff, +Comparing and Merging Files}. + +@item M-U +@findex diff-context->unified +Convert the patch to the unified diff format. +@xref{Unified Format, Unified Format, Diff, diff, +Comparing and Merging Files}. + +@item M-C +@findex diff-unified->context +Convert the patch back to context diff format. +@xref{Context Format, Context Format, Diff, diff, +Comparing and Merging Files}. + +@item M-r +@findex diff-restrict-view +@findex widen +Restrict the view to the current hunk. @xref{Narrowing}. With a +prefix argument of @kbd{C-u} restrict the view to the current patch of +a multiple file patch. The view can be widened again with @kbd{M-W}. + +@item C-c C-a +@findex diff-apply-hunk +Apply hunk to target file. With a prefix argument of @kbd{C-u}, apply +the reverse of the hunk. + +@item M-A +@findex diff-ediff-patch +Start an Ediff session with the patch. +@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}. + +@item C-x 4 a +Add a new entry to the change log for the current file. @xref{Change +Log}. This is useful for log entries for functions that are deleted +by the patch. + +@end table @findex compare-windows The command @kbd{M-x compare-windows} compares the text in the