[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Session Commands

All Ediff commands are displayed in a Quick Help window, unless you type ? to shrink the window to just one line. You can redisplay the help window by typing ? again. The Quick Help commands are detailed below.

Many Ediff commands take numeric prefix arguments. For instance, if you type a number, say 3, and then j (ediff-jump-to-difference), Ediff moves to the third difference region. Typing 3 and then a (ediff-diff-to-diff) copies the 3rd difference region from variant A to variant B. Likewise, 4 followed by ra restores the 4th difference region in buffer A (if it was previously written over via the command a).

Some commands take negative prefix arguments as well. For instance, typing - and then j will make the last difference region current. Typing -2 then j makes the penultimate difference region current, etc.

Without the prefix argument, all commands operate on the currently selected difference region. You can make any difference region current using the various commands explained below.

For some commands, the actual value of the prefix argument is immaterial. However, if supplied, the prefix argument may modify the command (see ga, gb, and gc).

3.1 Quick Help Commands  Frequently used commands.
3.2 Other Session Commands  Commands that are not bound to keys.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1 Quick Help Commands

?
Toggles the Ediff Quick Help window ON and OFF.
G
Prepares a mail buffer for sending a praise or a curse to the Ediff maintainer.

E
Brings up the top node of this manual, where you can find further information on the various Ediff functions and advanced issues, such as customization, session groups, etc.

v
Scrolls up buffers A and B (and buffer C where appropriate) in a coordinated fashion.
V
Scrolls the buffers down.

<
Scrolls the buffers to the left simultaneously.
>
Scrolls buffers to the right.

wd
Saves the output from the diff utility, for further reference.

With prefix argument, saves the plain output from diff (see ediff-diff-program and ediff-diff-options). Without the argument, it saves customized diff output (see ediff-custom-diff-program and ediff-custom-diff-options), if it is available.

wa
Saves buffer A, if it was modified.
wb
Saves buffer B, if it was modified.
wc
Saves buffer C, if it was modified (if you are in a session that compares three files simultaneously).

a
In comparison sessions: Copies the current difference region (or the region specified as the prefix to this command) from buffer A to buffer B. Ediff saves the old contents of buffer B's region; it can be restored via the command rb, which see.

In merge sessions: Copies the current difference region (or the region specified as the prefix to this command) from buffer A to the merge buffer. The old contents of this region in buffer C can be restored via the command r.

b
Works similarly, but copies the current difference region from buffer B to buffer A (in comparison sessions) or the merge buffer (in merge sessions).

Ediff saves the old contents of the difference region copied over; it can be reinstated via the command ra in comparison sessions and r in merge sessions.

ab
Copies the current difference region (or the region specified as the prefix to this command) from buffer A to buffer B. This (and the next five) command is enabled only in sessions that compare three files simultaneously. The old region in buffer B is saved and can be restored via the command rb.
ac
Copies the difference region from buffer A to buffer C. The old region in buffer C is saved and can be restored via the command rc.
ba
Copies the difference region from buffer B to buffer A. The old region in buffer A is saved and can be restored via the command ra.
bc
Copies the difference region from buffer B to buffer C. The command rc undoes this.
ca
Copies the difference region from buffer C to buffer A. The command ra undoes this.
cb
Copies the difference region from buffer C to buffer B. The command rb undoes this.

p
DEL
Makes the previous difference region current.
n
SPC
Makes the next difference region current.

j
-j
Nj
Makes the very first difference region current.

-j makes the last region current. Typing a number, N, and then `j' makes the difference region N current. Typing -N (a negative number) then `j' makes current the region Last - N.

ga
Makes current the difference region closest to the position of the point in buffer A.

However, with a prefix argument, Ediff would position all variants around the area indicated by the current point in buffer A: if the point is inside a difference region, then the variants will be positioned at this difference region. If the point is not in any difference region, then it is in an area where all variants agree with each other. In this case, the variants will be positioned so that each would display this area (of agreement).

gb
Makes current the difference region closest to the position of the point in buffer B.

With a prefix argument, behaves like ga, but with respect to buffer B.

gc
In merge sessions: makes current the difference region closest to the point in the merge buffer.

In 3-file comparison sessions: makes current the region closest to the point in buffer C.

With a prefix argument, behaves like ga, but with respect to buffer C.

!
Recomputes the difference regions, bringing them up to date. This is often needed because it is common to do all sorts of editing during Ediff sessions, so after a while, the highlighted difference regions may no longer reflect the actual differences among the buffers.

*
Forces refinement of the current difference region, which highlights the exact words of disagreement among the buffers. With a negative prefix argument, unhighlights the current region.

Forceful refinement may be needed if Ediff encounters a difference region that is larger than ediff-auto-refine-limit. In this situation, Ediff doesn't do automatic refinement in order to improve response time. (Ediff doesn't auto-refine on dumb terminals as well, but * still works there. However, the only useful piece of information it can tell you is whether or not the difference regions disagree only in the amount of white space.)

