Mercurial > hg > xemacs-beta
comparison man/ediff.texi @ 12:bcdc7deadc19 r19-15b7
Import from CVS: tag r19-15b7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:48:16 +0200 |
parents | ac2d302a0011 |
children | 9ee227acff29 |
comparison
equal
deleted
inserted
replaced
11:91ffe8bd52e4 | 12:bcdc7deadc19 |
---|---|
3 @c Written by Michael Kifer | 3 @c Written by Michael Kifer |
4 | 4 |
5 @comment %**start of header (This is for running Texinfo on a region.) | 5 @comment %**start of header (This is for running Texinfo on a region.) |
6 | 6 |
7 @comment Using ediff.info instead of ediff in setfilename breaks DOS. | 7 @comment Using ediff.info instead of ediff in setfilename breaks DOS. |
8 @setfilename ../info/ediff.info | 8 @setfilename ediff |
9 @comment @setfilename ediff.info | 9 @comment @setfilename ediff.info |
10 | 10 |
11 @settitle Ediff User's Manual | 11 @settitle Ediff User's Manual |
12 @synindex vr cp | 12 @synindex vr cp |
13 @synindex fn cp | 13 @synindex fn cp |
37 | 37 |
38 @iftex | 38 @iftex |
39 @titlepage | 39 @titlepage |
40 @title Ediff User's Manual | 40 @title Ediff User's Manual |
41 @sp 4 | 41 @sp 4 |
42 @subtitle Ediff version 2.61 | 42 @subtitle Ediff version 2.62 |
43 @sp 1 | 43 @sp 1 |
44 @subtitle June 1996 | 44 @subtitle July 1996 |
45 @sp 5 | 45 @sp 5 |
46 @author Michael Kifer | 46 @author Michael Kifer |
47 @page | 47 @page |
48 | 48 |
49 @vskip 0pt plus 1filll | 49 @vskip 0pt plus 1filll |
60 @node Top, Introduction, (dir), (dir) | 60 @node Top, Introduction, (dir), (dir) |
61 | 61 |
62 @menu | 62 @menu |
63 * Introduction:: About Ediff. | 63 * Introduction:: About Ediff. |
64 * Major Entry Points:: How to use Ediff. | 64 * Major Entry Points:: How to use Ediff. |
65 * Commands:: Ediff commands. | 65 * Session Commands:: Ediff commands used within a session. |
66 * Registry of Ediff Sessions:: Keeping track of multiple Ediff sessions. | 66 * Registry of Ediff Sessions:: Keeping track of multiple Ediff sessions. |
67 * Session Groups:: Comparing and merging directories. | 67 * Session Groups:: Comparing and merging directories. |
68 * Remote and Compressed Files:: You may want to know about this. | 68 * Remote and Compressed Files:: You may want to know about this. |
69 * Customization:: How to make Ediff work the way YOU want. | 69 * Customization:: How to make Ediff work the way YOU want. |
70 * Credits:: Thanks to those who helped. | 70 * Credits:: Thanks to those who helped. |
78 @cindex Merging files and buffers | 78 @cindex Merging files and buffers |
79 @cindex Patching files and buffers | 79 @cindex Patching files and buffers |
80 @cindex Finding differences | 80 @cindex Finding differences |
81 | 81 |
82 Ediff provides a convenient way for simultaneous browsing through | 82 Ediff provides a convenient way for simultaneous browsing through |
83 the differences between a pair (or a triple) of files or buffers. The | 83 the differences between a pair (or a triple) of files or buffers |
84 (which are called @samp{variants} for our purposes). The | |
84 files being compared, file-A, file-B, and file-C (if applicable) are | 85 files being compared, file-A, file-B, and file-C (if applicable) are |
85 shown in separate windows (side by side, one above the another, or in | 86 shown in separate windows (side by side, one above the another, or in |
86 separate frames), and the differences are highlighted as you step | 87 separate frames), and the differences are highlighted as you step |
87 through them. You can also copy difference regions from one buffer to | 88 through them. You can also copy difference regions from one buffer to |
88 another (and recover old differences if you change your mind). | 89 another (and recover old differences if you change your mind). |
95 | 96 |
96 In addition, Ediff can apply a patch to a file and then let you step though | 97 In addition, Ediff can apply a patch to a file and then let you step though |
97 both files, the patched and the original one, simultaneously, | 98 both files, the patched and the original one, simultaneously, |
98 difference-by-difference. You can even apply a patch right out of a mail | 99 difference-by-difference. You can even apply a patch right out of a mail |
99 buffer, i.e., patches received by mail don't even have to be saved. Since | 100 buffer, i.e., patches received by mail don't even have to be saved. Since |
100 Ediff lets you copy differences between buffers, you can, in effect, apply | 101 Ediff lets you copy differences between variants, you can, in effect, apply |
101 patches selectively (i.e., you can copy a difference region from | 102 patches selectively (i.e., you can copy a difference region from |
102 @file{file_orig} to @file{file}, thereby undoing any particular patch that | 103 @file{file.orig} to @file{file}, thereby undoing any particular patch that |
103 you don't like). | 104 you don't like). |
104 | 105 |
105 Ediff even understands multi-file patches and can apply them interactively! | 106 Ediff even understands multi-file patches and can apply them interactively! |
106 (Ediff can recognize multi-file patches only if they are in the context or | 107 (Ediff can recognize multi-file patches only if they are in the context |
107 GNU unified format. All other patches are treated as 1-file patches. Ediff | 108 format or GNU unified format. All other patches are treated as 1-file |
108 is [hopefully] using the same algorithm as patch to determine which | 109 patches. Ediff is [hopefully] using the same algorithm as @file{patch} to |
109 files need to be patched.) | 110 determine which files need to be patched.) |
110 | 111 |
111 Ediff is aware of version control, which lets you compare | 112 Ediff is aware of version control, which lets you compare |
112 files with their older versions. Ediff also works with remote and | 113 files with their older versions. Ediff also works with remote and |
113 compressed files, automatically ftp'ing them over and uncompressing them. | 114 compressed files, automatically ftp'ing them over and uncompressing them. |
114 @xref{Remote and Compressed Files}, for details. | 115 @xref{Remote and Compressed Files}, for details. |
115 | 116 |
116 This package builds upon ideas borrowed from Emerge and | 117 This package builds upon ideas borrowed from Emerge and several Ediff's |
117 several Ediff's functions are adaptations from Emerge. | 118 functions are adaptations from Emerge. Although Ediff subsumes and greatly |
118 Although Ediff subsumes Emerge, | 119 extends Emerge, much of the functionality in Ediff is influenced by Emerge. |
119 much of the functionality of Ediff is influenced by Emerge. | |
120 The architecture and the interface are, of course, drastically different. | 120 The architecture and the interface are, of course, drastically different. |
121 | 121 |
122 @node Major Entry Points, Commands, Introduction, Top | 122 @node Major Entry Points, Session Commands, Introduction, Top |
123 @chapter Major Entry Points | 123 @chapter Major Entry Points |
124 | 124 |
125 Ediff can be invoked interactively using the following functions, which can | 125 Ediff can be invoked interactively using the following functions, which can |
126 be run either from the minibuffer or from the menu bar. In the menu bar, | 126 be run either from the minibuffer or from the menu bar. In the menu bar, |
127 all Ediff's entry points belong to three submenus of the Tools menu: | 127 all Ediff's entry points belong to three submenus of the Tools menu: |
237 @item edirs-merge-with-ancestor | 237 @item edirs-merge-with-ancestor |
238 @itemx ediff-merge-directories-with-ancestor | 238 @itemx ediff-merge-directories-with-ancestor |
239 @findex edirs-merge-with-ancestor | 239 @findex edirs-merge-with-ancestor |
240 @findex ediff-merge-directories-with-ancestor | 240 @findex ediff-merge-directories-with-ancestor |
241 Same but using files in a third directory as ancestors. | 241 Same but using files in a third directory as ancestors. |
242 If a pair of files doesn't have an ancestor in the ancestor-directory, you | |
243 will still be able to merge them without the ancestor. | |
242 | 244 |
243 @item ediff-merge-revisions | 245 @item ediff-merge-revisions |
244 @findex ediff-merge-revisions | 246 @findex ediff-merge-revisions |
245 Merge two versions of the file visited by the current buffer. | 247 Merge two versions of the file visited by the current buffer. |
246 | 248 |
247 @item ediff-merge-revisions-with-ancestor | 249 @item ediff-merge-revisions-with-ancestor |
248 @findex ediff-merge-revisions-with-ancestor | 250 @findex ediff-merge-revisions-with-ancestor |
249 Same but with ancestor. | 251 Same but with ancestor. |
252 | |
253 @item ediff-documentation | |
254 @findex ediff-documentation | |
255 Brings up this manual. | |
256 | |
257 @item ediff-show-registry | |
258 @itemx eregistry | |
259 Brings up Ediff session registry. This feature enables you to quickly find | |
260 and restart active Ediff sessions. | |
250 @end table | 261 @end table |
251 | 262 |
252 @noindent | 263 @noindent |
253 If you want Ediff to be loaded from the very beginning of your Emacs | 264 If you want Ediff to be loaded from the very beginning of your Emacs |
254 session, you should put this line in your @file{~/.emacs} file: | 265 session, you should put this line in your @file{~/.emacs} file: |
259 | 270 |
260 @noindent | 271 @noindent |
261 Otherwise, Ediff will be loaded automatically when you use one of the | 272 Otherwise, Ediff will be loaded automatically when you use one of the |
262 above functions, either directly or through the menus. | 273 above functions, either directly or through the menus. |
263 | 274 |
264 When the above functions are invoked, they prompt the user for the | 275 When the above functions are invoked, the user is prompted for all the |
265 information they need---typically the files or buffers to compare or | 276 necessary information---typically the files or buffers to compare, merge, or |
266 patch. Ediff tries to be smart about these prompts. For instance, in | 277 patch. Ediff tries to be smart about these prompts. For instance, in |
267 comparing/merging files, it will offer the visible buffers as defaults. In | 278 comparing/merging files, it will offer the visible buffers as defaults. In |
268 prompting for files, if the user enters a directory, the previously input | 279 prompting for files, if the user enters a directory, the previously input |
269 file name will be appended to that directory. In addition, if the variable | 280 file name will be appended to that directory. In addition, if the variable |
270 @code{ediff-use-last-dir} is not @code{nil}, Ediff will offer | 281 @code{ediff-use-last-dir} is not @code{nil}, Ediff will offer |
271 previously entered directories as defaults (which will be maintained | 282 previously entered directories as defaults (which will be maintained |
272 separately for each type of file, A, B, or C). | 283 separately for each type of file, A, B, or C). |
273 @vindex @code{ediff-use-last-dir} | 284 @vindex @code{ediff-use-last-dir} |
274 | 285 |
275 All the above functions use the POSIX @code{diff} program to find | 286 All the above functions use the POSIX @code{diff} or @code{diff3} programs |
276 differences between two files. They process the @code{diff} output and | 287 to find differences between two files. They process the @code{diff} output |
277 display it in a convenient form. At present, Ediff understands only the | 288 and display it in a convenient form. At present, Ediff understands only |
278 plain output from diff. Options such as @samp{-c} are not supported, | 289 the plain output from diff. Options such as @samp{-c} are not supported, |
279 nor is the format produced by incompatible file comparison programs such | 290 nor is the format produced by incompatible file comparison programs such as |
280 as the VMS version of @code{diff}. | 291 the VMS version of @code{diff}. |
281 | 292 |
282 The functions @code{ediff-files}, @code{ediff-buffers}, | 293 The functions @code{ediff-files}, @code{ediff-buffers}, |
283 @code{ediff-files3}, @code{ediff-buffers3} first display the coarse, | 294 @code{ediff-files3}, @code{ediff-buffers3} first display the coarse, |
284 line-based difference regions, as reported by the @file{diff} program. | 295 line-based difference regions, as reported by the @file{diff} program. The |
285 Since diff may report fairly large chunks of text as being different, | 296 total number of difference regions and the current difference number are |
297 always displayed in the mode line of the control window. | |
298 | |
299 Since @code{diff} may report fairly large chunks of text as being different, | |
286 even though the difference may be localized to just a few words or even | 300 even though the difference may be localized to just a few words or even |
287 to the white space or line breaks, Ediff further @emph{refines} the | 301 to the white space or line breaks, Ediff further @emph{refines} the |
288 regions to indicate which exact words differ. If the only difference is | 302 regions to indicate which exact words differ. If the only difference is |
289 in the white space and line breaks, Ediff says so. | 303 in the white space and line breaks, Ediff says so. |
290 | 304 |
321 Moreover, the functions @code{ediff-directory-revisions}, | 335 Moreover, the functions @code{ediff-directory-revisions}, |
322 @code{ediff-merge-directory-revisions}, etc., let you run a group of | 336 @code{ediff-merge-directory-revisions}, etc., let you run a group of |
323 related Ediff sessions by taking a directory and comparing (or merging) | 337 related Ediff sessions by taking a directory and comparing (or merging) |
324 versions of files in that directory. | 338 versions of files in that directory. |
325 | 339 |
326 @node Commands, Registry of Ediff Sessions, Major Entry Points, Top | 340 @node Session Commands, Registry of Ediff Sessions, Major Entry Points, Top |
327 @chapter Commands | 341 @chapter Session Commands |
328 | 342 |
329 All Ediff commands are displayed in a quick | 343 All Ediff commands are displayed in a Quick Help window, unless you type |
330 help window, unless you type @kbd{?} to shrink the window to just one line. | 344 @kbd{?} to shrink the window to just one line. You can redisplay the help |
331 You can redisplay the help window by typing @kbd{?} again. | 345 window by typing @kbd{?} again. The Quick Help commands are detailed below. |
332 In this section | |
333 we comment only on the features that cannot be readily deduced from the | |
334 quick help window. | |
335 You can always type @kbd{E} in the control window to display this manual. | |
336 | 346 |
337 Many Ediff commands take numeric prefix arguments. For instance, if you | 347 Many Ediff commands take numeric prefix arguments. For instance, if you |
338 type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}), Ediff | 348 type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}), |
339 moves to the third difference region. Typing 3 and then @kbd{a} | 349 Ediff moves to the third difference region. Typing 3 and then @kbd{a} |
340 (@code{ediff-diff-to-diff}) copies the 3d difference region from buffer | 350 (@code{ediff-diff-to-diff}) copies the 3d difference region from variant A |
341 A to buffer B. Typing @kbd{b} does copying in the opposite | 351 to variant B. Likewise, 4 followed by @kbd{ra} restores the 4th difference |
342 direction. (In 3-way comparison mode, the commands for copying are | 352 region in buffer A (if it was previously written over via the command |
343 @kbd{ab}, @kbd{ba}, @kbd{ca}, etc.) | 353 @kbd{a}). |
344 Likewise, 4 followed by @kbd{ra} | 354 |
345 restores the 4th difference region in buffer A (if it was previously | 355 Some commands take negative prefix arguments as well. For instance, typing |
346 saved as a result of copying from, say, buffer B to A). | 356 @kbd{-} and then @kbd{j} will make the last difference region |
347 | 357 current. Typing @kbd{-2} then @kbd{j} makes the penultimate difference |
348 Some commands take negative prefix arguments as well. | 358 region current, etc. |
349 For instance, typing @kbd{-} and then @kbd{j} will take Ediff to the last | 359 |
350 difference. Typing @kbd{-2} then @kbd{j} takes Ediff to the penultimate | 360 Without the prefix argument, all commands operate on the currently |
351 difference region, etc. | 361 selected difference region. You can make any difference region |
352 | 362 current using the various commands explained below. |
353 Without the prefix argument, all commands operate on the current | 363 |
354 selected difference region. You can select any difference region | 364 For some commands, the actual value of the prefix argument is |
355 as the current one using other Ediff commands. | 365 immaterial. However, if supplied, the prefix argument may modify the |
356 | 366 command (see @kbd{ga}, @kbd{gb}, and @kbd{gc}). |
357 For some commands, the value of the prefix argument is immaterial. However, | 367 |
358 if supplied, the prefix argument modifies the command. For instance, | 368 @menu |
359 normally the commands @kbd{ga}/@kbd{gb}/@kbd{gc} | 369 * Quick Help Commands:: Frequently used commands. |
360 (@code{ediff-jump-to-difference-at-point}) causes Ediff to jump to the | 370 * Other Session Commands:: Commands that are not bound to keys. |
361 difference region that is closest to the point in a specified buffer (the | 371 @end menu |
362 buffer, A, B, or C, is specified by the last character of the command, | 372 |
363 i.e., for @code{gb}, the specified buffer is B). | 373 @node Quick Help Commands,Other Session Commands,,Session Commands |
364 However, with a prefix argument, Ediff would position all these | 374 @section Quick Help Commands |
365 buffers around the area indicated by the current point in the specified | 375 |
366 buffer: if the point is inside a difference region, then the buffers will | 376 @table @kbd |
367 be positioned at this difference region. If the point is not in any | 377 @item ? |
368 difference region, then it is in an area where all buffers agree with each | 378 Toggles the Ediff Quick Help window ON and OFF. |
369 other. In this case, all buffers will be positioned so that they would | 379 @item G |
370 display this area. | 380 Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer. |
371 | 381 |
372 The total number of differences and the current difference number are | 382 @item E |
373 always displayed in the mode line of the control window. | 383 Brings up the top node of this manual, where you can find further |
374 | 384 information on the various Ediff functions and advanced issues, such as |
375 If, after making changes to buffers A, B, or C, you decide to save them, it | 385 customization, session groups, etc. |
376 is best to use @code{ediff-save-buffer}, which is bound to @kbd{wa}, | 386 |
377 @kbd{wb}, and @kbd{wc} (@kbd{wa} will save buffer A, @kbd{wb} saves buffer | 387 @item v |
378 B, etc.). | 388 Scrolls up buffers A and B (and buffer C where appropriate) in a |
379 | 389 coordinated fashion. |
380 Typing @kbd{wd} saves the output from the @code{diff} utility to a file, so | 390 @item V |
381 you can later refer to it. With prefix argument, this command saves the | 391 Scrolls the buffers down. |
382 plain output from @file{diff} (see @code{ediff-diff-program} and | 392 |
383 @code{ediff-diff-options}). Without the argument, it saves customized | 393 @item < |
384 @file{diff} output (see @code{ediff-custom-diff-program} and | 394 Scrolls the buffers to the left simultaneously. |
385 @code{ediff-custom-diff-options}), if it is available. | 395 @item > |
386 | 396 Scrolls buffers to the right. |
387 Instead of saving it, @file{diff} output can be @emph{displayed} using the | 397 |
388 command @kbd{D}. Without the prefix argument, it displays the customized | 398 @item wd |
389 @file{diff} output of the session. With the prefix argument, it displays | 399 Saves the output from the diff utility, for further reference. |
390 the plain @file{diff} output If either of the @file{diff} outputs is | 400 |
391 unavailable (because it wasn't generated or the user killed the respective | 401 With prefix argument, saves the plain output from @file{diff} (see |
392 buffer), then Ediff will try to display the other @file{diff} output. If | 402 @code{ediff-diff-program} and @code{ediff-diff-options}). Without the |
393 none is available, a warning is issued. | 403 argument, it saves customized @file{diff} output (see |
394 | 404 @code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}), if |
395 The command @kbd{z} suspends the current ediff session. It hides the | 405 it is available. |
396 control buffer and the variants. The easiest way to resume a suspended | 406 |
397 Ediff session is through the registry of active sessions. | 407 @item wa |
398 @xref{Registry of Ediff Sessions}, for details. | 408 Saves buffer A, if it was modified. |
399 | 409 @item wb |
400 The command @kbd{q} quits the current Ediff session. With a prefix | 410 Saves buffer B, if it was modified. |
401 argument, it will ask the user whether to delete the variant | 411 @item wc |
402 buffers. | 412 Saves buffer C, if it was modified (if you are in a session that |
403 | 413 compares three files simultaneously). |
404 The command @kbd{s} is used only for merging. It shrinks window C (the | 414 |
405 merge window) to its minimal size, thereby exposing as much of buffers A | 415 @item a |
406 and B as possible. This command is intended only for temporary viewing; | 416 @emph{In comparison sessions:} |
407 therefore, Ediff restores window C to its original size whenever it | 417 Copies the current difference region (or the region specified as the prefix |
408 makes any other change in the window configuration. Typing @kbd{s} | 418 to this command) from buffer A to buffer B. |
409 again also restores the original size of window C. However, recentering and | 419 Ediff saves the old contents of buffer B's region; it can |
410 jumping to a difference does not affect window C's size. | 420 be restored via the command @kbd{rb}, which see. |
411 | 421 |
412 With a positive prefix argument, the command @kbd{s} makes the merge | 422 @emph{In merge sessions:} |
413 window, window C, slightly taller. With @kbd{-} or a negative prefix | 423 Copies the current difference region (or the region specified as the prefix |
414 argument, @kbd{s} makes window C slightly shorter. | 424 to this command) from buffer A to the merge buffer. The old contents of |
415 | 425 this region in buffer C can be restored via the command @kbd{r}. |
416 Another command used only for merging is @kbd{+}. Its effect is to | 426 |
417 combine the current difference regions of buffers A and B and put the | 427 @item b |
418 combination into the merge buffer. @xref{Merging and diff3}, specifically, | 428 Works similarly, but copies the current difference region from buffer B to |
419 the variables @code{ediff-combine-diffs} and | 429 buffer A (in @emph{comparison sessions}) or the merge buffer (in |
420 @code{ediff-combination-pattern}. | 430 @emph{merge sessions}). |
421 | 431 |
422 In merge mode, Ediff uses a default variant (one of the two files being | 432 Ediff saves the old contents of the difference region copied over; it can |
423 merged) when it cannot decide which of the difference regions (that of | 433 be reinstated via the command @kbd{ra} in comparison sessions and |
424 buffer A or buffer B) should be copied into the merge buffer. You might | 434 @kbd{r} in merge sessions. |
425 decide to use the other variant instead. To facilitate this, Ediff has | 435 |
426 a command, bound to @kbd{&}, which selects another default variant for | 436 @item ab |
427 the current difference and subsequent differences. You can specify as | 437 Copies the current difference region (or the region specified as the prefix |
428 the new default any of @samp{default-A}, @samp{default-B}, or | 438 to this command) from buffer A to buffer B. This (and the next five) |
429 @samp{combined}. @xref{Merging and diff3}, for details. | 439 command is enabled only in sessions that compare three files |
430 | 440 simultaneously. The old region in buffer B is saved and can be restored |
431 Such repeated merging affects only difference regions that have | 441 via the command @kbd{rb}. |
432 default-A/B status, and only if they were not changed with respect to | 442 @item ac |
433 their originals. | 443 Copies the difference region from buffer A to buffer C. |
434 | 444 The old region in buffer C is saved and can be restored via the command |
435 Some commands are not bound to any key: | 445 @kbd{rc}. |
446 @item ba | |
447 Copies the difference region from buffer B to buffer A. | |
448 The old region in buffer A is saved and can be restored via the command | |
449 @kbd{ra}. | |
450 @item bc | |
451 Copies the difference region from buffer B to buffer C. | |
452 The command @kbd{rc} undoes this. | |
453 @item ca | |
454 Copies the difference region from buffer C to buffer A. | |
455 The command @kbd{ra} undoes this. | |
456 @item cb | |
457 Copies the difference region from buffer C to buffer B. | |
458 The command @kbd{rb} undoes this. | |
459 | |
460 @item p | |
461 @itemx DEL | |
462 Makes the previous difference region current. | |
463 @item n | |
464 @itemx SPC | |
465 Makes the next difference region current. | |
466 | |
467 @item j | |
468 @itemx -j | |
469 @itemx Nj | |
470 Makes the very first difference region current. | |
471 | |
472 @kbd{-j} makes the last region current. Typing a number, N, and then `j' | |
473 makes the difference region N current. Typing -N (a negative number) then | |
474 `j' makes current the region Last - N. | |
475 | |
476 @item ga | |
477 Makes current the difference region closest to the position of the point in | |
478 buffer A. | |
479 | |
480 However, with a prefix argument, Ediff would position all variants | |
481 around the area indicated by the current point in buffer A: if | |
482 the point is inside a difference region, then the variants will be | |
483 positioned at this difference region. If the point is not in any difference | |
484 region, then it is in an area where all variants agree with each other. In | |
485 this case, the variants will be positioned so that each would display this | |
486 area (of agreement). | |
487 @item gb | |
488 Makes current the difference region closest to the position of the point in | |
489 buffer B. | |
490 | |
491 With a prefix argument, behaves like @kbd{ga}, but with respect to buffer B. | |
492 @item gc | |
493 @emph{In merge sessions:} | |
494 makes current the difference region closest to the point in the merge buffer. | |
495 | |
496 @emph{In 3-file comparison sessions:} | |
497 makes current the region closest to the point in buffer C. | |
498 | |
499 With a prefix argument, behaves like @kbd{ga}, but with respect to buffer C. | |
500 | |
501 @item ! | |
502 Recomputes the difference regions, bringing them up to date. This is often | |
503 needed because it is common to do all sorts of editing during Ediff | |
504 sessions, so after a while, the highlighted difference regions may no | |
505 longer reflect the actual differences among the buffers. | |
506 | |
507 @item * | |
508 Forces refinement of the current difference region, which highlights the exact | |
509 words of disagreement among the buffers. With a negative prefix argument, | |
510 unhighlights the current region. | |
511 | |
512 Forceful refinement may be needed if Ediff encounters a difference region | |
513 that is larger than @code{ediff-auto-refine-limit}. In this situation, | |
514 Ediff doesn't do automatic refinement in order to improve response time. | |
515 (Ediff doesn't auto-refine on dumb terminals as well, but @kbd{*} still | |
516 works there. However, the only useful piece of information it can tell you | |
517 is whether or not the difference regions disagree only in the amount of | |
518 white space.) | |
519 | |
520 This command is also useful when the highlighted fine differences are | |
521 no longer current, due to user editing. | |
522 | |
523 @item m | |
524 Displays the current Ediff session in a frame as wide as the physical | |
525 display. This is useful when comparing files side-by-side. Typing `m' again | |
526 restores the original size of the frame. | |
527 | |
528 @item | | |
529 Toggles the horizontal/vertical split of the Ediff display. Horizontal | |
530 split is convenient when it is possible to compare files | |
531 side-by-side. If the frame in which files are displayed is too narrow | |
532 and lines are cut off, typing @kbd{m} may help some. | |
533 | |
534 @item @@ | |
535 Toggles auto-refinement of difference regions (i.e., automatic highlighting | |
536 of the exact words that differ among the variants). Auto-refinement is | |
537 turned off on devices where Emacs doesn't support highlighting. | |
538 | |
539 On slow machines, it may be advantageous to turn auto-refinement off. The | |
540 user can always forcefully refine specific difference regions by typing | |
541 @kbd{*}. | |
542 | |
543 @item h | |
544 Cycles between full highlighting, the mode where fine differences are not | |
545 highlighted (but computed), and the mode where highlighting is done with | |
546 ASCII strings. The latter is not really recommended, unless on a dumb TTY. | |
547 | |
548 @item r | |
549 Restores the old contents of the region in the merge buffer. | |
550 (If you copied a difference region from buffer A or B into the merge buffer | |
551 using the commands @kbd{a} or @kbd{b}, Ediff saves the old contents of the | |
552 region in case you change your mind.) | |
553 | |
554 This command is enabled in merge sessions only. | |
555 | |
556 @item ra | |
557 Restores the old contents of the current difference region in buffer A, | |
558 which was previously saved when the user invoked one of these commands: | |
559 @kbd{b}, @kbd{ba}, @kbd{ca}, which see. This command is enabled in | |
560 comparison sessions only. | |
561 @item rb | |
562 Restores the old contents of the current difference region in buffer B, | |
563 which was previously saved when the user invoked one of these commands: | |
564 @kbd{a}, @kbd{ab}, @kbd{cb}, which see. This command is enabled in | |
565 comparison sessions only. | |
566 @item rc | |
567 Restores the old contents of the current difference region in buffer C, | |
568 which was previously saved when the user invoked one of these commands: | |
569 @kbd{ac}, @kbd{bc}, which see. This command is enabled in 3-file | |
570 comparison sessions only. | |
571 | |
572 @item ## | |
573 Tell Ediff to skip over regions that disagree among themselves only in the | |
574 amount of white space and line breaks. | |
575 | |
576 Even though such regions will be skipped over, you can still jump to any | |
577 one of them by typing the region number and then `j'. Typing @kbd{##} | |
578 again puts Ediff back in the original state. | |
579 | |
580 @item #h | |
581 @itemx #f | |
582 Ediff works hard to ameliorate the effects of boredom in the workplace... | |
583 | |
584 Quite often differences are due to identical replacements (e.g., the word | |
585 `foo' is replaced with the word `bar' everywhere). If the number of regions | |
586 with such boring differences exceeds your tolerance threshold, you may be | |
587 tempted to tell Ediff to skip these regions altogether (you will still be able | |
588 to jump to them via the command @kbd{j}). The above commands, @kbd{#h} | |
589 and @kbd{#f}, may well save your day! | |
590 | |
591 @kbd{#h} prompts you to specify regular expressions for each | |
592 variant. Difference regions where each variant's region matches the | |
593 corresponding regular expression will be skipped from then on. (You can | |
594 also tell Ediff to skip regions where at least one variant matches its | |
595 regular expression.) | |
596 | |
597 @kbd{#f} does dual job: it focuses on regions that match the corresponding | |
598 regular expressions. All other regions will be skipped | |
599 over. @xref{Selective Browsing}, for more. | |
600 | |
601 @item A | |
602 Toggles the read-only property in buffer A. | |
603 If file A is under version control and is checked in, it is checked out | |
604 (with your permission). | |
605 @item B | |
606 Toggles the read-only property in buffer B. | |
607 If file B is under version control and is checked in, it is checked out. | |
608 @item C | |
609 Toggles the read-only property in buffer C (in 3-file comparison sessions). | |
610 If file C is under version control and is checked in, it is checked out. | |
611 | |
612 @item ~ | |
613 Swaps the windows where buffers A and B are displayed. If you are comparing | |
614 three buffers at once, then this command would rotate the windows among | |
615 buffers A, B, and C. | |
616 | |
617 @item i | |
618 Displays all kinds of useful data about the current Ediff session. | |
619 @item D | |
620 Runs @code{ediff-custom-diff-program} on the variants and displays the | |
621 buffer containing the output. This is useful when you must send the output | |
622 to your Mom. | |
623 | |
624 With a prefix argument, displays the plain @file{diff} output. | |
625 @xref{Patch and Diff Programs}, for details. | |
626 | |
627 @item R | |
628 Displays a list of currently active Ediff sessions---the Ediff Registry. | |
629 You can then restart any of these sessions by either clicking on a session | |
630 record or by putting the cursor over it and then typing the return key. | |
631 | |
632 (Some poor souls leave so many active Ediff sessions around that they loose | |
633 track of them completely... The `R' command is designed to save these | |
634 people from the recently discovered Ediff Proficiency Syndrome.) | |
635 | |
636 Typing @kbd{R} brings up Ediff Registry only if it is typed into an Ediff | |
637 Control Panel. If you don't have a control panel handy, type this in the | |
638 minibuffer: @kbd{M-x eregistry}. @xref{Registry of Ediff Sessions}. | |
639 | |
640 @item M | |
641 Shows the session group buffer that invoked the current Ediff session. | |
642 @xref{Session Groups}, for more information on session groups. | |
643 | |
644 @item z | |
645 Suspends the current Ediff session. (If you develop a condition known as | |
646 Repetitive Ediff Injury---a serious but curable illness---you must change | |
647 your current activity. This command tries hard to hide all Ediff-related | |
648 buffers.) | |
649 | |
650 The easiest way to resume a suspended Ediff session is through the registry | |
651 of active sessions. @xref{Registry of Ediff Sessions}, for details. | |
652 @item q | |
653 Terminates this Ediff session. With a prefix argument (e.g.,@kbd{1q}), asks | |
654 if you also want to delete the buffers of the variants. | |
655 Modified files and the results of merges are never deleted. | |
656 | |
657 @item % | |
658 Toggles narrowing in Ediff buffers. Ediff buffers may be narrowed if you | |
659 are comparing only parts of these buffers via the commands | |
660 @code{ediff-windows-*} and @code{ediff-regions-*}, which see. | |
661 | |
662 @item C-l | |
663 Restores the usual Ediff window setup. This is the quickest way to resume | |
664 an Ediff session, but it works only if the control panel of that session is | |
665 visible. | |
666 | |
667 @item $ | |
668 While merging with an ancestor file, Ediff is determined to reduce user's | |
669 wear and tear by saving him and her much of unproductive, repetitive | |
670 typing. If it notices that, say, file A's difference region is identical to | |
671 the same difference region in the ancestor file, then the merge buffer will | |
672 automatically get the difference region taken from buffer B. The rationale | |
673 is that this difference region in buffer A is as old as that in the | |
674 ancestor buffer, so the contents of that region in buffer B represents real | |
675 change. | |
676 | |
677 You may want to ignore such `obvious' merges and concentrate on difference | |
678 regions where both files `clash' with the ancestor, since this means that | |
679 two different people have been changing this region independently and they | |
680 had different ideas on how to do this. | |
681 | |
682 The above command does this for you by skipping the regions where only one | |
683 of the variants clashes with the ancestor but the other variant agrees with | |
684 it. Typing @kbd{$} again undoes this setting. | |
685 | |
686 @item / | |
687 Displays the ancestor file during merges. | |
688 @item & | |
689 In some situations, such as when one of the files agrees with the ancestor file | |
690 on a difference region and the other doesn't, Ediff knows what to do: it copies | |
691 the current difference region from the second buffer into the merge buffer. | |
692 | |
693 In other cases, the right course of action is not that clearcut, and Ediff | |
694 would use a default action. The above command changes the default action. | |
695 The default action can be @samp{default-A} (choose the region from buffer | |
696 A), @samp{default-B} (choose the region from buffer B), or @samp{combined} | |
697 (combine the regions from the two buffers). | |
698 @xref{Merging and diff3}, for further details. | |
699 | |
700 The command @kbd{&} also affects the regions in the merge buffers that have | |
701 @samp{default-A}, @samp{default-B}, or @samp{combined} status, provided | |
702 they weren't changed with respect to the original. For instance, if such a | |
703 region has the status @samp{default-A} then changing the default action to | |
704 @samp{default-B} will also replace this merge-buffer's region with the | |
705 corresponding region from buffer B. | |
706 | |
707 @item s | |
708 Causes the merge wondow shrink to its minimum size, thereby exposing as much | |
709 of the variant buffers as possible. Typing `s' again restores | |
710 the original size of that window. | |
711 | |
712 With a positive prefix argument, this command enlarges the merge window. | |
713 E.g., @kbd{4s} increases the size of the window by about 4 lines, if | |
714 possible. With a negative numeric argument, the size of the merge window | |
715 shrinks by that many lines, if possible. Thus, @kbd{-s} shrinks the window | |
716 by about 1 line and @kbd{-3s} by about 3 lines. | |
717 | |
718 This command is intended only for temporary viewing; therefore, Ediff | |
719 restores window C to its original size whenever it makes any other change | |
720 in the window configuration. However, redisplaying (@kbd{C-l}) or jumping | |
721 to another difference does not affect window C's size. | |
722 | |
723 The split between the merge window and the variant windows is controlled by | |
724 the variable @code{ediff-merge-window-share}, which see. | |
725 | |
726 @item + | |
727 Combines the difference regions from buffers A and B and copies the | |
728 result into the merge buffer. @xref{Merging and diff3} and the | |
729 variables @code{ediff-combine-diffs} and @code{ediff-combination-pattern}. | |
730 | |
731 | |
732 @item = | |
733 You may run into situations when a large chunk of text in one file has been | |
734 edited and then moved to a different place in another file. In such a case, | |
735 these two chunks of text are unlikely to belong to the same difference | |
736 region, so the refinement feature of Ediff will not be able to tell you | |
737 what exactly differs inside these chunks. Since eyeballing large pieces of | |
738 text is contrary to human nature, Ediff has a special command to help | |
739 reduce the risk of developing a cataract. | |
740 | |
741 The above command compares regions within Ediff buffers. This creates a | |
742 child Ediff session for comparing current Emacs regions in buffers A, B, or | |
743 C as follows: | |
744 | |
745 @emph{If you are comparing 2 files or buffers:} | |
746 Ediff would compare current Emacs regions in buffers A and B. | |
747 | |
748 @emph{If you are comparing 3 files or buffers simultaneously:} Ediff would | |
749 compare the current Emacs regions in the buffers of your choice (you will | |
750 be asked which two of the three buffers to use). | |
751 | |
752 @emph{If you are merging files or buffers (with or without ancestor):} | |
753 Ediff would take the current region in the merge buffer and compare | |
754 it to the current region in the buffer of your choice (A or B). | |
755 | |
756 Highlighting set by the parent Ediff session is removed, to avoid interference | |
757 with highlighting of the child session. When done with the child session, type | |
758 @kbd{C-l} in the parent's control panel to restore the original highlighting. | |
759 | |
760 If you temporarily switch to the parent session, parent highlighting will be | |
761 restored. If you then come back to the child session, you may want to remove | |
762 parent highlighting, so it won't interfere. Typing @kbd{h} may help here. | |
763 | |
764 @end table | |
765 | |
766 @node Other Session Commands,,Quick Help Commands,Session Commands | |
767 @section Other Session Commands | |
768 | |
769 The following commands can be invoked from within any Ediff session, | |
770 although some of them are not bound to a key. | |
436 | 771 |
437 @table @code | 772 @table @code |
438 @item eregistry | 773 @item eregistry |
439 @itemx ediff-show-registry | 774 @itemx ediff-show-registry |
440 @findex eregistry | 775 @findex eregistry |
441 @findex ediff-show-registry | 776 @findex ediff-show-registry |
442 This command brings up the registry of active Ediff sessions. Ediff | 777 This command brings up the registry of active Ediff sessions. Ediff |
443 registry is a useful device that can be used for resuming Ediff sessions | 778 registry is a device that can be used to resume any active Ediff session |
444 when the user switched to some other work before finishing a comparison or | 779 (which may have been postponed because the user switched to some other |
445 merging job. It is also useful for switching between multiple active Ediff | 780 activity). This command is also useful for switching between multiple |
446 sessions that are run at the same time. The function @code{eregistry} is an | 781 active Ediff sessions that are run at the same time. The function |
447 alias for @code{ediff-show-registry}. | 782 @code{eregistry} is an alias for @code{ediff-show-registry}. |
783 @xref{Registry of Ediff Sessions}, for more information on this registry. | |
784 | |
448 @item ediff-toggle-multiframe | 785 @item ediff-toggle-multiframe |
449 @findex ediff-toggle-multiframe | 786 @findex ediff-toggle-multiframe |
450 Changes the display from the multi-frame mode (where the quick help window | 787 Changes the display from the multi-frame mode (where the quick help window |
451 is in a separate frame) to the single-frame mode (where all Ediff buffers | 788 is in a separate frame) to the single-frame mode (where all Ediff buffers |
452 share the same frame), and vice versa. | 789 share the same frame), and vice versa. See |
790 @code{ediff-window-setup-function} for details on how to make either of | |
791 these modes the default one. | |
792 | |
793 This function can also be invoked from Ediff menus. However, in this case, | |
794 it will affect only @emph{new} Ediff sessions, not the currently running | |
795 ones. | |
796 @item ediff-toggle-use-toolbar | |
797 @findex ediff-toggle-use-toolbar | |
798 Available in XEmacs only. The Ediff toolbar provides quick access to some | |
799 of the common Ediff functions. This function toggles the display of the | |
800 toolbar. If invoked from the menu, the function will not have immediate | |
801 effect---you will have to perform an action that changes Ediff window | |
802 configuration to see the effect (e.g., you could try to change the window | |
803 split). | |
804 | |
805 @item ediff-use-toolbar-p | |
806 @vindex ediff-use-toolbar-p | |
807 The use of the toolbar can also be specified via the variable | |
808 @code{ediff-use-toolbar-p} (default is @code{t}). This variable can be set | |
809 only in @file{.emacs} --- do @strong{not} change it interactively. Use the | |
810 function @code{ediff-toggle-use-toolbar} instead. | |
811 | |
453 @item ediff-revert-buffers-then-recompute-diffs | 812 @item ediff-revert-buffers-then-recompute-diffs |
454 @findex ediff-revert-buffers-then-recompute-diffs | 813 @findex ediff-revert-buffers-then-recompute-diffs |
455 This command reverts the buffers you are comparing and recomputes their | 814 This command reverts the buffers you are comparing and recomputes their |
456 differences. It is useful when, after making changes, you decided to | 815 differences. It is useful when, after making changes, you decided to |
457 make a fresh start, or if at some point you changed the files being | 816 make a fresh start, or if at some point you changed the files being |
468 Ediff's commands. It is meant for Ediff maintenance---specifically, for | 827 Ediff's commands. It is meant for Ediff maintenance---specifically, for |
469 making it run faster. The function @code{ediff-profile} toggles | 828 making it run faster. The function @code{ediff-profile} toggles |
470 profiling of ediff commands. | 829 profiling of ediff commands. |
471 @end table | 830 @end table |
472 | 831 |
473 @node Registry of Ediff Sessions, Session Groups, Commands, Top | 832 @node Registry of Ediff Sessions, Session Groups, Session Commands, Top |
474 @chapter Registry of Ediff Sessions | 833 @chapter Registry of Ediff Sessions |
475 | 834 |
476 Ediff maintains a registry of all its invocations that are | 835 Ediff maintains a registry of all its invocations that are |
477 still @emph{active}. This feature is very convenient for switching among | 836 still @emph{active}. This feature is very convenient for switching among |
478 active Ediff sessions or for quickly restarting a suspended Ediff session. | 837 active Ediff sessions or for quickly restarting a suspended Ediff session. |
524 files. You can come back to the session group buffer associated with a | 883 files. You can come back to the session group buffer associated with a |
525 particular invocation of Ediff by typing @kbd{M} in Ediff control buffer of | 884 particular invocation of Ediff by typing @kbd{M} in Ediff control buffer of |
526 that invocation. | 885 that invocation. |
527 | 886 |
528 Many commands are available in the session group buffer; some are | 887 Many commands are available in the session group buffer; some are |
529 applicable only for certain types of work. The relevant commands are always | 888 applicable only to certain types of work. The relevant commands are always |
530 listed at the top of each session group buffer, so there is no need to | 889 listed at the top of each session group buffer, so there is no need to |
531 memorize them. | 890 memorize them. |
532 | 891 |
533 In directory comparison or merging, a session group panel displays only the | 892 In directory comparison or merging, a session group panel displays only the |
534 files common to all directories involved. The differences are kept in a | 893 files common to all directories involved. The differences are kept in a |
550 though, so the user has to explicitly unmark the sessions of interest). | 909 though, so the user has to explicitly unmark the sessions of interest). |
551 | 910 |
552 Group sessions also understand the command @kbd{m}, which marks sessions | 911 Group sessions also understand the command @kbd{m}, which marks sessions |
553 for future operations (other than hiding) on a group of sessions. At present, | 912 for future operations (other than hiding) on a group of sessions. At present, |
554 the only such group-level operation is the creation of a multi-file patch. | 913 the only such group-level operation is the creation of a multi-file patch. |
914 | |
915 @vindex ediff-autostore-merges | |
916 For group sessions created to merge files, Ediff can store all merges | |
917 automatically in a directory. The user is asked to specify such directory | |
918 if the value of @code{ediff-autostore-merges} is non-nil. If the value is | |
919 @code{nil}, nothing is done to the merge buffers---it will be the user's | |
920 responsibility to save them. If the value is @code{t}, the user will be | |
921 asked where to save the merge buffers in all merge jobs, even those that do | |
922 not originate from a session group. It the value is neither @code{nil} nor | |
923 @code{t}, the merge buffer is saved @emph{only} if this merge session was | |
924 invoked from a session group. This behavior is implemented in the function | |
925 @code{ediff-maybe-save-and-delete-merge}, which is a hook in | |
926 @code{ediff-quit-merge-hook}. The user can supply a different hook, if | |
927 necessary. | |
928 | |
929 The variable @code{ediff-autostore-merges} is buffer-local, so it can be | |
930 set in a per-buffer manner. Therefore, use @code{setq-default} to globally | |
931 change this variable. | |
555 | 932 |
556 @cindex Multi-file patches | 933 @cindex Multi-file patches |
557 A multi-file patch is a concatenated output of several runs of the Unix | 934 A multi-file patch is a concatenated output of several runs of the Unix |
558 @file{diff} command (some versions of @file{diff} let you create a | 935 @file{diff} command (some versions of @file{diff} let you create a |
559 multi-file patch in just one run). In a session group buffer created in | 936 multi-file patch in just one run). In a session group buffer created in |
566 be active, or else Ediff will refuse to produce a multi-file patch. This is | 943 be active, or else Ediff will refuse to produce a multi-file patch. This is |
567 because, in the latter-style sessions, there are many ways to create diff | 944 because, in the latter-style sessions, there are many ways to create diff |
568 output, and it is easier to handle by running Ediff on the inactive | 945 output, and it is easier to handle by running Ediff on the inactive |
569 sessions. | 946 sessions. |
570 | 947 |
948 Last, but not least, by typing @kbd{=}, you can quickly find out which | |
949 sessions have identical files, so you won't have to run Ediff on those | |
950 sessions. This, however, works only on local, uncompressed files. | |
951 For compressed or local files, this command won't report anything. | |
952 | |
571 | 953 |
572 @node Remote and Compressed Files, Customization, Session Groups, Top | 954 @node Remote and Compressed Files, Customization, Session Groups, Top |
573 @chapter Remote and Compressed Files | 955 @chapter Remote and Compressed Files |
574 | 956 |
575 Ediff works with remote, compressed, and encrypted files. Ediff | 957 Ediff works with remote, compressed, and encrypted files. Ediff |
583 file (unlike what the @code{patch} utility would usually do). Instead, the | 965 file (unlike what the @code{patch} utility would usually do). Instead, the |
584 source file retains its name and the result of applying the patch is placed | 966 source file retains its name and the result of applying the patch is placed |
585 in a temporary file that has the suffix @file{_patched} attached. | 967 in a temporary file that has the suffix @file{_patched} attached. |
586 Generally, this applies to files that are handled using black magic, such | 968 Generally, this applies to files that are handled using black magic, such |
587 as special file handlers (ange-ftp and some compression and encryption | 969 as special file handlers (ange-ftp and some compression and encryption |
588 packages all use this method). | 970 packages also use this method). |
589 | 971 |
590 Regular files are treated by the @code{patch} utility in the usual manner, | 972 Regular files are treated by the @code{patch} utility in the usual manner, |
591 i.e., the original is renamed into @file{source-name.orig} and the result | 973 i.e., the original is renamed into @file{source-name.orig} and the result |
592 of the patch is placed into the file source-name. (Ediff @file{_orig} | 974 of the patch is placed into the file source-name (@file{_orig} is used |
593 on systems like VMS, DOS, etc.) | 975 on systems like VMS, DOS, etc.) |
594 | 976 |
595 @node Customization, Credits, Remote and Compressed Files, Top | 977 @node Customization, Credits, Remote and Compressed Files, Top |
596 @chapter Customization | 978 @chapter Customization |
597 | 979 |
598 Ediff has a rather self-explanatory interface, and in most cases you | 980 Ediff has a rather self-explanatory interface, and in most cases you |
599 won't need to change anything. However, should the need arise, there are | 981 won't need to change anything. However, should the need arise, there are |
600 extensive facilities to change the default behavior. | 982 extensive facilities for changing the default behavior. |
601 | 983 |
602 Most of the customization can be done by setting various variables in the | 984 Most of the customization can be done by setting various variables in the |
603 @file{.emacs} file. Some customization (mostly window-related | 985 @file{.emacs} file. Some customization (mostly window-related |
604 customization and faces) can be done by putting appropriate lines in | 986 customization and faces) can be done by putting appropriate lines in |
605 @file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use. | 987 @file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use. |
610 @xref{Highlighting Difference Regions}, for further details. Please also | 992 @xref{Highlighting Difference Regions}, for further details. Please also |
611 refer to Emacs manual for the information on how to set Emacs X resources. | 993 refer to Emacs manual for the information on how to set Emacs X resources. |
612 | 994 |
613 @menu | 995 @menu |
614 * Hooks:: Customization via the hooks. | 996 * Hooks:: Customization via the hooks. |
615 * Quick Help:: How to customize Ediff's quick help feature. | 997 * Quick Help Customization:: How to customize Ediff's quick help feature. |
616 * Window and Frame Configuration:: Controlling the way Ediff displays things. | 998 * Window and Frame Configuration:: Controlling the way Ediff displays things. |
617 * Selective Browsing:: Advanced browsing through difference regions. | 999 * Selective Browsing:: Advanced browsing through difference regions. |
618 * Highlighting Difference Regions:: Controlling highlighting. | 1000 * Highlighting Difference Regions:: Controlling highlighting. |
619 * Narrowing:: Comparing regions, windows, etc. | 1001 * Narrowing:: Comparing regions, windows, etc. |
620 * Refinement of Difference Regions:: How to control the refinement process. | 1002 * Refinement of Difference Regions:: How to control the refinement process. |
626 * Customizing the Mode Line:: Changing the look of the mode line in Ediff. | 1008 * Customizing the Mode Line:: Changing the look of the mode line in Ediff. |
627 * Miscellaneous:: Other customization. | 1009 * Miscellaneous:: Other customization. |
628 * Notes on Heavy-duty Customization:: Customization for the gurus. | 1010 * Notes on Heavy-duty Customization:: Customization for the gurus. |
629 @end menu | 1011 @end menu |
630 | 1012 |
631 @node Hooks, Quick Help, Customization, Customization | 1013 @node Hooks, Quick Help Customization, Customization, Customization |
632 @section Hooks | 1014 @section Hooks |
633 | 1015 |
634 The bulk of customization can be done via the following hooks: | 1016 The bulk of customization can be done via the following hooks: |
635 | 1017 |
636 @table @code | 1018 @table @code |
638 @vindex ediff-load-hook | 1020 @vindex ediff-load-hook |
639 This hook can be used to change defaults after Ediff is loaded. | 1021 This hook can be used to change defaults after Ediff is loaded. |
640 | 1022 |
641 @item ediff-keymap-setup-hook | 1023 @item ediff-keymap-setup-hook |
642 @vindex ediff-keymap-setup-hook | 1024 @vindex ediff-keymap-setup-hook |
643 This hook can be used to alter bindings in Ediff's keymap. These hooks are | 1025 @vindex ediff-mode-map |
1026 This hook can be used to alter bindings in Ediff's keymap, | |
1027 @code{ediff-mode-map}. These hooks are | |
644 run right after the default bindings are set but before | 1028 run right after the default bindings are set but before |
645 @code{ediff-load-hook}. The regular user needs not be concerned with this | 1029 @code{ediff-load-hook}. The regular user needs not be concerned with this |
646 hook---it is provided for implementors of other Emacs packages built on top | 1030 hook---it is provided for implementors of other Emacs packages built on top |
647 of Ediff. | 1031 of Ediff. |
648 | 1032 |
687 This function kills buffers A, B, and, possibly, C, if these buffers aren't | 1071 This function kills buffers A, B, and, possibly, C, if these buffers aren't |
688 modified. In merge jobs, buffer C is never deleted. However, the side | 1072 modified. In merge jobs, buffer C is never deleted. However, the side |
689 effect of using this function is that you may not be able to compare the | 1073 effect of using this function is that you may not be able to compare the |
690 same buffer in two separate Ediff sessions: quitting one of them will | 1074 same buffer in two separate Ediff sessions: quitting one of them will |
691 delete this buffer in another session as well. | 1075 delete this buffer in another session as well. |
1076 | |
1077 @item ediff-quit-merge-hook | |
1078 @vindex ediff-quit-merge-hook | |
1079 @vindex ediff-autostore-merges | |
1080 @findex ediff-maybe-save-and-delete-merge | |
1081 This hook is called when Ediff quits a merge job. By default, the value is | |
1082 @code{ediff-maybe-save-and-delete-merge}, which is a function that attempts | |
1083 to save the merge buffer according to the value of | |
1084 @code{ediff-autostore-merges}, as described later. | |
692 | 1085 |
693 @item ediff-before-setup-control-frame-hook | 1086 @item ediff-before-setup-control-frame-hook |
694 @itemx ediff-after-setup-control-frame-hook | 1087 @itemx ediff-after-setup-control-frame-hook |
695 @vindex ediff-before-setup-control-frame-hook | 1088 @vindex ediff-before-setup-control-frame-hook |
696 @vindex ediff-after-setup-control-frame-hook | 1089 @vindex ediff-after-setup-control-frame-hook |
738 @xref{Session Groups}, for details. | 1131 @xref{Session Groups}, for details. |
739 @item ediff-session-group-setup-hook | 1132 @item ediff-session-group-setup-hook |
740 @vindex ediff-session-group-setup-hook | 1133 @vindex ediff-session-group-setup-hook |
741 Hooks run after setting up a control panel for a group of related Ediff | 1134 Hooks run after setting up a control panel for a group of related Ediff |
742 sessions. @xref{Session Groups}, for details. | 1135 sessions. @xref{Session Groups}, for details. |
1136 @item ediff-quit-session-group-hook | |
1137 @vindex ediff-quit-session-group-hook | |
1138 Hooks run just before exiting a session group. | |
1139 @item ediff-meta-buffer-keymap-setup-hook | |
1140 @vindex ediff-meta-buffer-keymap-setup-hook | |
1141 @vindex ediff-meta-buffer-map | |
1142 Hooks run just after setting up the @code{ediff-meta-buffer-map} --- the | |
1143 map that controls key bindings in the meta buffer. Since | |
1144 @code{ediff-meta-buffer-map} is a local variable, you can set different | |
1145 bindings for different kinds of meta buffers. | |
743 @end table | 1146 @end table |
744 | 1147 |
745 @node Quick Help, Window and Frame Configuration, Hooks, Customization | 1148 @node Quick Help Customization, Window and Frame Configuration, Hooks, Customization |
746 @section Quick Help | 1149 @section Quick Help Customization |
747 @vindex ediff-use-long-help-message | 1150 @vindex ediff-use-long-help-message |
748 @vindex ediff-control-buffer | 1151 @vindex ediff-control-buffer |
749 @vindex ediff-startup-hook | 1152 @vindex ediff-startup-hook |
750 @vindex ediff-help-message | 1153 @vindex ediff-help-message |
751 | 1154 |
764 If you want to change the appearance of the help message on a per-buffer | 1167 If you want to change the appearance of the help message on a per-buffer |
765 basis, you must use @code{ediff-startup-hook} to change the value of | 1168 basis, you must use @code{ediff-startup-hook} to change the value of |
766 the variable @code{ediff-help-message}, which is local to | 1169 the variable @code{ediff-help-message}, which is local to |
767 @code{ediff-control-buffer}. | 1170 @code{ediff-control-buffer}. |
768 | 1171 |
769 @node Window and Frame Configuration, Selective Browsing, Quick Help, Customization | 1172 @node Window and Frame Configuration, Selective Browsing, Quick Help Customization, Customization |
770 @section Window and Frame Configuration | 1173 @section Window and Frame Configuration |
771 | 1174 |
772 On a non-windowing display, Ediff sets things up in one frame, splitting | 1175 On a non-windowing display, Ediff sets things up in one frame, splitting |
773 it between a small control window and the windows for buffers A, B, and C. | 1176 it between a small control window and the windows for buffers A, B, and C. |
774 The split between these windows can be horizontal or | 1177 The split between these windows can be horizontal or |
784 algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p} | 1187 algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p} |
785 (@code{ediff-previous-difference}), @kbd{n} | 1188 (@code{ediff-previous-difference}), @kbd{n} |
786 (@code{ediff-next-difference}), etc. | 1189 (@code{ediff-next-difference}), etc. |
787 | 1190 |
788 The above behavior also depends on whether the current frame is splittable, | 1191 The above behavior also depends on whether the current frame is splittable, |
789 dedicated, etc. Unfortunately, the margin is too small to present this | 1192 dedicated, etc. Unfortunately, the margin of this book is too narrow to |
790 remarkable algorithm. | 1193 present the details of this remarkable algorithm. |
791 | 1194 |
792 The bottom line of all this is that you can compare buffers in one frame or | 1195 The upshot of all this is that you can compare buffers in one frame or |
793 in different frames. The former is done by default, while the latter can | 1196 in different frames. The former is done by default, while the latter can |
794 be achieved by arranging buffers A, B (and C, if applicable) to be seen in | 1197 be achieved by arranging buffers A, B (and C, if applicable) to be seen in |
795 different frames. Ediff respects these arrangements, automatically | 1198 different frames. Ediff respects these arrangements, automatically |
796 adapting itself to the multi-frame mode. | 1199 adapting itself to the multi-frame mode. |
797 | 1200 |
853 valuable real estate on the screen. Toggling help back will deiconify | 1256 valuable real estate on the screen. Toggling help back will deiconify |
854 the control frame. | 1257 the control frame. |
855 | 1258 |
856 To start Ediff with an iconified Control Panel, you should set this | 1259 To start Ediff with an iconified Control Panel, you should set this |
857 variable to @code{t} and @code{ediff-prefer-long-help-message} to | 1260 variable to @code{t} and @code{ediff-prefer-long-help-message} to |
858 @code{nil} (@pxref{Quick Help}). This behavior is useful only if the | 1261 @code{nil} (@pxref{Quick Help Customization}). This behavior is useful |
859 window manager is TWM or a derivative. Also, this doesn't work under | 1262 only if the window manager is TWM or a derivative. Also, this doesn't work |
860 XEmacs, since this editor ignores input from icons. | 1263 under XEmacs, since this editor ignores input from icons. |
861 @end table | 1264 @end table |
862 | 1265 |
863 @findex ediff-setup-windows | 1266 @findex ediff-setup-windows |
864 To make more creative changes in the way Ediff sets up windows, you can | 1267 To make more creative changes in the way Ediff sets up windows, you can |
865 rewrite the function @code{ediff-setup-windows}. However, we believe | 1268 rewrite the function @code{ediff-setup-windows}. However, we believe |
866 that detaching Ediff Control Panel from the rest and making it into a | 1269 that detaching Ediff Control Panel from the rest and making it into a |
867 separate frame offers an important opportunity by allowing you to | 1270 separate frame offers an important opportunity by allowing you to |
868 iconify that frame. Under Emacs, the icon will usually accept all of | 1271 iconify that frame. Under Emacs, the icon will usually accept all of |
869 the Ediff commands, but will free up valuable real estate on your screen | 1272 the Ediff commands, but will free up valuable real estate on your screen |
870 (this may depend on the window manager, though). Iconifying won't do | 1273 (this may depend on your window manager, though). Iconifying won't do |
871 any good under XEmacs since XEmacs icons are not sensitive to keyboard | 1274 any good under XEmacs since XEmacs icons are not sensitive to keyboard |
872 input. The saving grace is that, even if not iconified, the control | 1275 input. The saving grace is that, even if not iconified, the control |
873 frame is very small, smaller than some icons, so it does not take much | 1276 frame is very small, smaller than some icons, so it does not take much |
874 space in any case. | 1277 space in any case. |
875 | 1278 |
908 | 1311 |
909 @node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization | 1312 @node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization |
910 @section Selective Browsing | 1313 @section Selective Browsing |
911 | 1314 |
912 Sometimes it is convenient to be able to step through only some difference | 1315 Sometimes it is convenient to be able to step through only some difference |
913 regions, those that satisfy certain regular expressions, and to ignore all | 1316 regions, those that match certain regular expressions, and to ignore all |
914 others. On other occasions, you may want to ignore difference regions that | 1317 others. On other occasions, you may want to ignore difference regions that |
915 satisfy some regular expressions, and to look only at the rest. | 1318 match some regular expressions, and to look only at the rest. |
916 | 1319 |
917 The commands @kbd{#f} and @kbd{#h} let you do precisely this. | 1320 The commands @kbd{#f} and @kbd{#h} let you do precisely this. |
918 | 1321 |
919 Typing @kbd{#f} lets you specify regular expressions that match difference | 1322 Typing @kbd{#f} lets you specify regular expressions that match difference |
920 regions you want to focus on. | 1323 regions you want to focus on. |
931 of the difference regions. | 1334 of the difference regions. |
932 | 1335 |
933 On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting | 1336 On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting |
934 regions. That is, if a difference region in buffer A matches | 1337 regions. That is, if a difference region in buffer A matches |
935 @var{regexp-A}, the corresponding region in buffer B matches @var{regexp-B} | 1338 @var{regexp-A}, the corresponding region in buffer B matches @var{regexp-B} |
936 and (if applicable) buffer-C's region matches @var{regexp-C}, then the | 1339 and (if applicable) buffer C's region matches @var{regexp-C}, then the |
937 region will be ignored by the commands @kbd{n}/@key{SPC} | 1340 region will be ignored by the commands @kbd{n}/@key{SPC} |
938 (@code{ediff-next-difference}) and @kbd{p}/@key{DEL} | 1341 (@code{ediff-next-difference}) and @kbd{p}/@key{DEL} |
939 (@code{ediff-previous-difference}) commands. | 1342 (@code{ediff-previous-difference}) commands. |
940 | 1343 |
941 Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off. | 1344 Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off. |
961 to accept the default value, which may not be what you want. Instead, you | 1364 to accept the default value, which may not be what you want. Instead, you |
962 should enter something like @key{^} or @key{$}. These match every | 1365 should enter something like @key{^} or @key{$}. These match every |
963 line. | 1366 line. |
964 | 1367 |
965 You can use the status command, @kbd{i}, to find out whether | 1368 You can use the status command, @kbd{i}, to find out whether |
966 selective browsing is currently in use. | 1369 selective browsing is currently in effect. |
967 | 1370 |
968 The regular expressions you specified are kept in the local variables | 1371 The regular expressions you specified are kept in the local variables |
969 @code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B}, | 1372 @code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B}, |
970 @code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A}, | 1373 @code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A}, |
971 @code{ediff-regexp-hide-B}, @code{ediff-regexp-hide-C}. Their default value | 1374 @code{ediff-regexp-hide-B}, @code{ediff-regexp-hide-C}. Their default value |
972 is the empty string (i.e., nothing is hidden or focused on). To change the | 1375 is the empty string (i.e., nothing is hidden or focused on). To change the |
973 default, set these variables in @file{.emacs} using @code{setq-default}. | 1376 default, set these variables in @file{.emacs} using @code{setq-default}. |
974 | 1377 |
975 In addition to the ability to ignore regions that match regular | 1378 In addition to the ability to ignore regions that match regular |
976 expressions, Ediff can be ordered to start skipping over certain | 1379 expressions, Ediff can be ordered to start skipping over certain |
977 ``inessential'' regions. This is controlled by the following variable: | 1380 ``uninteresting'' difference regions. This is controlled by the following |
1381 variable: | |
978 | 1382 |
979 @table @code | 1383 @table @code |
980 @item ediff-ignore-similar-regions | 1384 @item ediff-ignore-similar-regions |
981 @vindex ediff-ignore-similar-regions | 1385 @vindex ediff-ignore-similar-regions |
982 If @code{t}, causes Ediff to skip over difference regions | 1386 If @code{t}, causes Ediff to skip over "uninteresting" difference regions, |
983 that deemed inessential, i.e., where the only differences are those | 1387 which are the regions where the variants differ only in the amount of the |
984 in the white space and newlines. | 1388 white space and newlines. This feature can be toggled on/off interactively, |
1389 via the command @kbd{##}. | |
985 @end table | 1390 @end table |
986 | 1391 |
987 @strong{Note:} In order for this feature to work, auto-refining of | 1392 @strong{Note:} In order for this feature to work, auto-refining of |
988 difference regions must be on, since otherwise Ediff won't know if there | 1393 difference regions must be on, since otherwise Ediff won't know if there |
989 are fine differences between regions. On devices where Emacs can display | 1394 are fine differences between regions. On devices where Emacs can display |
990 faces, auto-refining is a default, but it is not turned on by default on | 1395 faces, auto-refining is a default, but it is not turned on by default on |
991 text-only terminals. In that case, you must explicitly turn auto-refining | 1396 text-only terminals. In that case, you must explicitly turn auto-refining |
992 on (such as, by typing @kbd{@@}). | 1397 on (such as, by typing @kbd{@@}). |
993 | 1398 |
994 @strong{Reassurance:} If many inessential regions appear in a row, Ediff may | 1399 @strong{Reassurance:} If many such uninteresting regions appear in a row, |
995 take a long time to jump to the next region because it has to compute | 1400 Ediff may take a long time to skip over them because it has to compute fine |
996 fine differences of all intermediate regions. This delay does not | 1401 differences of all intermediate regions. This delay does not indicate any |
997 indicate any problem. | 1402 problem. |
998 | 1403 |
999 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization | 1404 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization |
1000 @section Highlighting Difference Regions | 1405 @section Highlighting Difference Regions |
1001 | 1406 |
1002 The following variables control the way Ediff highlights difference | 1407 The following variables control the way Ediff highlights difference |
1051 Non-current difference regions are displayed using these alternating | 1456 Non-current difference regions are displayed using these alternating |
1052 faces. The odd and the even faces are actually identical on monochrome | 1457 faces. The odd and the even faces are actually identical on monochrome |
1053 displays, because without colors options are limited. | 1458 displays, because without colors options are limited. |
1054 So, Ediff uses italics to highlight non-current differences. | 1459 So, Ediff uses italics to highlight non-current differences. |
1055 | 1460 |
1461 @item ediff-even-diff-pixmap | |
1462 @itemx ediff-odd-diff-pixmap | |
1463 @itemx ediff-fine-diff-pixmap | |
1464 @vindex ediff-even-diff-pixmap | |
1465 @vindex ediff-odd-diff-pixmap | |
1466 @vindex ediff-fine-diff-pixmap | |
1467 On monochrome graphical displays, Ediff attempts to provide additional | |
1468 hues using background pixmaps. The above variables specify pixmaps (which | |
1469 are strings representing filenames of bitmaps) for even-numbered background | |
1470 difference regions, odd-numbered regions, and fine differences. If Ediff's | |
1471 default pixmaps don't exist on your machine, check the bitmap directory at | |
1472 your installation to find an appropriate bitmap. The bitmap directory can | |
1473 be found by checking the value of the Emacs variable | |
1474 @code{x-bitmap-file-path}. | |
1475 | |
1056 @item ediff-force-faces | 1476 @item ediff-force-faces |
1057 @vindex ediff-force-faces | 1477 @vindex ediff-force-faces |
1058 Ediff generally can detect when Emacs is running on a device where it can | 1478 Ediff generally can detect when Emacs is running on a device where it can |
1059 use highlighting with faces. However, if it fails to determine that faces | 1479 use highlighting with faces. However, if it fails to determine that faces |
1060 can be used, the user can set this variable to @code{t} to make sure that | 1480 can be used, the user can set this variable to @code{t} to make sure that |
1061 Ediff uses faces to highlight differences. | 1481 Ediff uses faces to highlight differences. |
1062 | 1482 |
1063 @item ediff-highlight-all-diffs | 1483 @item ediff-highlight-all-diffs |
1064 @vindex ediff-highlight-all-diffs | 1484 @vindex ediff-highlight-all-diffs |
1065 Indicates whether---on a window system---Ediff should highlight differences | 1485 Indicates whether---on a windowind display---Ediff should highlight |
1066 using inserted strings (as on a text-only terminal) or using colors and | 1486 differences using inserted strings (as on text-only terminals) or using |
1067 highlighting. Normally, Ediff highlights all differences, but the | 1487 colors and highlighting. Normally, Ediff highlights all differences, but |
1068 selected difference is highlighted more visibly. One can cycle through | 1488 the selected difference is highlighted more visibly. One can cycle through |
1069 various modes of highlighting by typing @kbd{h}. By default, Ediff | 1489 various modes of highlighting by typing @kbd{h}. By default, Ediff starts |
1070 starts in the mode where all difference regions are highlighted. If you | 1490 in the mode where all difference regions are highlighted. If you prefer to |
1071 prefer to start in the mode where unselected differences are not | 1491 start in the mode where unselected differences are not highlighted, you |
1072 highlighted, you should set @code{ediff-highlight-all-diffs} to | 1492 should set @code{ediff-highlight-all-diffs} to @code{nil}. Type @kbd{h} to |
1073 @code{nil}. Type @kbd{h} to restore highlighting of all differences. | 1493 restore highlighting for all differences. |
1074 | 1494 |
1075 Ediff lets you switch between the two modes of highlighting. That is, | 1495 Ediff lets you switch between the two modes of highlighting. That is, |
1076 you can switch interactively from highlighting using faces to | 1496 you can switch interactively from highlighting using faces to |
1077 highlighting using string flags, and back. Of course, switching has | 1497 highlighting using string flags, and back. Of course, switching has |
1078 effect only under a windowing system. On a text-only terminal or in an | 1498 effect only under a windowing system. On a text-only terminal or in an |
1093 @noindent | 1513 @noindent |
1094 or here, | 1514 or here, |
1095 | 1515 |
1096 @example | 1516 @example |
1097 (setq ediff-current-diff-face-A | 1517 (setq ediff-current-diff-face-A |
1098 (copy-face 'bold-italic 'ediff-current-diff-face-A)) | 1518 (copy-face 'bold-italic 'ediff-current-diff-face-A)) |
1099 @end example | 1519 @end example |
1100 | 1520 |
1101 @noindent | 1521 @noindent |
1102 or modify the defaults selectively: | 1522 or modify the defaults selectively: |
1103 | 1523 |
1125 @section Narrowing | 1545 @section Narrowing |
1126 | 1546 |
1127 If buffers being compared are narrowed at the time of invocation of | 1547 If buffers being compared are narrowed at the time of invocation of |
1128 Ediff, @code{ediff-buffers} will preserve the narrowing range. However, | 1548 Ediff, @code{ediff-buffers} will preserve the narrowing range. However, |
1129 if @code{ediff-files} is invoked on the files visited by these buffers, | 1549 if @code{ediff-files} is invoked on the files visited by these buffers, |
1130 that widens the buffers, since this command is defined to compare the | 1550 that would widen the buffers, since this command is defined to compare the |
1131 entire files. | 1551 entire files. |
1132 | 1552 |
1133 Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, | 1553 Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, or |
1134 or the corresponding @samp{-wordwise} commands, narrows the buffers | 1554 the corresponding @samp{-wordwise} commands, narrows the variants to the |
1135 being compared (corresponding to the regions being compared). The | 1555 particular regions being compared. The original accessible ranges are |
1136 original accessible ranges are restored when you quit Ediff. | 1556 restored when you quit Ediff. During the command, you can toggle this |
1137 During the command, you can toggle this narrowing on and off | 1557 narrowing on and off with the @kbd{%} command. |
1138 with the @kbd{%} command. | |
1139 | 1558 |
1140 These two variables control this narrowing behavior: | 1559 These two variables control this narrowing behavior: |
1141 | 1560 |
1142 @table @code | 1561 @table @code |
1143 @item ediff-start-narrowed | 1562 @item ediff-start-narrowed |
1189 | 1608 |
1190 You can always refine the current region by typing @kbd{*}. | 1609 You can always refine the current region by typing @kbd{*}. |
1191 | 1610 |
1192 @item ediff-forward-word-function | 1611 @item ediff-forward-word-function |
1193 @vindex ediff-forward-word-function | 1612 @vindex ediff-forward-word-function |
1194 This variable gives control over how fine differences are computed. The | 1613 This variable controls how fine differences are computed. The |
1195 value must be a Lisp function that determines how the current difference | 1614 value must be a Lisp function that determines how the current difference |
1196 region should be split into words. | 1615 region should be split into words. |
1197 | 1616 |
1198 @vindex ediff-diff-program | 1617 @vindex ediff-diff-program |
1199 @vindex ediff-forward-word-function | 1618 @vindex ediff-forward-word-function |
1200 @findex ediff-forward-word | 1619 @findex ediff-forward-word |
1201 Fine differences are computed by first splitting the current difference | 1620 Fine differences are computed by first splitting the current difference |
1202 region into words and then passing this along to | 1621 region into words and then passing the result to |
1203 @code{ediff-diff-program}. For the default | 1622 @code{ediff-diff-program}. For the default forward word function (which is |
1204 @code{ediff-forward-word-function} (which is @code{ediff-forward-word}), a | 1623 @code{ediff-forward-word}), a word is a string consisting of letters, |
1205 word is a string consisting of letters, @samp{-}, or @samp{_}; a string of | 1624 @samp{-}, or @samp{_}; a string of punctuation symbols; a string of digits, |
1206 punctuation symbols; a string of digits, or a string consisting of symbols | 1625 or a string consisting of symbols that are neither space, nor a letter. |
1207 that are neither space, nor a letter. | |
1208 | 1626 |
1209 This default behavior is controlled by four variables: @code{ediff-word-1}, | 1627 This default behavior is controlled by four variables: @code{ediff-word-1}, |
1210 ..., @code{ediff-word-4}. See the on-line documentation for these variables | 1628 ..., @code{ediff-word-4}. See the on-line documentation for these variables |
1211 and for the function @code{ediff-forward-word} for an explanation of how to | 1629 and for the function @code{ediff-forward-word} for an explanation of how to |
1212 modify these variables. | 1630 modify these variables. |
1233 This section describes variables that specify the programs to be used for | 1651 This section describes variables that specify the programs to be used for |
1234 applying patches and for computing the main difference regions (not the | 1652 applying patches and for computing the main difference regions (not the |
1235 fine difference regions): | 1653 fine difference regions): |
1236 | 1654 |
1237 @table @code | 1655 @table @code |
1238 @item ediff-patch-program | 1656 @item ediff-diff-program |
1239 @itemx ediff-diff-program | |
1240 @itemx ediff-diff3-program | 1657 @itemx ediff-diff3-program |
1241 @vindex ediff-patch-program | 1658 @vindex ediff-patch-program |
1242 @vindex ediff-diff-program | 1659 @vindex ediff-diff-program |
1243 @vindex ediff-diff3-program | 1660 @vindex ediff-diff3-program |
1244 These variables specify the programs to use to produce differences | 1661 These variables specify the programs to use to produce differences |
1245 and do patching. | 1662 and do patching. |
1246 | 1663 |
1247 @item ediff-patch-options | 1664 @item ediff-diff-options |
1248 @itemx ediff-diff-options | |
1249 @itemx ediff-diff3-options | 1665 @itemx ediff-diff3-options |
1250 @vindex ediff-patch-options | 1666 @vindex ediff-patch-options |
1251 @vindex ediff-diff-options | 1667 @vindex ediff-diff-options |
1252 @vindex ediff-diff3-options | 1668 @vindex ediff-diff3-options |
1253 These variables specify the options to pass to the above utilities. | 1669 These variables specify the options to pass to the above utilities. |
1255 In @code{ediff-diff-options}, it may be useful to specify options | 1671 In @code{ediff-diff-options}, it may be useful to specify options |
1256 such as @samp{-w} that ignore certain kinds of changes. However, | 1672 such as @samp{-w} that ignore certain kinds of changes. However, |
1257 Ediff does not let you use the option @samp{-c}, as it doesn't recognize this | 1673 Ediff does not let you use the option @samp{-c}, as it doesn't recognize this |
1258 format yet. | 1674 format yet. |
1259 | 1675 |
1676 @item ediff-patch-program | |
1677 The program to use to apply patches. Since there are certain | |
1678 incompatibilities between the different versions of the patch program, the | |
1679 best way to stay out of trouble is to use a GNU-compatible version. | |
1680 Otherwise, you may have to tune the values of the variables | |
1681 @code{ediff-patch-options}, @code{ediff-backup-specs}, and | |
1682 @code{ediff-backup-extension} as described below. | |
1683 @item ediff-patch-options | |
1684 Options to pass to @code{ediff-patch-program}. | |
1685 | |
1686 Note: the `-b' option should be specified in `ediff-backup-specs'. | |
1687 | |
1688 It is recommended to pass the `-f' option to the patch program, so it won't | |
1689 ask questions. However, some implementations don't accept this option, in | |
1690 which case the default value of this variable should be changed. | |
1691 | |
1692 @item ediff-backup-extension | |
1693 Backup extension used by the patch program. Must be specified, even if | |
1694 @code{ediff-backup-specs} is given. | |
1695 @item ediff-backup-specs | |
1696 Backup directives to pass to the patch program. | |
1697 Ediff requires that the old version of the file (before applying the patch) | |
1698 is saved in a file named @file{the-patch-file.extension}. Usually | |
1699 `extension' is `.orig', but this can be changed by the user, and may also be | |
1700 system-dependent. Therefore, Ediff needs to know the backup extension used | |
1701 by the patch program. | |
1702 | |
1703 Some versions of the patch program let the user specify `-b backup-extension'. | |
1704 Other versions only permit `-b', which (usually) assumes the extension `.orig'. | |
1705 | |
1706 Note that both `ediff-backup-extension' and `ediff-backup-specs' must be | |
1707 properly set. If your patch program takes the option `-b', but not | |
1708 `-b extension', the variable `ediff-backup-extension' must still | |
1709 be set so Ediff will know which extension to use. | |
1260 | 1710 |
1261 @item ediff-custom-diff-program | 1711 @item ediff-custom-diff-program |
1262 @itemx ediff-custom-diff-options | 1712 @itemx ediff-custom-diff-options |
1263 @vindex ediff-custom-diff-program | 1713 @vindex ediff-custom-diff-program |
1264 @vindex ediff-custom-diff-options | 1714 @vindex ediff-custom-diff-options |
1287 | 1737 |
1288 @end table | 1738 @end table |
1289 | 1739 |
1290 @noindent | 1740 @noindent |
1291 @strong{Warning:} Ediff does not support the output format of VMS | 1741 @strong{Warning:} Ediff does not support the output format of VMS |
1292 @code{diff}. Instead, make sure to use some implementation of POSIX | 1742 @code{diff}. Instead, make sure you are using some implementation of POSIX |
1293 @code{diff}, such as @code{gnudiff}. | 1743 @code{diff}, such as @code{gnudiff}. |
1294 | 1744 |
1295 @node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization | 1745 @node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization |
1296 @section Merging and diff3 | 1746 @section Merging and diff3 |
1297 | 1747 |
1331 are controlled by the variable @code{ediff-combination-pattern}. Its | 1781 are controlled by the variable @code{ediff-combination-pattern}. Its |
1332 value should be a list of three strings. The first is inserted before | 1782 value should be a list of three strings. The first is inserted before |
1333 the difference region of buffer A; the second string goes between the | 1783 the difference region of buffer A; the second string goes between the |
1334 regions; the third goes after region B, as shown in the above example. | 1784 regions; the third goes after region B, as shown in the above example. |
1335 | 1785 |
1336 In addition to the state of the difference, during merging Ediff | 1786 In addition to the state of the difference, Ediff displays the state of the |
1337 displays the state of the merge for each region. If a difference came | 1787 merge for each region. If a difference came from buffer A by default |
1338 from buffer A by default (because both regions A and B were different | 1788 (because both regions A and B were different from the ancestor and |
1339 from the ancestor and @code{ediff-default-variant} was set to @code{default-A}) | 1789 @code{ediff-default-variant} was set to @code{default-A}) then |
1340 then @samp{[=diff(A) default-A]} is displayed in the mode line. If the | 1790 @samp{[=diff(A) default-A]} is displayed in the mode line. If the |
1341 difference in buffer C came, say, from buffer B because the difference region | 1791 difference in buffer C came, say, from buffer B because the difference |
1342 in that buffer differs from the ancestor, but the region in buffer A | 1792 region in that buffer differs from the ancestor, but the region in buffer A |
1343 does not (if merging with an ancestor) then @samp{[=diff(B) prefer-B]} is | 1793 does not (if merging with an ancestor) then @samp{[=diff(B) prefer-B]} is |
1344 displayed. The indicators default-A/B and prefer-A/B are inspired by | 1794 displayed. The indicators default-A/B and prefer-A/B are inspired by |
1345 Emerge and have the same meaning. | 1795 Emerge and have the same meaning. |
1346 | 1796 |
1347 Another indicator of the state of merge is @samp{combined}. It appears | 1797 Another indicator of the state of merge is @samp{combined}. It appears |
1348 with any difference region in buffer C that was obtained by combining | 1798 with any difference region in buffer C that was obtained by combining |
1349 the difference regions in buffers A and B as explained above. | 1799 the difference regions in buffers A and B as explained above. |
1350 | 1800 |
1351 In addition to state of merge and difference indicator, while merging with an | 1801 In addition to the state of merge and state of difference indicators, while |
1352 ancestor file or buffer, Ediff informs the user when the current difference | 1802 merging with an ancestor file or buffer, Ediff informs the user when the |
1353 region in the (normally invisible) ancestor buffer is empty via the | 1803 current difference region in the (normally invisible) ancestor buffer is |
1354 @emph{AncestorEmpty} indicator. This helps determine if the changes | 1804 empty via the @emph{AncestorEmpty} indicator. This helps determine if the |
1355 made to the original in variants A and B represent pure insertion or | 1805 changes made to the original in variants A and B represent pure insertion |
1356 deletion of text: if the mode line shows @emph{AncestorEmpty} and the | 1806 or deletion of text: if the mode line shows @emph{AncestorEmpty} and the |
1357 corresponding region in buffers A or B is not empty, this means that new | 1807 corresponding region in buffers A or B is not empty, this means that new |
1358 text was inserted. If this indicator is not present and the difference | 1808 text was inserted. If this indicator is not present and the difference |
1359 regions in buffers A or B are non-empty, this means that text was | 1809 regions in buffers A or B are non-empty, this means that text was |
1360 modified. Otherwise, the original text was deleted. | 1810 modified. Otherwise, the original text was deleted. |
1361 | 1811 |
1436 buffers A and B disagrees with the ancestor. To do this, set the | 1886 buffers A and B disagrees with the ancestor. To do this, set the |
1437 variable @code{ediff-show-clashes-only} to non-@code{nil}. | 1887 variable @code{ediff-show-clashes-only} to non-@code{nil}. |
1438 | 1888 |
1439 You can toggle this feature interactively by typing @kbd{$}. | 1889 You can toggle this feature interactively by typing @kbd{$}. |
1440 | 1890 |
1441 Note that this variable controls only how Ediff chooses the | 1891 Note that this variable affects only the show next/previous difference |
1442 next/previous difference to show. You can still jump directly to any | 1892 commands. You can still jump directly to any difference region directly |
1443 difference using the command @kbd{j} (with a prefix argument specifying | 1893 using the command @kbd{j} (with a prefix argument specifying the difference |
1444 the difference number). | 1894 number). |
1895 | |
1896 @vindex ediff-autostore-merges | |
1897 @vindex ediff-quit-merge-hook | |
1898 @findex ediff-maybe-save-and-delete-merge | |
1899 The variable @code{ediff-autostore-merges} controls what happens to the | |
1900 merge buffer when Ediff quits. If the value is @code{nil}, nothing is done | |
1901 to the merge buffer---it will be the user's responsibility to save it. | |
1902 If the value is @code{t}, the user will be asked where to save the buffer | |
1903 and whether to delete it afterwards. It the value is neither @code{nil} nor | |
1904 @code{t}, the merge buffer is saved @emph{only} if this merge session was | |
1905 invoked from a group of related Ediff session, such as those that result | |
1906 from @code{ediff-merge-directories}, | |
1907 @code{ediff-merge-directory-revisions}, etc. | |
1908 @xref{Session Groups}. This behavior is implemented in the function | |
1909 @code{ediff-maybe-save-and-delete-merge}, which is a hook in | |
1910 @code{ediff-quit-merge-hook}. The user can supply a different hook, if | |
1911 necessary. | |
1912 | |
1913 The variable @code{ediff-autostore-merges} is buffer-local, so it can be | |
1914 set in a per-buffer manner. Therefore, use @code{setq-default} to globally | |
1915 change this variable. | |
1445 | 1916 |
1446 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization | 1917 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization |
1447 @section Support for Version Control | 1918 @section Support for Version Control |
1448 | 1919 |
1449 | 1920 |
1689 | 2160 |
1690 Ediff was written by Michael Kifer <kifer@@cs.sunysb.edu>. It was inspired | 2161 Ediff was written by Michael Kifer <kifer@@cs.sunysb.edu>. It was inspired |
1691 by emerge.el written by Dale R. Worley <drw@@math.mit.edu>. An idea due to | 2162 by emerge.el written by Dale R. Worley <drw@@math.mit.edu>. An idea due to |
1692 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight | 2163 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight |
1693 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de> | 2164 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de> |
1694 ported Ediff to XEmacs, and Eric Freudenthal <freudent@@jan.ultra.nyu.edu> | 2165 ported Ediff to XEmacs, Eric Freudenthal <freudent@@jan.ultra.nyu.edu> |
1695 made it work with VC. | 2166 made it work with VC, and Marc Paquette <paquette@@crim.ca> wrote the |
2167 toolbar support package for Ediff. | |
1696 | 2168 |
1697 Many people provided help with bug reports, patches, and advice. | 2169 Many people provided help with bug reports, patches, and advice. |
1698 Without them, Ediff would not be nearly as useful as it is today. | 2170 Without them, Ediff would not be nearly as useful as it is today. |
1699 Here is a full list of contributors (I hope I didn't miss anyone): | 2171 Here is a full list of contributors (I hope I didn't miss anyone): |
1700 | 2172 |
1711 Kevin Esler (esler@@ch.hp.com), Robert Estes (estes@@ece.ucdavis.edu), | 2183 Kevin Esler (esler@@ch.hp.com), Robert Estes (estes@@ece.ucdavis.edu), |
1712 Xavier Fornari (xavier@@europe.cma.fr), | 2184 Xavier Fornari (xavier@@europe.cma.fr), |
1713 Eric Freudenthal (freudent@@jan.ultra.nyu.edu), | 2185 Eric Freudenthal (freudent@@jan.ultra.nyu.edu), |
1714 Job Ganzevoort (Job.Ganzevoort@@cwi.nl), | 2186 Job Ganzevoort (Job.Ganzevoort@@cwi.nl), |
1715 Boris Goldowsky (boris@@cs.rochester.edu), | 2187 Boris Goldowsky (boris@@cs.rochester.edu), |
1716 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu), Xiaoli Huang (hxl@@epic.com), | 2188 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu), |
2189 Xiaoli Huang (hxl@@epic.com), | |
2190 Lars Magne Ingebrigtsen (larsi@@ifi.uio.no), | |
1717 Larry Gouge (larry@@itginc.com), Karl Heuer (kwzh@@gnu.ai.mit.edu), | 2191 Larry Gouge (larry@@itginc.com), Karl Heuer (kwzh@@gnu.ai.mit.edu), |
1718 (irvine@@lks.csi.com), (jaffe@@chipmunk.cita.utoronto.ca), | 2192 (irvine@@lks.csi.com), (jaffe@@chipmunk.cita.utoronto.ca), |
1719 David Karr (dkarr@@nmo.gtegsc.com), | 2193 David Karr (dkarr@@nmo.gtegsc.com), |
1720 Norbert Kiesel (norbert@@i3.informatik.rwth-aachen.de), | 2194 Norbert Kiesel (norbert@@i3.informatik.rwth-aachen.de), |
1721 Leigh L Klotz (klotz@@adoc.xerox.com), Fritz Knabe (Fritz.Knabe@@ecrc.de), | 2195 Leigh L Klotz (klotz@@adoc.xerox.com), Fritz Knabe (Fritz.Knabe@@ecrc.de), |
1737 C.S. Roberson (roberson@@aur.alcatel.com), | 2211 C.S. Roberson (roberson@@aur.alcatel.com), |
1738 Kevin Rodgers (kevin.rodgers@@ihs.com), | 2212 Kevin Rodgers (kevin.rodgers@@ihs.com), |
1739 Sandy Rutherford (sandy@@ibm550.sissa.it), | 2213 Sandy Rutherford (sandy@@ibm550.sissa.it), |
1740 Heribert Schuetz (schuetz@@ecrc.de), Andy Scott (ascott@@pcocd2.intel.com), | 2214 Heribert Schuetz (schuetz@@ecrc.de), Andy Scott (ascott@@pcocd2.intel.com), |
1741 Axel Seibert (axel@@tumbolia.ppp.informatik.uni-muenchen.de), | 2215 Axel Seibert (axel@@tumbolia.ppp.informatik.uni-muenchen.de), |
2216 Scott O. Sherman (Scott.Sherman@@mci.com), | |
1742 Richard Stallman (rms@@gnu.ai.mit.edu), | 2217 Richard Stallman (rms@@gnu.ai.mit.edu), |
1743 Richard Stanton (stanton@@haas.berkeley.edu), | 2218 Richard Stanton (stanton@@haas.berkeley.edu), |
1744 Ake Stenhoff (etxaksf@@aom.ericsson.se), Stig (stig@@hackvan.com), | 2219 Ake Stenhoff (etxaksf@@aom.ericsson.se), Stig (stig@@hackvan.com), |
1745 Peter Stout (Peter_Stout@@cs.cmu.edu), Chuck Thompson (cthomp@@cs.uiuc.edu), | 2220 Peter Stout (Peter_Stout@@cs.cmu.edu), Chuck Thompson (cthomp@@cs.uiuc.edu), |
1746 Ray Tomlinson (tomlinso@@bbn.com), | 2221 Ray Tomlinson (tomlinso@@bbn.com), |
1747 Raymond Toy (toy@@rtp.ericsson.se), | 2222 Raymond Toy (toy@@rtp.ericsson.se), |
2223 Philippe Waroquiers (philippe.waroquiers@@eurocontrol.be), | |
1748 Ben Wing (wing@@666.com), | 2224 Ben Wing (wing@@666.com), |
1749 Ilya Zakharevich (ilya@@math.ohio-state.edu), | 2225 Ilya Zakharevich (ilya@@math.ohio-state.edu), |
1750 Eli Zaretskii (eliz@@is.elta.co.il) | 2226 Eli Zaretskii (eliz@@is.elta.co.il) |
1751 @end example | 2227 @end example |
1752 | 2228 |