Книга: Learning GNU Emacs, 3rd Edition
12.13.2 Using Ediff
12.13.2 Using Ediff
The basic way to use Ediff is to scroll through the buffers, seeing what has changed between them. The normal Emacs "browsing" keys (Space to move forward, Del to move backward) are bound in the control window to take you through the differences one by one. Pressing n (next) and p (previous) has the same effect. If you want to go to a specific difference, you can type a number followed by j (jump) to move immediately to that difference. To scroll up or down by pages rather than by differences you can use v to move forward and V to move backward. If your buffers contain wide lines, you can also type < and > to scroll left and right. If you'd like to view the buffers side by side rather than one above the other, type | (vertical bar). Typing this a second time returns to showing the buffers vertically. To reduce the need to scroll horizontally, you can make the comparison window as wide as possible by typing m (this is also a toggle; typing it again returns the window to its previous width). This command might cause the control window to lose focus, forcing you to click back into it before issuing the next Ediff command. (See "Recovering from Confusion" later in this chapter.) Important commands available in Ediff are summarized in Table 12-2.
Table 12-2. Ediff commands
Keystrokes | Command name | Action |
---|---|---|
Space or n | ediff-next-difference | Move to the next difference between the files. |
Del or p | ediff-previous-difference | Move to the preceding difference between the files. |
j | ediff-jump-to-difference | Go to the difference specified as a numeric prefix argument. |
v or C-v | ediff-scroll-vertically | Move forward one page in both buffers. |
V or M-v | ediff-scroll-vertically | Move backward one page in both buffers. |
< | ediff-scroll-horizontally | Scroll each buffer to the left. |
> | ediff-scroll-horizontally | Scroll each buffer to the right. |
| (vertical bar) | ediff-toggle-split | Switch between viewing the buffers one above the other and side-by-side. |
m | ediff-toggle-wide-display | Toggle between normal frame size and making it as wide as possible. |
a | ediff-copy-A-to-B | Copy the version of the current difference found in buffer A to buffer B. |
b | ediff-copy-B-to-A | Copy the version of the current difference found in buffer B to buffer A. |
r a or r b | ediff-restore-diff | Restore the current difference in buffer A (or B) to the way it was before copying from the other buffer. |
A or B | ediff-toggle-read-only | Switch the specified buffer into (or out of) read-only mode. |
g a or g b | ediff-jump-to-difference-at-point | Recenter the comparison buffers on the difference nearest to your current location (point) in the specified buffer. |
C-l | ediff-recenter | Restore the comparison display so that the highlighted regions of all buffers being compared are visible; useful if you've been doing something else and want to get back to comparing. |
! | ediff-update-diffs | Recalculate and redisplay the highlighted regions; useful if you've manually made extensive changes to a buffer. |
w a or w b | ediff-save-buffer | Save the specified buffer to disk. |
E | ediff-documentation | Open the manual for Ediff. |
z | ediff-suspend | Close the Ediff control window, but leave the session active so you can resume it later. |
q | ediff-quit | Close the Ediff window and end this comparison session. |
- 12.13.8 Invoking Ediff Automatically
- 12.13 Comparing with Ediff
- 12.13.1 Starting Ediff
- 12.13.4 Quitting Ediff
- 12.13.7 Customizing Ediff
- Table E-21. Ediff commands
- Caveats using NAT
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- Data Binding Using the GridView Control
- Using the kill Command to Control Processes
- Installing Using a Network
- Using X