This command is also useful when the highlighted fine differences are no longer current, due to user editing.

m
Displays the current Ediff session in a frame as wide as the physical display. This is useful when comparing files side-by-side. Typing `m' again restores the original size of the frame.

|
Toggles the horizontal/vertical split of the Ediff display. Horizontal split is convenient when it is possible to compare files side-by-side. If the frame in which files are displayed is too narrow and lines are cut off, typing m may help some.

@
Toggles auto-refinement of difference regions (i.e., automatic highlighting of the exact words that differ among the variants). Auto-refinement is turned off on devices where Emacs doesn't support highlighting.

On slow machines, it may be advantageous to turn auto-refinement off. The user can always forcefully refine specific difference regions by typing *.

h
Cycles between full highlighting, the mode where fine differences are not highlighted (but computed), and the mode where highlighting is done with ASCII strings. The latter is not really recommended, unless on a dumb TTY.

r
Restores the old contents of the region in the merge buffer. (If you copied a difference region from buffer A or B into the merge buffer using the commands a or b, Ediff saves the old contents of the region in case you change your mind.)

This command is enabled in merge sessions only.

ra
Restores the old contents of the current difference region in buffer A, which was previously saved when the user invoked one of these commands: b, ba, ca, which see. This command is enabled in comparison sessions only.
rb
Restores the old contents of the current difference region in buffer B, which was previously saved when the user invoked one of these commands: a, ab, cb, which see. This command is enabled in comparison sessions only.
rc
Restores the old contents of the current difference region in buffer C, which was previously saved when the user invoked one of these commands: ac, bc, which see. This command is enabled in 3-file comparison sessions only.

##
Tell Ediff to skip over regions that disagree among themselves only in the amount of white space and line breaks.

Even though such regions will be skipped over, you can still jump to any one of them by typing the region number and then `j'. Typing ## again puts Ediff back in the original state.

#c
Toggle case sensitivity in the diff program. All diffs are recomputed. Case sensitivity is controlled by the variables ediff-ignore-case-option, ediff-ignore-case-option3, and ediff-ignore-case, which are explained elsewhere.

#h
#f
Ediff works hard to ameliorate the effects of boredom in the workplace...

