aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-05-04 00:25:54 +0000
committerRichard M. Stallman2006-05-04 00:25:54 +0000
commit5004f8d371eacd841b6391aea091b5c5dd90d20d (patch)
tree1374bfad66e9ba607fdc10468efbc59a04d48fed
parente4a9a1cfc72babe6d9931c4eb02ef2411c2a53e8 (diff)
downloademacs-5004f8d371eacd841b6391aea091b5c5dd90d20d.tar.gz
emacs-5004f8d371eacd841b6391aea091b5c5dd90d20d.zip
(Diff Mode): Node moved here.
(Comparing Files): Delete what duplicates new node. (Files): Put Diff Mode in menu.
-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.
30* Version Control:: Version control systems (RCS, CVS and SCCS). 30* Version Control:: Version control systems (RCS, CVS and SCCS).
31* Directories:: Creating, deleting, and listing file directories. 31* Directories:: Creating, deleting, and listing file directories.
32* Comparing Files:: Finding where two files differ. 32* Comparing Files:: Finding where two files differ.
33* Diff Mode:: Mode for editing file differences.
33* Misc File Ops:: Other things you can do on files. 34* Misc File Ops:: Other things you can do on files.
34* Compressed Files:: Accessing compressed files. 35* Compressed Files:: Accessing compressed files.
35* File Archives:: Operating on tar, zip, jar etc. archive files. 36* 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
2159running the @code{diff} program, using options taken from the variable 2160running the @code{diff} program, using options taken from the variable
2160@code{diff-switches}. The value of @code{diff-switches} should be a 2161@code{diff-switches}. The value of @code{diff-switches} should be a
2161string; the default is @code{"-c"} to specify a context diff. 2162string; the default is @code{"-c"} to specify a context diff.
2163@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
2164information about @command{diff} output formats.
2162 2165
2163@findex diff-backup 2166@findex diff-backup
2164 The command @kbd{M-x diff-backup} compares a specified file with its most 2167 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,
2166@code{diff-backup} compares it with the source file that it is a backup 2169@code{diff-backup} compares it with the source file that it is a backup
2167of. 2170of.
2168 2171
2169@findex diff-goto-source
2170@findex diff-mode
2171@cindex Diff mode
2172 The @samp{*diff*} buffer uses Diff mode, which enables you to use
2173@kbd{C-x `} to visit successive changed locations in the two source
2174files, as in Compilation mode (@pxref{Compilation Mode}.) You can
2175also move to a particular hunk of changes and type @kbd{C-c C-c}
2176(@code{diff-goto-source}) to visit the corresponding source location.
2177
2178@cindex patches
2179 Differences between versions of files are often distributed as
2180patches, which are the output from the @command{diff} program. You
2181can use Diff mode to operate on a patch by typing @kbd{M-x diff-mode}.
2182
2183@findex compare-windows 2172@findex compare-windows
2184 The command @kbd{M-x compare-windows} compares the text in the 2173 The command @kbd{M-x compare-windows} compares the text in the
2185current window with that in the next window. (For more information 2174current window with that in the next window. (For more information
@@ -2219,6 +2208,86 @@ changes.
2219 @inforef{Emerge,, emacs-xtra} for the Emerge facility, which 2208 @inforef{Emerge,, emacs-xtra} for the Emerge facility, which
2220provides a powerful interface for merging files. 2209provides a powerful interface for merging files.
2221 2210
2211@node Diff Mode
2212@section Diff Mode
2213@cindex Diff mode
2214@findex diff-mode
2215@cindex patches, editing
2216
2217 The @samp{*diff*} buffer uses Diff mode (@pxref{Diff Mode}). Diff
2218mode is also useful for editing patches and comparisons produced by
2219the @command{diff} program. To select Diff mode manually, type
2220@kbd{M-x diff-mode}.
2221
2222 One general feature of Diff mode is that manual edits to the patch
2223automatically correct line numbers, including those in the hunk
2224header, so that you can actually apply the edited patch. Diff mode
2225also provides the following commands to navigate, manipulate and apply
2226parts of patches:
2227
2228@table @kbd
2229@item M-n
2230Move to the next hunk-start (@code{diff-hunk-next}).
2231
2232@item M-p
2233Move to the previous hunk-start (@code{diff-hunk-prev}).
2234
2235@item M-@}
2236Move to the next file-start, in a multi-file patch
2237(@code{diff-file-next}).
2238
2239@item M-@{
2240Move to the previous file-start, in a multi-file patch
2241(@code{diff-file-prev}).
2242
2243@item M-k
2244Kill the hunk at point (@code{diff-hunk-kill}).
2245
2246@item M-K
2247In a multi-file patch, kill the current file part.
2248(@code{diff-file-kill}).
2249
2250@item C-c C-a
2251Apply this hunk to its target file (@code{diff-apply-hunk}). With a
2252prefix argument of @kbd{C-u}, revert this hunk.
2253
2254@item C-c C-c
2255Go to the source corresponding to this hunk (@code{diff-goto-source}).
2256
2257@item C-c C-e
2258Start an Ediff session with the patch (@code{diff-ediff-patch}).
2259@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
2260
2261@item C-c C-n
2262Restrict the view to the current hunk (@code{diff-restrict-view}).
2263@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
2264view to the current patch of a multiple file patch. To widen again,
2265use @kbd{C-x n w}.
2266
2267@item C-c C-r
2268Reverse the direction of comparison for the entire buffer
2269(@code{diff-reverse-direction}).
2270
2271@item C-c C-s
2272Split the hunk at point (@code{diff-split-hunk}). This is for
2273manually editing patches, and only works with the unified diff format.
2274
2275@item C-c C-u
2276Convert the entire buffer to unified format
2277(@code{diff-context->unified}). With a prefix argument, convert
2278unified format to context format. In Transient Mark mode, when the
2279mark is active, this command operates only on the region.
2280
2281@item C-c C-w
2282Refine the current hunk so that it disregards changes in whitespace
2283(@code{diff-refine-hunk}).
2284@end table
2285
2286 @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
2287but gets the function name from the patch itself. @xref{Change Log}.
2288This is useful for making log entries for functions that are deleted
2289by the patch.
2290
2222@node Misc File Ops 2291@node Misc File Ops
2223@section Miscellaneous File Operations 2292@section Miscellaneous File Operations
2224 2293