Mercurial > hg > xemacs-beta
comparison man/ediff.texi @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 4103f0995bd7 |
children | c7528f8e288d |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
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 ediff | 8 @setfilename ../info/ediff.info |
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.62 | 42 @subtitle Ediff version 2.61 |
43 @sp 1 | 43 @sp 1 |
44 @subtitle July 1996 | 44 @subtitle June 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 * Session Commands:: Ediff commands used within a session. | 65 * Commands:: Ediff commands. |
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 | 83 the differences between a pair (or a triple) of files or buffers. The |
84 (which are called @samp{variants} for our purposes). The | |
85 files being compared, file-A, file-B, and file-C (if applicable) are | 84 files being compared, file-A, file-B, and file-C (if applicable) are |
86 shown in separate windows (side by side, one above the another, or in | 85 shown in separate windows (side by side, one above the another, or in |
87 separate frames), and the differences are highlighted as you step | 86 separate frames), and the differences are highlighted as you step |
88 through them. You can also copy difference regions from one buffer to | 87 through them. You can also copy difference regions from one buffer to |
89 another (and recover old differences if you change your mind). | 88 another (and recover old differences if you change your mind). |
96 | 95 |
97 In addition, Ediff can apply a patch to a file and then let you step though | 96 In addition, Ediff can apply a patch to a file and then let you step though |
98 both files, the patched and the original one, simultaneously, | 97 both files, the patched and the original one, simultaneously, |
99 difference-by-difference. You can even apply a patch right out of a mail | 98 difference-by-difference. You can even apply a patch right out of a mail |
100 buffer, i.e., patches received by mail don't even have to be saved. Since | 99 buffer, i.e., patches received by mail don't even have to be saved. Since |
101 Ediff lets you copy differences between variants, you can, in effect, apply | 100 Ediff lets you copy differences between buffers, you can, in effect, apply |
102 patches selectively (i.e., you can copy a difference region from | 101 patches selectively (i.e., you can copy a difference region from |
103 @file{file.orig} to @file{file}, thereby undoing any particular patch that | 102 @file{file_orig} to @file{file}, thereby undoing any particular patch that |
104 you don't like). | 103 you don't like). |
105 | 104 |
106 Ediff even understands multi-file patches and can apply them interactively! | 105 Ediff even understands multi-file patches and can apply them interactively! |
107 (Ediff can recognize multi-file patches only if they are in the context | 106 (Ediff can recognize multi-file patches only if they are in the context or |
108 format or GNU unified format. All other patches are treated as 1-file | 107 GNU unified format. All other patches are treated as 1-file patches. Ediff |
109 patches. Ediff is [hopefully] using the same algorithm as @file{patch} to | 108 is [hopefully] using the same algorithm as patch to determine which |
110 determine which files need to be patched.) | 109 files need to be patched.) |
111 | 110 |
112 Ediff is aware of version control, which lets you compare | 111 Ediff is aware of version control, which lets you compare |
113 files with their older versions. Ediff also works with remote and | 112 files with their older versions. Ediff also works with remote and |
114 compressed files, automatically ftp'ing them over and uncompressing them. | 113 compressed files, automatically ftp'ing them over and uncompressing them. |
115 @xref{Remote and Compressed Files}, for details. | 114 @xref{Remote and Compressed Files}, for details. |
116 | 115 |
117 This package builds upon ideas borrowed from Emerge and several Ediff's | 116 This package builds upon ideas borrowed from Emerge and |
118 functions are adaptations from Emerge. Although Ediff subsumes and greatly | 117 several Ediff's functions are adaptations from Emerge. |
119 extends Emerge, much of the functionality in Ediff is influenced by Emerge. | 118 Although Ediff subsumes 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, Session Commands, Introduction, Top | 122 @node Major Entry Points, 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. | |
244 | 242 |
245 @item ediff-merge-revisions | 243 @item ediff-merge-revisions |
246 @findex ediff-merge-revisions | 244 @findex ediff-merge-revisions |
247 Merge two versions of the file visited by the current buffer. | 245 Merge two versions of the file visited by the current buffer. |
248 | 246 |
249 @item ediff-merge-revisions-with-ancestor | 247 @item ediff-merge-revisions-with-ancestor |
250 @findex ediff-merge-revisions-with-ancestor | 248 @findex ediff-merge-revisions-with-ancestor |
251 Same but with ancestor. | 249 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. | |
261 @end table | 250 @end table |
262 | 251 |
263 @noindent | 252 @noindent |
264 If you want Ediff to be loaded from the very beginning of your Emacs | 253 If you want Ediff to be loaded from the very beginning of your Emacs |
265 session, you should put this line in your @file{~/.emacs} file: | 254 session, you should put this line in your @file{~/.emacs} file: |
270 | 259 |
271 @noindent | 260 @noindent |
272 Otherwise, Ediff will be loaded automatically when you use one of the | 261 Otherwise, Ediff will be loaded automatically when you use one of the |
273 above functions, either directly or through the menus. | 262 above functions, either directly or through the menus. |
274 | 263 |
275 When the above functions are invoked, the user is prompted for all the | 264 When the above functions are invoked, they prompt the user for the |
276 necessary information---typically the files or buffers to compare, merge, or | 265 information they need---typically the files or buffers to compare or |
277 patch. Ediff tries to be smart about these prompts. For instance, in | 266 patch. Ediff tries to be smart about these prompts. For instance, in |
278 comparing/merging files, it will offer the visible buffers as defaults. In | 267 comparing/merging files, it will offer the visible buffers as defaults. In |
279 prompting for files, if the user enters a directory, the previously input | 268 prompting for files, if the user enters a directory, the previously input |
280 file name will be appended to that directory. In addition, if the variable | 269 file name will be appended to that directory. In addition, if the variable |
281 @code{ediff-use-last-dir} is not @code{nil}, Ediff will offer | 270 @code{ediff-use-last-dir} is not @code{nil}, Ediff will offer |
282 previously entered directories as defaults (which will be maintained | 271 previously entered directories as defaults (which will be maintained |
283 separately for each type of file, A, B, or C). | 272 separately for each type of file, A, B, or C). |
284 @vindex @code{ediff-use-last-dir} | 273 @vindex @code{ediff-use-last-dir} |
285 | 274 |
286 All the above functions use the POSIX @code{diff} or @code{diff3} programs | 275 All the above functions use the POSIX @code{diff} program to find |
287 to find differences between two files. They process the @code{diff} output | 276 differences between two files. They process the @code{diff} output and |
288 and display it in a convenient form. At present, Ediff understands only | 277 display it in a convenient form. At present, Ediff understands only the |
289 the plain output from diff. Options such as @samp{-c} are not supported, | 278 plain output from diff. Options such as @samp{-c} are not supported, |
290 nor is the format produced by incompatible file comparison programs such as | 279 nor is the format produced by incompatible file comparison programs such |
291 the VMS version of @code{diff}. | 280 as the VMS version of @code{diff}. |
292 | 281 |
293 The functions @code{ediff-files}, @code{ediff-buffers}, | 282 The functions @code{ediff-files}, @code{ediff-buffers}, |
294 @code{ediff-files3}, @code{ediff-buffers3} first display the coarse, | 283 @code{ediff-files3}, @code{ediff-buffers3} first display the coarse, |
295 line-based difference regions, as reported by the @file{diff} program. The | 284 line-based difference regions, as reported by the @file{diff} program. |
296 total number of difference regions and the current difference number are | 285 Since diff may report fairly large chunks of text as being different, |
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, | |
300 even though the difference may be localized to just a few words or even | 286 even though the difference may be localized to just a few words or even |
301 to the white space or line breaks, Ediff further @emph{refines} the | 287 to the white space or line breaks, Ediff further @emph{refines} the |
302 regions to indicate which exact words differ. If the only difference is | 288 regions to indicate which exact words differ. If the only difference is |
303 in the white space and line breaks, Ediff says so. | 289 in the white space and line breaks, Ediff says so. |
304 | 290 |
335 Moreover, the functions @code{ediff-directory-revisions}, | 321 Moreover, the functions @code{ediff-directory-revisions}, |
336 @code{ediff-merge-directory-revisions}, etc., let you run a group of | 322 @code{ediff-merge-directory-revisions}, etc., let you run a group of |
337 related Ediff sessions by taking a directory and comparing (or merging) | 323 related Ediff sessions by taking a directory and comparing (or merging) |
338 versions of files in that directory. | 324 versions of files in that directory. |
339 | 325 |
340 @node Session Commands, Registry of Ediff Sessions, Major Entry Points, Top | 326 @node Commands, Registry of Ediff Sessions, Major Entry Points, Top |
341 @chapter Session Commands | 327 @chapter Commands |
342 | 328 |
343 All Ediff commands are displayed in a Quick Help window, unless you type | 329 All Ediff commands are displayed in a quick |
344 @kbd{?} to shrink the window to just one line. You can redisplay the help | 330 help window, unless you type @kbd{?} to shrink the window to just one line. |
345 window by typing @kbd{?} again. The Quick Help commands are detailed below. | 331 You can redisplay the help window by typing @kbd{?} again. |
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. | |
346 | 336 |
347 Many Ediff commands take numeric prefix arguments. For instance, if you | 337 Many Ediff commands take numeric prefix arguments. For instance, if you |
348 type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}), | 338 type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}), Ediff |
349 Ediff moves to the third difference region. Typing 3 and then @kbd{a} | 339 moves to the third difference region. Typing 3 and then @kbd{a} |
350 (@code{ediff-diff-to-diff}) copies the 3d difference region from variant A | 340 (@code{ediff-diff-to-diff}) copies the 3d difference region from buffer |
351 to variant B. Likewise, 4 followed by @kbd{ra} restores the 4th difference | 341 A to buffer B. Typing @kbd{b} does copying in the opposite |
352 region in buffer A (if it was previously written over via the command | 342 direction. (In 3-way comparison mode, the commands for copying are |
353 @kbd{a}). | 343 @kbd{ab}, @kbd{ba}, @kbd{ca}, etc.) |
354 | 344 Likewise, 4 followed by @kbd{ra} |
355 Some commands take negative prefix arguments as well. For instance, typing | 345 restores the 4th difference region in buffer A (if it was previously |
356 @kbd{-} and then @kbd{j} will make the last difference region | 346 saved as a result of copying from, say, buffer B to A). |
357 current. Typing @kbd{-2} then @kbd{j} makes the penultimate difference | 347 |
358 region current, etc. | 348 Some commands take negative prefix arguments as well. |
359 | 349 For instance, typing @kbd{-} and then @kbd{j} will take Ediff to the last |
360 Without the prefix argument, all commands operate on the currently | 350 difference. Typing @kbd{-2} then @kbd{j} takes Ediff to the penultimate |
361 selected difference region. You can make any difference region | 351 difference region, etc. |
362 current using the various commands explained below. | 352 |
363 | 353 Without the prefix argument, all commands operate on the current |
364 For some commands, the actual value of the prefix argument is | 354 selected difference region. You can select any difference region |
365 immaterial. However, if supplied, the prefix argument may modify the | 355 as the current one using other Ediff commands. |
366 command (see @kbd{ga}, @kbd{gb}, and @kbd{gc}). | 356 |
367 | 357 For some commands, the value of the prefix argument is immaterial. However, |
368 @menu | 358 if supplied, the prefix argument modifies the command. For instance, |
369 * Quick Help Commands:: Frequently used commands. | 359 normally the commands @kbd{ga}/@kbd{gb}/@kbd{gc} |
370 * Other Session Commands:: Commands that are not bound to keys. | 360 (@code{ediff-jump-to-difference-at-point}) causes Ediff to jump to the |
371 @end menu | 361 difference region that is closest to the point in a specified buffer (the |
372 | 362 buffer, A, B, or C, is specified by the last character of the command, |
373 @node Quick Help Commands,Other Session Commands,,Session Commands | 363 i.e., for @code{gb}, the specified buffer is B). |
374 @section Quick Help Commands | 364 However, with a prefix argument, Ediff would position all these |
375 | 365 buffers around the area indicated by the current point in the specified |
376 @table @kbd | 366 buffer: if the point is inside a difference region, then the buffers will |
377 @item ? | 367 be positioned at this difference region. If the point is not in any |
378 Toggles the Ediff Quick Help window ON and OFF. | 368 difference region, then it is in an area where all buffers agree with each |
379 @item G | 369 other. In this case, all buffers will be positioned so that they would |
380 Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer. | 370 display this area. |
381 | 371 |
382 @item E | 372 The total number of differences and the current difference number are |
383 Brings up the top node of this manual, where you can find further | 373 always displayed in the mode line of the control window. |
384 information on the various Ediff functions and advanced issues, such as | 374 |
385 customization, session groups, etc. | 375 If, after making changes to buffers A, B, or C, you decide to save them, it |
386 | 376 is best to use @code{ediff-save-buffer}, which is bound to @kbd{wa}, |
387 @item v | 377 @kbd{wb}, and @kbd{wc} (@kbd{wa} will save buffer A, @kbd{wb} saves buffer |
388 Scrolls up buffers A and B (and buffer C where appropriate) in a | 378 B, etc.). |
389 coordinated fashion. | 379 |
390 @item V | 380 Typing @kbd{wd} saves the output from the @code{diff} utility to a file, so |
391 Scrolls the buffers down. | 381 you can later refer to it. With prefix argument, this command saves the |
392 | 382 plain output from @file{diff} (see @code{ediff-diff-program} and |
393 @item < | 383 @code{ediff-diff-options}). Without the argument, it saves customized |
394 Scrolls the buffers to the left simultaneously. | 384 @file{diff} output (see @code{ediff-custom-diff-program} and |
395 @item > | 385 @code{ediff-custom-diff-options}), if it is available. |
396 Scrolls buffers to the right. | 386 |
397 | 387 Instead of saving it, @file{diff} output can be @emph{displayed} using the |
398 @item wd | 388 command @kbd{D}. Without the prefix argument, it displays the customized |
399 Saves the output from the diff utility, for further reference. | 389 @file{diff} output of the session. With the prefix argument, it displays |
400 | 390 the plain @file{diff} output If either of the @file{diff} outputs is |
401 With prefix argument, saves the plain output from @file{diff} (see | 391 unavailable (because it wasn't generated or the user killed the respective |
402 @code{ediff-diff-program} and @code{ediff-diff-options}). Without the | 392 buffer), then Ediff will try to display the other @file{diff} output. If |
403 argument, it saves customized @file{diff} output (see | 393 none is available, a warning is issued. |
404 @code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}), if | 394 |
405 it is available. | 395 The command @kbd{z} suspends the current ediff session. It hides the |
406 | 396 control buffer and the variants. The easiest way to resume a suspended |
407 @item wa | 397 Ediff session is through the registry of active sessions. |
408 Saves buffer A, if it was modified. | 398 @xref{Registry of Ediff Sessions}, for details. |
409 @item wb | 399 |
410 Saves buffer B, if it was modified. | 400 The command @kbd{q} quits the current Ediff session. With a prefix |
411 @item wc | 401 argument, it will ask the user whether to delete the variant |
412 Saves buffer C, if it was modified (if you are in a session that | 402 buffers. |
413 compares three files simultaneously). | 403 |
414 | 404 The command @kbd{s} is used only for merging. It shrinks window C (the |
415 @item a | 405 merge window) to its minimal size, thereby exposing as much of buffers A |
416 @emph{In comparison sessions:} | 406 and B as possible. This command is intended only for temporary viewing; |
417 Copies the current difference region (or the region specified as the prefix | 407 therefore, Ediff restores window C to its original size whenever it |
418 to this command) from buffer A to buffer B. | 408 makes any other change in the window configuration. Typing @kbd{s} |
419 Ediff saves the old contents of buffer B's region; it can | 409 again also restores the original size of window C. However, recentering and |
420 be restored via the command @kbd{rb}, which see. | 410 jumping to a difference does not affect window C's size. |
421 | 411 |
422 @emph{In merge sessions:} | 412 With a positive prefix argument, the command @kbd{s} makes the merge |
423 Copies the current difference region (or the region specified as the prefix | 413 window, window C, slightly taller. With @kbd{-} or a negative prefix |
424 to this command) from buffer A to the merge buffer. The old contents of | 414 argument, @kbd{s} makes window C slightly shorter. |
425 this region in buffer C can be restored via the command @kbd{r}. | 415 |
426 | 416 Another command used only for merging is @kbd{+}. Its effect is to |
427 @item b | 417 combine the current difference regions of buffers A and B and put the |
428 Works similarly, but copies the current difference region from buffer B to | 418 combination into the merge buffer. @xref{Merging and diff3}, specifically, |
429 buffer A (in @emph{comparison sessions}) or the merge buffer (in | 419 the variables @code{ediff-combine-diffs} and |
430 @emph{merge sessions}). | 420 @code{ediff-combination-pattern}. |
431 | 421 |
432 Ediff saves the old contents of the difference region copied over; it can | 422 In merge mode, Ediff uses a default variant (one of the two files being |
433 be reinstated via the command @kbd{ra} in comparison sessions and | 423 merged) when it cannot decide which of the difference regions (that of |
434 @kbd{r} in merge sessions. | 424 buffer A or buffer B) should be copied into the merge buffer. You might |
435 | 425 decide to use the other variant instead. To facilitate this, Ediff has |
436 @item ab | 426 a command, bound to @kbd{&}, which selects another default variant for |
437 Copies the current difference region (or the region specified as the prefix | 427 the current difference and subsequent differences. You can specify as |
438 to this command) from buffer A to buffer B. This (and the next five) | 428 the new default any of @samp{default-A}, @samp{default-B}, or |
439 command is enabled only in sessions that compare three files | 429 @samp{combined}. @xref{Merging and diff3}, for details. |
440 simultaneously. The old region in buffer B is saved and can be restored | 430 |
441 via the command @kbd{rb}. | 431 Such repeated merging affects only difference regions that have |
442 @item ac | 432 default-A/B status, and only if they were not changed with respect to |
443 Copies the difference region from buffer A to buffer C. | 433 their originals. |
444 The old region in buffer C is saved and can be restored via the command | 434 |
445 @kbd{rc}. | 435 Some commands are not bound to any key: |
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. | |
771 | 436 |
772 @table @code | 437 @table @code |
773 @item eregistry | 438 @item eregistry |
774 @itemx ediff-show-registry | 439 @itemx ediff-show-registry |
775 @findex eregistry | 440 @findex eregistry |
776 @findex ediff-show-registry | 441 @findex ediff-show-registry |
777 This command brings up the registry of active Ediff sessions. Ediff | 442 This command brings up the registry of active Ediff sessions. Ediff |
778 registry is a device that can be used to resume any active Ediff session | 443 registry is a useful device that can be used for resuming Ediff sessions |
779 (which may have been postponed because the user switched to some other | 444 when the user switched to some other work before finishing a comparison or |
780 activity). This command is also useful for switching between multiple | 445 merging job. It is also useful for switching between multiple active Ediff |
781 active Ediff sessions that are run at the same time. The function | 446 sessions that are run at the same time. The function @code{eregistry} is an |
782 @code{eregistry} is an alias for @code{ediff-show-registry}. | 447 alias for @code{ediff-show-registry}. |
783 @xref{Registry of Ediff Sessions}, for more information on this registry. | |
784 | |
785 @item ediff-toggle-multiframe | 448 @item ediff-toggle-multiframe |
786 @findex ediff-toggle-multiframe | 449 @findex ediff-toggle-multiframe |
787 Changes the display from the multi-frame mode (where the quick help window | 450 Changes the display from the multi-frame mode (where the quick help window |
788 is in a separate frame) to the single-frame mode (where all Ediff buffers | 451 is in a separate frame) to the single-frame mode (where all Ediff buffers |
789 share the same frame), and vice versa. See | 452 share the same frame), and vice versa. |
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 the Menubar. However, in some | |
794 cases, the change will take place only after you execute one of the Ediff | |
795 commands, such as going to the next difference or redisplaying. | |
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 menubar, the function may take sometimes | |
801 effect only after you execute an Ediff command, such as going to the next | |
802 difference. | |
803 | |
804 @item ediff-use-toolbar-p | |
805 @vindex ediff-use-toolbar-p | |
806 The use of the toolbar can also be specified via the variable | |
807 @code{ediff-use-toolbar-p} (default is @code{t}). This variable can be set | |
808 only in @file{.emacs} --- do @strong{not} change it interactively. Use the | |
809 function @code{ediff-toggle-use-toolbar} instead. | |
810 | |
811 @item ediff-revert-buffers-then-recompute-diffs | 453 @item ediff-revert-buffers-then-recompute-diffs |
812 @findex ediff-revert-buffers-then-recompute-diffs | 454 @findex ediff-revert-buffers-then-recompute-diffs |
813 This command reverts the buffers you are comparing and recomputes their | 455 This command reverts the buffers you are comparing and recomputes their |
814 differences. It is useful when, after making changes, you decided to | 456 differences. It is useful when, after making changes, you decided to |
815 make a fresh start, or if at some point you changed the files being | 457 make a fresh start, or if at some point you changed the files being |
826 Ediff's commands. It is meant for Ediff maintenance---specifically, for | 468 Ediff's commands. It is meant for Ediff maintenance---specifically, for |
827 making it run faster. The function @code{ediff-profile} toggles | 469 making it run faster. The function @code{ediff-profile} toggles |
828 profiling of ediff commands. | 470 profiling of ediff commands. |
829 @end table | 471 @end table |
830 | 472 |
831 @node Registry of Ediff Sessions, Session Groups, Session Commands, Top | 473 @node Registry of Ediff Sessions, Session Groups, Commands, Top |
832 @chapter Registry of Ediff Sessions | 474 @chapter Registry of Ediff Sessions |
833 | 475 |
834 Ediff maintains a registry of all its invocations that are | 476 Ediff maintains a registry of all its invocations that are |
835 still @emph{active}. This feature is very convenient for switching among | 477 still @emph{active}. This feature is very convenient for switching among |
836 active Ediff sessions or for quickly restarting a suspended Ediff session. | 478 active Ediff sessions or for quickly restarting a suspended Ediff session. |
882 files. You can come back to the session group buffer associated with a | 524 files. You can come back to the session group buffer associated with a |
883 particular invocation of Ediff by typing @kbd{M} in Ediff control buffer of | 525 particular invocation of Ediff by typing @kbd{M} in Ediff control buffer of |
884 that invocation. | 526 that invocation. |
885 | 527 |
886 Many commands are available in the session group buffer; some are | 528 Many commands are available in the session group buffer; some are |
887 applicable only to certain types of work. The relevant commands are always | 529 applicable only for certain types of work. The relevant commands are always |
888 listed at the top of each session group buffer, so there is no need to | 530 listed at the top of each session group buffer, so there is no need to |
889 memorize them. | 531 memorize them. |
890 | 532 |
891 In directory comparison or merging, a session group panel displays only the | 533 In directory comparison or merging, a session group panel displays only the |
892 files common to all directories involved. The differences are kept in a | 534 files common to all directories involved. The differences are kept in a |
908 though, so the user has to explicitly unmark the sessions of interest). | 550 though, so the user has to explicitly unmark the sessions of interest). |
909 | 551 |
910 Group sessions also understand the command @kbd{m}, which marks sessions | 552 Group sessions also understand the command @kbd{m}, which marks sessions |
911 for future operations (other than hiding) on a group of sessions. At present, | 553 for future operations (other than hiding) on a group of sessions. At present, |
912 the only such group-level operation is the creation of a multi-file patch. | 554 the only such group-level operation is the creation of a multi-file patch. |
913 | |
914 @vindex ediff-autostore-merges | |
915 For group sessions created to merge files, Ediff can store all merges | |
916 automatically in a directory. The user is asked to specify such directory | |
917 if the value of @code{ediff-autostore-merges} is non-nil. If the value is | |
918 @code{nil}, nothing is done to the merge buffers---it will be the user's | |
919 responsibility to save them. If the value is @code{t}, the user will be | |
920 asked where to save the merge buffers in all merge jobs, even those that do | |
921 not originate from a session group. It the value is neither @code{nil} nor | |
922 @code{t}, the merge buffer is saved @emph{only} if this merge session was | |
923 invoked from a session group. This behavior is implemented in the function | |
924 @code{ediff-maybe-save-and-delete-merge}, which is a hook in | |
925 @code{ediff-quit-merge-hook}. The user can supply a different hook, if | |
926 necessary. | |
927 | |
928 The variable @code{ediff-autostore-merges} is buffer-local, so it can be | |
929 set in a per-buffer manner. Therefore, use @code{setq-default} to globally | |
930 change this variable. | |
931 | 555 |
932 @cindex Multi-file patches | 556 @cindex Multi-file patches |
933 A multi-file patch is a concatenated output of several runs of the Unix | 557 A multi-file patch is a concatenated output of several runs of the Unix |
934 @file{diff} command (some versions of @file{diff} let you create a | 558 @file{diff} command (some versions of @file{diff} let you create a |
935 multi-file patch in just one run). In a session group buffer created in | 559 multi-file patch in just one run). In a session group buffer created in |
942 be active, or else Ediff will refuse to produce a multi-file patch. This is | 566 be active, or else Ediff will refuse to produce a multi-file patch. This is |
943 because, in the latter-style sessions, there are many ways to create diff | 567 because, in the latter-style sessions, there are many ways to create diff |
944 output, and it is easier to handle by running Ediff on the inactive | 568 output, and it is easier to handle by running Ediff on the inactive |
945 sessions. | 569 sessions. |
946 | 570 |
947 Last, but not least, by typing @kbd{=}, you can quickly find out which | |
948 sessions have identical files, so you won't have to run Ediff on those | |
949 sessions. This, however, works only on local, uncompressed files. | |
950 For compressed or local files, this command won't report anything. | |
951 | |
952 | 571 |
953 @node Remote and Compressed Files, Customization, Session Groups, Top | 572 @node Remote and Compressed Files, Customization, Session Groups, Top |
954 @chapter Remote and Compressed Files | 573 @chapter Remote and Compressed Files |
955 | 574 |
956 Ediff works with remote, compressed, and encrypted files. Ediff | 575 Ediff works with remote, compressed, and encrypted files. Ediff |
964 file (unlike what the @code{patch} utility would usually do). Instead, the | 583 file (unlike what the @code{patch} utility would usually do). Instead, the |
965 source file retains its name and the result of applying the patch is placed | 584 source file retains its name and the result of applying the patch is placed |
966 in a temporary file that has the suffix @file{_patched} attached. | 585 in a temporary file that has the suffix @file{_patched} attached. |
967 Generally, this applies to files that are handled using black magic, such | 586 Generally, this applies to files that are handled using black magic, such |
968 as special file handlers (ange-ftp and some compression and encryption | 587 as special file handlers (ange-ftp and some compression and encryption |
969 packages also use this method). | 588 packages all use this method). |
970 | 589 |
971 Regular files are treated by the @code{patch} utility in the usual manner, | 590 Regular files are treated by the @code{patch} utility in the usual manner, |
972 i.e., the original is renamed into @file{source-name.orig} and the result | 591 i.e., the original is renamed into @file{source-name.orig} and the result |
973 of the patch is placed into the file source-name (@file{_orig} is used | 592 of the patch is placed into the file source-name. (Ediff @file{_orig} |
974 on systems like VMS, DOS, etc.) | 593 on systems like VMS, DOS, etc.) |
975 | 594 |
976 @node Customization, Credits, Remote and Compressed Files, Top | 595 @node Customization, Credits, Remote and Compressed Files, Top |
977 @chapter Customization | 596 @chapter Customization |
978 | 597 |
979 Ediff has a rather self-explanatory interface, and in most cases you | 598 Ediff has a rather self-explanatory interface, and in most cases you |
980 won't need to change anything. However, should the need arise, there are | 599 won't need to change anything. However, should the need arise, there are |
981 extensive facilities for changing the default behavior. | 600 extensive facilities to change the default behavior. |
982 | 601 |
983 Most of the customization can be done by setting various variables in the | 602 Most of the customization can be done by setting various variables in the |
984 @file{.emacs} file. Some customization (mostly window-related | 603 @file{.emacs} file. Some customization (mostly window-related |
985 customization and faces) can be done by putting appropriate lines in | 604 customization and faces) can be done by putting appropriate lines in |
986 @file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use. | 605 @file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use. |
991 @xref{Highlighting Difference Regions}, for further details. Please also | 610 @xref{Highlighting Difference Regions}, for further details. Please also |
992 refer to Emacs manual for the information on how to set Emacs X resources. | 611 refer to Emacs manual for the information on how to set Emacs X resources. |
993 | 612 |
994 @menu | 613 @menu |
995 * Hooks:: Customization via the hooks. | 614 * Hooks:: Customization via the hooks. |
996 * Quick Help Customization:: How to customize Ediff's quick help feature. | 615 * Quick Help:: How to customize Ediff's quick help feature. |
997 * Window and Frame Configuration:: Controlling the way Ediff displays things. | 616 * Window and Frame Configuration:: Controlling the way Ediff displays things. |
998 * Selective Browsing:: Advanced browsing through difference regions. | 617 * Selective Browsing:: Advanced browsing through difference regions. |
999 * Highlighting Difference Regions:: Controlling highlighting. | 618 * Highlighting Difference Regions:: Controlling highlighting. |
1000 * Narrowing:: Comparing regions, windows, etc. | 619 * Narrowing:: Comparing regions, windows, etc. |
1001 * Refinement of Difference Regions:: How to control the refinement process. | 620 * Refinement of Difference Regions:: How to control the refinement process. |
1007 * Customizing the Mode Line:: Changing the look of the mode line in Ediff. | 626 * Customizing the Mode Line:: Changing the look of the mode line in Ediff. |
1008 * Miscellaneous:: Other customization. | 627 * Miscellaneous:: Other customization. |
1009 * Notes on Heavy-duty Customization:: Customization for the gurus. | 628 * Notes on Heavy-duty Customization:: Customization for the gurus. |
1010 @end menu | 629 @end menu |
1011 | 630 |
1012 @node Hooks, Quick Help Customization, Customization, Customization | 631 @node Hooks, Quick Help, Customization, Customization |
1013 @section Hooks | 632 @section Hooks |
1014 | 633 |
1015 The bulk of customization can be done via the following hooks: | 634 The bulk of customization can be done via the following hooks: |
1016 | 635 |
1017 @table @code | 636 @table @code |
1019 @vindex ediff-load-hook | 638 @vindex ediff-load-hook |
1020 This hook can be used to change defaults after Ediff is loaded. | 639 This hook can be used to change defaults after Ediff is loaded. |
1021 | 640 |
1022 @item ediff-keymap-setup-hook | 641 @item ediff-keymap-setup-hook |
1023 @vindex ediff-keymap-setup-hook | 642 @vindex ediff-keymap-setup-hook |
1024 @vindex ediff-mode-map | 643 This hook can be used to alter bindings in Ediff's keymap. These hooks are |
1025 This hook can be used to alter bindings in Ediff's keymap, | |
1026 @code{ediff-mode-map}. These hooks are | |
1027 run right after the default bindings are set but before | 644 run right after the default bindings are set but before |
1028 @code{ediff-load-hook}. The regular user needs not be concerned with this | 645 @code{ediff-load-hook}. The regular user needs not be concerned with this |
1029 hook---it is provided for implementors of other Emacs packages built on top | 646 hook---it is provided for implementors of other Emacs packages built on top |
1030 of Ediff. | 647 of Ediff. |
1031 | 648 |
1070 This function kills buffers A, B, and, possibly, C, if these buffers aren't | 687 This function kills buffers A, B, and, possibly, C, if these buffers aren't |
1071 modified. In merge jobs, buffer C is never deleted. However, the side | 688 modified. In merge jobs, buffer C is never deleted. However, the side |
1072 effect of using this function is that you may not be able to compare the | 689 effect of using this function is that you may not be able to compare the |
1073 same buffer in two separate Ediff sessions: quitting one of them will | 690 same buffer in two separate Ediff sessions: quitting one of them will |
1074 delete this buffer in another session as well. | 691 delete this buffer in another session as well. |
1075 | |
1076 @item ediff-quit-merge-hook | |
1077 @vindex ediff-quit-merge-hook | |
1078 @vindex ediff-autostore-merges | |
1079 @findex ediff-maybe-save-and-delete-merge | |
1080 This hook is called when Ediff quits a merge job. By default, the value is | |
1081 @code{ediff-maybe-save-and-delete-merge}, which is a function that attempts | |
1082 to save the merge buffer according to the value of | |
1083 @code{ediff-autostore-merges}, as described later. | |
1084 | 692 |
1085 @item ediff-before-setup-control-frame-hook | 693 @item ediff-before-setup-control-frame-hook |
1086 @itemx ediff-after-setup-control-frame-hook | 694 @itemx ediff-after-setup-control-frame-hook |
1087 @vindex ediff-before-setup-control-frame-hook | 695 @vindex ediff-before-setup-control-frame-hook |
1088 @vindex ediff-after-setup-control-frame-hook | 696 @vindex ediff-after-setup-control-frame-hook |
1130 @xref{Session Groups}, for details. | 738 @xref{Session Groups}, for details. |
1131 @item ediff-session-group-setup-hook | 739 @item ediff-session-group-setup-hook |
1132 @vindex ediff-session-group-setup-hook | 740 @vindex ediff-session-group-setup-hook |
1133 Hooks run after setting up a control panel for a group of related Ediff | 741 Hooks run after setting up a control panel for a group of related Ediff |
1134 sessions. @xref{Session Groups}, for details. | 742 sessions. @xref{Session Groups}, for details. |
1135 @item ediff-quit-session-group-hook | |
1136 @vindex ediff-quit-session-group-hook | |
1137 Hooks run just before exiting a session group. | |
1138 @item ediff-meta-buffer-keymap-setup-hook | |
1139 @vindex ediff-meta-buffer-keymap-setup-hook | |
1140 @vindex ediff-meta-buffer-map | |
1141 Hooks run just after setting up the @code{ediff-meta-buffer-map} --- the | |
1142 map that controls key bindings in the meta buffer. Since | |
1143 @code{ediff-meta-buffer-map} is a local variable, you can set different | |
1144 bindings for different kinds of meta buffers. | |
1145 @end table | 743 @end table |
1146 | 744 |
1147 @node Quick Help Customization, Window and Frame Configuration, Hooks, Customization | 745 @node Quick Help, Window and Frame Configuration, Hooks, Customization |
1148 @section Quick Help Customization | 746 @section Quick Help |
1149 @vindex ediff-use-long-help-message | 747 @vindex ediff-use-long-help-message |
1150 @vindex ediff-control-buffer | 748 @vindex ediff-control-buffer |
1151 @vindex ediff-startup-hook | 749 @vindex ediff-startup-hook |
1152 @vindex ediff-help-message | 750 @vindex ediff-help-message |
1153 | 751 |
1166 If you want to change the appearance of the help message on a per-buffer | 764 If you want to change the appearance of the help message on a per-buffer |
1167 basis, you must use @code{ediff-startup-hook} to change the value of | 765 basis, you must use @code{ediff-startup-hook} to change the value of |
1168 the variable @code{ediff-help-message}, which is local to | 766 the variable @code{ediff-help-message}, which is local to |
1169 @code{ediff-control-buffer}. | 767 @code{ediff-control-buffer}. |
1170 | 768 |
1171 @node Window and Frame Configuration, Selective Browsing, Quick Help Customization, Customization | 769 @node Window and Frame Configuration, Selective Browsing, Quick Help, Customization |
1172 @section Window and Frame Configuration | 770 @section Window and Frame Configuration |
1173 | 771 |
1174 On a non-windowing display, Ediff sets things up in one frame, splitting | 772 On a non-windowing display, Ediff sets things up in one frame, splitting |
1175 it between a small control window and the windows for buffers A, B, and C. | 773 it between a small control window and the windows for buffers A, B, and C. |
1176 The split between these windows can be horizontal or | 774 The split between these windows can be horizontal or |
1186 algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p} | 784 algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p} |
1187 (@code{ediff-previous-difference}), @kbd{n} | 785 (@code{ediff-previous-difference}), @kbd{n} |
1188 (@code{ediff-next-difference}), etc. | 786 (@code{ediff-next-difference}), etc. |
1189 | 787 |
1190 The above behavior also depends on whether the current frame is splittable, | 788 The above behavior also depends on whether the current frame is splittable, |
1191 dedicated, etc. Unfortunately, the margin of this book is too narrow to | 789 dedicated, etc. Unfortunately, the margin is too small to present this |
1192 present the details of this remarkable algorithm. | 790 remarkable algorithm. |
1193 | 791 |
1194 The upshot of all this is that you can compare buffers in one frame or | 792 The bottom line of all this is that you can compare buffers in one frame or |
1195 in different frames. The former is done by default, while the latter can | 793 in different frames. The former is done by default, while the latter can |
1196 be achieved by arranging buffers A, B (and C, if applicable) to be seen in | 794 be achieved by arranging buffers A, B (and C, if applicable) to be seen in |
1197 different frames. Ediff respects these arrangements, automatically | 795 different frames. Ediff respects these arrangements, automatically |
1198 adapting itself to the multi-frame mode. | 796 adapting itself to the multi-frame mode. |
1199 | 797 |
1255 valuable real estate on the screen. Toggling help back will deiconify | 853 valuable real estate on the screen. Toggling help back will deiconify |
1256 the control frame. | 854 the control frame. |
1257 | 855 |
1258 To start Ediff with an iconified Control Panel, you should set this | 856 To start Ediff with an iconified Control Panel, you should set this |
1259 variable to @code{t} and @code{ediff-prefer-long-help-message} to | 857 variable to @code{t} and @code{ediff-prefer-long-help-message} to |
1260 @code{nil} (@pxref{Quick Help Customization}). This behavior is useful | 858 @code{nil} (@pxref{Quick Help}). This behavior is useful only if the |
1261 only if the window manager is TWM or a derivative. Also, this doesn't work | 859 window manager is TWM or a derivative. Also, this doesn't work under |
1262 under XEmacs, since this editor ignores input from icons. | 860 XEmacs, since this editor ignores input from icons. |
1263 @end table | 861 @end table |
1264 | 862 |
1265 @findex ediff-setup-windows | 863 @findex ediff-setup-windows |
1266 To make more creative changes in the way Ediff sets up windows, you can | 864 To make more creative changes in the way Ediff sets up windows, you can |
1267 rewrite the function @code{ediff-setup-windows}. However, we believe | 865 rewrite the function @code{ediff-setup-windows}. However, we believe |
1268 that detaching Ediff Control Panel from the rest and making it into a | 866 that detaching Ediff Control Panel from the rest and making it into a |
1269 separate frame offers an important opportunity by allowing you to | 867 separate frame offers an important opportunity by allowing you to |
1270 iconify that frame. Under Emacs, the icon will usually accept all of | 868 iconify that frame. Under Emacs, the icon will usually accept all of |
1271 the Ediff commands, but will free up valuable real estate on your screen | 869 the Ediff commands, but will free up valuable real estate on your screen |
1272 (this may depend on your window manager, though). Iconifying won't do | 870 (this may depend on the window manager, though). Iconifying won't do |
1273 any good under XEmacs since XEmacs icons are not sensitive to keyboard | 871 any good under XEmacs since XEmacs icons are not sensitive to keyboard |
1274 input. The saving grace is that, even if not iconified, the control | 872 input. The saving grace is that, even if not iconified, the control |
1275 frame is very small, smaller than some icons, so it does not take much | 873 frame is very small, smaller than some icons, so it does not take much |
1276 space in any case. | 874 space in any case. |
1277 | 875 |
1284 @code{ediff-setup-windows-multiframe} function, which is the default on | 882 @code{ediff-setup-windows-multiframe} function, which is the default on |
1285 windowing displays. The plain setup, one where all windows are always | 883 windowing displays. The plain setup, one where all windows are always |
1286 in one frame, is done by @code{ediff-setup-windows-plain}, which is the | 884 in one frame, is done by @code{ediff-setup-windows-plain}, which is the |
1287 default on a non-windowing display (or in an xterm window). In fact, | 885 default on a non-windowing display (or in an xterm window). In fact, |
1288 under Emacs, you can switch freely between these two setups by executing | 886 under Emacs, you can switch freely between these two setups by executing |
1289 the command @code{ediff-toggle-multiframe} using the Minibuffer of the | 887 the command @code{ediff-toggle-multiframe} using the Minibuffer. |
1290 Menubar. | |
1291 @findex ediff-setup-windows-multiframe | 888 @findex ediff-setup-windows-multiframe |
1292 @findex ediff-setup-windows-plain | 889 @findex ediff-setup-windows-plain |
1293 @findex ediff-toggle-multiframe | 890 @findex ediff-toggle-multiframe |
1294 | 891 |
1295 If you don't like any of these setups, write your own function. See the | 892 If you don't like any of these setups, write your own function. See the |
1311 | 908 |
1312 @node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization | 909 @node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization |
1313 @section Selective Browsing | 910 @section Selective Browsing |
1314 | 911 |
1315 Sometimes it is convenient to be able to step through only some difference | 912 Sometimes it is convenient to be able to step through only some difference |
1316 regions, those that match certain regular expressions, and to ignore all | 913 regions, those that satisfy certain regular expressions, and to ignore all |
1317 others. On other occasions, you may want to ignore difference regions that | 914 others. On other occasions, you may want to ignore difference regions that |
1318 match some regular expressions, and to look only at the rest. | 915 satisfy some regular expressions, and to look only at the rest. |
1319 | 916 |
1320 The commands @kbd{#f} and @kbd{#h} let you do precisely this. | 917 The commands @kbd{#f} and @kbd{#h} let you do precisely this. |
1321 | 918 |
1322 Typing @kbd{#f} lets you specify regular expressions that match difference | 919 Typing @kbd{#f} lets you specify regular expressions that match difference |
1323 regions you want to focus on. | 920 regions you want to focus on. |
1334 of the difference regions. | 931 of the difference regions. |
1335 | 932 |
1336 On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting | 933 On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting |
1337 regions. That is, if a difference region in buffer A matches | 934 regions. That is, if a difference region in buffer A matches |
1338 @var{regexp-A}, the corresponding region in buffer B matches @var{regexp-B} | 935 @var{regexp-A}, the corresponding region in buffer B matches @var{regexp-B} |
1339 and (if applicable) buffer C's region matches @var{regexp-C}, then the | 936 and (if applicable) buffer-C's region matches @var{regexp-C}, then the |
1340 region will be ignored by the commands @kbd{n}/@key{SPC} | 937 region will be ignored by the commands @kbd{n}/@key{SPC} |
1341 (@code{ediff-next-difference}) and @kbd{p}/@key{DEL} | 938 (@code{ediff-next-difference}) and @kbd{p}/@key{DEL} |
1342 (@code{ediff-previous-difference}) commands. | 939 (@code{ediff-previous-difference}) commands. |
1343 | 940 |
1344 Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off. | 941 Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off. |
1364 to accept the default value, which may not be what you want. Instead, you | 961 to accept the default value, which may not be what you want. Instead, you |
1365 should enter something like @key{^} or @key{$}. These match every | 962 should enter something like @key{^} or @key{$}. These match every |
1366 line. | 963 line. |
1367 | 964 |
1368 You can use the status command, @kbd{i}, to find out whether | 965 You can use the status command, @kbd{i}, to find out whether |
1369 selective browsing is currently in effect. | 966 selective browsing is currently in use. |
1370 | 967 |
1371 The regular expressions you specified are kept in the local variables | 968 The regular expressions you specified are kept in the local variables |
1372 @code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B}, | 969 @code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B}, |
1373 @code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A}, | 970 @code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A}, |
1374 @code{ediff-regexp-hide-B}, @code{ediff-regexp-hide-C}. Their default value | 971 @code{ediff-regexp-hide-B}, @code{ediff-regexp-hide-C}. Their default value |
1375 is the empty string (i.e., nothing is hidden or focused on). To change the | 972 is the empty string (i.e., nothing is hidden or focused on). To change the |
1376 default, set these variables in @file{.emacs} using @code{setq-default}. | 973 default, set these variables in @file{.emacs} using @code{setq-default}. |
1377 | 974 |
1378 In addition to the ability to ignore regions that match regular | 975 In addition to the ability to ignore regions that match regular |
1379 expressions, Ediff can be ordered to start skipping over certain | 976 expressions, Ediff can be ordered to start skipping over certain |
1380 ``uninteresting'' difference regions. This is controlled by the following | 977 ``inessential'' regions. This is controlled by the following variable: |
1381 variable: | |
1382 | 978 |
1383 @table @code | 979 @table @code |
1384 @item ediff-ignore-similar-regions | 980 @item ediff-ignore-similar-regions |
1385 @vindex ediff-ignore-similar-regions | 981 @vindex ediff-ignore-similar-regions |
1386 If @code{t}, causes Ediff to skip over "uninteresting" difference regions, | 982 If @code{t}, causes Ediff to skip over difference regions |
1387 which are the regions where the variants differ only in the amount of the | 983 that deemed inessential, i.e., where the only differences are those |
1388 white space and newlines. This feature can be toggled on/off interactively, | 984 in the white space and newlines. |
1389 via the command @kbd{##}. | |
1390 @end table | 985 @end table |
1391 | 986 |
1392 @strong{Note:} In order for this feature to work, auto-refining of | 987 @strong{Note:} In order for this feature to work, auto-refining of |
1393 difference regions must be on, since otherwise Ediff won't know if there | 988 difference regions must be on, since otherwise Ediff won't know if there |
1394 are fine differences between regions. On devices where Emacs can display | 989 are fine differences between regions. On devices where Emacs can display |
1395 faces, auto-refining is a default, but it is not turned on by default on | 990 faces, auto-refining is a default, but it is not turned on by default on |
1396 text-only terminals. In that case, you must explicitly turn auto-refining | 991 text-only terminals. In that case, you must explicitly turn auto-refining |
1397 on (such as, by typing @kbd{@@}). | 992 on (such as, by typing @kbd{@@}). |
1398 | 993 |
1399 @strong{Reassurance:} If many such uninteresting regions appear in a row, | 994 @strong{Reassurance:} If many inessential regions appear in a row, Ediff may |
1400 Ediff may take a long time to skip over them because it has to compute fine | 995 take a long time to jump to the next region because it has to compute |
1401 differences of all intermediate regions. This delay does not indicate any | 996 fine differences of all intermediate regions. This delay does not |
1402 problem. | 997 indicate any problem. |
1403 | 998 |
1404 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization | 999 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization |
1405 @section Highlighting Difference Regions | 1000 @section Highlighting Difference Regions |
1406 | 1001 |
1407 The following variables control the way Ediff highlights difference | 1002 The following variables control the way Ediff highlights difference |
1456 Non-current difference regions are displayed using these alternating | 1051 Non-current difference regions are displayed using these alternating |
1457 faces. The odd and the even faces are actually identical on monochrome | 1052 faces. The odd and the even faces are actually identical on monochrome |
1458 displays, because without colors options are limited. | 1053 displays, because without colors options are limited. |
1459 So, Ediff uses italics to highlight non-current differences. | 1054 So, Ediff uses italics to highlight non-current differences. |
1460 | 1055 |
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 | |
1476 @item ediff-force-faces | 1056 @item ediff-force-faces |
1477 @vindex ediff-force-faces | 1057 @vindex ediff-force-faces |
1478 Ediff generally can detect when Emacs is running on a device where it can | 1058 Ediff generally can detect when Emacs is running on a device where it can |
1479 use highlighting with faces. However, if it fails to determine that faces | 1059 use highlighting with faces. However, if it fails to determine that faces |
1480 can be used, the user can set this variable to @code{t} to make sure that | 1060 can be used, the user can set this variable to @code{t} to make sure that |
1481 Ediff uses faces to highlight differences. | 1061 Ediff uses faces to highlight differences. |
1482 | 1062 |
1483 @item ediff-highlight-all-diffs | 1063 @item ediff-highlight-all-diffs |
1484 @vindex ediff-highlight-all-diffs | 1064 @vindex ediff-highlight-all-diffs |
1485 Indicates whether---on a windowind display---Ediff should highlight | 1065 Indicates whether---on a window system---Ediff should highlight differences |
1486 differences using inserted strings (as on text-only terminals) or using | 1066 using inserted strings (as on a text-only terminal) or using colors and |
1487 colors and highlighting. Normally, Ediff highlights all differences, but | 1067 highlighting. Normally, Ediff highlights all differences, but the |
1488 the selected difference is highlighted more visibly. One can cycle through | 1068 selected difference is highlighted more visibly. One can cycle through |
1489 various modes of highlighting by typing @kbd{h}. By default, Ediff starts | 1069 various modes of highlighting by typing @kbd{h}. By default, Ediff |
1490 in the mode where all difference regions are highlighted. If you prefer to | 1070 starts in the mode where all difference regions are highlighted. If you |
1491 start in the mode where unselected differences are not highlighted, you | 1071 prefer to start in the mode where unselected differences are not |
1492 should set @code{ediff-highlight-all-diffs} to @code{nil}. Type @kbd{h} to | 1072 highlighted, you should set @code{ediff-highlight-all-diffs} to |
1493 restore highlighting for all differences. | 1073 @code{nil}. Type @kbd{h} to restore highlighting of all differences. |
1494 | 1074 |
1495 Ediff lets you switch between the two modes of highlighting. That is, | 1075 Ediff lets you switch between the two modes of highlighting. That is, |
1496 you can switch interactively from highlighting using faces to | 1076 you can switch interactively from highlighting using faces to |
1497 highlighting using string flags, and back. Of course, switching has | 1077 highlighting using string flags, and back. Of course, switching has |
1498 effect only under a windowing system. On a text-only terminal or in an | 1078 effect only under a windowing system. On a text-only terminal or in an |
1513 @noindent | 1093 @noindent |
1514 or here, | 1094 or here, |
1515 | 1095 |
1516 @example | 1096 @example |
1517 (setq ediff-current-diff-face-A | 1097 (setq ediff-current-diff-face-A |
1518 (copy-face 'bold-italic 'ediff-current-diff-face-A)) | 1098 (copy-face 'bold-italic 'ediff-current-diff-face-A)) |
1519 @end example | 1099 @end example |
1520 | 1100 |
1521 @noindent | 1101 @noindent |
1522 or modify the defaults selectively: | 1102 or modify the defaults selectively: |
1523 | 1103 |
1545 @section Narrowing | 1125 @section Narrowing |
1546 | 1126 |
1547 If buffers being compared are narrowed at the time of invocation of | 1127 If buffers being compared are narrowed at the time of invocation of |
1548 Ediff, @code{ediff-buffers} will preserve the narrowing range. However, | 1128 Ediff, @code{ediff-buffers} will preserve the narrowing range. However, |
1549 if @code{ediff-files} is invoked on the files visited by these buffers, | 1129 if @code{ediff-files} is invoked on the files visited by these buffers, |
1550 that would widen the buffers, since this command is defined to compare the | 1130 that widens the buffers, since this command is defined to compare the |
1551 entire files. | 1131 entire files. |
1552 | 1132 |
1553 Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, or | 1133 Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, |
1554 the corresponding @samp{-wordwise} commands, narrows the variants to the | 1134 or the corresponding @samp{-wordwise} commands, narrows the buffers |
1555 particular regions being compared. The original accessible ranges are | 1135 being compared (corresponding to the regions being compared). The |
1556 restored when you quit Ediff. During the command, you can toggle this | 1136 original accessible ranges are restored when you quit Ediff. |
1557 narrowing on and off with the @kbd{%} command. | 1137 During the command, you can toggle this narrowing on and off |
1138 with the @kbd{%} command. | |
1558 | 1139 |
1559 These two variables control this narrowing behavior: | 1140 These two variables control this narrowing behavior: |
1560 | 1141 |
1561 @table @code | 1142 @table @code |
1562 @item ediff-start-narrowed | 1143 @item ediff-start-narrowed |
1608 | 1189 |
1609 You can always refine the current region by typing @kbd{*}. | 1190 You can always refine the current region by typing @kbd{*}. |
1610 | 1191 |
1611 @item ediff-forward-word-function | 1192 @item ediff-forward-word-function |
1612 @vindex ediff-forward-word-function | 1193 @vindex ediff-forward-word-function |
1613 This variable controls how fine differences are computed. The | 1194 This variable gives control over how fine differences are computed. The |
1614 value must be a Lisp function that determines how the current difference | 1195 value must be a Lisp function that determines how the current difference |
1615 region should be split into words. | 1196 region should be split into words. |
1616 | 1197 |
1617 @vindex ediff-diff-program | 1198 @vindex ediff-diff-program |
1618 @vindex ediff-forward-word-function | 1199 @vindex ediff-forward-word-function |
1619 @findex ediff-forward-word | 1200 @findex ediff-forward-word |
1620 Fine differences are computed by first splitting the current difference | 1201 Fine differences are computed by first splitting the current difference |
1621 region into words and then passing the result to | 1202 region into words and then passing this along to |
1622 @code{ediff-diff-program}. For the default forward word function (which is | 1203 @code{ediff-diff-program}. For the default |
1623 @code{ediff-forward-word}), a word is a string consisting of letters, | 1204 @code{ediff-forward-word-function} (which is @code{ediff-forward-word}), a |
1624 @samp{-}, or @samp{_}; a string of punctuation symbols; a string of digits, | 1205 word is a string consisting of letters, @samp{-}, or @samp{_}; a string of |
1625 or a string consisting of symbols that are neither space, nor a letter. | 1206 punctuation symbols; a string of digits, or a string consisting of symbols |
1207 that are neither space, nor a letter. | |
1626 | 1208 |
1627 This default behavior is controlled by four variables: @code{ediff-word-1}, | 1209 This default behavior is controlled by four variables: @code{ediff-word-1}, |
1628 ..., @code{ediff-word-4}. See the on-line documentation for these variables | 1210 ..., @code{ediff-word-4}. See the on-line documentation for these variables |
1629 and for the function @code{ediff-forward-word} for an explanation of how to | 1211 and for the function @code{ediff-forward-word} for an explanation of how to |
1630 modify these variables. | 1212 modify these variables. |
1651 This section describes variables that specify the programs to be used for | 1233 This section describes variables that specify the programs to be used for |
1652 applying patches and for computing the main difference regions (not the | 1234 applying patches and for computing the main difference regions (not the |
1653 fine difference regions): | 1235 fine difference regions): |
1654 | 1236 |
1655 @table @code | 1237 @table @code |
1656 @item ediff-diff-program | 1238 @item ediff-patch-program |
1239 @itemx ediff-diff-program | |
1657 @itemx ediff-diff3-program | 1240 @itemx ediff-diff3-program |
1658 @vindex ediff-patch-program | 1241 @vindex ediff-patch-program |
1659 @vindex ediff-diff-program | 1242 @vindex ediff-diff-program |
1660 @vindex ediff-diff3-program | 1243 @vindex ediff-diff3-program |
1661 These variables specify the programs to use to produce differences | 1244 These variables specify the programs to use to produce differences |
1662 and do patching. | 1245 and do patching. |
1663 | 1246 |
1664 @item ediff-diff-options | 1247 @item ediff-patch-options |
1248 @itemx ediff-diff-options | |
1665 @itemx ediff-diff3-options | 1249 @itemx ediff-diff3-options |
1666 @vindex ediff-patch-options | 1250 @vindex ediff-patch-options |
1667 @vindex ediff-diff-options | 1251 @vindex ediff-diff-options |
1668 @vindex ediff-diff3-options | 1252 @vindex ediff-diff3-options |
1669 These variables specify the options to pass to the above utilities. | 1253 These variables specify the options to pass to the above utilities. |
1671 In @code{ediff-diff-options}, it may be useful to specify options | 1255 In @code{ediff-diff-options}, it may be useful to specify options |
1672 such as @samp{-w} that ignore certain kinds of changes. However, | 1256 such as @samp{-w} that ignore certain kinds of changes. However, |
1673 Ediff does not let you use the option @samp{-c}, as it doesn't recognize this | 1257 Ediff does not let you use the option @samp{-c}, as it doesn't recognize this |
1674 format yet. | 1258 format yet. |
1675 | 1259 |
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. | |
1710 | 1260 |
1711 @item ediff-custom-diff-program | 1261 @item ediff-custom-diff-program |
1712 @itemx ediff-custom-diff-options | 1262 @itemx ediff-custom-diff-options |
1713 @vindex ediff-custom-diff-program | 1263 @vindex ediff-custom-diff-program |
1714 @vindex ediff-custom-diff-options | 1264 @vindex ediff-custom-diff-options |
1737 | 1287 |
1738 @end table | 1288 @end table |
1739 | 1289 |
1740 @noindent | 1290 @noindent |
1741 @strong{Warning:} Ediff does not support the output format of VMS | 1291 @strong{Warning:} Ediff does not support the output format of VMS |
1742 @code{diff}. Instead, make sure you are using some implementation of POSIX | 1292 @code{diff}. Instead, make sure to use some implementation of POSIX |
1743 @code{diff}, such as @code{gnudiff}. | 1293 @code{diff}, such as @code{gnudiff}. |
1744 | 1294 |
1745 @node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization | 1295 @node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization |
1746 @section Merging and diff3 | 1296 @section Merging and diff3 |
1747 | 1297 |
1781 are controlled by the variable @code{ediff-combination-pattern}. Its | 1331 are controlled by the variable @code{ediff-combination-pattern}. Its |
1782 value should be a list of three strings. The first is inserted before | 1332 value should be a list of three strings. The first is inserted before |
1783 the difference region of buffer A; the second string goes between the | 1333 the difference region of buffer A; the second string goes between the |
1784 regions; the third goes after region B, as shown in the above example. | 1334 regions; the third goes after region B, as shown in the above example. |
1785 | 1335 |
1786 In addition to the state of the difference, Ediff displays the state of the | 1336 In addition to the state of the difference, during merging Ediff |
1787 merge for each region. If a difference came from buffer A by default | 1337 displays the state of the merge for each region. If a difference came |
1788 (because both regions A and B were different from the ancestor and | 1338 from buffer A by default (because both regions A and B were different |
1789 @code{ediff-default-variant} was set to @code{default-A}) then | 1339 from the ancestor and @code{ediff-default-variant} was set to @code{default-A}) |
1790 @samp{[=diff(A) default-A]} is displayed in the mode line. If the | 1340 then @samp{[=diff(A) default-A]} is displayed in the mode line. If the |
1791 difference in buffer C came, say, from buffer B because the difference | 1341 difference in buffer C came, say, from buffer B because the difference region |
1792 region in that buffer differs from the ancestor, but the region in buffer A | 1342 in that buffer differs from the ancestor, but the region in buffer A |
1793 does not (if merging with an ancestor) then @samp{[=diff(B) prefer-B]} is | 1343 does not (if merging with an ancestor) then @samp{[=diff(B) prefer-B]} is |
1794 displayed. The indicators default-A/B and prefer-A/B are inspired by | 1344 displayed. The indicators default-A/B and prefer-A/B are inspired by |
1795 Emerge and have the same meaning. | 1345 Emerge and have the same meaning. |
1796 | 1346 |
1797 Another indicator of the state of merge is @samp{combined}. It appears | 1347 Another indicator of the state of merge is @samp{combined}. It appears |
1798 with any difference region in buffer C that was obtained by combining | 1348 with any difference region in buffer C that was obtained by combining |
1799 the difference regions in buffers A and B as explained above. | 1349 the difference regions in buffers A and B as explained above. |
1800 | 1350 |
1801 In addition to the state of merge and state of difference indicators, while | 1351 In addition to state of merge and difference indicator, while merging with an |
1802 merging with an ancestor file or buffer, Ediff informs the user when the | 1352 ancestor file or buffer, Ediff informs the user when the current difference |
1803 current difference region in the (normally invisible) ancestor buffer is | 1353 region in the (normally invisible) ancestor buffer is empty via the |
1804 empty via the @emph{AncestorEmpty} indicator. This helps determine if the | 1354 @emph{AncestorEmpty} indicator. This helps determine if the changes |
1805 changes made to the original in variants A and B represent pure insertion | 1355 made to the original in variants A and B represent pure insertion or |
1806 or deletion of text: if the mode line shows @emph{AncestorEmpty} and the | 1356 deletion of text: if the mode line shows @emph{AncestorEmpty} and the |
1807 corresponding region in buffers A or B is not empty, this means that new | 1357 corresponding region in buffers A or B is not empty, this means that new |
1808 text was inserted. If this indicator is not present and the difference | 1358 text was inserted. If this indicator is not present and the difference |
1809 regions in buffers A or B are non-empty, this means that text was | 1359 regions in buffers A or B are non-empty, this means that text was |
1810 modified. Otherwise, the original text was deleted. | 1360 modified. Otherwise, the original text was deleted. |
1811 | 1361 |
1886 buffers A and B disagrees with the ancestor. To do this, set the | 1436 buffers A and B disagrees with the ancestor. To do this, set the |
1887 variable @code{ediff-show-clashes-only} to non-@code{nil}. | 1437 variable @code{ediff-show-clashes-only} to non-@code{nil}. |
1888 | 1438 |
1889 You can toggle this feature interactively by typing @kbd{$}. | 1439 You can toggle this feature interactively by typing @kbd{$}. |
1890 | 1440 |
1891 Note that this variable affects only the show next/previous difference | 1441 Note that this variable controls only how Ediff chooses the |
1892 commands. You can still jump directly to any difference region directly | 1442 next/previous difference to show. You can still jump directly to any |
1893 using the command @kbd{j} (with a prefix argument specifying the difference | 1443 difference using the command @kbd{j} (with a prefix argument specifying |
1894 number). | 1444 the difference 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. | |
1916 | 1445 |
1917 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization | 1446 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization |
1918 @section Support for Version Control | 1447 @section Support for Version Control |
1919 | 1448 |
1920 | 1449 |
2160 | 1689 |
2161 Ediff was written by Michael Kifer <kifer@@cs.sunysb.edu>. It was inspired | 1690 Ediff was written by Michael Kifer <kifer@@cs.sunysb.edu>. It was inspired |
2162 by emerge.el written by Dale R. Worley <drw@@math.mit.edu>. An idea due to | 1691 by emerge.el written by Dale R. Worley <drw@@math.mit.edu>. An idea due to |
2163 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight | 1692 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight |
2164 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de> | 1693 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de> |
2165 ported Ediff to XEmacs, Eric Freudenthal <freudent@@jan.ultra.nyu.edu> | 1694 ported Ediff to XEmacs, and Eric Freudenthal <freudent@@jan.ultra.nyu.edu> |
2166 made it work with VC, and Marc Paquette <marcpa@@cam.org> wrote the | 1695 made it work with VC. |
2167 toolbar support package for Ediff. | |
2168 | 1696 |
2169 Many people provided help with bug reports, patches, and advice. | 1697 Many people provided help with bug reports, patches, and advice. |
2170 Without them, Ediff would not be nearly as useful as it is today. | 1698 Without them, Ediff would not be nearly as useful as it is today. |
2171 Here is a full list of contributors (I hope I didn't miss anyone): | 1699 Here is a full list of contributors (I hope I didn't miss anyone): |
2172 | 1700 |
2183 Kevin Esler (esler@@ch.hp.com), Robert Estes (estes@@ece.ucdavis.edu), | 1711 Kevin Esler (esler@@ch.hp.com), Robert Estes (estes@@ece.ucdavis.edu), |
2184 Xavier Fornari (xavier@@europe.cma.fr), | 1712 Xavier Fornari (xavier@@europe.cma.fr), |
2185 Eric Freudenthal (freudent@@jan.ultra.nyu.edu), | 1713 Eric Freudenthal (freudent@@jan.ultra.nyu.edu), |
2186 Job Ganzevoort (Job.Ganzevoort@@cwi.nl), | 1714 Job Ganzevoort (Job.Ganzevoort@@cwi.nl), |
2187 Boris Goldowsky (boris@@cs.rochester.edu), | 1715 Boris Goldowsky (boris@@cs.rochester.edu), |
2188 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu), | 1716 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu), Xiaoli Huang (hxl@@epic.com), |
2189 Xiaoli Huang (hxl@@epic.com), | |
2190 Lars Magne Ingebrigtsen (larsi@@ifi.uio.no), | |
2191 Larry Gouge (larry@@itginc.com), Karl Heuer (kwzh@@gnu.ai.mit.edu), | 1717 Larry Gouge (larry@@itginc.com), Karl Heuer (kwzh@@gnu.ai.mit.edu), |
2192 (irvine@@lks.csi.com), (jaffe@@chipmunk.cita.utoronto.ca), | 1718 (irvine@@lks.csi.com), (jaffe@@chipmunk.cita.utoronto.ca), |
2193 David Karr (dkarr@@nmo.gtegsc.com), | 1719 David Karr (dkarr@@nmo.gtegsc.com), |
2194 Norbert Kiesel (norbert@@i3.informatik.rwth-aachen.de), | 1720 Norbert Kiesel (norbert@@i3.informatik.rwth-aachen.de), |
2195 Leigh L Klotz (klotz@@adoc.xerox.com), Fritz Knabe (Fritz.Knabe@@ecrc.de), | 1721 Leigh L Klotz (klotz@@adoc.xerox.com), Fritz Knabe (Fritz.Knabe@@ecrc.de), |
2196 Heinz Knutzen (hk@@informatik.uni-kiel.d400.de), | 1722 Heinz Knutzen (hk@@informatik.uni-kiel.d400.de), |
2197 Andrew Koenig (ark@@research.att.com), | 1723 Andrew Koenig (ark@@research.att.com), |
2198 Ken Laprade (laprade@@dw3f.ess.harris.com), Will C Lauer (wcl@@cadre.com), | 1724 Ken Laprade (laprade@@dw3f.ess.harris.com), Will C Lauer (wcl@@cadre.com), |
2199 Richard Levitte (levitte@@e.kth.se), Mike Long (mike.long@@analog.com), | 1725 Richard Levitte (levitte@@e.kth.se), Mike Long (mike.long@@analog.com), |
2200 Martin Maechler (maechler@@stat.math.ethz.ch), | 1726 Martin Maechler (maechler@@stat.math.ethz.ch), |
2201 Simon Marshall (Simon.Marshall@@gnu.ai.mit.edu), | 1727 Simon Marshall (Simon.Marshall@@mail.esrin.esa.it), |
2202 Richard Mlynarik (mly@@adoc.xerox.com), | 1728 Richard Mlynarik (mly@@adoc.xerox.com), |
2203 Chris Murphy (murphycm@@sun.aston.ac.uk), | 1729 Chris Murphy (murphycm@@sun.aston.ac.uk), |
2204 Erik Naggum (erik@@naggum.no), | 1730 Erik Naggum (erik@@naggum.no), |
2205 Eyvind Ness (Eyvind.Ness@@hrp.no), Ray Nickson (nickson@@cs.uq.oz.au), | 1731 Eyvind Ness (Eyvind.Ness@@hrp.no), Ray Nickson (nickson@@cs.uq.oz.au), |
2206 David Petchey (petchey_david@@jpmorgan.com), | 1732 David Petchey (petchey_david@@jpmorgan.com), |
2211 C.S. Roberson (roberson@@aur.alcatel.com), | 1737 C.S. Roberson (roberson@@aur.alcatel.com), |
2212 Kevin Rodgers (kevin.rodgers@@ihs.com), | 1738 Kevin Rodgers (kevin.rodgers@@ihs.com), |
2213 Sandy Rutherford (sandy@@ibm550.sissa.it), | 1739 Sandy Rutherford (sandy@@ibm550.sissa.it), |
2214 Heribert Schuetz (schuetz@@ecrc.de), Andy Scott (ascott@@pcocd2.intel.com), | 1740 Heribert Schuetz (schuetz@@ecrc.de), Andy Scott (ascott@@pcocd2.intel.com), |
2215 Axel Seibert (axel@@tumbolia.ppp.informatik.uni-muenchen.de), | 1741 Axel Seibert (axel@@tumbolia.ppp.informatik.uni-muenchen.de), |
2216 Scott O. Sherman (Scott.Sherman@@mci.com), | |
2217 Richard Stallman (rms@@gnu.ai.mit.edu), | 1742 Richard Stallman (rms@@gnu.ai.mit.edu), |
2218 Richard Stanton (stanton@@haas.berkeley.edu), | 1743 Richard Stanton (stanton@@haas.berkeley.edu), |
2219 Ake Stenhoff (etxaksf@@aom.ericsson.se), Stig (stig@@hackvan.com), | 1744 Ake Stenhoff (etxaksf@@aom.ericsson.se), Stig (stig@@hackvan.com), |
2220 Peter Stout (Peter_Stout@@cs.cmu.edu), Chuck Thompson (cthomp@@cs.uiuc.edu), | 1745 Peter Stout (Peter_Stout@@cs.cmu.edu), Chuck Thompson (cthomp@@cs.uiuc.edu), |
2221 Ray Tomlinson (tomlinso@@bbn.com), | 1746 Ray Tomlinson (tomlinso@@bbn.com), |
2222 Raymond Toy (toy@@rtp.ericsson.se), | 1747 Raymond Toy (toy@@rtp.ericsson.se), |
2223 Philippe Waroquiers (philippe.waroquiers@@eurocontrol.be), | |
2224 Ben Wing (wing@@666.com), | 1748 Ben Wing (wing@@666.com), |
2225 Ilya Zakharevich (ilya@@math.ohio-state.edu), | 1749 Ilya Zakharevich (ilya@@math.ohio-state.edu), |
2226 Eli Zaretskii (eliz@@is.elta.co.il) | 1750 Eli Zaretskii (eliz@@is.elta.co.il) |
2227 @end example | 1751 @end example |
2228 | 1752 |