Quite often differences are due to identical replacements (e.g., the word `foo' is replaced with the word `bar' everywhere). If the number of regions with such boring differences exceeds your tolerance threshold, you may be tempted to tell Ediff to skip these regions altogether (you will still be able to jump to them via the command j). The above commands, #h and #f, may well save your day!

#h prompts you to specify regular expressions for each variant. Difference regions where each variant's region matches the corresponding regular expression will be skipped from then on. (You can also tell Ediff to skip regions where at least one variant matches its regular expression.)

#f does dual job: it focuses on regions that match the corresponding regular expressions. All other regions will be skipped over. See section 7.4 Selective Browsing, for more.

A
Toggles the read-only property in buffer A. If file A is under version control and is checked in, it is checked out (with your permission).
B
Toggles the read-only property in buffer B. If file B is under version control and is checked in, it is checked out.
C
Toggles the read-only property in buffer C (in 3-file comparison sessions). If file C is under version control and is checked in, it is checked out.

~
Swaps the windows where buffers A and B are displayed. If you are comparing three buffers at once, then this command would rotate the windows among buffers A, B, and C.

i
Displays all kinds of useful data about the current Ediff session.
D
Runs ediff-custom-diff-program on the variants and displays the buffer containing the output. This is useful when you must send the output to your Mom.

With a prefix argument, displays the plain diff output. See section 7.8 Patch and Diff Programs, for details.

R
Displays a list of currently active Ediff sessions--the Ediff Registry. You can then restart any of these sessions by either clicking on a session record or by putting the cursor over it and then typing the return key.

(Some poor souls leave so many active Ediff sessions around that they loose track of them completely... The `R' command is designed to save these people from the recently discovered Ediff Proficiency Syndrome.)

Typing R brings up Ediff Registry only if it is typed into an Ediff Control Panel. If you don't have a control panel handy, type this in the minibuffer: M-x eregistry. See section 4. Registry of Ediff Sessions.

M
Shows the session group buffer that invoked the current Ediff session. See section 5. Session Groups, for more information on session groups.

z
Suspends the current Ediff session. (If you develop a condition known as Repetitive Ediff Injury--a serious but curable illness--you must change your current activity. This command tries hard to hide all Ediff-related buffers.)

The easiest way to resume a suspended Ediff session is through the registry of active sessions. See section 4. Registry of Ediff Sessions, for details.

q
Terminates this Ediff session. With a prefix argument (e.g.,1q), asks if you also want to delete the buffers of the variants. Modified files and the results of merges are never deleted.

%
Toggles narrowing in Ediff buffers. Ediff buffers may be narrowed if you are comparing only parts of these buffers via the commands ediff-windows-* and ediff-regions-*, which see.

C-l
Restores the usual Ediff window setup. This is the quickest way to resume an Ediff session, but it works only if the control panel of that session is visible.

$$
While merging with an ancestor file, Ediff is determined to reduce user's wear and tear by saving him and her much of unproductive, repetitive typing. If it notices that, say, file A's difference region is identical to the same difference region in the ancestor file, then the merge buffer will automatically get the difference region taken from buffer B. The rationale is that this difference region in buffer A is as old as that in the ancestor buffer, so the contents of that region in buffer B represents real change.

You may want to ignore such `obvious' merges and concentrate on difference regions where both files `clash' with the ancestor, since this means that two different people have been changing this region independently and they had different ideas on how to do this.

The above command does this for you by skipping the regions where only one of the variants clashes with the ancestor but the other variant agrees with it. Typing $$ again undoes this setting.

$*
When merging files with large number of differences, it is sometimes convenient to be able to skip the difference regions for which you already decided which variant is most appropriate. Typing $* will accomplish precisely this.

To be more precise, this toggles the check for whether the current merge is identical to its default setting, as originally decided by Ediff. For instance, if Ediff is merging according to the `combined' policy, then the merge region is skipped over if it is different from the combination of the regions in buffers A and B. (Warning: swapping buffers A and B will confuse things in this respect.) If the merge region is marked as `prefer-A' then this region will be skipped if it differs from the current difference region in buffer A, etc.

/
Displays the ancestor file during merges.
&
In some situations, such as when one of the files agrees with the ancestor file on a difference region and the other doesn't, Ediff knows what to do: it copies the current difference region from the second buffer into the merge buffer.

In other cases, the right course of action is not that clearcut, and Ediff would use a default action. The above command changes the default action. The default action can be `default-A' (choose the region from buffer A), `default-B' (choose the region from buffer B), or `combined' (combine the regions from the two buffers). See section 7.9 Merging and diff3, for further details.

The command & also affects the regions in the merge buffers that have `default-A', `default-B', or `combined' status, provided they weren't changed with respect to the original. For instance, if such a region has the status `default-A' then changing the default action to `default-B' will also replace this merge-buffer's region with the corresponding region from buffer B.

s
Causes the merge window shrink to its minimum size, thereby exposing as much of the variant buffers as possible. Typing `s' again restores the original size of that window.

With a positive prefix argument, this command enlarges the merge window. E.g., 4s increases the size of the window by about 4 lines, if possible. With a negative numeric argument, the size of the merge window shrinks by that many lines, if possible. Thus, -s shrinks the window by about 1 line and -3s by about 3 lines.

This command is intended only for temporary viewing; therefore, Ediff restores window C to its original size whenever it makes any other change in the window configuration. However, redisplaying (C-l) or jumping to another difference does not affect window C's size.

The split between the merge window and the variant windows is controlled by the variable ediff-merge-window-share, which see.

+
Combines the difference regions from buffers A and B and copies the result into the merge buffer. See section 7.9 Merging and diff3, and the variables ediff-combine-diffs and ediff-combination-pattern.

=
You may run into situations when a large chunk of text in one file has been edited and then moved to a different place in another file. In such a case, these two chunks of text are unlikely to belong to the same difference region, so the refinement feature of Ediff will not be able to tell you what exactly differs inside these chunks. Since eyeballing large pieces of text is contrary to human nature, Ediff has a special command to help reduce the risk of developing a cataract.

In other situations, the currently highlighted region might be big and you might want to reconcile of them interactively.

All of this can be done with the above command, =, which compares regions within Ediff buffers. Typing = creates a child Ediff session for comparing regions in buffers A, B, or C as follows.

First, you will be asked whether you want to compare the fine differences between the currently highlighted buffers on a word-by-word basis. If you accept, a child Ediff session will start using the currently highlighted regions. Ediff will let you step over the differences word-wise.

If you reject the offer, you will be asked to select regions of your choice.

If you are comparing 2 files or buffers: Ediff will ask you to select regions in buffers A and B.

If you are comparing 3 files or buffers simultaneously: Ediff will ask you to choose buffers and then select regions inside those buffers.

If you are merging files or buffers (with or without ancestor): Ediff will ask you to choose which buffer (A or B) to compare with the merge buffer and then select regions in those buffers.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2 Other Session Commands

The following commands can be invoked from within any Ediff session, although some of them are not bound to a key.

eregistry
ediff-show-registry
This command brings up the registry of active Ediff sessions. Ediff registry is a device that can be used to resume any active Ediff session (which may have been postponed because the user switched to some other activity). This command is also useful for switching between multiple active Ediff sessions that are run at the same time. The function eregistry is an alias for ediff-show-registry. See section 4. Registry of Ediff Sessions, for more information on this registry.

ediff-toggle-multiframe
Changes the display from the multi-frame mode (where the quick help window is in a separate frame) to the single-frame mode (where all Ediff buffers share the same frame), and vice versa. See ediff-window-setup-function for details on how to make either of these modes the default one.

This function can also be invoked from the Menubar. However, in some cases, the change will take place only after you execute one of the Ediff commands, such as going to the next difference or redisplaying.

ediff-toggle-use-toolbar
Available in XEmacs only. The Ediff toolbar provides quick access to some of the common Ediff functions. This function toggles the display of the toolbar. If invoked from the menubar, the function may take sometimes effect only after you execute an Ediff command, such as going to the next difference.

ediff-use-toolbar-p
The use of the toolbar can also be specified via the variable ediff-use-toolbar-p (default is t). This variable can be set only in `.emacs' -- do not change it interactively. Use the function ediff-toggle-use-toolbar instead.

ediff-revert-buffers-then-recompute-diffs
This command reverts the buffers you are comparing and recomputes their differences. It is useful when, after making changes, you decided to make a fresh start, or if at some point you changed the files being compared but want to discard any changes to comparison buffers that were done since then.

This command normally asks for confirmation before reverting files. With a prefix argument, it reverts files without asking.

ediff-profile
Ediff has an admittedly primitive (but useful) facility for profiling Ediff's commands. It is meant for Ediff maintenance--specifically, for making it run faster. The function ediff-profile toggles profiling of ediff commands.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs shared group account on December, 19 2009 using texi2html 1.65.