diff options
| author | Richard M. Stallman | 2006-05-04 00:25:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-05-04 00:25:54 +0000 |
| commit | 5004f8d371eacd841b6391aea091b5c5dd90d20d (patch) | |
| tree | 1374bfad66e9ba607fdc10468efbc59a04d48fed | |
| parent | e4a9a1cfc72babe6d9931c4eb02ef2411c2a53e8 (diff) | |
| download | emacs-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.texi | 97 |
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 | |||
| 2159 | running the @code{diff} program, using options taken from the variable | 2160 | running 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 |
| 2161 | string; the default is @code{"-c"} to specify a context diff. | 2162 | string; the default is @code{"-c"} to specify a context diff. |
| 2163 | @xref{Top,, Diff, diff, Comparing and Merging Files}, for more | ||
| 2164 | information 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 |
| 2167 | of. | 2170 | of. |
| 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 | ||
| 2174 | files, as in Compilation mode (@pxref{Compilation Mode}.) You can | ||
| 2175 | also 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 | ||
| 2180 | patches, which are the output from the @command{diff} program. You | ||
| 2181 | can 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 |
| 2185 | current window with that in the next window. (For more information | 2174 | current 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 |
| 2220 | provides a powerful interface for merging files. | 2209 | provides 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 | ||
| 2218 | mode is also useful for editing patches and comparisons produced by | ||
| 2219 | the @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 | ||
| 2223 | automatically correct line numbers, including those in the hunk | ||
| 2224 | header, so that you can actually apply the edited patch. Diff mode | ||
| 2225 | also provides the following commands to navigate, manipulate and apply | ||
| 2226 | parts of patches: | ||
| 2227 | |||
| 2228 | @table @kbd | ||
| 2229 | @item M-n | ||
| 2230 | Move to the next hunk-start (@code{diff-hunk-next}). | ||
| 2231 | |||
| 2232 | @item M-p | ||
| 2233 | Move to the previous hunk-start (@code{diff-hunk-prev}). | ||
| 2234 | |||
| 2235 | @item M-@} | ||
| 2236 | Move to the next file-start, in a multi-file patch | ||
| 2237 | (@code{diff-file-next}). | ||
| 2238 | |||
| 2239 | @item M-@{ | ||
| 2240 | Move to the previous file-start, in a multi-file patch | ||
| 2241 | (@code{diff-file-prev}). | ||
| 2242 | |||
| 2243 | @item M-k | ||
| 2244 | Kill the hunk at point (@code{diff-hunk-kill}). | ||
| 2245 | |||
| 2246 | @item M-K | ||
| 2247 | In a multi-file patch, kill the current file part. | ||
| 2248 | (@code{diff-file-kill}). | ||
| 2249 | |||
| 2250 | @item C-c C-a | ||
| 2251 | Apply this hunk to its target file (@code{diff-apply-hunk}). With a | ||
| 2252 | prefix argument of @kbd{C-u}, revert this hunk. | ||
| 2253 | |||
| 2254 | @item C-c C-c | ||
| 2255 | Go to the source corresponding to this hunk (@code{diff-goto-source}). | ||
| 2256 | |||
| 2257 | @item C-c C-e | ||
| 2258 | Start 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 | ||
| 2262 | Restrict the view to the current hunk (@code{diff-restrict-view}). | ||
| 2263 | @xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the | ||
| 2264 | view to the current patch of a multiple file patch. To widen again, | ||
| 2265 | use @kbd{C-x n w}. | ||
| 2266 | |||
| 2267 | @item C-c C-r | ||
| 2268 | Reverse the direction of comparison for the entire buffer | ||
| 2269 | (@code{diff-reverse-direction}). | ||
| 2270 | |||
| 2271 | @item C-c C-s | ||
| 2272 | Split the hunk at point (@code{diff-split-hunk}). This is for | ||
| 2273 | manually editing patches, and only works with the unified diff format. | ||
| 2274 | |||
| 2275 | @item C-c C-u | ||
| 2276 | Convert the entire buffer to unified format | ||
| 2277 | (@code{diff-context->unified}). With a prefix argument, convert | ||
| 2278 | unified format to context format. In Transient Mark mode, when the | ||
| 2279 | mark is active, this command operates only on the region. | ||
| 2280 | |||
| 2281 | @item C-c C-w | ||
| 2282 | Refine 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, | ||
| 2287 | but gets the function name from the patch itself. @xref{Change Log}. | ||
| 2288 | This is useful for making log entries for functions that are deleted | ||
| 2289 | by 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 | ||