| 1 |
This is ../info/ediff, produced by makeinfo version 4.2 from ediff.texi. |
|---|
| 2 |
|
|---|
| 3 |
INFO-DIR-SECTION Emacs |
|---|
| 4 |
START-INFO-DIR-ENTRY |
|---|
| 5 |
* Ediff: (ediff). A visual interface for comparing and merging programs. |
|---|
| 6 |
END-INFO-DIR-ENTRY |
|---|
| 7 |
|
|---|
| 8 |
This file documents Ediff, a comprehensive visual interface to diff |
|---|
| 9 |
and patch utilities. |
|---|
| 10 |
|
|---|
| 11 |
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software |
|---|
| 12 |
Foundation, Inc. |
|---|
| 13 |
|
|---|
| 14 |
Permission is granted to copy, distribute and/or modify this document |
|---|
| 15 |
under the terms of the GNU Free Documentation License, Version 1.1 or |
|---|
| 16 |
any later version published by the Free Software Foundation; with no |
|---|
| 17 |
Invariant Sections, with the Front-Cover texts being "A GNU Manual", |
|---|
| 18 |
and with the Back-Cover Texts as in (a) below. A copy of the license |
|---|
| 19 |
is included in the section entitled "GNU Free Documentation License" in |
|---|
| 20 |
the Emacs manual. |
|---|
| 21 |
|
|---|
| 22 |
(a) The FSF's Back-Cover Text is: "You have freedom to copy and |
|---|
| 23 |
modify this GNU Manual, like GNU software. Copies published by the Free |
|---|
| 24 |
Software Foundation raise funds for GNU development." |
|---|
| 25 |
|
|---|
| 26 |
This document is part of a collection distributed under the GNU Free |
|---|
| 27 |
Documentation License. If you want to distribute this document |
|---|
| 28 |
separately from the collection, you can do so by adding a copy of the |
|---|
| 29 |
license to the document, as described in section 6 of the license. |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
File: ediff, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) |
|---|
| 33 |
|
|---|
| 34 |
* Menu: |
|---|
| 35 |
|
|---|
| 36 |
* Introduction:: About Ediff. |
|---|
| 37 |
* Major Entry Points:: How to use Ediff. |
|---|
| 38 |
* Session Commands:: Ediff commands used within a session. |
|---|
| 39 |
* Registry of Ediff Sessions:: Keeping track of multiple Ediff sessions. |
|---|
| 40 |
* Session Groups:: Comparing and merging directories. |
|---|
| 41 |
* Remote and Compressed Files:: You may want to know about this. |
|---|
| 42 |
* Customization:: How to make Ediff work the way YOU want. |
|---|
| 43 |
* Credits:: Thanks to those who helped. |
|---|
| 44 |
* Index:: |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
File: ediff, Node: Introduction, Next: Major Entry Points, Prev: Top, Up: Top |
|---|
| 48 |
|
|---|
| 49 |
Introduction |
|---|
| 50 |
************ |
|---|
| 51 |
|
|---|
| 52 |
Ediff provides a convenient way for simultaneous browsing through |
|---|
| 53 |
the differences between a pair (or a triple) of files or buffers (which |
|---|
| 54 |
are called `variants' for our purposes). The files being compared, |
|---|
| 55 |
file-A, file-B, and file-C (if applicable) are shown in separate |
|---|
| 56 |
windows (side by side, one above the another, or in separate frames), |
|---|
| 57 |
and the differences are highlighted as you step through them. You can |
|---|
| 58 |
also copy difference regions from one buffer to another (and recover |
|---|
| 59 |
old differences if you change your mind). |
|---|
| 60 |
|
|---|
| 61 |
Another powerful feature is the ability to merge a pair of files |
|---|
| 62 |
into a third buffer. Merging with an ancestor file is also supported. |
|---|
| 63 |
Furthermore, Ediff is equipped with directory-level capabilities that |
|---|
| 64 |
allow the user to conveniently launch browsing or merging sessions on |
|---|
| 65 |
groups of files in two (or three) different directories. |
|---|
| 66 |
|
|---|
| 67 |
In addition, Ediff can apply a patch to a file and then let you step |
|---|
| 68 |
though both files, the patched and the original one, simultaneously, |
|---|
| 69 |
difference-by-difference. You can even apply a patch right out of a |
|---|
| 70 |
mail buffer, i.e., patches received by mail don't even have to be |
|---|
| 71 |
saved. Since Ediff lets you copy differences between variants, you |
|---|
| 72 |
can, in effect, apply patches selectively (i.e., you can copy a |
|---|
| 73 |
difference region from `file.orig' to `file', thereby undoing any |
|---|
| 74 |
particular patch that you don't like). |
|---|
| 75 |
|
|---|
| 76 |
Ediff even understands multi-file patches and can apply them |
|---|
| 77 |
interactively! (Ediff can recognize multi-file patches only if they |
|---|
| 78 |
are in the context format or GNU unified format. All other patches are |
|---|
| 79 |
treated as 1-file patches. Ediff is [hopefully] using the same |
|---|
| 80 |
algorithm as `patch' to determine which files need to be patched.) |
|---|
| 81 |
|
|---|
| 82 |
Ediff is aware of version control, which lets you compare files with |
|---|
| 83 |
their older versions. Ediff also works with remote and compressed |
|---|
| 84 |
files, automatically ftp'ing them over and uncompressing them. *Note |
|---|
| 85 |
Remote and Compressed Files::, for details. |
|---|
| 86 |
|
|---|
| 87 |
This package builds upon ideas borrowed from Emerge, and several of |
|---|
| 88 |
Ediff's functions are adaptations from Emerge. Although Ediff subsumes |
|---|
| 89 |
and greatly extends Emerge, much of the functionality in Ediff is |
|---|
| 90 |
influenced by Emerge. The architecture and the interface are, of |
|---|
| 91 |
course, drastically different. |
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
File: ediff, Node: Major Entry Points, Next: Session Commands, Prev: Introduction, Up: Top |
|---|
| 95 |
|
|---|
| 96 |
Major Entry Points |
|---|
| 97 |
****************** |
|---|
| 98 |
|
|---|
| 99 |
When Ediff starts up, it displays a small control window, which |
|---|
| 100 |
accepts the Ediff commands and two or three windows displaying the |
|---|
| 101 |
files to be compared or merged. The control window can be in its own |
|---|
| 102 |
small frame or it can be part of a bigger frame that displays other |
|---|
| 103 |
buffers. In any case, it is important that the control window be active |
|---|
| 104 |
(i.e., be the one receiving the keystrokes) when you use Ediff. You can |
|---|
| 105 |
switch to other Emacs buffers at will and even edit the files currently |
|---|
| 106 |
being compared with Ediff and then switch back to Ediff at any time by |
|---|
| 107 |
activating the appropriate Emacs windows. |
|---|
| 108 |
|
|---|
| 109 |
Ediff can be invoked interactively using the following functions, |
|---|
| 110 |
which can be run either from the minibuffer or from the menu bar. In |
|---|
| 111 |
the menu bar, all Ediff's entry points belong to three submenus of the |
|---|
| 112 |
Tools menu: Compare, Merge, and Apply Patch. |
|---|
| 113 |
|
|---|
| 114 |
`ediff-files' |
|---|
| 115 |
`ediff' |
|---|
| 116 |
Compare two files. |
|---|
| 117 |
|
|---|
| 118 |
`ediff-buffers' |
|---|
| 119 |
Compare two buffers. |
|---|
| 120 |
|
|---|
| 121 |
`ediff-files3' |
|---|
| 122 |
`ediff3' |
|---|
| 123 |
Compare three files. |
|---|
| 124 |
|
|---|
| 125 |
`ediff-buffers3' |
|---|
| 126 |
Compare three buffers. |
|---|
| 127 |
|
|---|
| 128 |
`edirs' |
|---|
| 129 |
`ediff-directories' |
|---|
| 130 |
Compare files common to two directories. |
|---|
| 131 |
|
|---|
| 132 |
`edirs3' |
|---|
| 133 |
`ediff-directories3' |
|---|
| 134 |
Compare files common to three directories. |
|---|
| 135 |
|
|---|
| 136 |
`edir-revisions' |
|---|
| 137 |
`ediff-directory-revisions' |
|---|
| 138 |
Compare versions of files in a given directory. Ediff selects |
|---|
| 139 |
only the files that are under version control. |
|---|
| 140 |
|
|---|
| 141 |
`edir-merge-revisions' |
|---|
| 142 |
`ediff-merge-directory-revisions' |
|---|
| 143 |
Merge versions of files in a given directory. Ediff selects only |
|---|
| 144 |
the files that are under version control. |
|---|
| 145 |
|
|---|
| 146 |
`edir-merge-revisions-with-ancestor' |
|---|
| 147 |
`ediff-merge-directory-revisions-with-ancestor' |
|---|
| 148 |
Merge versions of files in a given directory using other versions |
|---|
| 149 |
as ancestors. Ediff selects only the files that are under version |
|---|
| 150 |
control. |
|---|
| 151 |
|
|---|
| 152 |
`ediff-windows-wordwise' |
|---|
| 153 |
Compare windows word-by-word. |
|---|
| 154 |
|
|---|
| 155 |
`ediff-windows-linewise' |
|---|
| 156 |
Compare windows line-by-line. |
|---|
| 157 |
|
|---|
| 158 |
`ediff-regions-wordwise' |
|---|
| 159 |
Compare regions word-by-word. |
|---|
| 160 |
|
|---|
| 161 |
`ediff-regions-linewise' |
|---|
| 162 |
Compare regions line-by-line. |
|---|
| 163 |
|
|---|
| 164 |
`ediff-revision' |
|---|
| 165 |
Compare versions of the current buffer, if the buffer is visiting |
|---|
| 166 |
a file under version control. |
|---|
| 167 |
|
|---|
| 168 |
`ediff-patch-file' |
|---|
| 169 |
`epatch' |
|---|
| 170 |
Patch a file or multiple files, then compare. If the patch |
|---|
| 171 |
applies to just one file, Ediff will invoke a regular comparison |
|---|
| 172 |
session. If it is a multi-file patch, then a session group |
|---|
| 173 |
interface will be used and the user will be able to patch the |
|---|
| 174 |
files selectively. *Note Session Groups::, for more details. |
|---|
| 175 |
|
|---|
| 176 |
Since the patch might be in a buffer or a file, you will be asked |
|---|
| 177 |
which is the case. To avoid this extra prompt, you can invoke this |
|---|
| 178 |
command with a prefix argument. With an odd prefix argument, |
|---|
| 179 |
Ediff assumes the patch is in a file; with an even argument, a |
|---|
| 180 |
buffer is assumed. |
|---|
| 181 |
|
|---|
| 182 |
Note that `ediff-patch-file' will actually use the `patch' utility |
|---|
| 183 |
to change the original files on disk. This is not that dangerous, |
|---|
| 184 |
since you will always have the original contents of the file saved |
|---|
| 185 |
in another file that has the extension `.orig'. Furthermore, if |
|---|
| 186 |
the file is under version control, then you can always back out to |
|---|
| 187 |
one of the previous versions (see the section on Version Countrol |
|---|
| 188 |
in Emacs manual). |
|---|
| 189 |
|
|---|
| 190 |
`ediff-patch-file' is careful about versions control: if the file |
|---|
| 191 |
to be patched is checked in, then Ediff will offer to check it |
|---|
| 192 |
out, because failing to do so may result in the loss of the |
|---|
| 193 |
changes when the file is checked out the next time. |
|---|
| 194 |
|
|---|
| 195 |
If you don't intend to modify the file via the patch and just want |
|---|
| 196 |
to see what the patch is all about (and decide later), then |
|---|
| 197 |
`ediff-patch-buffer' might be a better choice. |
|---|
| 198 |
|
|---|
| 199 |
`ediff-patch-buffer' |
|---|
| 200 |
`epatch-buffer' |
|---|
| 201 |
Patch a buffer, then compare. The buffer being patched and the |
|---|
| 202 |
file visited by that buffer (if any) is _not_ modified. The |
|---|
| 203 |
result of the patch appears in some other buffer that has the name |
|---|
| 204 |
ending with __patched_. |
|---|
| 205 |
|
|---|
| 206 |
This function would refuse to apply a multifile patch to a buffer. |
|---|
| 207 |
Use `ediff-patch-file' for that (and when you want the original |
|---|
| 208 |
file to be modified by the `patch' utility). |
|---|
| 209 |
|
|---|
| 210 |
Since the patch might be in a buffer or a file, you will be asked |
|---|
| 211 |
which is the case. To avoid this extra prompt, you can invoke this |
|---|
| 212 |
command with a prefix argument. With an odd prefix argument, |
|---|
| 213 |
Ediff assumes the patch is in a file; with an even argument, a |
|---|
| 214 |
buffer is assumed. |
|---|
| 215 |
|
|---|
| 216 |
`ediff-merge-files' |
|---|
| 217 |
`ediff-merge' |
|---|
| 218 |
Merge two files. |
|---|
| 219 |
|
|---|
| 220 |
`ediff-merge-files-with-ancestor' |
|---|
| 221 |
`ediff-merge-with-ancestor' |
|---|
| 222 |
Like `ediff-merge', but with a third ancestor file. |
|---|
| 223 |
|
|---|
| 224 |
`ediff-merge-buffers' |
|---|
| 225 |
Merge two buffers. |
|---|
| 226 |
|
|---|
| 227 |
`ediff-merge-buffers-with-ancestor' |
|---|
| 228 |
Same but with ancestor. |
|---|
| 229 |
|
|---|
| 230 |
`edirs-merge' |
|---|
| 231 |
`ediff-merge-directories' |
|---|
| 232 |
Merge files common to two directories. |
|---|
| 233 |
|
|---|
| 234 |
`edirs-merge-with-ancestor' |
|---|
| 235 |
`ediff-merge-directories-with-ancestor' |
|---|
| 236 |
Same but using files in a third directory as ancestors. If a |
|---|
| 237 |
pair of files doesn't have an ancestor in the ancestor-directory, |
|---|
| 238 |
you will still be able to merge them without the ancestor. |
|---|
| 239 |
|
|---|
| 240 |
`ediff-merge-revisions' |
|---|
| 241 |
Merge two versions of the file visited by the current buffer. |
|---|
| 242 |
|
|---|
| 243 |
`ediff-merge-revisions-with-ancestor' |
|---|
| 244 |
Same but with ancestor. |
|---|
| 245 |
|
|---|
| 246 |
`ediff-documentation' |
|---|
| 247 |
Brings up this manual. |
|---|
| 248 |
|
|---|
| 249 |
`ediff-show-registry' |
|---|
| 250 |
`eregistry' |
|---|
| 251 |
Brings up Ediff session registry. This feature enables you to |
|---|
| 252 |
quickly find and restart active Ediff sessions. |
|---|
| 253 |
|
|---|
| 254 |
If you want Ediff to be loaded from the very beginning of your Emacs |
|---|
| 255 |
session, you should put this line in your `~/.emacs' file: |
|---|
| 256 |
|
|---|
| 257 |
(require 'ediff) |
|---|
| 258 |
|
|---|
| 259 |
Otherwise, Ediff will be loaded automatically when you use one of the |
|---|
| 260 |
above functions, either directly or through the menus. |
|---|
| 261 |
|
|---|
| 262 |
When the above functions are invoked, the user is prompted for all |
|---|
| 263 |
the necessary information--typically the files or buffers to compare, |
|---|
| 264 |
merge, or patch. Ediff tries to be smart about these prompts. For |
|---|
| 265 |
instance, in comparing/merging files, it will offer the visible buffers |
|---|
| 266 |
as defaults. In prompting for files, if the user enters a directory, |
|---|
| 267 |
the previously input file name will be appended to that directory. In |
|---|
| 268 |
addition, if the variable `ediff-use-last-dir' is not `nil', Ediff will |
|---|
| 269 |
offer previously entered directories as defaults (which will be |
|---|
| 270 |
maintained separately for each type of file, A, B, or C). |
|---|
| 271 |
|
|---|
| 272 |
All the above functions use the POSIX `diff' or `diff3' programs to |
|---|
| 273 |
find differences between two files. They process the `diff' output and |
|---|
| 274 |
display it in a convenient form. At present, Ediff understands only |
|---|
| 275 |
the plain output from diff. Options such as `-c' are not supported, |
|---|
| 276 |
nor is the format produced by incompatible file comparison programs |
|---|
| 277 |
such as the VMS version of `diff'. |
|---|
| 278 |
|
|---|
| 279 |
The functions `ediff-files', `ediff-buffers', `ediff-files3', |
|---|
| 280 |
`ediff-buffers3' first display the coarse, line-based difference |
|---|
| 281 |
regions, as reported by the `diff' program. The total number of |
|---|
| 282 |
difference regions and the current difference number are always |
|---|
| 283 |
displayed in the mode line of the control window. |
|---|
| 284 |
|
|---|
| 285 |
Since `diff' may report fairly large chunks of text as being |
|---|
| 286 |
different, even though the difference may be localized to just a few |
|---|
| 287 |
words or even to the white space or line breaks, Ediff further |
|---|
| 288 |
_refines_ the regions to indicate which exact words differ. If the |
|---|
| 289 |
only difference is in the white space and line breaks, Ediff says so. |
|---|
| 290 |
|
|---|
| 291 |
On a color display, fine differences are highlighted with color; on a |
|---|
| 292 |
monochrome display, they are underlined. *Note Highlighting Difference |
|---|
| 293 |
Regions::, for information on how to customize this. |
|---|
| 294 |
|
|---|
| 295 |
The functions `ediff-windows-wordwise', `ediff-windows-linewise', |
|---|
| 296 |
`ediff-regions-wordwise' and `ediff-regions-linewise' do comparison on |
|---|
| 297 |
parts of existing Emacs buffers. Since `ediff-windows-wordwise' and |
|---|
| 298 |
`ediff-regions-wordwise' are intended for relatively small segments of |
|---|
| 299 |
buffers, comparison is done on the basis of words rather than lines. |
|---|
| 300 |
No refinement is necessary in this case. These commands are recommended |
|---|
| 301 |
only for relatively small regions (perhaps, up to 100 lines), because |
|---|
| 302 |
these functions have a relatively slow startup. |
|---|
| 303 |
|
|---|
| 304 |
To compare large regions, use `ediff-regions-linewise'. This |
|---|
| 305 |
command displays differences much like `ediff-files' and |
|---|
| 306 |
`ediff-buffers'. |
|---|
| 307 |
|
|---|
| 308 |
The functions `ediff-patch-file' and `ediff-patch-buffer' apply a |
|---|
| 309 |
patch to a file or a buffer and then run Ediff on the appropriate |
|---|
| 310 |
files/buffers, displaying the difference regions. |
|---|
| 311 |
|
|---|
| 312 |
The entry points `ediff-directories', `ediff-merge-directories', |
|---|
| 313 |
etc., provide a convenient interface for comparing and merging files in |
|---|
| 314 |
different directories. The user is presented with Dired-like interface |
|---|
| 315 |
from which one can run a group of related Ediff sessions. |
|---|
| 316 |
|
|---|
| 317 |
For files under version control, `ediff-revision' lets you compare |
|---|
| 318 |
the file visited by the current buffer to one of its checked-in |
|---|
| 319 |
versions. You can also compare two checked-in versions of the visited |
|---|
| 320 |
file. Moreover, the functions `ediff-directory-revisions', |
|---|
| 321 |
`ediff-merge-directory-revisions', etc., let you run a group of related |
|---|
| 322 |
Ediff sessions by taking a directory and comparing (or merging) |
|---|
| 323 |
versions of files in that directory. |
|---|
| 324 |
|
|---|
| 325 |
|
|---|
| 326 |
File: ediff, Node: Session Commands, Next: Registry of Ediff Sessions, Prev: Major Entry Points, Up: Top |
|---|
| 327 |
|
|---|
| 328 |
Session Commands |
|---|
| 329 |
**************** |
|---|
| 330 |
|
|---|
| 331 |
All Ediff commands are displayed in a Quick Help window, unless you |
|---|
| 332 |
type `?' to shrink the window to just one line. You can redisplay the |
|---|
| 333 |
help window by typing `?' again. The Quick Help commands are detailed |
|---|
| 334 |
below. |
|---|
| 335 |
|
|---|
| 336 |
Many Ediff commands take numeric prefix arguments. For instance, if |
|---|
| 337 |
you type a number, say 3, and then `j' (`ediff-jump-to-difference'), |
|---|
| 338 |
Ediff moves to the third difference region. Typing 3 and then `a' |
|---|
| 339 |
(`ediff-diff-to-diff') copies the 3d difference region from variant A |
|---|
| 340 |
to variant B. Likewise, 4 followed by `ra' restores the 4th difference |
|---|
| 341 |
region in buffer A (if it was previously written over via the command |
|---|
| 342 |
`a'). |
|---|
| 343 |
|
|---|
| 344 |
Some commands take negative prefix arguments as well. For instance, |
|---|
| 345 |
typing `-' and then `j' will make the last difference region current. |
|---|
| 346 |
Typing `-2' then `j' makes the penultimate difference region current, |
|---|
| 347 |
etc. |
|---|
| 348 |
|
|---|
| 349 |
Without the prefix argument, all commands operate on the currently |
|---|
| 350 |
selected difference region. You can make any difference region current |
|---|
| 351 |
using the various commands explained below. |
|---|
| 352 |
|
|---|
| 353 |
For some commands, the actual value of the prefix argument is |
|---|
| 354 |
immaterial. However, if supplied, the prefix argument may modify the |
|---|
| 355 |
command (see `ga', `gb', and `gc'). |
|---|
| 356 |
|
|---|
| 357 |
* Menu: |
|---|
| 358 |
|
|---|
| 359 |
* Quick Help Commands:: Frequently used commands. |
|---|
| 360 |
* Other Session Commands:: Commands that are not bound to keys. |
|---|
| 361 |
|
|---|
| 362 |
|
|---|
| 363 |
File: ediff, Node: Quick Help Commands, Next: Other Session Commands, Up: Session Commands |
|---|
| 364 |
|
|---|
| 365 |
Quick Help Commands |
|---|
| 366 |
=================== |
|---|
| 367 |
|
|---|
| 368 |
`?' |
|---|
| 369 |
Toggles the Ediff Quick Help window ON and OFF. |
|---|
| 370 |
|
|---|
| 371 |
`G' |
|---|
| 372 |
Prepares a mail buffer for sending a praise or a curse to the |
|---|
| 373 |
Ediff maintainer. |
|---|
| 374 |
|
|---|
| 375 |
`E' |
|---|
| 376 |
Brings up the top node of this manual, where you can find further |
|---|
| 377 |
information on the various Ediff functions and advanced issues, |
|---|
| 378 |
such as customization, session groups, etc. |
|---|
| 379 |
|
|---|
| 380 |
`v' |
|---|
| 381 |
Scrolls up buffers A and B (and buffer C where appropriate) in a |
|---|
| 382 |
coordinated fashion. |
|---|
| 383 |
|
|---|
| 384 |
`V' |
|---|
| 385 |
Scrolls the buffers down. |
|---|
| 386 |
|
|---|
| 387 |
`<' |
|---|
| 388 |
Scrolls the buffers to the left simultaneously. |
|---|
| 389 |
|
|---|
| 390 |
`>' |
|---|
| 391 |
Scrolls buffers to the right. |
|---|
| 392 |
|
|---|
| 393 |
`wd' |
|---|
| 394 |
Saves the output from the diff utility, for further reference. |
|---|
| 395 |
|
|---|
| 396 |
With prefix argument, saves the plain output from `diff' (see |
|---|
| 397 |
`ediff-diff-program' and `ediff-diff-options'). Without the |
|---|
| 398 |
argument, it saves customized `diff' output (see |
|---|
| 399 |
`ediff-custom-diff-program' and `ediff-custom-diff-options'), if |
|---|
| 400 |
it is available. |
|---|
| 401 |
|
|---|
| 402 |
`wa' |
|---|
| 403 |
Saves buffer A, if it was modified. |
|---|
| 404 |
|
|---|
| 405 |
`wb' |
|---|
| 406 |
Saves buffer B, if it was modified. |
|---|
| 407 |
|
|---|
| 408 |
`wc' |
|---|
| 409 |
Saves buffer C, if it was modified (if you are in a session that |
|---|
| 410 |
compares three files simultaneously). |
|---|
| 411 |
|
|---|
| 412 |
`a' |
|---|
| 413 |
_In comparison sessions:_ Copies the current difference region (or |
|---|
| 414 |
the region specified as the prefix to this command) from buffer A |
|---|
| 415 |
to buffer B. Ediff saves the old contents of buffer B's region; |
|---|
| 416 |
it can be restored via the command `rb', which see. |
|---|
| 417 |
|
|---|
| 418 |
_In merge sessions:_ Copies the current difference region (or the |
|---|
| 419 |
region specified as the prefix to this command) from buffer A to |
|---|
| 420 |
the merge buffer. The old contents of this region in buffer C can |
|---|
| 421 |
be restored via the command `r'. |
|---|
| 422 |
|
|---|
| 423 |
`b' |
|---|
| 424 |
Works similarly, but copies the current difference region from |
|---|
| 425 |
buffer B to buffer A (in _comparison sessions_) or the merge |
|---|
| 426 |
buffer (in _merge sessions_). |
|---|
| 427 |
|
|---|
| 428 |
Ediff saves the old contents of the difference region copied over; |
|---|
| 429 |
it can be reinstated via the command `ra' in comparison sessions |
|---|
| 430 |
and `r' in merge sessions. |
|---|
| 431 |
|
|---|
| 432 |
`ab' |
|---|
| 433 |
Copies the current difference region (or the region specified as |
|---|
| 434 |
the prefix to this command) from buffer A to buffer B. This (and |
|---|
| 435 |
the next five) command is enabled only in sessions that compare |
|---|
| 436 |
three files simultaneously. The old region in buffer B is saved |
|---|
| 437 |
and can be restored via the command `rb'. |
|---|
| 438 |
|
|---|
| 439 |
`ac' |
|---|
| 440 |
Copies the difference region from buffer A to buffer C. The old |
|---|
| 441 |
region in buffer C is saved and can be restored via the command |
|---|
| 442 |
`rc'. |
|---|
| 443 |
|
|---|
| 444 |
`ba' |
|---|
| 445 |
Copies the difference region from buffer B to buffer A. The old |
|---|
| 446 |
region in buffer A is saved and can be restored via the command |
|---|
| 447 |
`ra'. |
|---|
| 448 |
|
|---|
| 449 |
`bc' |
|---|
| 450 |
Copies the difference region from buffer B to buffer C. The |
|---|
| 451 |
command `rc' undoes this. |
|---|
| 452 |
|
|---|
| 453 |
`ca' |
|---|
| 454 |
Copies the difference region from buffer C to buffer A. The |
|---|
| 455 |
command `ra' undoes this. |
|---|
| 456 |
|
|---|
| 457 |
`cb' |
|---|
| 458 |
Copies the difference region from buffer C to buffer B. The |
|---|
| 459 |
command `rb' undoes this. |
|---|
| 460 |
|
|---|
| 461 |
`p' |
|---|
| 462 |
`DEL' |
|---|
| 463 |
Makes the previous difference region current. |
|---|
| 464 |
|
|---|
| 465 |
`n' |
|---|
| 466 |
`SPC' |
|---|
| 467 |
Makes the next difference region current. |
|---|
| 468 |
|
|---|
| 469 |
`j' |
|---|
| 470 |
`-j' |
|---|
| 471 |
`Nj' |
|---|
| 472 |
Makes the very first difference region current. |
|---|
| 473 |
|
|---|
| 474 |
`-j' makes the last region current. Typing a number, N, and then |
|---|
| 475 |
`j' makes the difference region N current. Typing -N (a negative |
|---|
| 476 |
number) then `j' makes current the region Last - N. |
|---|
| 477 |
|
|---|
| 478 |
`ga' |
|---|
| 479 |
Makes current the difference region closest to the position of the |
|---|
| 480 |
point in buffer A. |
|---|
| 481 |
|
|---|
| 482 |
However, with a prefix argument, Ediff would position all variants |
|---|
| 483 |
around the area indicated by the current point in buffer A: if the |
|---|
| 484 |
point is inside a difference region, then the variants will be |
|---|
| 485 |
positioned at this difference region. If the point is not in any |
|---|
| 486 |
difference region, then it is in an area where all variants agree |
|---|
| 487 |
with each other. In this case, the variants will be positioned so |
|---|
| 488 |
that each would display this area (of agreement). |
|---|
| 489 |
|
|---|
| 490 |
`gb' |
|---|
| 491 |
Makes current the difference region closest to the position of the |
|---|
| 492 |
point in buffer B. |
|---|
| 493 |
|
|---|
| 494 |
With a prefix argument, behaves like `ga', but with respect to |
|---|
| 495 |
buffer B. |
|---|
| 496 |
|
|---|
| 497 |
`gc' |
|---|
| 498 |
_In merge sessions:_ makes current the difference region closest |
|---|
| 499 |
to the point in the merge buffer. |
|---|
| 500 |
|
|---|
| 501 |
_In 3-file comparison sessions:_ makes current the region closest |
|---|
| 502 |
to the point in buffer C. |
|---|
| 503 |
|
|---|
| 504 |
With a prefix argument, behaves like `ga', but with respect to |
|---|
| 505 |
buffer C. |
|---|
| 506 |
|
|---|
| 507 |
`!' |
|---|
| 508 |
Recomputes the difference regions, bringing them up to date. This |
|---|
| 509 |
is often needed because it is common to do all sorts of editing |
|---|
| 510 |
during Ediff sessions, so after a while, the highlighted |
|---|
| 511 |
difference regions may no longer reflect the actual differences |
|---|
| 512 |
among the buffers. |
|---|
| 513 |
|
|---|
| 514 |
`*' |
|---|
| 515 |
Forces refinement of the current difference region, which |
|---|
| 516 |
highlights the exact words of disagreement among the buffers. |
|---|
| 517 |
With a negative prefix argument, unhighlights the current region. |
|---|
| 518 |
|
|---|
| 519 |
Forceful refinement may be needed if Ediff encounters a difference |
|---|
| 520 |
region that is larger than `ediff-auto-refine-limit'. In this |
|---|
| 521 |
situation, Ediff doesn't do automatic refinement in order to |
|---|
| 522 |
improve response time. (Ediff doesn't auto-refine on dumb |
|---|
| 523 |
terminals as well, but `*' still works there. However, the only |
|---|
| 524 |
useful piece of information it can tell you is whether or not the |
|---|
| 525 |
difference regions disagree only in the amount of white space.) |
|---|
| 526 |
|
|---|
| 527 |
This command is also useful when the highlighted fine differences |
|---|
| 528 |
are no longer current, due to user editing. |
|---|
| 529 |
|
|---|
| 530 |
`m' |
|---|
| 531 |
Displays the current Ediff session in a frame as wide as the |
|---|
| 532 |
physical display. This is useful when comparing files |
|---|
| 533 |
side-by-side. Typing `m' again restores the original size of the |
|---|
| 534 |
frame. |
|---|
| 535 |
|
|---|
| 536 |
`|' |
|---|
| 537 |
Toggles the horizontal/vertical split of the Ediff display. |
|---|
| 538 |
Horizontal split is convenient when it is possible to compare files |
|---|
| 539 |
side-by-side. If the frame in which files are displayed is too |
|---|
| 540 |
narrow and lines are cut off, typing `m' may help some. |
|---|
| 541 |
|
|---|
| 542 |
`@' |
|---|
| 543 |
Toggles auto-refinement of difference regions (i.e., automatic |
|---|
| 544 |
highlighting of the exact words that differ among the variants). |
|---|
| 545 |
Auto-refinement is turned off on devices where Emacs doesn't |
|---|
| 546 |
support highlighting. |
|---|
| 547 |
|
|---|
| 548 |
On slow machines, it may be advantageous to turn auto-refinement |
|---|
| 549 |
off. The user can always forcefully refine specific difference |
|---|
| 550 |
regions by typing `*'. |
|---|
| 551 |
|
|---|
| 552 |
`h' |
|---|
| 553 |
Cycles between full highlighting, the mode where fine differences |
|---|
| 554 |
are not highlighted (but computed), and the mode where |
|---|
| 555 |
highlighting is done with ASCII strings. The latter is not really |
|---|
| 556 |
recommended, unless on a dumb TTY. |
|---|
| 557 |
|
|---|
| 558 |
`r' |
|---|
| 559 |
Restores the old contents of the region in the merge buffer. (If |
|---|
| 560 |
you copied a difference region from buffer A or B into the merge |
|---|
| 561 |
buffer using the commands `a' or `b', Ediff saves the old contents |
|---|
| 562 |
of the region in case you change your mind.) |
|---|
| 563 |
|
|---|
| 564 |
This command is enabled in merge sessions only. |
|---|
| 565 |
|
|---|
| 566 |
`ra' |
|---|
| 567 |
Restores the old contents of the current difference region in |
|---|
| 568 |
buffer A, which was previously saved when the user invoked one of |
|---|
| 569 |
these commands: `b', `ba', `ca', which see. This command is |
|---|
| 570 |
enabled in comparison sessions only. |
|---|
| 571 |
|
|---|
| 572 |
`rb' |
|---|
| 573 |
Restores the old contents of the current difference region in |
|---|
| 574 |
buffer B, which was previously saved when the user invoked one of |
|---|
| 575 |
these commands: `a', `ab', `cb', which see. This command is |
|---|
| 576 |
enabled in comparison sessions only. |
|---|
| 577 |
|
|---|
| 578 |
`rc' |
|---|
| 579 |
Restores the old contents of the current difference region in |
|---|
| 580 |
buffer C, which was previously saved when the user invoked one of |
|---|
| 581 |
these commands: `ac', `bc', which see. This command is enabled in |
|---|
| 582 |
3-file comparison sessions only. |
|---|
| 583 |
|
|---|
| 584 |
`##' |
|---|
| 585 |
Tell Ediff to skip over regions that disagree among themselves |
|---|
| 586 |
only in the amount of white space and line breaks. |
|---|
| 587 |
|
|---|
| 588 |
Even though such regions will be skipped over, you can still jump |
|---|
| 589 |
to any one of them by typing the region number and then `j'. |
|---|
| 590 |
Typing `##' again puts Ediff back in the original state. |
|---|
| 591 |
|
|---|
| 592 |
`#h' |
|---|
| 593 |
`#f' |
|---|
| 594 |
Ediff works hard to ameliorate the effects of boredom in the |
|---|
| 595 |
workplace... |
|---|
| 596 |
|
|---|
| 597 |
Quite often differences are due to identical replacements (e.g., |
|---|
| 598 |
the word `foo' is replaced with the word `bar' everywhere). If |
|---|
| 599 |
the number of regions with such boring differences exceeds your |
|---|
| 600 |
tolerance threshold, you may be tempted to tell Ediff to skip |
|---|
| 601 |
these regions altogether (you will still be able to jump to them |
|---|
| 602 |
via the command `j'). The above commands, `#h' and `#f', may well |
|---|
| 603 |
save your day! |
|---|
| 604 |
|
|---|
| 605 |
`#h' prompts you to specify regular expressions for each variant. |
|---|
| 606 |
Difference regions where each variant's region matches the |
|---|
| 607 |
corresponding regular expression will be skipped from then on. |
|---|
| 608 |
(You can also tell Ediff to skip regions where at least one |
|---|
| 609 |
variant matches its regular expression.) |
|---|
| 610 |
|
|---|
| 611 |
`#f' does dual job: it focuses on regions that match the |
|---|
| 612 |
corresponding regular expressions. All other regions will be |
|---|
| 613 |
skipped over. *Note Selective Browsing::, for more. |
|---|
| 614 |
|
|---|
| 615 |
`A' |
|---|
| 616 |
Toggles the read-only property in buffer A. If file A is under |
|---|
| 617 |
version control and is checked in, it is checked out (with your |
|---|
| 618 |
permission). |
|---|
| 619 |
|
|---|
| 620 |
`B' |
|---|
| 621 |
Toggles the read-only property in buffer B. If file B is under |
|---|
| 622 |
version control and is checked in, it is checked out. |
|---|
| 623 |
|
|---|
| 624 |
`C' |
|---|
| 625 |
Toggles the read-only property in buffer C (in 3-file comparison |
|---|
| 626 |
sessions). If file C is under version control and is checked in, |
|---|
| 627 |
it is checked out. |
|---|
| 628 |
|
|---|
| 629 |
`~' |
|---|
| 630 |
Swaps the windows where buffers A and B are displayed. If you are |
|---|
| 631 |
comparing three buffers at once, then this command would rotate |
|---|
| 632 |
the windows among buffers A, B, and C. |
|---|
| 633 |
|
|---|
| 634 |
`i' |
|---|
| 635 |
Displays all kinds of useful data about the current Ediff session. |
|---|
| 636 |
|
|---|
| 637 |
`D' |
|---|
| 638 |
Runs `ediff-custom-diff-program' on the variants and displays the |
|---|
| 639 |
buffer containing the output. This is useful when you must send |
|---|
| 640 |
the output to your Mom. |
|---|
| 641 |
|
|---|
| 642 |
With a prefix argument, displays the plain `diff' output. *Note |
|---|
| 643 |
Patch and Diff Programs::, for details. |
|---|
| 644 |
|
|---|
| 645 |
`R' |
|---|
| 646 |
Displays a list of currently active Ediff sessions--the Ediff |
|---|
| 647 |
Registry. You can then restart any of these sessions by either |
|---|
| 648 |
clicking on a session record or by putting the cursor over it and |
|---|
| 649 |
then typing the return key. |
|---|
| 650 |
|
|---|
| 651 |
(Some poor souls leave so many active Ediff sessions around that |
|---|
| 652 |
they loose track of them completely... The `R' command is |
|---|
| 653 |
designed to save these people from the recently discovered Ediff |
|---|
| 654 |
Proficiency Syndrome.) |
|---|
| 655 |
|
|---|
| 656 |
Typing `R' brings up Ediff Registry only if it is typed into an |
|---|
| 657 |
Ediff Control Panel. If you don't have a control panel handy, |
|---|
| 658 |
type this in the minibuffer: `M-x eregistry'. *Note Registry of |
|---|
| 659 |
Ediff Sessions::. |
|---|
| 660 |
|
|---|
| 661 |
`M' |
|---|
| 662 |
Shows the session group buffer that invoked the current Ediff |
|---|
| 663 |
session. *Note Session Groups::, for more information on session |
|---|
| 664 |
groups. |
|---|
| 665 |
|
|---|
| 666 |
`z' |
|---|
| 667 |
Suspends the current Ediff session. (If you develop a condition |
|---|
| 668 |
known as Repetitive Ediff Injury--a serious but curable |
|---|
| 669 |
illness--you must change your current activity. This command |
|---|
| 670 |
tries hard to hide all Ediff-related buffers.) |
|---|
| 671 |
|
|---|
| 672 |
The easiest way to resume a suspended Ediff session is through the |
|---|
| 673 |
registry of active sessions. *Note Registry of Ediff Sessions::, |
|---|
| 674 |
for details. |
|---|
| 675 |
|
|---|
| 676 |
`q' |
|---|
| 677 |
Terminates this Ediff session. With a prefix argument |
|---|
| 678 |
(e.g.,`1q'), asks if you also want to delete the buffers of the |
|---|
| 679 |
variants. Modified files and the results of merges are never |
|---|
| 680 |
deleted. |
|---|
| 681 |
|
|---|
| 682 |
`%' |
|---|
| 683 |
Toggles narrowing in Ediff buffers. Ediff buffers may be narrowed |
|---|
| 684 |
if you are comparing only parts of these buffers via the commands |
|---|
| 685 |
`ediff-windows-*' and `ediff-regions-*', which see. |
|---|
| 686 |
|
|---|
| 687 |
`C-l' |
|---|
| 688 |
Restores the usual Ediff window setup. This is the quickest way |
|---|
| 689 |
to resume an Ediff session, but it works only if the control panel |
|---|
| 690 |
of that session is visible. |
|---|
| 691 |
|
|---|
| 692 |
`$$' |
|---|
| 693 |
While merging with an ancestor file, Ediff is determined to reduce |
|---|
| 694 |
user's wear and tear by saving him and her much of unproductive, |
|---|
| 695 |
repetitive typing. If it notices that, say, file A's difference |
|---|
| 696 |
region is identical to the same difference region in the ancestor |
|---|
| 697 |
file, then the merge buffer will automatically get the difference |
|---|
| 698 |
region taken from buffer B. The rationale is that this difference |
|---|
| 699 |
region in buffer A is as old as that in the ancestor buffer, so |
|---|
| 700 |
the contents of that region in buffer B represents real change. |
|---|
| 701 |
|
|---|
| 702 |
You may want to ignore such `obvious' merges and concentrate on |
|---|
| 703 |
difference regions where both files `clash' with the ancestor, |
|---|
| 704 |
since this means that two different people have been changing this |
|---|
| 705 |
region independently and they had different ideas on how to do |
|---|
| 706 |
this. |
|---|
| 707 |
|
|---|
| 708 |
The above command does this for you by skipping the regions where |
|---|
| 709 |
only one of the variants clashes with the ancestor but the other |
|---|
| 710 |
variant agrees with it. Typing `$$' again undoes this setting. |
|---|
| 711 |
|
|---|
| 712 |
`$*' |
|---|
| 713 |
When merging files with large number of differences, it is |
|---|
| 714 |
sometimes convenient to be able to skip the difference regions for |
|---|
| 715 |
which you already decided which variant is most appropriate. |
|---|
| 716 |
Typing `$*' will accomplish precisely this. |
|---|
| 717 |
|
|---|
| 718 |
To be more precise, this toggles the check for whether the current |
|---|
| 719 |
merge is identical to its default setting, as originally decided |
|---|
| 720 |
by Ediff. For instance, if Ediff is merging according to the |
|---|
| 721 |
`combined' policy, then the merge region is skipped over if it is |
|---|
| 722 |
different from the combination of the regions in buffers A and B. |
|---|
| 723 |
(Warning: swapping buffers A and B will confuse things in this |
|---|
| 724 |
respect). If the merge region is marked as `prefer-A' then this |
|---|
| 725 |
region will be skipped if it differs from the current difference |
|---|
| 726 |
region in buffer A, etc. |
|---|
| 727 |
|
|---|
| 728 |
`/' |
|---|
| 729 |
Displays the ancestor file during merges. |
|---|
| 730 |
|
|---|
| 731 |
`&' |
|---|
| 732 |
In some situations, such as when one of the files agrees with the |
|---|
| 733 |
ancestor file on a difference region and the other doesn't, Ediff |
|---|
| 734 |
knows what to do: it copies the current difference region from the |
|---|
| 735 |
second buffer into the merge buffer. |
|---|
| 736 |
|
|---|
| 737 |
In other cases, the right course of action is not that clearcut, |
|---|
| 738 |
and Ediff would use a default action. The above command changes |
|---|
| 739 |
the default action. The default action can be `default-A' (choose |
|---|
| 740 |
the region from buffer A), `default-B' (choose the region from |
|---|
| 741 |
buffer B), or `combined' (combine the regions from the two |
|---|
| 742 |
buffers). *Note Merging and diff3::, for further details. |
|---|
| 743 |
|
|---|
| 744 |
The command `&' also affects the regions in the merge buffers that |
|---|
| 745 |
have `default-A', `default-B', or `combined' status, provided they |
|---|
| 746 |
weren't changed with respect to the original. For instance, if |
|---|
| 747 |
such a region has the status `default-A' then changing the default |
|---|
| 748 |
action to `default-B' will also replace this merge-buffer's region |
|---|
| 749 |
with the corresponding region from buffer B. |
|---|
| 750 |
|
|---|
| 751 |
`s' |
|---|
| 752 |
Causes the merge window shrink to its minimum size, thereby |
|---|
| 753 |
exposing as much of the variant buffers as possible. Typing `s' |
|---|
| 754 |
again restores the original size of that window. |
|---|
| 755 |
|
|---|
| 756 |
With a positive prefix argument, this command enlarges the merge |
|---|
| 757 |
window. E.g., `4s' increases the size of the window by about 4 |
|---|
| 758 |
lines, if possible. With a negative numeric argument, the size of |
|---|
| 759 |
the merge window shrinks by that many lines, if possible. Thus, |
|---|
| 760 |
`-s' shrinks the window by about 1 line and `-3s' by about 3 lines. |
|---|
| 761 |
|
|---|
| 762 |
This command is intended only for temporary viewing; therefore, |
|---|
| 763 |
Ediff restores window C to its original size whenever it makes any |
|---|
| 764 |
other change in the window configuration. However, redisplaying |
|---|
| 765 |
(`C-l') or jumping to another difference does not affect window |
|---|
| 766 |
C's size. |
|---|
| 767 |
|
|---|
| 768 |
The split between the merge window and the variant windows is |
|---|
| 769 |
controlled by the variable `ediff-merge-window-share', which see. |
|---|
| 770 |
|
|---|
| 771 |
`+' |
|---|
| 772 |
Combines the difference regions from buffers A and B and copies the |
|---|
| 773 |
result into the merge buffer. *Note Merging and diff3::, and the |
|---|
| 774 |
variables `ediff-combine-diffs' and `ediff-combination-pattern'. |
|---|
| 775 |
|
|---|
| 776 |
`=' |
|---|
| 777 |
You may run into situations when a large chunk of text in one file |
|---|
| 778 |
has been edited and then moved to a different place in another |
|---|
| 779 |
file. In such a case, these two chunks of text are unlikely to |
|---|
| 780 |
belong to the same difference region, so the refinement feature of |
|---|
| 781 |
Ediff will not be able to tell you what exactly differs inside |
|---|
| 782 |
these chunks. Since eyeballing large pieces of text is contrary |
|---|
| 783 |
to human nature, Ediff has a special command to help reduce the |
|---|
| 784 |
risk of developing a cataract. |
|---|
| 785 |
|
|---|
| 786 |
The above command compares regions within Ediff buffers. This |
|---|
| 787 |
creates a child Ediff session for comparing current Emacs regions |
|---|
| 788 |
in buffers A, B, or C as follows: |
|---|
| 789 |
|
|---|
| 790 |
_If you are comparing 2 files or buffers:_ Ediff would compare |
|---|
| 791 |
current Emacs regions in buffers A and B. |
|---|
| 792 |
|
|---|
| 793 |
_If you are comparing 3 files or buffers simultaneously:_ Ediff |
|---|
| 794 |
would compare the current Emacs regions in the buffers of your |
|---|
| 795 |
choice (you will be asked which two of the three buffers to use). |
|---|
| 796 |
|
|---|
| 797 |
_If you are merging files or buffers (with or without ancestor):_ |
|---|
| 798 |
Ediff would take the current region in the merge buffer and compare |
|---|
| 799 |
it to the current region in the buffer of your choice (A or B). |
|---|
| 800 |
|
|---|
| 801 |
_Note: In all these cases you must first switch to the appropriate |
|---|
| 802 |
Emacs buffers and manually set the regions that you want to |
|---|
| 803 |
compare._ |
|---|
| 804 |
|
|---|
| 805 |
Highlighting set by the parent Ediff session is removed, to avoid |
|---|
| 806 |
interference with highlighting of the child session. When done |
|---|
| 807 |
with the child session, type `C-l' in the parent's control panel |
|---|
| 808 |
to restore the original highlighting. |
|---|
| 809 |
|
|---|
| 810 |
If you temporarily switch to the parent session, parent |
|---|
| 811 |
highlighting will be restored. If you then come back to the child |
|---|
| 812 |
session, you may want to remove parent highlighting, so it won't |
|---|
| 813 |
interfere. Typing `h' may help here. |
|---|
| 814 |
|
|---|
| 815 |
|
|---|
| 816 |
File: ediff, Node: Other Session Commands, Prev: Quick Help Commands, Up: Session Commands |
|---|
| 817 |
|
|---|
| 818 |
Other Session Commands |
|---|
| 819 |
====================== |
|---|
| 820 |
|
|---|
| 821 |
The following commands can be invoked from within any Ediff session, |
|---|
| 822 |
although some of them are not bound to a key. |
|---|
| 823 |
|
|---|
| 824 |
`eregistry' |
|---|
| 825 |
`ediff-show-registry' |
|---|
| 826 |
This command brings up the registry of active Ediff sessions. |
|---|
| 827 |
Ediff registry is a device that can be used to resume any active |
|---|
| 828 |
Ediff session (which may have been postponed because the user |
|---|
| 829 |
switched to some other activity). This command is also useful for |
|---|
| 830 |
switching between multiple active Ediff sessions that are run at |
|---|
| 831 |
the same time. The function `eregistry' is an alias for |
|---|
| 832 |
`ediff-show-registry'. *Note Registry of Ediff Sessions::, for |
|---|
| 833 |
more information on this registry. |
|---|
| 834 |
|
|---|
| 835 |
`ediff-toggle-multiframe' |
|---|
| 836 |
Changes the display from the multi-frame mode (where the quick |
|---|
| 837 |
help window is in a separate frame) to the single-frame mode |
|---|
| 838 |
(where all Ediff buffers share the same frame), and vice versa. |
|---|
| 839 |
See `ediff-window-setup-function' for details on how to make |
|---|
| 840 |
either of these modes the default one. |
|---|
| 841 |
|
|---|
| 842 |
This function can also be invoked from the Menubar. However, in |
|---|
| 843 |
some cases, the change will take place only after you execute one |
|---|
| 844 |
of the Ediff commands, such as going to the next difference or |
|---|
| 845 |
redisplaying. |
|---|
| 846 |
|
|---|
| 847 |
`ediff-revert-buffers-then-recompute-diffs' |
|---|
| 848 |
This command reverts the buffers you are comparing and recomputes |
|---|
| 849 |
their differences. It is useful when, after making changes, you |
|---|
| 850 |
decided to make a fresh start, or if at some point you changed the |
|---|
| 851 |
files being compared but want to discard any changes to comparison |
|---|
| 852 |
buffers that were done since then. |
|---|
| 853 |
|
|---|
| 854 |
This command normally asks for confirmation before reverting files. |
|---|
| 855 |
With a prefix argument, it reverts files without asking. |
|---|
| 856 |
|
|---|
| 857 |
`ediff-profile' |
|---|
| 858 |
Ediff has an admittedly primitive (but useful) facility for |
|---|
| 859 |
profiling Ediff's commands. It is meant for Ediff |
|---|
| 860 |
maintenance--specifically, for making it run faster. The function |
|---|
| 861 |
`ediff-profile' toggles profiling of ediff commands. |
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 |
File: ediff, Node: Registry of Ediff Sessions, Next: Session Groups, Prev: Session Commands, Up: Top |
|---|
| 865 |
|
|---|
| 866 |
Registry of Ediff Sessions |
|---|
| 867 |
************************** |
|---|
| 868 |
|
|---|
| 869 |
Ediff maintains a registry of all its invocations that are still |
|---|
| 870 |
_active_. This feature is very convenient for switching among active |
|---|
| 871 |
Ediff sessions or for quickly restarting a suspended Ediff session. |
|---|
| 872 |
|
|---|
| 873 |
The focal point of this activity is a buffer called _*Ediff |
|---|
| 874 |
Registry*_. You can display this buffer by typing `R' in any Ediff |
|---|
| 875 |
Control Buffer or Session Group Buffer (*note Session Groups::), or by |
|---|
| 876 |
typing `M-x eregistry' into the Minibuffer. The latter would be the |
|---|
| 877 |
fastest way to bring up the registry buffer if no control or group |
|---|
| 878 |
buffer is displayed in any of the visible Emacs windows. If you are in |
|---|
| 879 |
a habit of running multiple long Ediff sessions and often need to |
|---|
| 880 |
suspend, resume, or switch between them, it may be a good idea to have |
|---|
| 881 |
the registry buffer permanently displayed in a separate, dedicated |
|---|
| 882 |
window. |
|---|
| 883 |
|
|---|
| 884 |
The registry buffer has several convenient key bindings. For |
|---|
| 885 |
instance, clicking mouse button 2 or typing `RET' or `v' over any |
|---|
| 886 |
session record resumes that session. Session records in the registry |
|---|
| 887 |
buffer provide a fairly complete description of each session, so it is |
|---|
| 888 |
usually easy to identify the right session to resume. |
|---|
| 889 |
|
|---|
| 890 |
Other useful commands are bound to `SPC' (next registry record) and |
|---|
| 891 |
`DEL' (previous registry record). There are other commands as well, |
|---|
| 892 |
but you don't need to memorize them, since they are listed at the top of |
|---|
| 893 |
the registry buffer. |
|---|
| 894 |
|
|---|
| 895 |
|
|---|
| 896 |
File: ediff, Node: Session Groups, Next: Remote and Compressed Files, Prev: Registry of Ediff Sessions, Up: Top |
|---|
| 897 |
|
|---|
| 898 |
Session Groups |
|---|
| 899 |
************** |
|---|
| 900 |
|
|---|
| 901 |
Several major entries of Ediff perform comparison and merging on |
|---|
| 902 |
directories. On entering `ediff-directories', `ediff-directories3', |
|---|
| 903 |
`ediff-merge-directories', `ediff-merge-directories-with-ancestor', |
|---|
| 904 |
`ediff-directory-revisions', `ediff-merge-directory-revisions', or |
|---|
| 905 |
`ediff-merge-directory-revisions-with-ancestor', the user is presented |
|---|
| 906 |
with a Dired-like buffer that lists files common to the directories |
|---|
| 907 |
involved along with their sizes. (The list of common files can be |
|---|
| 908 |
further filtered through a regular expression, which the user is |
|---|
| 909 |
prompted for.) We call this buffer _Session Group Panel_ because all |
|---|
| 910 |
Ediff sessions associated with the listed files will have this buffer |
|---|
| 911 |
as a common focal point. |
|---|
| 912 |
|
|---|
| 913 |
Clicking button 2 or typing `RET' or `v' over a record describing |
|---|
| 914 |
files invokes Ediff in the appropriate mode on these files. You can |
|---|
| 915 |
come back to the session group buffer associated with a particular |
|---|
| 916 |
invocation of Ediff by typing `M' in Ediff control buffer of that |
|---|
| 917 |
invocation. |
|---|
| 918 |
|
|---|
| 919 |
Many commands are available in the session group buffer; some are |
|---|
| 920 |
applicable only to certain types of work. The relevant commands are |
|---|
| 921 |
always listed at the top of each session group buffer, so there is no |
|---|
| 922 |
need to memorize them. |
|---|
| 923 |
|
|---|
| 924 |
In directory comparison or merging, a session group panel displays |
|---|
| 925 |
only the files common to all directories involved. The differences are |
|---|
| 926 |
kept in a separate buffer and are conveniently displayed by typing `D' |
|---|
| 927 |
to the corresponding session group panel. Thus, as an added benefit, |
|---|
| 928 |
Ediff can be used to compare the contents of up to three directories. |
|---|
| 929 |
|
|---|
| 930 |
Session records in session group panels are also marked with `+', for |
|---|
| 931 |
active sessions, and with `-', for finished sessions. |
|---|
| 932 |
|
|---|
| 933 |
Sometimes, it is convenient to exclude certain sessions from a group. |
|---|
| 934 |
Usually this happens when the user doesn't intend to run Ediff of |
|---|
| 935 |
certain files in the group, and the corresponding session records just |
|---|
| 936 |
add clutter to the session group buffer. To help alleviate this |
|---|
| 937 |
problem, the user can type `h' to mark a session as a candidate for |
|---|
| 938 |
exclusion and `x' to actually hide the marked sessions. There actions |
|---|
| 939 |
are reversible: with a prefix argument, `h' unmarks the session under |
|---|
| 940 |
the cursor, and `x' brings the hidden sessions into the view (`x' |
|---|
| 941 |
doesn't unmark them, though, so the user has to explicitly unmark the |
|---|
| 942 |
sessions of interest). |
|---|
| 943 |
|
|---|
| 944 |
Group sessions also understand the command `m', which marks sessions |
|---|
| 945 |
for future operations (other than hiding) on a group of sessions. At |
|---|
| 946 |
present, the only such group-level operation is the creation of a |
|---|
| 947 |
multi-file patch. |
|---|
| 948 |
|
|---|
| 949 |
For group sessions created to merge files, Ediff can store all merges |
|---|
| 950 |
automatically in a directory. The user is asked to specify such |
|---|
| 951 |
directory if the value of `ediff-autostore-merges' is non-nil. If the |
|---|
| 952 |
value is `nil', nothing is done to the merge buffers--it will be the |
|---|
| 953 |
user's responsibility to save them. If the value is `t', the user will |
|---|
| 954 |
be asked where to save the merge buffers in all merge jobs, even those |
|---|
| 955 |
that do not originate from a session group. It the value is neither |
|---|
| 956 |
`nil' nor `t', the merge buffer is saved _only_ if this merge session |
|---|
| 957 |
was invoked from a session group. This behavior is implemented in the |
|---|
| 958 |
function `ediff-maybe-save-and-delete-merge', which is a hook in |
|---|
| 959 |
`ediff-quit-merge-hook'. The user can supply a different hook, if |
|---|
| 960 |
necessary. |
|---|
| 961 |
|
|---|
| 962 |
The variable `ediff-autostore-merges' is buffer-local, so it can be |
|---|
| 963 |
set on a per-buffer basis. Therefore, use `setq-default' to change |
|---|
| 964 |
this variable globally. |
|---|
| 965 |
|
|---|
| 966 |
A multi-file patch is a concatenated output of several runs of the |
|---|
| 967 |
`diff' command (some versions of `diff' let you create a multi-file |
|---|
| 968 |
patch in just one run). Ediff facilitates creation of multi-file |
|---|
| 969 |
patches as follows. If you are in a session group buffer created in |
|---|
| 970 |
response to `ediff-directories' or `ediff-directory-revisions', you can |
|---|
| 971 |
mark (by typing `m') the desired Ediff sessions and then type `P' to |
|---|
| 972 |
create a multi-file patch of those marked sessions. Ediff will then |
|---|
| 973 |
display a buffer containing the patch. The patch is generated by |
|---|
| 974 |
invoking `diff' on all marked individual sessions (represented by |
|---|
| 975 |
files) and session groups (represented by directories). Ediff will |
|---|
| 976 |
also recursively descend into any _unmarked_ session group and will |
|---|
| 977 |
search for marked sessions there. In this way, you can create |
|---|
| 978 |
multi-file patches that span file subtrees that grow out of any given |
|---|
| 979 |
directory. |
|---|
| 980 |
|
|---|
| 981 |
In an `ediff-directories' session, it is enough to just mark the |
|---|
| 982 |
requisite sessions. In `ediff-directory-revisions' revisions, the |
|---|
| 983 |
marked sessions must also be active, or else Ediff will refuse to |
|---|
| 984 |
produce a multi-file patch. This is because, in the latter-style |
|---|
| 985 |
sessions, there are many ways to create diff output, and it is easier |
|---|
| 986 |
to handle by running Ediff on the inactive sessions. |
|---|
| 987 |
|
|---|
| 988 |
Last, but not least, by typing `=', you can quickly find out which |
|---|
| 989 |
sessions have identical files, so you won't have to run Ediff on those |
|---|
| 990 |
sessions. This, however, works only on local, uncompressed files. For |
|---|
| 991 |
compressed or remote files, this command won't report anything. |
|---|
| 992 |
|
|---|
| 993 |
|
|---|
| 994 |
File: ediff, Node: Remote and Compressed Files, Next: Customization, Prev: Session Groups, Up: Top |
|---|
| 995 |
|
|---|
| 996 |
Remote and Compressed Files |
|---|
| 997 |
*************************** |
|---|
| 998 |
|
|---|
| 999 |
Ediff works with remote, compressed, and encrypted files. Ediff |
|---|
| 1000 |
supports `ange-ftp.el', `jka-compr.el', `uncompress.el' and |
|---|
| 1001 |
`crypt++.el', but it may work with other similar packages as well. |
|---|
| 1002 |
This means that you can compare files residing on another machine, or |
|---|
| 1003 |
you can apply a patch to a file on another machine. Even the patch |
|---|
| 1004 |
itself can be a remote file! |
|---|
| 1005 |
|
|---|
| 1006 |
When patching compressed or remote files, Ediff does not rename the |
|---|
| 1007 |
source file (unlike what the `patch' utility would usually do). |
|---|
| 1008 |
Instead, the source file retains its name and the result of applying |
|---|
| 1009 |
the patch is placed in a temporary file that has the suffix `_patched' |
|---|
| 1010 |
attached. Generally, this applies to files that are handled using |
|---|
| 1011 |
black magic, such as special file handlers (ange-ftp and some |
|---|
| 1012 |
compression and encryption packages also use this method). |
|---|
| 1013 |
|
|---|
| 1014 |
Regular files are treated by the `patch' utility in the usual manner, |
|---|
| 1015 |
i.e., the original is renamed into `source-name.orig' and the result of |
|---|
| 1016 |
the patch is placed into the file source-name (`_orig' is used on |
|---|
| 1017 |
systems like VMS, DOS, etc.) |
|---|
| 1018 |
|
|---|
| 1019 |
|
|---|
| 1020 |
File: ediff, Node: Customization, Next: Credits, Prev: Remote and Compressed Files, Up: Top |
|---|
| 1021 |
|
|---|
| 1022 |
Customization |
|---|
| 1023 |
************* |
|---|
| 1024 |
|
|---|
| 1025 |
Ediff has a rather self-explanatory interface, and in most cases you |
|---|
| 1026 |
won't need to change anything. However, should the need arise, there |
|---|
| 1027 |
are extensive facilities for changing the default behavior. |
|---|
| 1028 |
|
|---|
| 1029 |
Most of the customization can be done by setting various variables |
|---|
| 1030 |
in the `.emacs' file. Some customization (mostly window-related |
|---|
| 1031 |
customization and faces) can be done by putting appropriate lines in |
|---|
| 1032 |
`.Xdefaults', `.xrdb', or whatever X resource file is in use. |
|---|
| 1033 |
|
|---|
| 1034 |
With respect to the latter, please note that the X resource for |
|---|
| 1035 |
Ediff customization is `Ediff', _not_ `emacs'. *Note Window and Frame |
|---|
| 1036 |
Configuration::, *Note Highlighting Difference Regions::, for further |
|---|
| 1037 |
details. Please also refer to Emacs manual for the information on how |
|---|
| 1038 |
to set Emacs X resources. |
|---|
| 1039 |
|
|---|
| 1040 |
* Menu: |
|---|
| 1041 |
|
|---|
| 1042 |
* Hooks:: Customization via the hooks. |
|---|
| 1043 |
* Quick Help Customization:: How to customize Ediff's quick help feature. |
|---|
| 1044 |
* Window and Frame Configuration:: Controlling the way Ediff displays things. |
|---|
| 1045 |
* Selective Browsing:: Advanced browsing through difference regions. |
|---|
| 1046 |
* Highlighting Difference Regions:: Controlling highlighting. |
|---|
| 1047 |
* Narrowing:: Comparing regions, windows, etc. |
|---|
| 1048 |
* Refinement of Difference Regions:: How to control the refinement process. |
|---|
| 1049 |
* Patch and Diff Programs:: Changing the utilities that compute differences |
|---|
| 1050 |
and apply patches. |
|---|
| 1051 |
* Merging and diff3:: How to customize Ediff in its Merge Mode. |
|---|
| 1052 |
* Support for Version Control:: Changing the version control package. |
|---|
| 1053 |
You are not likely to do that. |
|---|
| 1054 |
* Customizing the Mode Line:: Changing the look of the mode line in Ediff. |
|---|
| 1055 |
* Miscellaneous:: Other customization. |
|---|
| 1056 |
* Notes on Heavy-duty Customization:: Customization for the gurus. |
|---|
| 1057 |
|
|---|
| 1058 |
|
|---|
| 1059 |
File: ediff, Node: Hooks, Next: Quick Help Customization, Prev: Customization, Up: Customization |
|---|
| 1060 |
|
|---|
| 1061 |
Hooks |
|---|
| 1062 |
===== |
|---|
| 1063 |
|
|---|
| 1064 |
The bulk of customization can be done via the following hooks: |
|---|
| 1065 |
|
|---|
| 1066 |
`ediff-load-hook' |
|---|
| 1067 |
This hook can be used to change defaults after Ediff is loaded. |
|---|
| 1068 |
|
|---|
| 1069 |
`ediff-before-setup-hook' |
|---|
| 1070 |
Hook that is run just before Ediff rearranges windows to its |
|---|
| 1071 |
liking. Can be used to save windows configuration. |
|---|
| 1072 |
|
|---|
| 1073 |
`ediff-keymap-setup-hook' |
|---|
| 1074 |
This hook can be used to alter bindings in Ediff's keymap, |
|---|
| 1075 |
`ediff-mode-map'. These hooks are run right after the default |
|---|
| 1076 |
bindings are set but before `ediff-load-hook'. The regular user |
|---|
| 1077 |
needs not be concerned with this hook--it is provided for |
|---|
| 1078 |
implementors of other Emacs packages built on top of Ediff. |
|---|
| 1079 |
|
|---|
| 1080 |
`ediff-before-setup-windows-hook' |
|---|
| 1081 |
`ediff-after-setup-windows-hook' |
|---|
| 1082 |
These two hooks are called before and after Ediff sets up its |
|---|
| 1083 |
window configuration. These hooks are run each time Ediff |
|---|
| 1084 |
rearranges windows to its liking. This happens whenever it detects |
|---|
| 1085 |
that the user changed the windows setup. |
|---|
| 1086 |
|
|---|
| 1087 |
`ediff-suspend-hook' |
|---|
| 1088 |
`ediff-quit-hook' |
|---|
| 1089 |
These two hooks are run when you suspend or quit Ediff. They can |
|---|
| 1090 |
be used to set desired window configurations, delete files Ediff |
|---|
| 1091 |
didn't want to clean up after exiting, etc. |
|---|
| 1092 |
|
|---|
| 1093 |
By default, `ediff-quit-hook' holds one hook function, |
|---|
| 1094 |
`ediff-cleanup-mess', which cleans after Ediff, as appropriate in |
|---|
| 1095 |
most cases. You probably won't want to change it, but you might |
|---|
| 1096 |
want to add other hook functions. |
|---|
| 1097 |
|
|---|
| 1098 |
Keep in mind that hooks executing before `ediff-cleanup-mess' start |
|---|
| 1099 |
in `ediff-control-buffer;' they should also leave |
|---|
| 1100 |
`ediff-control-buffer' as the current buffer when they finish. |
|---|
| 1101 |
Hooks that are executed after `ediff-cleanup-mess' should expect |
|---|
| 1102 |
the current buffer be either buffer A or buffer B. |
|---|
| 1103 |
`ediff-cleanup-mess' doesn't kill the buffers being compared or |
|---|
| 1104 |
merged (see `ediff-cleanup-hook', below). |
|---|
| 1105 |
|
|---|
| 1106 |
`ediff-cleanup-hook' |
|---|
| 1107 |
This hook is run just before `ediff-quit-hook'. This is a good |
|---|
| 1108 |
place to do various cleanups, such as deleting the variant buffers. |
|---|
| 1109 |
Ediff provides a function, `ediff-janitor', as one such possible |
|---|
| 1110 |
hook, which you can add to `ediff-cleanup-hook' with `add-hooks'. |
|---|
| 1111 |
|
|---|
| 1112 |
This function kills |
|---|