0
|
1 \input texinfo @c -*-texinfo-*-
|
|
2 @c documentation for Ediff
|
|
3 @c Written by Michael Kifer
|
|
4
|
|
5 @comment %**start of header (This is for running Texinfo on a region.)
|
|
6
|
|
7 @comment Using ediff.info instead of ediff in setfilename breaks DOS.
|
12
|
8 @setfilename ediff
|
0
|
9 @comment @setfilename ediff.info
|
|
10
|
|
11 @settitle Ediff User's Manual
|
|
12 @synindex vr cp
|
|
13 @synindex fn cp
|
|
14 @synindex pg cp
|
|
15 @iftex
|
|
16 @finalout
|
|
17 @end iftex
|
|
18 @c @smallbook
|
|
19 @comment %**end of header (This is for running Texinfo on a region.)
|
|
20
|
|
21 @ifinfo
|
|
22 This file documents Ediff, a comprehensive visual interface to Unix diff
|
|
23 and patch utilities.
|
|
24
|
|
25 Permission is granted to make and distribute verbatim copies of this
|
|
26 manual provided the copyright notice and this permission notice are
|
|
27 preserved on all copies.
|
|
28
|
|
29 @ignore
|
|
30 Permission is granted to process this file through TeX and print the
|
|
31 results, provided the printed document carries copying permission notice
|
|
32 identical to this one except for the removal of this paragraph (this
|
|
33 paragraph not being relevant to the printed manual).
|
|
34
|
|
35 @end ignore
|
|
36 @end ifinfo
|
|
37
|
|
38 @iftex
|
|
39 @titlepage
|
|
40 @title Ediff User's Manual
|
|
41 @sp 4
|
12
|
42 @subtitle Ediff version 2.62
|
0
|
43 @sp 1
|
12
|
44 @subtitle July 1996
|
0
|
45 @sp 5
|
|
46 @author Michael Kifer
|
|
47 @page
|
|
48
|
|
49 @vskip 0pt plus 1filll
|
|
50 @noindent
|
|
51 Copyright @copyright{} 1995, 1996 Free Software Foundation, Inc.
|
|
52
|
|
53 Permission is granted to make and distribute verbatim copies of
|
|
54 this manual provided the copyright notice and this permission notice
|
|
55 are preserved on all copies.
|
|
56 @end titlepage
|
|
57 @page
|
|
58 @end iftex
|
|
59
|
|
60 @node Top, Introduction, (dir), (dir)
|
|
61
|
|
62 @menu
|
|
63 * Introduction:: About Ediff.
|
|
64 * Major Entry Points:: How to use Ediff.
|
12
|
65 * Session Commands:: Ediff commands used within a session.
|
0
|
66 * Registry of Ediff Sessions:: Keeping track of multiple Ediff sessions.
|
|
67 * Session Groups:: Comparing and merging directories.
|
|
68 * Remote and Compressed Files:: You may want to know about this.
|
|
69 * Customization:: How to make Ediff work the way YOU want.
|
|
70 * Credits:: Thanks to those who helped.
|
|
71 * Index::
|
|
72 @end menu
|
|
73
|
|
74 @node Introduction, Major Entry Points, Top, Top
|
|
75 @chapter Introduction
|
|
76
|
|
77 @cindex Comparing files and buffers
|
|
78 @cindex Merging files and buffers
|
|
79 @cindex Patching files and buffers
|
|
80 @cindex Finding differences
|
|
81
|
|
82 Ediff provides a convenient way for simultaneous browsing through
|
12
|
83 the differences between a pair (or a triple) of files or buffers
|
|
84 (which are called @samp{variants} for our purposes). The
|
0
|
85 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
|
|
87 separate frames), and the differences are highlighted as you step
|
|
88 through them. You can also copy difference regions from one buffer to
|
|
89 another (and recover old differences if you change your mind).
|
|
90
|
|
91 Another powerful feature is the ability to merge a pair of files into a
|
|
92 third buffer. Merging with an ancestor file is also supported.
|
|
93 Furthermore, Ediff is equipped with directory-level capabilities that
|
|
94 allow the user to conveniently launch browsing or merging sessions on
|
|
95 groups of files in two (or three) different directories.
|
|
96
|
|
97 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,
|
|
99 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
|
12
|
101 Ediff lets you copy differences between variants, you can, in effect, apply
|
0
|
102 patches selectively (i.e., you can copy a difference region from
|
12
|
103 @file{file.orig} to @file{file}, thereby undoing any particular patch that
|
0
|
104 you don't like).
|
|
105
|
|
106 Ediff even understands multi-file patches and can apply them interactively!
|
12
|
107 (Ediff can recognize multi-file patches only if they are in the context
|
|
108 format or GNU unified format. All other patches are treated as 1-file
|
|
109 patches. Ediff is [hopefully] using the same algorithm as @file{patch} to
|
|
110 determine which files need to be patched.)
|
0
|
111
|
|
112 Ediff is aware of version control, which lets you compare
|
|
113 files with their older versions. Ediff also works with remote and
|
|
114 compressed files, automatically ftp'ing them over and uncompressing them.
|
|
115 @xref{Remote and Compressed Files}, for details.
|
|
116
|
12
|
117 This package builds upon ideas borrowed from Emerge and several Ediff's
|
|
118 functions are adaptations from Emerge. Although Ediff subsumes and greatly
|
|
119 extends Emerge, much of the functionality in Ediff is influenced by Emerge.
|
0
|
120 The architecture and the interface are, of course, drastically different.
|
|
121
|
12
|
122 @node Major Entry Points, Session Commands, Introduction, Top
|
0
|
123 @chapter Major Entry Points
|
|
124
|
|
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,
|
|
127 all Ediff's entry points belong to three submenus of the Tools menu:
|
|
128 Compare, Merge, and Apply Patch.
|
|
129
|
|
130 @table @code
|
|
131 @item ediff-files
|
|
132 @itemx ediff
|
|
133 @findex ediff-files
|
|
134 @findex ediff
|
|
135 Compare two files.
|
|
136
|
|
137 @item ediff-buffers
|
|
138 @findex ediff-buffers
|
|
139 Compare two buffers.
|
|
140
|
|
141 @item ediff-files3
|
|
142 @itemx ediff3
|
|
143 @findex ediff-files3
|
|
144 @findex ediff3
|
|
145 Compare three files.
|
|
146
|
|
147 @item ediff-buffers3
|
|
148 @findex ediff-buffers3
|
|
149 Compare three buffers.
|
|
150
|
|
151 @item edirs
|
|
152 @itemx ediff-directories
|
|
153 @findex edirs
|
|
154 @findex ediff-directories
|
|
155 Compare files common to two directories.
|
|
156 @item edirs3
|
|
157 @itemx ediff-directories3
|
|
158 @findex edirs3
|
|
159 @findex ediff-directories3
|
|
160 Compare files common to three directories.
|
|
161 @item edir-revisions
|
|
162 @itemx ediff-directory-revisions
|
|
163 @findex ediff-directory-revisions
|
|
164 @findex edir-revisions
|
|
165 Compare versions of files in a given directory. Ediff selects only the
|
|
166 files that are under version control.
|
|
167 @item edir-merge-revisions
|
|
168 @itemx ediff-merge-directory-revisions
|
|
169 @findex edir-merge-revisions
|
|
170 @findex ediff-merge-directory-revisions
|
|
171 Merge versions of files in a given directory. Ediff selects only the
|
|
172 files that are under version control.
|
|
173 @item edir-merge-revisions-with-ancestor
|
|
174 @itemx ediff-merge-directory-revisions-with-ancestor
|
|
175 @findex edir-merge-revisions-with-ancestor
|
|
176 @findex ediff-merge-directory-revisions-with-ancestor
|
|
177 Merge versions of files in a given directory using other versions as
|
|
178 ancestors. Ediff selects only the files that are under version control.
|
|
179
|
|
180 @item ediff-windows-wordwise
|
|
181 @findex ediff-windows-wordwise
|
|
182 Compare windows word-by-word.
|
|
183
|
|
184 @item ediff-windows-linewise
|
|
185 @findex ediff-windows-linewise
|
|
186 Compare windows line-by-line.
|
|
187
|
|
188 @item ediff-regions-wordwise
|
|
189 @findex ediff-regions-wordwise
|
|
190 Compare regions word-by-word.
|
|
191
|
|
192 @item ediff-regions-linewise
|
|
193 @findex ediff-regions-linewise
|
|
194 Compare regions line-by-line.
|
|
195
|
|
196 @item ediff-revision
|
|
197 @findex ediff-revision
|
|
198 Compare versions of the current buffer, if the buffer is visiting
|
|
199 a file under version control.
|
|
200
|
|
201 @item ediff-patch-file
|
|
202 @itemx epatch
|
|
203 @findex ediff-patch-file
|
|
204 @findex epatch
|
|
205 Patch a file, then compare.
|
|
206 @item ediff-patch-buffer
|
|
207 @itemx epatch-buffer
|
|
208 @findex ediff-patch-buffer
|
|
209 Patch a buffer, then compare.
|
|
210
|
|
211 @item ediff-merge-files
|
|
212 @itemx ediff-merge
|
|
213 @findex ediff-merge-files
|
|
214 @findex ediff-merge
|
|
215 Merge two files.
|
|
216
|
|
217 @item ediff-merge-files-with-ancestor
|
|
218 @itemx ediff-merge-with-ancestor
|
|
219 @findex ediff-merge-files-with-ancestor
|
|
220 @findex ediff-merge-with-ancestor
|
|
221 Like @code{ediff-merge}, but with a third ancestor file.
|
|
222
|
|
223 @item ediff-merge-buffers
|
|
224 @findex ediff-merge-buffers
|
|
225 Merge two buffers.
|
|
226
|
|
227 @item ediff-merge-buffers-with-ancestor
|
|
228 @findex ediff-merge-buffers-with-ancestor
|
|
229 Same but with ancestor.
|
|
230
|
|
231
|
|
232 @item edirs-merge
|
|
233 @itemx ediff-merge-directories
|
|
234 @findex edirs-merge
|
|
235 @findex ediff-merge-directories
|
|
236 Merge files common to two directories.
|
|
237 @item edirs-merge-with-ancestor
|
|
238 @itemx ediff-merge-directories-with-ancestor
|
|
239 @findex edirs-merge-with-ancestor
|
|
240 @findex ediff-merge-directories-with-ancestor
|
|
241 Same but using files in a third directory as ancestors.
|
12
|
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.
|
0
|
244
|
|
245 @item ediff-merge-revisions
|
|
246 @findex ediff-merge-revisions
|
|
247 Merge two versions of the file visited by the current buffer.
|
|
248
|
|
249 @item ediff-merge-revisions-with-ancestor
|
|
250 @findex ediff-merge-revisions-with-ancestor
|
|
251 Same but with ancestor.
|
12
|
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.
|
0
|
261 @end table
|
|
262
|
|
263 @noindent
|
|
264 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:
|
|
266
|
|
267 @example
|
|
268 (require 'ediff)
|
|
269 @end example
|
|
270
|
|
271 @noindent
|
|
272 Otherwise, Ediff will be loaded automatically when you use one of the
|
|
273 above functions, either directly or through the menus.
|
|
274
|
12
|
275 When the above functions are invoked, the user is prompted for all the
|
|
276 necessary information---typically the files or buffers to compare, merge, or
|
0
|
277 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
|
|
279 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
|
|
281 @code{ediff-use-last-dir} is not @code{nil}, Ediff will offer
|
|
282 previously entered directories as defaults (which will be maintained
|
|
283 separately for each type of file, A, B, or C).
|
|
284 @vindex @code{ediff-use-last-dir}
|
|
285
|
12
|
286 All the above functions use the POSIX @code{diff} or @code{diff3} programs
|
|
287 to find differences between two files. They process the @code{diff} output
|
|
288 and display it in a convenient form. At present, Ediff understands only
|
|
289 the 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
|
|
291 the VMS version of @code{diff}.
|
0
|
292
|
|
293 The functions @code{ediff-files}, @code{ediff-buffers},
|
|
294 @code{ediff-files3}, @code{ediff-buffers3} first display the coarse,
|
12
|
295 line-based difference regions, as reported by the @file{diff} program. The
|
|
296 total number of difference regions and the current difference number are
|
|
297 always displayed in the mode line of the control window.
|
|
298
|
|
299 Since @code{diff} may report fairly large chunks of text as being different,
|
0
|
300 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
|
|
302 regions to indicate which exact words differ. If the only difference is
|
|
303 in the white space and line breaks, Ediff says so.
|
|
304
|
|
305 On a color display, fine differences are highlighted with color; on a
|
|
306 monochrome display, they are underlined. @xref{Highlighting Difference
|
|
307 Regions}, for information on how to customize this.
|
|
308
|
|
309 The functions @code{ediff-windows-wordwise},
|
|
310 @code{ediff-windows-linewise}, @code{ediff-regions-wordwise} and
|
|
311 @code{ediff-regions-linewise} do comparison on parts of existing Emacs
|
|
312 buffers. Since @code{ediff-windows-wordwise} and
|
|
313 @code{ediff-regions-wordwise} are intended for relatively small segments
|
|
314 of buffers, comparison is done on the basis of words rather than lines.
|
|
315 No refinement is necessary in this case. These commands are recommended
|
|
316 only for relatively small regions (perhaps, up to 100 lines), because
|
|
317 these functions have a relatively slow startup.
|
|
318
|
|
319 To compare large regions, use @code{ediff-regions-linewise}. This
|
|
320 command displays differences much like @code{ediff-files} and
|
|
321 @code{ediff-buffers}.
|
|
322
|
|
323 The functions @code{ediff-patch-file} and @code{ediff-patch-buffer} apply a
|
|
324 patch to a file or a buffer and then run Ediff on these buffers, displaying
|
|
325 the difference regions.
|
|
326
|
|
327 The entry points @code{ediff-directories}, @code{ediff-merge-directories},
|
|
328 etc., provide a convenient interface for comparing and merging files in
|
|
329 different directories. The user is presented with Dired-like interface from
|
|
330 which one can run a group of related Ediff sessions.
|
|
331
|
|
332 For files under version control, @code{ediff-revisions} lets you compare
|
|
333 the file visited by the current buffer to one of its checked-in versions.
|
|
334 You can also compare two checked-in versions of the visited file.
|
|
335 Moreover, the functions @code{ediff-directory-revisions},
|
|
336 @code{ediff-merge-directory-revisions}, etc., let you run a group of
|
|
337 related Ediff sessions by taking a directory and comparing (or merging)
|
|
338 versions of files in that directory.
|
|
339
|
12
|
340 @node Session Commands, Registry of Ediff Sessions, Major Entry Points, Top
|
|
341 @chapter Session Commands
|
0
|
342
|
12
|
343 All Ediff commands are displayed in a Quick Help window, unless you type
|
|
344 @kbd{?} to shrink the window to just one line. You can redisplay the help
|
|
345 window by typing @kbd{?} again. The Quick Help commands are detailed below.
|
0
|
346
|
|
347 Many Ediff commands take numeric prefix arguments. For instance, if you
|
12
|
348 type a number, say 3, and then @kbd{j} (@code{ediff-jump-to-difference}),
|
|
349 Ediff 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
|
|
351 to variant B. Likewise, 4 followed by @kbd{ra} restores the 4th difference
|
|
352 region in buffer A (if it was previously written over via the command
|
|
353 @kbd{a}).
|
|
354
|
|
355 Some commands take negative prefix arguments as well. For instance, typing
|
|
356 @kbd{-} and then @kbd{j} will make the last difference region
|
|
357 current. Typing @kbd{-2} then @kbd{j} makes the penultimate difference
|
|
358 region current, etc.
|
|
359
|
|
360 Without the prefix argument, all commands operate on the currently
|
|
361 selected difference region. You can make any difference region
|
|
362 current using the various commands explained below.
|
|
363
|
|
364 For some commands, the actual value of the prefix argument is
|
|
365 immaterial. However, if supplied, the prefix argument may modify the
|
|
366 command (see @kbd{ga}, @kbd{gb}, and @kbd{gc}).
|
|
367
|
|
368 @menu
|
|
369 * Quick Help Commands:: Frequently used commands.
|
|
370 * Other Session Commands:: Commands that are not bound to keys.
|
|
371 @end menu
|
|
372
|
|
373 @node Quick Help Commands,Other Session Commands,,Session Commands
|
|
374 @section Quick Help Commands
|
|
375
|
|
376 @table @kbd
|
|
377 @item ?
|
|
378 Toggles the Ediff Quick Help window ON and OFF.
|
|
379 @item G
|
|
380 Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer.
|
|
381
|
|
382 @item E
|
|
383 Brings up the top node of this manual, where you can find further
|
|
384 information on the various Ediff functions and advanced issues, such as
|
|
385 customization, session groups, etc.
|
0
|
386
|
12
|
387 @item v
|
|
388 Scrolls up buffers A and B (and buffer C where appropriate) in a
|
|
389 coordinated fashion.
|
|
390 @item V
|
|
391 Scrolls the buffers down.
|
|
392
|
|
393 @item <
|
|
394 Scrolls the buffers to the left simultaneously.
|
|
395 @item >
|
|
396 Scrolls buffers to the right.
|
|
397
|
|
398 @item wd
|
|
399 Saves the output from the diff utility, for further reference.
|
|
400
|
|
401 With prefix argument, saves the plain output from @file{diff} (see
|
|
402 @code{ediff-diff-program} and @code{ediff-diff-options}). Without the
|
|
403 argument, it saves customized @file{diff} output (see
|
|
404 @code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}), if
|
|
405 it is available.
|
0
|
406
|
12
|
407 @item wa
|
|
408 Saves buffer A, if it was modified.
|
|
409 @item wb
|
|
410 Saves buffer B, if it was modified.
|
|
411 @item wc
|
|
412 Saves buffer C, if it was modified (if you are in a session that
|
|
413 compares three files simultaneously).
|
|
414
|
|
415 @item a
|
|
416 @emph{In comparison sessions:}
|
|
417 Copies the current difference region (or the region specified as the prefix
|
|
418 to this command) from buffer A to buffer B.
|
|
419 Ediff saves the old contents of buffer B's region; it can
|
|
420 be restored via the command @kbd{rb}, which see.
|
|
421
|
|
422 @emph{In merge sessions:}
|
|
423 Copies the current difference region (or the region specified as the prefix
|
|
424 to this command) from buffer A to the merge buffer. The old contents of
|
|
425 this region in buffer C can be restored via the command @kbd{r}.
|
|
426
|
|
427 @item b
|
|
428 Works similarly, but copies the current difference region from buffer B to
|
|
429 buffer A (in @emph{comparison sessions}) or the merge buffer (in
|
|
430 @emph{merge sessions}).
|
|
431
|
|
432 Ediff saves the old contents of the difference region copied over; it can
|
|
433 be reinstated via the command @kbd{ra} in comparison sessions and
|
|
434 @kbd{r} in merge sessions.
|
0
|
435
|
12
|
436 @item ab
|
|
437 Copies the current difference region (or the region specified as the prefix
|
|
438 to this command) from buffer A to buffer B. This (and the next five)
|
|
439 command is enabled only in sessions that compare three files
|
|
440 simultaneously. The old region in buffer B is saved and can be restored
|
|
441 via the command @kbd{rb}.
|
|
442 @item ac
|
|
443 Copies the difference region from buffer A to buffer C.
|
|
444 The old region in buffer C is saved and can be restored via the command
|
|
445 @kbd{rc}.
|
|
446 @item ba
|
|
447 Copies the difference region from buffer B to buffer A.
|
|
448 The old region in buffer A is saved and can be restored via the command
|
|
449 @kbd{ra}.
|
|
450 @item bc
|
|
451 Copies the difference region from buffer B to buffer C.
|
|
452 The command @kbd{rc} undoes this.
|
|
453 @item ca
|
|
454 Copies the difference region from buffer C to buffer A.
|
|
455 The command @kbd{ra} undoes this.
|
|
456 @item cb
|
|
457 Copies the difference region from buffer C to buffer B.
|
|
458 The command @kbd{rb} undoes this.
|
|
459
|
|
460 @item p
|
|
461 @itemx DEL
|
|
462 Makes the previous difference region current.
|
|
463 @item n
|
|
464 @itemx SPC
|
|
465 Makes the next difference region current.
|
|
466
|
|
467 @item j
|
|
468 @itemx -j
|
|
469 @itemx Nj
|
|
470 Makes the very first difference region current.
|
|
471
|
|
472 @kbd{-j} makes the last region current. Typing a number, N, and then `j'
|
|
473 makes the difference region N current. Typing -N (a negative number) then
|
|
474 `j' makes current the region Last - N.
|
|
475
|
|
476 @item ga
|
|
477 Makes current the difference region closest to the position of the point in
|
|
478 buffer A.
|
|
479
|
|
480 However, with a prefix argument, Ediff would position all variants
|
|
481 around the area indicated by the current point in buffer A: if
|
|
482 the point is inside a difference region, then the variants will be
|
|
483 positioned at this difference region. If the point is not in any difference
|
|
484 region, then it is in an area where all variants agree with each other. In
|
|
485 this case, the variants will be positioned so that each would display this
|
|
486 area (of agreement).
|
|
487 @item gb
|
|
488 Makes current the difference region closest to the position of the point in
|
|
489 buffer B.
|
|
490
|
|
491 With a prefix argument, behaves like @kbd{ga}, but with respect to buffer B.
|
|
492 @item gc
|
|
493 @emph{In merge sessions:}
|
|
494 makes current the difference region closest to the point in the merge buffer.
|
0
|
495
|
12
|
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.
|
0
|
522
|
12
|
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.
|
0
|
538
|
12
|
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.
|
0
|
555
|
12
|
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.
|
0
|
600
|
12
|
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.
|
0
|
626
|
12
|
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.
|
0
|
643
|
12
|
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.
|
0
|
661
|
12
|
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.
|
0
|
685
|
12
|
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.
|
0
|
711
|
12
|
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.
|
0
|
740
|
12
|
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).
|
0
|
755
|
12
|
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.
|
0
|
771
|
|
772 @table @code
|
|
773 @item eregistry
|
|
774 @itemx ediff-show-registry
|
|
775 @findex eregistry
|
|
776 @findex ediff-show-registry
|
|
777 This command brings up the registry of active Ediff sessions. Ediff
|
12
|
778 registry is a device that can be used to resume any active Ediff session
|
|
779 (which may have been postponed because the user switched to some other
|
|
780 activity). This command is also useful for switching between multiple
|
|
781 active Ediff sessions that are run at the same time. The function
|
|
782 @code{eregistry} is an alias for @code{ediff-show-registry}.
|
|
783 @xref{Registry of Ediff Sessions}, for more information on this registry.
|
|
784
|
0
|
785 @item ediff-toggle-multiframe
|
|
786 @findex ediff-toggle-multiframe
|
|
787 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
|
12
|
789 share the same frame), and vice versa. See
|
|
790 @code{ediff-window-setup-function} for details on how to make either of
|
|
791 these modes the default one.
|
|
792
|
14
|
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.
|
12
|
796 @item ediff-toggle-use-toolbar
|
|
797 @findex ediff-toggle-use-toolbar
|
16
|
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.
|
12
|
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
|
0
|
811 @item ediff-revert-buffers-then-recompute-diffs
|
|
812 @findex ediff-revert-buffers-then-recompute-diffs
|
|
813 This command reverts the buffers you are comparing and recomputes their
|
|
814 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
|
|
816 compared but want to discard any changes to comparison buffers that were
|
|
817 done since then.
|
|
818
|
|
819 This command normally asks for confirmation before reverting files.
|
|
820 With a prefix argument, it reverts files without asking.
|
|
821
|
|
822
|
|
823 @item ediff-profile
|
|
824 @findex ediff-profile
|
|
825 Ediff has an admittedly primitive (but useful) facility for profiling
|
|
826 Ediff's commands. It is meant for Ediff maintenance---specifically, for
|
|
827 making it run faster. The function @code{ediff-profile} toggles
|
|
828 profiling of ediff commands.
|
|
829 @end table
|
|
830
|
12
|
831 @node Registry of Ediff Sessions, Session Groups, Session Commands, Top
|
0
|
832 @chapter Registry of Ediff Sessions
|
|
833
|
|
834 Ediff maintains a registry of all its invocations that are
|
|
835 still @emph{active}. This feature is very convenient for switching among
|
|
836 active Ediff sessions or for quickly restarting a suspended Ediff session.
|
|
837
|
|
838 The focal point of this activity is a buffer
|
|
839 called @emph{*Ediff Registry*}. You can display this buffer by typing
|
|
840 @kbd{R} in any Ediff Control Buffer or Session Group Buffer
|
|
841 (@pxref{Session Groups}), or by typing
|
|
842 @kbd{M-x eregistry} into the Minibuffer.
|
|
843 The latter would be the fastest way to bring up the registry
|
|
844 buffer if no control or group buffer is displayed in any of the visible
|
|
845 Emacs windows.
|
|
846 If you are in a habit of running multiple long Ediff sessions and often need to
|
|
847 suspend, resume, or switch between them, it may be a good idea to have the
|
|
848 registry buffer permanently displayed in a separate, dedicated window.
|
|
849
|
|
850 The registry buffer has several convenient key bindings.
|
|
851 For instance, clicking mouse button 2 or typing
|
|
852 @kbd{RET} or @kbd{v} over any session record resumes that session.
|
|
853 Session records in the registry buffer provide a fairly complete
|
|
854 description of each session, so it is usually easy to identify the right
|
|
855 session to resume.
|
|
856
|
|
857 Other useful commands are bound to @kbd{SPC} (next registry record)
|
|
858 and @kbd{DEL} (previous registry record). There are other commands as well,
|
|
859 but you don't need to memorize them, since they are listed at the top of
|
|
860 the registry buffer.
|
|
861
|
|
862 @node Session Groups, Remote and Compressed Files, Registry of Ediff Sessions, Top
|
|
863 @chapter Session Groups
|
|
864
|
|
865 Several major entries of Ediff perform comparison and merging on
|
|
866 directories. On entering @code{ediff-directories},
|
|
867 @code{ediff-directories3},
|
|
868 @code{ediff-merge-directories},
|
|
869 @code{ediff-merge-directories-with-ancestor},
|
|
870 @code{ediff-directory-revisions},
|
|
871 @code{ediff-merge-directory-revisions}, or
|
|
872 @code{ediff-merge-directory-revisions-with-ancestor},
|
|
873 the user is presented with a
|
|
874 Dired-like buffer that lists files common to the directories involved along
|
|
875 with their sizes. (The list of common files can be further filtered through
|
|
876 a regular expression, which the user is prompted for.) We call this buffer
|
|
877 @emph{Session Group Panel} because all Ediff sessions associated with the
|
|
878 listed files will have this buffer as a common focal point.
|
|
879
|
|
880 Clicking button 2 or typing @kbd{RET} or @kbd{v} over a
|
|
881 record describing files invokes Ediff in the appropriate mode on these
|
|
882 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
|
|
884 that invocation.
|
|
885
|
|
886 Many commands are available in the session group buffer; some are
|
12
|
887 applicable only to certain types of work. The relevant commands are always
|
0
|
888 listed at the top of each session group buffer, so there is no need to
|
|
889 memorize them.
|
|
890
|
|
891 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
|
|
893 separate buffer and are conveniently displayed by typing @kbd{D} to the
|
|
894 corresponding session group panel. Thus, as an added benefit, Ediff can be
|
|
895 used to compare the contents of up to three directories.
|
|
896
|
|
897 Session records in session group panels are also marked with @kbd{+}, for
|
|
898 active sessions, and with @kbd{-}, for finished sessions.
|
|
899
|
|
900 Sometimes, it is convenient to exclude certain session records from a group.
|
|
901 Usually this happens when the user doesn't intend to run Ediff of certain
|
|
902 files in the group, and the corresponding session records just add clutter
|
|
903 to the session group buffer. To help alleviate this problem, the user can
|
|
904 type @kbd{h} to mark a session as a candidate for exclusion and @kbd{x} to
|
|
905 actually hide the marked sessions. There actions are reversible: with a
|
|
906 prefix argument, @kbd{h} unmarks the session under the cursor, and @kbd{x}
|
|
907 brings the hidden sessions into the view (@kbd{x} doesn't unmark them,
|
|
908 though, so the user has to explicitly unmark the sessions of interest).
|
|
909
|
|
910 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,
|
|
912 the only such group-level operation is the creation of a multi-file patch.
|
|
913
|
12
|
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
|
0
|
932 @cindex Multi-file patches
|
|
933 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
|
|
935 multi-file patch in just one run). In a session group buffer created in
|
|
936 response to @code{ediff-directories} or @code{ediff-directory-revisions},
|
|
937 the user can type @kbd{P} to create a multi-file patch of marked sessions
|
|
938 (which must be marked using the @kbd{m} command). Ediff then will display
|
|
939 a buffer containing the patch. In an @code{ediff-directories} session, it
|
|
940 is enough to just mark the requisite sessions. In
|
|
941 @code{ediff-directory-revisions} revisions, the marked sessions must also
|
|
942 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
|
|
944 output, and it is easier to handle by running Ediff on the inactive
|
|
945 sessions.
|
|
946
|
12
|
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
|
0
|
952
|
|
953 @node Remote and Compressed Files, Customization, Session Groups, Top
|
|
954 @chapter Remote and Compressed Files
|
|
955
|
|
956 Ediff works with remote, compressed, and encrypted files. Ediff
|
|
957 supports @file{ange-ftp.el}, @file{jka-compr.el}, @file{uncompress.el}
|
|
958 and @file{crypt++.el}, but it may work with other similar packages as
|
|
959 well. This means that you can compare files residing on another
|
|
960 machine, or you can apply a patch to a file on another machine. Even
|
|
961 the patch itself can be a remote file!
|
|
962
|
|
963 When patching compressed or remote files, Ediff does not rename the source
|
|
964 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
|
|
966 in a temporary file that has the suffix @file{_patched} attached.
|
|
967 Generally, this applies to files that are handled using black magic, such
|
|
968 as special file handlers (ange-ftp and some compression and encryption
|
12
|
969 packages also use this method).
|
0
|
970
|
|
971 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
|
12
|
973 of the patch is placed into the file source-name (@file{_orig} is used
|
0
|
974 on systems like VMS, DOS, etc.)
|
|
975
|
|
976 @node Customization, Credits, Remote and Compressed Files, Top
|
|
977 @chapter Customization
|
|
978
|
|
979 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
|
12
|
981 extensive facilities for changing the default behavior.
|
0
|
982
|
|
983 Most of the customization can be done by setting various variables in the
|
|
984 @file{.emacs} file. Some customization (mostly window-related
|
|
985 customization and faces) can be done by putting appropriate lines in
|
|
986 @file{.Xdefaults}, @file{.xrdb}, or whatever X resource file is in use.
|
|
987
|
|
988 With respect to the latter, please note that the X resource
|
|
989 for Ediff customization is `Ediff', @emph{not} `emacs'.
|
|
990 @xref{Window and Frame Configuration},
|
|
991 @xref{Highlighting Difference Regions}, for further details. Please also
|
|
992 refer to Emacs manual for the information on how to set Emacs X resources.
|
|
993
|
|
994 @menu
|
|
995 * Hooks:: Customization via the hooks.
|
12
|
996 * Quick Help Customization:: How to customize Ediff's quick help feature.
|
0
|
997 * Window and Frame Configuration:: Controlling the way Ediff displays things.
|
|
998 * Selective Browsing:: Advanced browsing through difference regions.
|
|
999 * Highlighting Difference Regions:: Controlling highlighting.
|
|
1000 * Narrowing:: Comparing regions, windows, etc.
|
|
1001 * Refinement of Difference Regions:: How to control the refinement process.
|
|
1002 * Patch and Diff Programs:: Changing the utilities that compute differences
|
|
1003 and apply patches.
|
|
1004 * Merging and diff3:: How to customize Ediff in its Merge Mode.
|
|
1005 * Support for Version Control:: Changing the version control package.
|
|
1006 You are not likely to do that.
|
|
1007 * Customizing the Mode Line:: Changing the look of the mode line in Ediff.
|
|
1008 * Miscellaneous:: Other customization.
|
|
1009 * Notes on Heavy-duty Customization:: Customization for the gurus.
|
|
1010 @end menu
|
|
1011
|
12
|
1012 @node Hooks, Quick Help Customization, Customization, Customization
|
0
|
1013 @section Hooks
|
|
1014
|
|
1015 The bulk of customization can be done via the following hooks:
|
|
1016
|
|
1017 @table @code
|
|
1018 @item ediff-load-hook
|
|
1019 @vindex ediff-load-hook
|
|
1020 This hook can be used to change defaults after Ediff is loaded.
|
|
1021
|
|
1022 @item ediff-keymap-setup-hook
|
|
1023 @vindex ediff-keymap-setup-hook
|
12
|
1024 @vindex ediff-mode-map
|
|
1025 This hook can be used to alter bindings in Ediff's keymap,
|
|
1026 @code{ediff-mode-map}. These hooks are
|
0
|
1027 run right after the default bindings are set but before
|
|
1028 @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
|
|
1030 of Ediff.
|
|
1031
|
|
1032 @item ediff-before-setup-windows-hook
|
|
1033 @itemx ediff-after-setup-windows-hook
|
|
1034 @vindex ediff-before-setup-windows-hook
|
|
1035 @vindex ediff-after-setup-windows-hook
|
|
1036 These two hooks are called before and after Ediff sets up its window
|
|
1037 configuration. Can be used to save the configuration that existed
|
|
1038 before Ediff starts or for whatever other purposes.
|
|
1039
|
|
1040 @item ediff-suspend-hook
|
|
1041 @itemx ediff-quit-hook
|
|
1042 @vindex ediff-suspend-hook
|
|
1043 @vindex ediff-quit-hook
|
|
1044 These two hooks are run when you suspend or quit Ediff. They can be
|
|
1045 used to set desired window configurations, delete files Ediff didn't
|
|
1046 want to clean up after exiting, etc.
|
|
1047
|
|
1048 By default, @code{ediff-quit-hook} holds one hook function,
|
|
1049 @code{ediff-cleanup-mess}, which cleans after Ediff, as appropriate in
|
|
1050 most cases. You probably won't want to change it, but you might
|
|
1051 want to add other hook functions.
|
|
1052
|
|
1053 Keep in mind that hooks executing before @code{ediff-cleanup-mess} start
|
|
1054 in @code{ediff-control-buffer;} they should also leave
|
|
1055 @code{ediff-control-buffer} as the current buffer when they finish.
|
|
1056 Hooks that are executed after @code{ediff-cleanup-mess} should expect
|
|
1057 the current buffer be either buffer A or buffer B.
|
|
1058 @code{ediff-cleanup-mess} doesn't kill the buffers being compared or
|
|
1059 merged (see @code{ediff-cleanup-hook}, below).
|
|
1060
|
|
1061 @item ediff-cleanup-hook
|
|
1062 @vindex ediff-cleanup-hook
|
|
1063 This hook is run just before @code{ediff-quit-hook}. This is a good
|
|
1064 place to do various cleanups, such as deleting the variant buffers.
|
|
1065 Ediff provides a function, @code{ediff-janitor}, as one such possible
|
|
1066 hook, which you can add to @code{ediff-cleanup-hook} with
|
|
1067 @code{add-hooks}.
|
|
1068
|
|
1069 @findex ediff-janitor
|
|
1070 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
|
|
1072 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
|
|
1074 delete this buffer in another session as well.
|
|
1075
|
12
|
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
|
0
|
1085 @item ediff-before-setup-control-frame-hook
|
|
1086 @itemx ediff-after-setup-control-frame-hook
|
|
1087 @vindex ediff-before-setup-control-frame-hook
|
|
1088 @vindex ediff-after-setup-control-frame-hook
|
|
1089 These two hooks run before and after Ediff sets up the control frame.
|
|
1090 They can be used to relocate Ediff control frame when Ediff runs in a
|
|
1091 multiframe mode (i.e., when the control buffer is in its own dedicated
|
|
1092 frame). Be aware that many variables that drive Ediff are local to
|
|
1093 Ediff Control Panel (@code{ediff-control-buffer}), which requires
|
|
1094 special care in writing these hooks. Take a look at
|
|
1095 @code{ediff-default-suspend-hook} and @code{ediff-default-quit-hook} to
|
|
1096 see what's involved.
|
|
1097
|
|
1098 @item ediff-startup-hook
|
|
1099 @vindex ediff-startup-hook
|
|
1100 This hook is run at the end of Ediff startup.
|
|
1101
|
|
1102 @item ediff-select-hook
|
|
1103 @vindex ediff-select-hook
|
|
1104 This hook is run after Ediff selects the next difference region.
|
|
1105
|
|
1106 @item ediff-unselect-hook
|
|
1107 @vindex ediff-unselect-hook
|
|
1108 This hook is run after Ediff unselects the current difference region.
|
|
1109
|
|
1110 @item ediff-prepare-buffer-hook
|
|
1111 @vindex ediff-prepare-buffer-hook
|
|
1112 This hook is run for each Ediff buffer (A, B, C) right after the buffer
|
|
1113 is arranged.
|
|
1114
|
|
1115 @item ediff-display-help-hook
|
|
1116 @vindex ediff-display-help-hook
|
|
1117 Ediff runs this hook each time after setting up the help message. It
|
|
1118 can be used to alter the help message for custom packages that run on
|
|
1119 top of Ediff.
|
|
1120
|
|
1121 @item ediff-mode-hook
|
|
1122 @vindex ediff-mode-hook
|
|
1123 This hook is run just after Ediff mode is set up in the control
|
|
1124 buffer. This is done before any Ediff window is created. You can use it to
|
|
1125 set local variables that alter the look of the display.
|
|
1126
|
|
1127 @item ediff-registry-setup-hook
|
|
1128 @vindex ediff-registry-setup-hook
|
|
1129 Hooks run after setting up the registry for all active Ediff session.
|
|
1130 @xref{Session Groups}, for details.
|
|
1131 @item ediff-session-group-setup-hook
|
|
1132 @vindex ediff-session-group-setup-hook
|
|
1133 Hooks run after setting up a control panel for a group of related Ediff
|
|
1134 sessions. @xref{Session Groups}, for details.
|
12
|
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.
|
0
|
1145 @end table
|
|
1146
|
12
|
1147 @node Quick Help Customization, Window and Frame Configuration, Hooks, Customization
|
|
1148 @section Quick Help Customization
|
0
|
1149 @vindex ediff-use-long-help-message
|
|
1150 @vindex ediff-control-buffer
|
|
1151 @vindex ediff-startup-hook
|
|
1152 @vindex ediff-help-message
|
|
1153
|
|
1154 Ediff provides quick help using its control panel window. Since this window
|
|
1155 takes a fair share of the screen real estate, you can toggle it off by
|
|
1156 typing @kbd{?}. The control window will then shrink to just one line and a
|
|
1157 mode line, displaying a short help message.
|
|
1158
|
|
1159 The variable @code{ediff-use-long-help-message} tells Ediff whether
|
|
1160 you use the short message or the long one. By default, it
|
|
1161 is set to @code{nil}, meaning that the short message is used.
|
|
1162 Set this to @code{t}, if you want Ediff to use the long
|
|
1163 message by default. This property can always be changed interactively, by
|
|
1164 typing @kbd{?} into Ediff Control Buffer.
|
|
1165
|
|
1166 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
|
|
1168 the variable @code{ediff-help-message}, which is local to
|
|
1169 @code{ediff-control-buffer}.
|
|
1170
|
12
|
1171 @node Window and Frame Configuration, Selective Browsing, Quick Help Customization, Customization
|
0
|
1172 @section Window and Frame Configuration
|
|
1173
|
|
1174 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.
|
|
1176 The split between these windows can be horizontal or
|
|
1177 vertical, which can be changed interactively by typing @kbd{|} while the
|
|
1178 cursor is in the control window.
|
|
1179
|
|
1180 On a window display, Ediff sets up a dedicated frame for Ediff Control
|
|
1181 Panel and then it chooses windows as follows: If one of the buffers
|
|
1182 is invisible, it is displayed in the currently selected frame. If
|
|
1183 a buffer is visible, it is displayed in the frame where it is visible.
|
|
1184 If, according to the above criteria, the two buffers fall into the same
|
|
1185 frame, then so be it---the frame will be shared by the two. The same
|
|
1186 algorithm works when you type @kbd{C-l} (@code{ediff-recenter}), @kbd{p}
|
|
1187 (@code{ediff-previous-difference}), @kbd{n}
|
|
1188 (@code{ediff-next-difference}), etc.
|
|
1189
|
|
1190 The above behavior also depends on whether the current frame is splittable,
|
12
|
1191 dedicated, etc. Unfortunately, the margin of this book is too narrow to
|
|
1192 present the details of this remarkable algorithm.
|
0
|
1193
|
12
|
1194 The upshot of all this is that you can compare buffers in one frame or
|
0
|
1195 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
|
|
1197 different frames. Ediff respects these arrangements, automatically
|
|
1198 adapting itself to the multi-frame mode.
|
|
1199
|
|
1200 Ediff uses the following variables to set up its control panel
|
|
1201 (a.k.a. control buffer, a.k.a. quick help window):
|
|
1202
|
|
1203 @table @code
|
|
1204 @item ediff-control-frame-parameters
|
|
1205 @vindex ediff-control-frame-parameters
|
|
1206 You can change or augment this variable including the font, color,
|
|
1207 etc. The X resource name of Ediff Control Panel frames is @samp{Ediff}. Under
|
|
1208 X-windows, you can use this name to set up preferences in your
|
|
1209 @file{~/.Xdefaults}, @file{~/.xrdb}, or whatever X resource file is in
|
|
1210 use. Usually this is preferable to changing
|
|
1211 @code{ediff-control-frame-parameters} directly. For instance, you can
|
|
1212 specify in @file{~/.Xdefaults} the color of the control frame
|
|
1213 using the resource @samp{Ediff*background}.
|
|
1214
|
|
1215 In general, any X resource pertaining the control frame can be reached
|
|
1216 via the prefix @code{Ediff*}.
|
|
1217
|
|
1218 @item ediff-control-frame-position-function
|
|
1219 @vindex ediff-control-frame-position-function
|
|
1220 The preferred way of specifying the position of the control frame is by
|
|
1221 setting the variable @code{ediff-control-frame-position-function} to an
|
|
1222 appropriate function.
|
|
1223 The default value of this variable is
|
|
1224 @code{ediff-make-frame-position}. This function places the control frame in
|
|
1225 the vicinity of the North-East corner of the frame displaying buffer A.
|
|
1226
|
|
1227 @findex ediff-make-frame-position
|
|
1228 @end table
|
|
1229
|
|
1230 The following variables can be used to adjust the location produced by
|
|
1231 @code{ediff-make-frame-position} and for related customization.
|
|
1232
|
|
1233 @table @code
|
|
1234 @item ediff-narrow-control-frame-leftward-shift
|
|
1235 @vindex ediff-narrow-control-frame-leftward-shift
|
|
1236 Specifies the number of characters for shifting
|
|
1237 the control frame from the rightmost edge of frame A when the control
|
|
1238 frame is displayed as a small window.
|
|
1239
|
|
1240 @item ediff-wide-control-frame-rightward-shift
|
|
1241 @vindex ediff-wide-control-frame-rightward-shift
|
|
1242 Specifies the rightward shift of the control frame
|
|
1243 from the left edge of frame A when the control frame shows the full
|
|
1244 menu of options.
|
|
1245
|
|
1246 @item ediff-control-frame-upward-shift
|
|
1247 @vindex ediff-control-frame-upward-shift
|
|
1248 Specifies the number of pixels for the upward shift
|
|
1249 of the control frame.
|
|
1250
|
|
1251 @item ediff-prefer-iconified-control-frame
|
|
1252 @vindex ediff-prefer-iconified-control-frame
|
|
1253 If this variable is @code{t}, the control frame becomes iconified
|
|
1254 automatically when you toggle the quick help message off. This saves
|
|
1255 valuable real estate on the screen. Toggling help back will deiconify
|
|
1256 the control frame.
|
|
1257
|
|
1258 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
|
12
|
1260 @code{nil} (@pxref{Quick Help Customization}). This behavior is useful
|
|
1261 only if the window manager is TWM or a derivative. Also, this doesn't work
|
|
1262 under XEmacs, since this editor ignores input from icons.
|
0
|
1263 @end table
|
|
1264
|
|
1265 @findex ediff-setup-windows
|
|
1266 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
|
|
1268 that detaching Ediff Control Panel from the rest and making it into a
|
|
1269 separate frame offers an important opportunity by allowing you to
|
|
1270 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
|
12
|
1272 (this may depend on your window manager, though). Iconifying won't do
|
0
|
1273 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
|
|
1275 frame is very small, smaller than some icons, so it does not take much
|
|
1276 space in any case.
|
|
1277
|
|
1278 The following variable controls how windows are set up:
|
|
1279
|
|
1280 @table @code
|
|
1281 @item ediff-window-setup-function
|
|
1282 @vindex ediff-window-setup-function
|
|
1283 The multiframe setup is done by the
|
|
1284 @code{ediff-setup-windows-multiframe} function, which is the default on
|
|
1285 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
|
|
1287 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
|
14
|
1289 the command @code{ediff-toggle-multiframe} using the Minibuffer of the
|
|
1290 Menubar.
|
0
|
1291 @findex ediff-setup-windows-multiframe
|
|
1292 @findex ediff-setup-windows-plain
|
|
1293 @findex ediff-toggle-multiframe
|
|
1294
|
|
1295 If you don't like any of these setups, write your own function. See the
|
|
1296 documentation for @code{ediff-window-setup-function} for the basic
|
|
1297 guidelines. However, writing window setups is not easy, so you should
|
|
1298 first take a close look at @code{ediff-setup-windows-plain} and
|
|
1299 @code{ediff-setup-windows-multiframe}.
|
|
1300 @end table
|
|
1301
|
|
1302 You can run multiple Ediff sessions at once, by invoking Ediff several
|
|
1303 times without exiting previous Ediff sessions. Different sessions
|
|
1304 may even operate on the same pair of files.
|
|
1305
|
|
1306 Each session has its own Ediff Control Panel and all the regarding a
|
|
1307 particular session is local to the associated control panel buffer. You
|
|
1308 can switch between sessions by suspending one session and then switching
|
|
1309 to another control panel. (Different control panel buffers are
|
|
1310 distinguished by a numerical suffix, e.g., @samp{Ediff Control Panel<3>}.)
|
|
1311
|
|
1312 @node Selective Browsing, Highlighting Difference Regions, Window and Frame Configuration, Customization
|
|
1313 @section Selective Browsing
|
|
1314
|
|
1315 Sometimes it is convenient to be able to step through only some difference
|
12
|
1316 regions, those that match certain regular expressions, and to ignore all
|
0
|
1317 others. On other occasions, you may want to ignore difference regions that
|
12
|
1318 match some regular expressions, and to look only at the rest.
|
0
|
1319
|
|
1320 The commands @kbd{#f} and @kbd{#h} let you do precisely this.
|
|
1321
|
|
1322 Typing @kbd{#f} lets you specify regular expressions that match difference
|
|
1323 regions you want to focus on.
|
|
1324 We shall call these regular expressions @var{regexp-A}, @var{regexp-B} and
|
|
1325 @var{regexp-C}.
|
|
1326 Ediff will then start stepping through only those difference regions
|
|
1327 where the region in buffer A matches @var{regexp-A} and/or the region in
|
|
1328 buffer B matches @var{regexp-B}, etc. Whether `and' or `or' will be used
|
|
1329 depends on how you respond to a question.
|
|
1330
|
|
1331 When scanning difference regions for the aforesaid regular expressions,
|
|
1332 Ediff narrows the buffers to those regions. This means that you can use
|
|
1333 the expressions @kbd{\`} and @kbd{\'} to tie search to the beginning or end
|
|
1334 of the difference regions.
|
|
1335
|
|
1336 On the other hand, typing @kbd{#h} lets you specify (hide) uninteresting
|
|
1337 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}
|
12
|
1339 and (if applicable) buffer C's region matches @var{regexp-C}, then the
|
0
|
1340 region will be ignored by the commands @kbd{n}/@key{SPC}
|
|
1341 (@code{ediff-next-difference}) and @kbd{p}/@key{DEL}
|
|
1342 (@code{ediff-previous-difference}) commands.
|
|
1343
|
|
1344 Typing @kbd{#f} and @kbd{#h} toggles selective browsing on and off.
|
|
1345
|
|
1346 Note that selective browsing affects only @code{ediff-next-difference}
|
|
1347 and @code{ediff-previous-difference}, i.e., the commands
|
|
1348 @kbd{n}/@key{SPC} and @kbd{p}/@key{DEL}. @kbd{#f} and @kbd{#h} do not
|
|
1349 change the position of the point in the buffers. And you can still jump
|
|
1350 directly (using @kbd{j}) to any numbered
|
|
1351 difference.
|
|
1352
|
|
1353 Users can supply their own functions to specify how Ediff should do
|
|
1354 selective browsing. To change the default Ediff function, add a function to
|
|
1355 @code{ediff-load-hook} which will do the following assignments:
|
|
1356
|
|
1357 @example
|
|
1358 (setq ediff-hide-regexp-matches-function 'your-hide-function)
|
|
1359 (setq ediff-focus-on-regexp-matches-function 'your-focus-function)
|
|
1360 @end example
|
|
1361
|
|
1362 @strong{Useful hint}: To specify a regexp that matches everything, don't
|
|
1363 simply type @key{RET} in response to a prompt. Typing @key{RET} tells Ediff
|
|
1364 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
|
|
1366 line.
|
|
1367
|
|
1368 You can use the status command, @kbd{i}, to find out whether
|
12
|
1369 selective browsing is currently in effect.
|
0
|
1370
|
|
1371 The regular expressions you specified are kept in the local variables
|
|
1372 @code{ediff-regexp-focus-A}, @code{ediff-regexp-focus-B},
|
|
1373 @code{ediff-regexp-focus-C}, @code{ediff-regexp-hide-A},
|
|
1374 @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
|
|
1376 default, set these variables in @file{.emacs} using @code{setq-default}.
|
|
1377
|
|
1378 In addition to the ability to ignore regions that match regular
|
|
1379 expressions, Ediff can be ordered to start skipping over certain
|
12
|
1380 ``uninteresting'' difference regions. This is controlled by the following
|
|
1381 variable:
|
0
|
1382
|
|
1383 @table @code
|
|
1384 @item ediff-ignore-similar-regions
|
|
1385 @vindex ediff-ignore-similar-regions
|
12
|
1386 If @code{t}, causes Ediff to skip over "uninteresting" difference regions,
|
|
1387 which are the regions where the variants differ only in the amount of the
|
|
1388 white space and newlines. This feature can be toggled on/off interactively,
|
|
1389 via the command @kbd{##}.
|
0
|
1390 @end table
|
|
1391
|
|
1392 @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
|
|
1394 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
|
|
1396 text-only terminals. In that case, you must explicitly turn auto-refining
|
|
1397 on (such as, by typing @kbd{@@}).
|
|
1398
|
12
|
1399 @strong{Reassurance:} If many such uninteresting regions appear in a row,
|
|
1400 Ediff may take a long time to skip over them because it has to compute fine
|
|
1401 differences of all intermediate regions. This delay does not indicate any
|
|
1402 problem.
|
0
|
1403
|
|
1404 @node Highlighting Difference Regions, Narrowing, Selective Browsing, Customization
|
|
1405 @section Highlighting Difference Regions
|
|
1406
|
|
1407 The following variables control the way Ediff highlights difference
|
|
1408 regions:
|
|
1409
|
|
1410 @table @code
|
|
1411 @item ediff-before-flag-bol
|
|
1412 @itemx ediff-after-flag-eol
|
|
1413 @itemx ediff-before-flag-mol
|
|
1414 @itemx ediff-after-flag-mol
|
|
1415 @vindex ediff-before-flag-bol
|
|
1416 @vindex ediff-after-flag-eol
|
|
1417 @vindex ediff-before-flag-mol
|
|
1418 @vindex ediff-after-flag-mol
|
|
1419 These variables hold strings that Ediff uses to mark the beginning and the
|
|
1420 end of the differences found in files A, B, and C on devices where Emacs
|
|
1421 cannot display faces. Ediff uses different flags to highlight regions that
|
|
1422 begin/end at the beginning/end of a line or in a middle of a line.
|
|
1423
|
|
1424 @item ediff-current-diff-face-A
|
|
1425 @itemx ediff-current-diff-face-B
|
|
1426 @itemx ediff-current-diff-face-C
|
|
1427 @vindex ediff-current-diff-face-A
|
|
1428 @vindex ediff-current-diff-face-B
|
|
1429 @vindex ediff-current-diff-face-C
|
|
1430 Ediff uses these faces to highlight current differences on devices where
|
|
1431 Emacs can display faces. These and subsequently described faces can be set
|
|
1432 either in @file{.emacs} or in @file{.Xdefaults}. The X resource for Ediff
|
|
1433 is @samp{Ediff}, @emph{not} @samp{emacs}. Please refer to Emacs manual for
|
|
1434 the information on how to set X resources.
|
|
1435 @item ediff-fine-diff-face-A
|
|
1436 @itemx ediff-fine-diff-face-B
|
|
1437 @itemx ediff-fine-diff-face-C
|
|
1438 @vindex ediff-fine-diff-face-A
|
|
1439 @vindex ediff-fine-diff-face-B
|
|
1440 @vindex ediff-fine-diff-face-C
|
|
1441 Ediff uses these faces to show the fine differences between the current
|
|
1442 differences regions in buffers A, B, and C, respectively.
|
|
1443
|
|
1444 @item ediff-even-diff-face-A
|
|
1445 @itemx ediff-even-diff-face-B
|
|
1446 @itemx ediff-even-diff-face-C
|
|
1447 @itemx ediff-odd-diff-face-A
|
|
1448 @itemx ediff-odd-diff-face-B
|
|
1449 @itemx ediff-odd-diff-face-C
|
|
1450 @vindex ediff-even-diff-face-A
|
|
1451 @vindex ediff-even-diff-face-B
|
|
1452 @vindex ediff-even-diff-face-C
|
|
1453 @vindex ediff-odd-diff-face-A
|
|
1454 @vindex ediff-odd-diff-face-B
|
|
1455 @vindex ediff-odd-diff-face-C
|
|
1456 Non-current difference regions are displayed using these alternating
|
|
1457 faces. The odd and the even faces are actually identical on monochrome
|
|
1458 displays, because without colors options are limited.
|
|
1459 So, Ediff uses italics to highlight non-current differences.
|
|
1460
|
12
|
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
|
0
|
1476 @item ediff-force-faces
|
|
1477 @vindex ediff-force-faces
|
|
1478 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
|
|
1480 can be used, the user can set this variable to @code{t} to make sure that
|
|
1481 Ediff uses faces to highlight differences.
|
|
1482
|
|
1483 @item ediff-highlight-all-diffs
|
|
1484 @vindex ediff-highlight-all-diffs
|
12
|
1485 Indicates whether---on a windowind display---Ediff should highlight
|
|
1486 differences using inserted strings (as on text-only terminals) or using
|
|
1487 colors and highlighting. Normally, Ediff highlights all differences, but
|
|
1488 the selected difference is highlighted more visibly. One can cycle through
|
|
1489 various modes of highlighting by typing @kbd{h}. By default, Ediff starts
|
|
1490 in the mode where all difference regions are highlighted. If you prefer to
|
|
1491 start in the mode where unselected differences are not highlighted, you
|
|
1492 should set @code{ediff-highlight-all-diffs} to @code{nil}. Type @kbd{h} to
|
|
1493 restore highlighting for all differences.
|
0
|
1494
|
|
1495 Ediff lets you switch between the two modes of highlighting. That is,
|
|
1496 you can switch interactively from highlighting using faces to
|
|
1497 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
|
|
1499 xterm window, the only available option is highlighting with strings.
|
|
1500 @end table
|
|
1501
|
|
1502 @noindent
|
|
1503 If you want to change the above variables, you must do it
|
|
1504 @strong{before} Ediff is loaded.
|
|
1505
|
|
1506 There are two ways to change the default setting
|
|
1507 for highlighting faces: either change the variables, as shown here,
|
|
1508
|
|
1509 @example
|
|
1510 (setq ediff-current-diff-face-A 'bold-italic)
|
|
1511 @end example
|
|
1512
|
|
1513 @noindent
|
|
1514 or here,
|
|
1515
|
|
1516 @example
|
|
1517 (setq ediff-current-diff-face-A
|
12
|
1518 (copy-face 'bold-italic 'ediff-current-diff-face-A))
|
0
|
1519 @end example
|
|
1520
|
|
1521 @noindent
|
|
1522 or modify the defaults selectively:
|
|
1523
|
|
1524 @smallexample
|
|
1525 (add-hook 'ediff-load-hook
|
|
1526 (function (lambda ()
|
|
1527 (set-face-foreground
|
|
1528 ediff-current-diff-face-B "blue")
|
|
1529 (set-face-background
|
|
1530 ediff-current-diff-face-B "red")
|
|
1531 (make-face-italic
|
|
1532 ediff-current-diff-face-B))))
|
|
1533 @end smallexample
|
|
1534
|
|
1535 You may also want to take a look at how the above faces are defined in the
|
|
1536 source code of Ediff.
|
|
1537
|
|
1538 @strong{Note:} it is not recommended to use @code{internal-get-face} (or
|
|
1539 @code{get-face} in XEmacs) when defining Ediff's faces, since this may
|
|
1540 cause problems when there are several frames with different font sizes.
|
|
1541 Instead, use @code{copy-face} or @code{set/make-face-@dots{}} as shown
|
|
1542 above.
|
|
1543
|
|
1544 @node Narrowing, Refinement of Difference Regions, Highlighting Difference Regions, Customization
|
|
1545 @section Narrowing
|
|
1546
|
|
1547 If buffers being compared are narrowed at the time of invocation of
|
|
1548 Ediff, @code{ediff-buffers} will preserve the narrowing range. However,
|
|
1549 if @code{ediff-files} is invoked on the files visited by these buffers,
|
12
|
1550 that would widen the buffers, since this command is defined to compare the
|
0
|
1551 entire files.
|
|
1552
|
12
|
1553 Calling @code{ediff-regions-linewise} or @code{ediff-windows-linewise}, or
|
|
1554 the corresponding @samp{-wordwise} commands, narrows the variants to the
|
|
1555 particular regions being compared. The original accessible ranges are
|
|
1556 restored when you quit Ediff. During the command, you can toggle this
|
|
1557 narrowing on and off with the @kbd{%} command.
|
0
|
1558
|
|
1559 These two variables control this narrowing behavior:
|
|
1560
|
|
1561 @table @code
|
|
1562 @item ediff-start-narrowed
|
|
1563 @vindex ediff-start-narrowed
|
|
1564 If @code{t}, Ediff narrows the display to the appropriate range when it
|
|
1565 is invoked with an @samp{ediff-regions@dots{}} or
|
|
1566 @samp{ediff-windows@dots{}} command. If @code{nil}, these commands do
|
|
1567 not automatically narrow, but you can still toggle narrowing on and off
|
|
1568 by typing @kbd{%}.
|
|
1569
|
|
1570 @item ediff-quit-widened
|
|
1571 @vindex ediff-quit-widened
|
|
1572 Controls whether on quitting Ediff should restore the accessible range
|
|
1573 that existed before the current invocation.
|
|
1574 @end table
|
|
1575
|
|
1576 @node Refinement of Difference Regions, Patch and Diff Programs, Narrowing, Customization
|
|
1577 @section Refinement of Difference Regions
|
|
1578
|
|
1579 Ediff has variables to control the way fine differences are
|
|
1580 highlighted. This feature gives you control over the process of refinement.
|
|
1581 Note that refinement ignores spaces, tabs, and newlines.
|
|
1582
|
|
1583 @table @code
|
|
1584 @item ediff-auto-refine
|
|
1585 @vindex ediff-auto-refine
|
|
1586 This variable controls whether fine differences within regions are
|
|
1587 highlighted automatically (``auto-refining''). The default is yes
|
|
1588 (@samp{on}).
|
|
1589
|
|
1590 On a slow machine, automatic refinement may be painful. In that case,
|
|
1591 you can turn auto-refining on or off interactively by typing
|
|
1592 @kbd{@@}. You can also turn off display of refining that has
|
|
1593 already been done.
|
|
1594
|
|
1595 When auto-refining is off, fine differences are shown only for regions
|
|
1596 for which these differences have been computed and saved before. If
|
|
1597 auto-refining and display of refining are both turned off, fine
|
|
1598 differences are not shown at all.
|
|
1599
|
|
1600 Typing @kbd{*} computes and displays fine differences for the current
|
|
1601 difference region, regardless of whether auto-refining is turned on.
|
|
1602
|
|
1603 @item ediff-auto-refine-limit
|
|
1604 @vindex ediff-auto-refine-limit
|
|
1605 If auto-refining is on, this variable limits the size of the regions to
|
|
1606 be auto-refined. This guards against the possible slowdown that may be
|
|
1607 caused by extraordinary large difference regions.
|
|
1608
|
|
1609 You can always refine the current region by typing @kbd{*}.
|
|
1610
|
|
1611 @item ediff-forward-word-function
|
|
1612 @vindex ediff-forward-word-function
|
12
|
1613 This variable controls how fine differences are computed. The
|
0
|
1614 value must be a Lisp function that determines how the current difference
|
|
1615 region should be split into words.
|
|
1616
|
|
1617 @vindex ediff-diff-program
|
|
1618 @vindex ediff-forward-word-function
|
|
1619 @findex ediff-forward-word
|
|
1620 Fine differences are computed by first splitting the current difference
|
12
|
1621 region into words and then passing the result to
|
|
1622 @code{ediff-diff-program}. For the default forward word function (which is
|
|
1623 @code{ediff-forward-word}), a word is a string consisting of letters,
|
|
1624 @samp{-}, or @samp{_}; a string of punctuation symbols; a string of digits,
|
|
1625 or a string consisting of symbols that are neither space, nor a letter.
|
0
|
1626
|
|
1627 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
|
|
1629 and for the function @code{ediff-forward-word} for an explanation of how to
|
|
1630 modify these variables.
|
|
1631 @vindex ediff-word-1
|
|
1632 @vindex ediff-word-2
|
|
1633 @vindex ediff-word-3
|
|
1634 @vindex ediff-word-4
|
|
1635 @end table
|
|
1636
|
|
1637 Sometimes, when a region has too many differences between the variants,
|
|
1638 highlighting of fine differences is inconvenient, especially on
|
|
1639 color displays. If that is the case, type @kbd{*} with a negative
|
|
1640 prefix argument. This unhighlights fine differences for the current
|
|
1641 region.
|
|
1642
|
|
1643 To unhighlight fine differences in all difference regions, use the
|
|
1644 command @kbd{@@}. Repeated typing of this key cycles through three
|
|
1645 different states: auto-refining, no-auto-refining, and no-highlighting
|
|
1646 of fine differences.
|
|
1647
|
|
1648 @node Patch and Diff Programs, Merging and diff3, Refinement of Difference Regions, Customization
|
|
1649 @section Patch and Diff Programs
|
|
1650
|
|
1651 This section describes variables that specify the programs to be used for
|
|
1652 applying patches and for computing the main difference regions (not the
|
|
1653 fine difference regions):
|
|
1654
|
|
1655 @table @code
|
12
|
1656 @item ediff-diff-program
|
0
|
1657 @itemx ediff-diff3-program
|
|
1658 @vindex ediff-patch-program
|
|
1659 @vindex ediff-diff-program
|
|
1660 @vindex ediff-diff3-program
|
|
1661 These variables specify the programs to use to produce differences
|
|
1662 and do patching.
|
|
1663
|
12
|
1664 @item ediff-diff-options
|
0
|
1665 @itemx ediff-diff3-options
|
|
1666 @vindex ediff-patch-options
|
|
1667 @vindex ediff-diff-options
|
|
1668 @vindex ediff-diff3-options
|
|
1669 These variables specify the options to pass to the above utilities.
|
|
1670
|
|
1671 In @code{ediff-diff-options}, it may be useful to specify options
|
|
1672 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
|
|
1674 format yet.
|
|
1675
|
12
|
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.
|
0
|
1710
|
|
1711 @item ediff-custom-diff-program
|
|
1712 @itemx ediff-custom-diff-options
|
|
1713 @vindex ediff-custom-diff-program
|
|
1714 @vindex ediff-custom-diff-options
|
|
1715 @findex ediff-save-buffer
|
|
1716 Because Ediff limits the options you may want to pass to the @code{diff}
|
|
1717 program, it partially makes up for this drawback by letting you save the
|
|
1718 output from @code{diff} in your preferred format, which is specified via
|
|
1719 the above two variables.
|
|
1720
|
|
1721 The output generated by @code{ediff-custom-diff-program} (which doesn't
|
|
1722 even have to be a standard-style @file{diff}!) is not used by Ediff. It is
|
|
1723 provided exclusively so that you can
|
|
1724 refer to
|
|
1725 it later, send it over email, etc. For instance, after reviewing the
|
|
1726 differences, you may want to send context differences to a colleague.
|
|
1727 Since Ediff ignores the @samp{-c} option in
|
|
1728 @code{ediff-diff-program}, you would have to run @code{diff -c} separately
|
|
1729 just to produce the list of differences. Fortunately,
|
|
1730 @code{ediff-custom-diff-program} and @code{ediff-custom-diff-options}
|
|
1731 eliminate this nuisance by keeping a copy of a difference list in the
|
|
1732 desired format in a buffer that can be displayed via the command @kbd{D}.
|
|
1733
|
|
1734 @item ediff-patch-default-directory
|
|
1735 @vindex ediff-patch-default-directory
|
|
1736 Specifies the default directory to look for patches.
|
|
1737
|
|
1738 @end table
|
|
1739
|
|
1740 @noindent
|
|
1741 @strong{Warning:} Ediff does not support the output format of VMS
|
12
|
1742 @code{diff}. Instead, make sure you are using some implementation of POSIX
|
0
|
1743 @code{diff}, such as @code{gnudiff}.
|
|
1744
|
|
1745 @node Merging and diff3, Support for Version Control, Patch and Diff Programs, Customization
|
|
1746 @section Merging and diff3
|
|
1747
|
|
1748 Ediff supports three-way comparison via the functions @code{ediff-files3} and
|
|
1749 @code{ediff-buffers3}. The interface is the same as for two-way comparison.
|
|
1750 In three-way comparison and merging, Ediff reports if any two difference
|
|
1751 regions are identical. For instance, if the current region in buffer A
|
|
1752 is the same as the region in buffer C, then the mode line of buffer A will
|
|
1753 display @samp{[=diff(C)]} and the mode line of buffer C will display
|
|
1754 @samp{[=diff(A)]}.
|
|
1755
|
|
1756 Merging is done according to the following algorithm.
|
|
1757
|
|
1758 If a difference region in one of the buffers, say B, differs from the ancestor
|
|
1759 file while the region in the other buffer, A, doesn't, then the merge buffer,
|
|
1760 C, gets B's region. Similarly when buffer A's region differs from
|
|
1761 the ancestor and B's doesn't, A's region is used.
|
|
1762
|
|
1763 @vindex ediff-default-variant
|
|
1764 If both regions in buffers A and B differ from the ancestor file, Ediff
|
|
1765 chooses the region according to the value of the variable
|
|
1766 @code{ediff-default-variant}. If its value is @code{default-A} then A's
|
|
1767 region is chosen. If it is @code{default-B} then B's region is chosen.
|
|
1768 If it is @code{combined} then the region in buffer C will look like
|
|
1769 this:
|
|
1770
|
|
1771 @example
|
|
1772 #ifdef NEW /* variant A */
|
|
1773 difference region from buffer A
|
|
1774 #else /* variant B */
|
|
1775 difference region from buffer B
|
|
1776 #endif /* NEW */
|
|
1777 @end example
|
|
1778
|
|
1779 @vindex ediff-combination-pattern
|
|
1780 The actual strings that separate the regions copied from buffer A and B
|
|
1781 are controlled by the variable @code{ediff-combination-pattern}. Its
|
|
1782 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
|
|
1784 regions; the third goes after region B, as shown in the above example.
|
|
1785
|
12
|
1786 In addition to the state of the difference, Ediff displays the state of the
|
|
1787 merge for each region. If a difference came from buffer A by default
|
|
1788 (because both regions A and B were different from the ancestor and
|
|
1789 @code{ediff-default-variant} was set to @code{default-A}) then
|
|
1790 @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
|
|
1792 region in that buffer differs from the ancestor, but the region in buffer A
|
0
|
1793 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
|
12
|
1795 Emerge and have the same meaning.
|
0
|
1796
|
|
1797 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
|
|
1799 the difference regions in buffers A and B as explained above.
|
|
1800
|
12
|
1801 In addition to the state of merge and state of difference indicators, while
|
|
1802 merging with an ancestor file or buffer, Ediff informs the user when the
|
|
1803 current difference region in the (normally invisible) ancestor buffer is
|
|
1804 empty via the @emph{AncestorEmpty} indicator. This helps determine if the
|
|
1805 changes made to the original in variants A and B represent pure insertion
|
|
1806 or deletion of text: if the mode line shows @emph{AncestorEmpty} and the
|
0
|
1807 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
|
|
1809 regions in buffers A or B are non-empty, this means that text was
|
|
1810 modified. Otherwise, the original text was deleted.
|
|
1811
|
|
1812 Although the ancestor buffer is normally invisible, Ediff maintains
|
|
1813 difference regions there and advances the current difference region
|
|
1814 accordingly. All highlighting of difference regions is provided in the
|
|
1815 ancestor buffer, except for the fine differences. Therefore, if desired, the
|
|
1816 user can put the ancestor buffer in a separate frame and watch it
|
|
1817 there. However, on a TTY, only one frame can be visible at any given time,
|
|
1818 and Ediff doesn't support any single-frame window configuration where all
|
|
1819 buffers, including the ancestor buffer, would be visible. However, the
|
|
1820 ancestor buffer can be displayed by typing @kbd{/} to the control
|
|
1821 window. (Type @kbd{C-l} to hide it again.)
|
|
1822
|
|
1823 Note that the state-of-difference indicators @samp{=diff(A)} and
|
|
1824 @samp{=diff(B)} above are not redundant, even in the presence of a
|
|
1825 state-of-merge indicator. In fact, the two serve different purposes.
|
|
1826
|
|
1827 For instance, if the mode line displays @samp{=diff(B) prefer(B)} and
|
|
1828 you copy a difference region from buffer A to buffer C then
|
|
1829 @samp{=diff(B)} will change to @samp{diff-A} and the mode line will
|
|
1830 display @samp{=diff(A) prefer-B}. This indicates that the difference
|
|
1831 region in buffer C is identical to that in buffer A, but originally
|
|
1832 buffer C's region came from buffer B. This is useful to know because
|
|
1833 you can recover the original difference region in buffer C by typing
|
|
1834 @kbd{r}.
|
|
1835
|
|
1836
|
|
1837 Ediff never changes the state-of-merge indicator, except in response to
|
|
1838 the @kbd{!} command (see below), in which case the indicator is lost.
|
|
1839 On the other hand, the state-of-difference indicator is changed
|
|
1840 automatically by the copying/recovery commands, @kbd{a}, @kbd{b}, @kbd{r},
|
|
1841 @kbd{+}.
|
|
1842
|
|
1843 The @kbd{!} command loses the information about origins of the regions
|
|
1844 in the merge buffer (default-A, prefer-B, or combined). This is because
|
|
1845 recomputing differences in this case means running @code{diff3} on
|
|
1846 buffers A, B, and the merge buffer, not on the ancestor buffer. (It
|
|
1847 makes no sense to recompute differences using the ancestor file, since
|
|
1848 in the merging mode Ediff assumes that you have not edited buffers A and
|
|
1849 B, but that you may have edited buffer C, and these changes are to be
|
|
1850 preserved.) Since some difference regions may disappear as a result of
|
|
1851 editing buffer C and others may arise, there is generally no simple way
|
|
1852 to tell where the various regions in the merge buffer came from.
|
|
1853
|
|
1854 In three-way comparison, Ediff tries to disregard regions that consist
|
|
1855 entirely of white space. For instance, if, say, the current region in
|
|
1856 buffer A consists of the white space only (or if it is empty), Ediff will
|
|
1857 not take it into account for the purpose of computing fine differences. The
|
|
1858 result is that Ediff can provide a better visual information regarding the
|
|
1859 actual fine differences in the non-white regions in buffers B and
|
|
1860 C. Moreover, if the regions in buffers B and C differ in the white space
|
|
1861 only, then a message to this effect will be displayed.
|
|
1862
|
|
1863 @vindex ediff-merge-window-share
|
|
1864 In the merge mode, the share of the split between window C (the window
|
|
1865 displaying the merge-buffer) and the windows displaying buffers A and B
|
|
1866 is controlled by the variable @code{ediff-merge-window-share}. Its
|
|
1867 default value is 0.5. To make the merge-buffer window smaller, reduce
|
|
1868 this amount.
|
|
1869
|
|
1870 We don't recommend increasing the size of the merge-window to more than
|
|
1871 half the frame (i.e., to increase the value of
|
|
1872 @code{ediff-merge-window-share}) to more than 0.5, since it would be
|
|
1873 hard to see the contents of buffers A and B.
|
|
1874
|
|
1875 You can temporarily shrink the merge window to just one line by
|
|
1876 typing @kbd{s}. This change is temporary, until Ediff finds a reason to
|
|
1877 redraw the screen. Typing @kbd{s} again restores the original window size.
|
|
1878
|
|
1879 With a positive prefix argument, the @kbd{s} command will make the merge
|
|
1880 window slightly taller. This change is persistent. With `@kbd{-}' or
|
|
1881 with a negative prefix argument, the command @kbd{s} makes the merge
|
|
1882 window slightly shorter. This change also persistent.
|
|
1883
|
|
1884 @vindex ediff-show-clashes-only
|
|
1885 Ediff lets you automatically ignore the regions where only one of the
|
|
1886 buffers A and B disagrees with the ancestor. To do this, set the
|
|
1887 variable @code{ediff-show-clashes-only} to non-@code{nil}.
|
|
1888
|
|
1889 You can toggle this feature interactively by typing @kbd{$}.
|
|
1890
|
12
|
1891 Note that this variable affects only the show next/previous difference
|
|
1892 commands. You can still jump directly to any difference region directly
|
|
1893 using the command @kbd{j} (with a prefix argument specifying the difference
|
|
1894 number).
|
|
1895
|
|
1896 @vindex ediff-autostore-merges
|
|
1897 @vindex ediff-quit-merge-hook
|
|
1898 @findex ediff-maybe-save-and-delete-merge
|
|
1899 The variable @code{ediff-autostore-merges} controls what happens to the
|
|
1900 merge buffer when Ediff quits. If the value is @code{nil}, nothing is done
|
|
1901 to the merge buffer---it will be the user's responsibility to save it.
|
|
1902 If the value is @code{t}, the user will be asked where to save the buffer
|
|
1903 and whether to delete it afterwards. It the value is neither @code{nil} nor
|
|
1904 @code{t}, the merge buffer is saved @emph{only} if this merge session was
|
|
1905 invoked from a group of related Ediff session, such as those that result
|
|
1906 from @code{ediff-merge-directories},
|
|
1907 @code{ediff-merge-directory-revisions}, etc.
|
|
1908 @xref{Session Groups}. This behavior is implemented in the function
|
|
1909 @code{ediff-maybe-save-and-delete-merge}, which is a hook in
|
|
1910 @code{ediff-quit-merge-hook}. The user can supply a different hook, if
|
|
1911 necessary.
|
|
1912
|
|
1913 The variable @code{ediff-autostore-merges} is buffer-local, so it can be
|
|
1914 set in a per-buffer manner. Therefore, use @code{setq-default} to globally
|
|
1915 change this variable.
|
0
|
1916
|
|
1917 @node Support for Version Control, Customizing the Mode Line, Merging and diff3, Customization
|
|
1918 @section Support for Version Control
|
|
1919
|
|
1920
|
|
1921 Ediff supports version control and lets you compare versions of files
|
|
1922 visited by Emacs buffers via the function @code{ediff-revision}. This
|
|
1923 feature is controlled by the following variables:
|
|
1924
|
|
1925 @table @code
|
|
1926 @item ediff-version-control-package
|
|
1927 @vindex ediff-version-control-package
|
|
1928 A symbol. The default is @samp{vc}.
|
|
1929
|
|
1930 If you are like most Emacs users, Ediff will use VC as the version control
|
|
1931 package. This is the standard Emacs interface to RCS, CVS, and SCCS.
|
|
1932
|
|
1933 However, if your needs are better served by other interfaces, you will
|
|
1934 have to tell Ediff which version control package you are using, e.g.,
|
|
1935 @example
|
|
1936 (setq ediff-version-control-package 'rcs)
|
|
1937 @end example
|
|
1938
|
|
1939 Apart from the standard @file{vc.el}, Ediff supports three other interfaces
|
|
1940 to version control:
|
|
1941 @file{rcs.el}, @file{pcl-cvs.el}, and @file{generic-sc.el}.
|
|
1942 The package @file{rcs.el} is written by Sebastian Kremer
|
|
1943 <sk@@thp.Uni-Koeln.DE> and is available as
|
|
1944 @example
|
|
1945 @file{ftp.cs.buffalo.edu:pub/Emacs/rcs.tar.Z}
|
|
1946 @file{ftp.uni-koeln.de:/pub/gnu/emacs/rcs.tar.Z}
|
|
1947 @end example
|
|
1948 The packages @file{pcl-cvs.el} and @file{generic-sc.el} are found in XEmacs
|
|
1949 distribution.
|
|
1950 @pindex @file{vc.el}
|
|
1951 @pindex @file{rcs.el}
|
|
1952 @pindex @file{pcl-cvs.el}
|
|
1953 @pindex @file{generic-sc.el}
|
|
1954 @end table
|
|
1955
|
|
1956 Ediff's interface to the above packages allows the user to compare the
|
|
1957 versions of the current buffer or to merge them (with or without an
|
|
1958 ancestor-version). These operations can also be performed on directories
|
|
1959 containing files under version control.
|
|
1960
|
|
1961 In case of @file{pcl-cvs.el}, Ediff can also be invoked via the function
|
|
1962 @code{run-ediff-from-cvs-buffer}---see the documentation string for this
|
|
1963 function.
|
|
1964
|
|
1965 @node Customizing the Mode Line, Miscellaneous, Support for Version Control, Customization
|
|
1966 @section Customizing the Mode Line
|
|
1967
|
|
1968 When Ediff is running, the mode line of @samp{Ediff Control Panel}
|
|
1969 buffer shows the current difference number and the total number of
|
|
1970 difference regions in the two files.
|
|
1971
|
|
1972 The mode line of the buffers being compared displays the type of the
|
|
1973 buffer (@samp{A:}, @samp{B:}, or @samp{C:}) and (usually) the file name.
|
|
1974 Ediff tries to be intelligent in choosing the mode line buffer
|
|
1975 identification. In particular, it works well with the
|
|
1976 @file{uniquify.el} and @file{mode-line.el} packages (which improve on
|
|
1977 the default way in which Emacs displays buffer identification). If you
|
|
1978 don't like the way Ediff changes the mode line, you can use
|
|
1979 @code{ediff-prepare-buffer-hook} to modify the mode line.
|
|
1980 @vindex ediff-prepare-buffer-hook
|
|
1981 @pindex @file{uniquify.el}
|
|
1982 @pindex @file{mode-line.el}
|
|
1983
|
|
1984 @node Miscellaneous, Notes on Heavy-duty Customization, Customizing the Mode Line, Customization
|
|
1985 @section Miscellaneous
|
|
1986
|
|
1987 Here are a few other variables for customizing Ediff:
|
|
1988
|
|
1989 @table @code
|
|
1990 @item ediff-split-window-function
|
|
1991 @vindex ediff-split-window-function
|
|
1992 Controls the way you want the window be split between file-A and file-B
|
|
1993 (and file-C, if applicable). It defaults to the vertical split
|
|
1994 (@code{split-window-vertically}, but you can set it to
|
|
1995 @code{split-window-horizontally}, if you so wish.
|
|
1996 Ediff also lets you switch from vertical to horizontal split and back
|
|
1997 interactively.
|
|
1998
|
|
1999 Note that if Ediff detects that all the buffers it compares are displayed in
|
|
2000 separate frames, it assumes that the user wants them to be so displayed
|
|
2001 and stops splitting windows. Instead, it arranges for each buffer to
|
|
2002 be displayed in a separate frame. You can switch to the one-frame mode
|
|
2003 by hiding one of the buffers A/B/C.
|
|
2004
|
|
2005 You can also swap the windows where buffers are displayed by typing
|
|
2006 @kbd{~}.
|
|
2007
|
|
2008 @item ediff-merge-split-window-function
|
|
2009 @vindex ediff-merge-split-window-function
|
|
2010 Controls how windows are
|
|
2011 split between buffers A and B in the merge mode.
|
|
2012 This variable is like @code{ediff-split-window-function}, but it defaults
|
|
2013 to @code{split-window-horizontally} instead of
|
|
2014 @code{split-window-vertically}.
|
|
2015
|
|
2016 @item ediff-make-wide-display-function
|
|
2017 @vindex ediff-make-wide-display-function
|
|
2018 The value is a function to be called to widen the frame for displaying
|
|
2019 the Ediff buffers. See the on-line documentation for
|
|
2020 @code{ediff-make-wide-display-function} for details. It is also
|
|
2021 recommended to look into the source of the default function
|
|
2022 @code{ediff-make-wide-display}.
|
|
2023
|
|
2024 You can toggle wide/regular display by typing @kbd{m}. In the wide
|
|
2025 display mode, buffers A, B (and C, when applicable) are displayed in a
|
|
2026 single frame that is as wide as the entire workstation screen. This is
|
|
2027 useful when files are compared side-by-side. By default, the display is
|
|
2028 widened without changing its height.
|
|
2029
|
|
2030 @item ediff-use-last-dir
|
|
2031 @vindex ediff-use-last-dir
|
|
2032 Controls the way Ediff presents the
|
|
2033 default directory when it prompts the user for files to compare. If
|
|
2034 @code{nil},
|
|
2035 Ediff uses the default directory of the current buffer when it
|
|
2036 prompts the user for file names. Otherwise, it will use the
|
|
2037 directories it had previously used for files A, B, or C, respectively.
|
|
2038
|
|
2039 @item ediff-no-emacs-help-in-control-buffer
|
|
2040 @vindex ediff-no-emacs-help-in-control-buffer
|
|
2041 If @code{t}, makes @kbd{C-h}
|
|
2042 behave like the @key{DEL} key, i.e., it will move you back to the previous
|
|
2043 difference rather than invoking help. This is useful when, in an xterm
|
|
2044 window or a text-only terminal, the Backspace key is bound to @kbd{C-h} and is
|
|
2045 positioned more conveniently than the @key{DEL} key.
|
|
2046
|
|
2047 @item ediff-toggle-read-only-function
|
|
2048 @vindex ediff-toggle-read-only-function
|
|
2049 This variable's value is a function that Ediff uses to toggle
|
|
2050 the read-only property in its buffers.
|
|
2051
|
|
2052 The default function that Ediff uses simply toggles the read-only property,
|
|
2053 unless the file is under version control. For a checked-in file under
|
|
2054 version control, Ediff first tries to check the file out.
|
|
2055
|
|
2056 @item ediff-keep-variants
|
|
2057 @vindex @code{ediff-keep-variants}
|
|
2058 The default is @code{t}, meaning that the buffers being compared or merged will
|
|
2059 be preserved when Ediff quits. Setting this to @code{nil} causes Ediff to
|
|
2060 offer the user a chance to delete these buffers (if they are not modified).
|
|
2061 Supplying a prefix argument to the quit command (@code{q}) temporarily
|
|
2062 reverses the meaning of this variable. This is convenient when the user
|
|
2063 prefers one of the behaviors most of the time, but occasionally needs the
|
|
2064 other behavior.
|
|
2065
|
|
2066 However, Ediff temporarily resets this variable to @code{t} if it is
|
|
2067 invoked via one of the "buffer" jobs, such as @code{ediff-buffers}.
|
|
2068 This is because it is all too easy to loose day's work otherwise.
|
|
2069 Besides, in a "buffer" job, the variant buffers have already been loaded
|
|
2070 prior to starting Ediff, so Ediff just preserves status quo here.
|
|
2071
|
|
2072 Using @code{ediff-cleanup-hook}, one can make Ediff delete the variants
|
|
2073 unconditionally (e.g., by making @code{ediff-janitor} into one of these hooks).
|
|
2074 @item ediff-grab-mouse
|
|
2075 @vindex @code{ediff-grab-mouse}
|
|
2076 Default is @code{t}. Normally, Ediff grabs mouse and puts it in its
|
|
2077 control frame. This is useful since the user can be sure that when he
|
|
2078 needs to type an Ediff command the focus will be in an appropriate Ediff's
|
|
2079 frame. However, some users prefer to move the mouse by themselves. The
|
|
2080 above variable, if set to @code{maybe}, will prevent Ediff from grabbing
|
|
2081 the mouse in many situations, usually after commands that may take more
|
|
2082 time than usual. In other situation, Ediff will continue grabbing the mouse
|
|
2083 and putting it where it believes is appropriate. If the value is
|
|
2084 @code{nil}, then mouse is entirely user's responsibility.
|
|
2085 Try different settings and see which one is for you.
|
|
2086 @end table
|
|
2087
|
|
2088
|
|
2089 @node Notes on Heavy-duty Customization, , Miscellaneous, Customization
|
|
2090 @section Notes on Heavy-duty Customization
|
|
2091
|
|
2092 Some users need to customize Ediff in rather sophisticated ways, which
|
|
2093 requires different defaults for different kinds of files (e.g., SGML,
|
|
2094 etc.). Ediff supports this kind of customization in several ways. First,
|
|
2095 most customization variables are buffer-local. Those that aren't are
|
|
2096 usually accessible from within Ediff Control Panel, so one can make them
|
|
2097 local to the panel by calling make-local-variable from within
|
|
2098 @code{ediff-startup-hook}.
|
|
2099
|
|
2100 Second, the function @code{ediff-setup} accepts an optional sixth
|
|
2101 argument which has the form @code{((@var{var-name-1} . @var{val-1})
|
|
2102 (@var{var-name-2} . @var{val-2}) @dots{})}. The function
|
|
2103 @code{ediff-setup} sets the variables in the list to the respective
|
|
2104 values, locally in the Ediff control buffer. This is an easy way to
|
|
2105 throw in custom variables (which usually should be buffer-local) that
|
|
2106 can then be tested in various hooks.
|
|
2107
|
|
2108 Make sure the variable @code{ediff-job-name} and @code{ediff-word-mode} are set
|
|
2109 properly in this case, as some things in Ediff depend on this.
|
|
2110
|
|
2111 Finally, if you want custom-tailored help messages, you can set the
|
|
2112 variables @code{ediff-brief-help-message-function} and
|
|
2113 @code{ediff-long-help-message-function}
|
|
2114 to functions that return help strings.
|
|
2115 @vindex ediff-startup-hook
|
|
2116 @findex ediff-setup
|
|
2117 @vindex ediff-job-name
|
|
2118 @vindex ediff-word-mode
|
|
2119 @vindex ediff-brief-help-message-function
|
|
2120 @vindex ediff-long-help-message-function
|
|
2121
|
|
2122 When customizing Ediff, some other variables are useful, although they are
|
|
2123 not user-definable. They are local to the Ediff control buffer, so this
|
|
2124 buffer must be current when you access these variables. The control buffer
|
|
2125 is accessible via the variable @code{ediff-control-buffer}, which is also
|
|
2126 local to that buffer. It is usually used for checking if the current buffer
|
|
2127 is also the control buffer.
|
|
2128
|
|
2129 Other variables of interest are:
|
|
2130 @table @code
|
|
2131 @item ediff-buffer-A
|
|
2132 The first of the data buffers being compared.
|
|
2133
|
|
2134 @item ediff-buffer-B
|
|
2135 The second of the data buffers being compared.
|
|
2136
|
|
2137 @item ediff-buffer-C
|
|
2138 In three-way comparisons, this is the third buffer being compared.
|
|
2139 In merging, this is the merge buffer.
|
|
2140 In two-way comparison, this variable is nil.
|
|
2141
|
|
2142 @item ediff-window-A
|
|
2143 The window displaying buffer A. If buffer A is not visible, this variable
|
|
2144 is nil or it may be a dead window.
|
|
2145
|
|
2146 @item ediff-window-B
|
|
2147 The window displaying buffer B.
|
|
2148
|
|
2149 @item ediff-window-C
|
|
2150 The window displaying buffer C, if any.
|
|
2151
|
|
2152 @item ediff-control-frame
|
|
2153 A dedicated frame displaying the control buffer, if it exists.
|
|
2154 It is non-nil only if Ediff uses the multiframe display, i.e., when the
|
|
2155 control buffer is in its own frame.
|
|
2156 @end table
|
|
2157
|
|
2158 @node Credits, Index, Customization, Top
|
|
2159 @chapter Credits
|
|
2160
|
|
2161 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
|
|
2163 Boris Goldowsky <boris@@cs.rochester.edu> made it possible to highlight
|
|
2164 fine differences in Ediff buffers. Alastair Burt <burt@@dfki.uni-kl.de>
|
12
|
2165 ported Ediff to XEmacs, Eric Freudenthal <freudent@@jan.ultra.nyu.edu>
|
16
|
2166 made it work with VC, and Marc Paquette <marcpa@@cam.org> wrote the
|
12
|
2167 toolbar support package for Ediff.
|
0
|
2168
|
|
2169 Many people provided help with bug reports, patches, and advice.
|
|
2170 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):
|
|
2172
|
|
2173 @example
|
|
2174 Neal Becker (neal@@ctd.comsat.com),
|
|
2175 Alastair Burt (burt@@dfki.uni-kl.de), Paul Bibilo (peb@@delcam.co.uk),
|
|
2176 Kevin Broadey (KevinB@@bartley.demon.co.uk),
|
|
2177 Harald Boegeholz (hwb@@machnix.mathematik.uni-stuttgart.de),
|
|
2178 Bradley A. Bosch (brad@@lachman.com),
|
|
2179 Michael D. Carney (carney@@ltx-tr.com),
|
|
2180 Jin S. Choi (jin@@atype.com),
|
|
2181 Albert Dvornik (bert@@mit.edu),
|
|
2182 Eric Eide (eeide@@asylum.cs.utah.edu),
|
|
2183 Kevin Esler (esler@@ch.hp.com), Robert Estes (estes@@ece.ucdavis.edu),
|
|
2184 Xavier Fornari (xavier@@europe.cma.fr),
|
|
2185 Eric Freudenthal (freudent@@jan.ultra.nyu.edu),
|
|
2186 Job Ganzevoort (Job.Ganzevoort@@cwi.nl),
|
|
2187 Boris Goldowsky (boris@@cs.rochester.edu),
|
12
|
2188 Allan Gottlieb (gottlieb@@allan.ultra.nyu.edu),
|
|
2189 Xiaoli Huang (hxl@@epic.com),
|
|
2190 Lars Magne Ingebrigtsen (larsi@@ifi.uio.no),
|
0
|
2191 Larry Gouge (larry@@itginc.com), Karl Heuer (kwzh@@gnu.ai.mit.edu),
|
|
2192 (irvine@@lks.csi.com), (jaffe@@chipmunk.cita.utoronto.ca),
|
|
2193 David Karr (dkarr@@nmo.gtegsc.com),
|
|
2194 Norbert Kiesel (norbert@@i3.informatik.rwth-aachen.de),
|
|
2195 Leigh L Klotz (klotz@@adoc.xerox.com), Fritz Knabe (Fritz.Knabe@@ecrc.de),
|
|
2196 Heinz Knutzen (hk@@informatik.uni-kiel.d400.de),
|
|
2197 Andrew Koenig (ark@@research.att.com),
|
|
2198 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),
|
|
2200 Martin Maechler (maechler@@stat.math.ethz.ch),
|
24
|
2201 Simon Marshall (Simon.Marshall@@gnu.ai.mit.edu),
|
0
|
2202 Richard Mlynarik (mly@@adoc.xerox.com),
|
|
2203 Chris Murphy (murphycm@@sun.aston.ac.uk),
|
|
2204 Erik Naggum (erik@@naggum.no),
|
|
2205 Eyvind Ness (Eyvind.Ness@@hrp.no), Ray Nickson (nickson@@cs.uq.oz.au),
|
|
2206 David Petchey (petchey_david@@jpmorgan.com),
|
|
2207 Benjamin Pierce (benjamin.pierce@@cl.cam.ac.uk),
|
|
2208 Tibor Polgar (tlp00@@spg.amdahl.com),
|
|
2209 David Prince (dave0d@@fegs.co.uk),
|
|
2210 Paul Raines (raines@@slac.stanford.edu),
|
|
2211 C.S. Roberson (roberson@@aur.alcatel.com),
|
|
2212 Kevin Rodgers (kevin.rodgers@@ihs.com),
|
|
2213 Sandy Rutherford (sandy@@ibm550.sissa.it),
|
|
2214 Heribert Schuetz (schuetz@@ecrc.de), Andy Scott (ascott@@pcocd2.intel.com),
|
|
2215 Axel Seibert (axel@@tumbolia.ppp.informatik.uni-muenchen.de),
|
12
|
2216 Scott O. Sherman (Scott.Sherman@@mci.com),
|
0
|
2217 Richard Stallman (rms@@gnu.ai.mit.edu),
|
|
2218 Richard Stanton (stanton@@haas.berkeley.edu),
|
|
2219 Ake Stenhoff (etxaksf@@aom.ericsson.se), Stig (stig@@hackvan.com),
|
|
2220 Peter Stout (Peter_Stout@@cs.cmu.edu), Chuck Thompson (cthomp@@cs.uiuc.edu),
|
|
2221 Ray Tomlinson (tomlinso@@bbn.com),
|
|
2222 Raymond Toy (toy@@rtp.ericsson.se),
|
12
|
2223 Philippe Waroquiers (philippe.waroquiers@@eurocontrol.be),
|
0
|
2224 Ben Wing (wing@@666.com),
|
|
2225 Ilya Zakharevich (ilya@@math.ohio-state.edu),
|
|
2226 Eli Zaretskii (eliz@@is.elta.co.il)
|
|
2227 @end example
|
|
2228
|
|
2229 @node Index, , Credits, Top
|
|
2230 @unnumbered Index
|
|
2231 @printindex cp
|
|
2232
|
|
2233 @contents
|
|
2234 @bye
|