annotate man/emerge-xtra.texi @ 72533:56fd2cceac24

Remove * in defcustoms. (defgroup checkdoc): Move to beginning.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 25 Aug 2006 23:40:38 +0000
parents d0129b429526
children 3d45362f1d38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70457
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
1 @c This is part of the Emacs manual.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
2 @c Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
3 @c See file emacs.texi for copying conditions.
bdd0ac985d67 Add Copyright notices.
Eli Zaretskii <eliz@gnu.org>
parents: 70440
diff changeset
4 @c
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5 @c This file is included either in emacs-xtra.texi (when producing the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6 @c printed version) or in the main Emacs manual (for the on-line version).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
7 @node Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
8 @section Merging Files with Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
9 @cindex Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
10 @cindex merging files
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
11
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
12 It's not unusual for programmers to get their signals crossed and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
13 modify the same program in two different directions. To recover from
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
14 this confusion, you need to merge the two versions. Emerge makes this
70462
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
15 easier. For other ways to compare files, see
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
16 @iftex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
17 @ref{Comparing Files,,, emacs, the Emacs Manual},
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
18 @end iftex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
19 @ifnottex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
20 @ref{Comparing Files},
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
21 @end ifnottex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
22 and @ref{Top, Ediff,, ediff, The Ediff Manual}.
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
23
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
24 @menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
25 * Overview of Emerge:: How to start Emerge. Basic concepts.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
26 * Submodes of Emerge:: Fast mode vs. Edit mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
27 Skip Prefers mode and Auto Advance mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
28 * State of Difference:: You do the merge by specifying state A or B
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
29 for each difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
30 * Merge Commands:: Commands for selecting a difference,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
31 changing states of differences, etc.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
32 * Exiting Emerge:: What to do when you've finished the merge.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
33 * Combining in Emerge:: How to keep both alternatives for a difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
34 * Fine Points of Emerge:: Misc.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
35 @end menu
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
36
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
37 @node Overview of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
38 @subsection Overview of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
39
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
40 To start Emerge, run one of these four commands:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
41
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
42 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
43 @item M-x emerge-files
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
44 @findex emerge-files
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
45 Merge two specified files.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
46
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
47 @item M-x emerge-files-with-ancestor
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
48 @findex emerge-files-with-ancestor
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
49 Merge two specified files, with reference to a common ancestor.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
50
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
51 @item M-x emerge-buffers
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
52 @findex emerge-buffers
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
53 Merge two buffers.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
54
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
55 @item M-x emerge-buffers-with-ancestor
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
56 @findex emerge-buffers-with-ancestor
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
57 Merge two buffers with reference to a common ancestor in a third
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
58 buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
59 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
60
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
61 @cindex merge buffer (Emerge)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
62 @cindex A and B buffers (Emerge)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
63 The Emerge commands compare two files or buffers, and display the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
64 comparison in three buffers: one for each input text (the @dfn{A buffer}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
65 and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
66 takes place. The merge buffer shows the full merged text, not just the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
67 differences. Wherever the two input texts differ, you can choose which
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
68 one of them to include in the merge buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
69
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
70 The Emerge commands that take input from existing buffers use only
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
71 the accessible portions of those buffers, if they are narrowed.
70462
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
72 @iftex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
73 @xref{Narrowing,,, emacs, the Emacs Manual}.
70462
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
74 @end iftex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
75 @ifnottex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
76 @xref{Narrowing}.
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
77 @end ifnottex
70440
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
78
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
79
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
80 If a common ancestor version is available, from which the two texts to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
81 be merged were both derived, Emerge can use it to guess which
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
82 alternative is right. Wherever one current version agrees with the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
83 ancestor, Emerge presumes that the other current version is a deliberate
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
84 change which should be kept in the merged version. Use the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
85 @samp{with-ancestor} commands if you want to specify a common ancestor
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
86 text. These commands read three file or buffer names---variant A,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
87 variant B, and the common ancestor.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
88
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
89 After the comparison is done and the buffers are prepared, the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
90 interactive merging starts. You control the merging by typing special
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
91 @dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
92 For each run of differences between the input texts, you can choose
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
93 which one of them to keep, or edit them both together.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
94
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
95 The merge buffer uses a special major mode, Emerge mode, with commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
96 for making these choices. But you can also edit the buffer with
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
97 ordinary Emacs commands.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
98
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
99 At any given time, the attention of Emerge is focused on one
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
100 particular difference, called the @dfn{selected} difference. This
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
101 difference is marked off in the three buffers like this:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
102
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
103 @example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
104 vvvvvvvvvvvvvvvvvvvv
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
105 @var{text that differs}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
106 ^^^^^^^^^^^^^^^^^^^^
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
107 @end example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
108
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
109 @noindent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
110 Emerge numbers all the differences sequentially and the mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
111 line always shows the number of the selected difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
112
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
113 Normally, the merge buffer starts out with the A version of the text.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
114 But when the A version of a difference agrees with the common ancestor,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
115 then the B version is initially preferred for that difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
116
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
117 Emerge leaves the merged text in the merge buffer when you exit. At
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
118 that point, you can save it in a file with @kbd{C-x C-w}. If you give a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
119 numeric argument to @code{emerge-files} or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
120 @code{emerge-files-with-ancestor}, it reads the name of the output file
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
121 using the minibuffer. (This is the last file name those commands read.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
122 Then exiting from Emerge saves the merged text in the output file.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
123
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
124 Normally, Emerge commands save the output buffer in its file when you
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
125 exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
126 save the output buffer, but you can save it yourself if you wish.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
127
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
128 @node Submodes of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
129 @subsection Submodes of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
130
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
131 You can choose between two modes for giving merge commands: Fast mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
132 and Edit mode. In Fast mode, basic merge commands are single
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
133 characters, but ordinary Emacs commands are disabled. This is
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
134 convenient if you use only merge commands. In Edit mode, all merge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
135 commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
136 commands are also available. This allows editing the merge buffer, but
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
137 slows down Emerge operations.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
138
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
139 Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
140 Fast mode. The mode line indicates Edit and Fast modes with @samp{E}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
141 and @samp{F}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
142
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
143 Emerge has two additional submodes that affect how particular merge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
144 commands work: Auto Advance mode and Skip Prefers mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
145
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
146 If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
147 advance to the next difference. This lets you go through the merge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
148 faster as long as you simply choose one of the alternatives from the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
149 input. The mode line indicates Auto Advance mode with @samp{A}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
150
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
151 If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
152 skip over differences in states prefer-A and prefer-B (@pxref{State of
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
153 Difference}). Thus you see only differences for which neither version
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
154 is presumed ``correct.'' The mode line indicates Skip Prefers mode with
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
155 @samp{S}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
156
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
157 @findex emerge-auto-advance-mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
158 @findex emerge-skip-prefers-mode
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
159 Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
160 clear Auto Advance mode. Use @kbd{s s}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
161 (@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
162 These commands turn on the mode with a positive argument, turns it off
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
163 with a negative or zero argument, and toggle the mode with no argument.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
164
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
165 @node State of Difference
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
166 @subsection State of a Difference
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
167
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
168 In the merge buffer, a difference is marked with lines of @samp{v} and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
169 @samp{^} characters. Each difference has one of these seven states:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
170
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
171 @table @asis
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
172 @item A
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
173 The difference is showing the A version. The @kbd{a} command always
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
174 produces this state; the mode line indicates it with @samp{A}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
175
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
176 @item B
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
177 The difference is showing the B version. The @kbd{b} command always
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
178 produces this state; the mode line indicates it with @samp{B}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
179
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
180 @item default-A
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
181 @itemx default-B
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
182 The difference is showing the A or the B state by default, because you
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
183 haven't made a choice. All differences start in the default-A state
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
184 (and thus the merge buffer is a copy of the A buffer), except those for
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
185 which one alternative is ``preferred'' (see below).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
186
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
187 When you select a difference, its state changes from default-A or
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
188 default-B to plain A or B. Thus, the selected difference never has
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
189 state default-A or default-B, and these states are never displayed in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
190 the mode line.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
191
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
192 The command @kbd{d a} chooses default-A as the default state, and @kbd{d
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
193 b} chooses default-B. This chosen default applies to all differences
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
194 which you haven't ever selected and for which no alternative is preferred.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
195 If you are moving through the merge sequentially, the differences you
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
196 haven't selected are those following the selected one. Thus, while
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
197 moving sequentially, you can effectively make the A version the default
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
198 for some sections of the merge buffer and the B version the default for
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
199 others by using @kbd{d a} and @kbd{d b} between sections.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
200
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
201 @item prefer-A
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
202 @itemx prefer-B
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
203 The difference is showing the A or B state because it is
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
204 @dfn{preferred}. This means that you haven't made an explicit choice,
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
205 but one alternative seems likely to be right because the other
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
206 alternative agrees with the common ancestor. Thus, where the A buffer
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
207 agrees with the common ancestor, the B version is preferred, because
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
208 chances are it is the one that was actually changed.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
209
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
210 These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
211
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
212 @item combined
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
213 The difference is showing a combination of the A and B states, as a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
214 result of the @kbd{x c} or @kbd{x C} commands.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
215
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
216 Once a difference is in this state, the @kbd{a} and @kbd{b} commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
217 don't do anything to it unless you give them a numeric argument.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
218
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
219 The mode line displays this state as @samp{comb}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
220 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
221
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
222 @node Merge Commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
223 @subsection Merge Commands
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
224
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
225 Here are the Merge commands for Fast mode; in Edit mode, precede them
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
226 with @kbd{C-c C-c}:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
227
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
228 @table @kbd
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
229 @item p
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
230 Select the previous difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
231
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
232 @item n
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
233 Select the next difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
234
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
235 @item a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
236 Choose the A version of this difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
237
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
238 @item b
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
239 Choose the B version of this difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
240
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
241 @item C-u @var{n} j
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
242 Select difference number @var{n}.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
243
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
244 @item .
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
245 Select the difference containing point. You can use this command in the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
246 merge buffer or in the A or B buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
247
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
248 @item q
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
249 Quit---finish the merge.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
250
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
251 @item C-]
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
252 Abort---exit merging and do not save the output.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
253
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
254 @item f
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
255 Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
256
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
257 @item e
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
258 Go into Edit mode.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
259
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
260 @item l
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
261 Recenter (like @kbd{C-l}) all three windows.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
262
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
263 @item -
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
264 Specify part of a prefix numeric argument.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
265
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
266 @item @var{digit}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
267 Also specify part of a prefix numeric argument.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
268
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
269 @item d a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
270 Choose the A version as the default from here down in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
271 the merge buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
272
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
273 @item d b
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
274 Choose the B version as the default from here down in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
275 the merge buffer.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
276
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
277 @item c a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
278 Copy the A version of this difference into the kill ring.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
279
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
280 @item c b
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
281 Copy the B version of this difference into the kill ring.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
282
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
283 @item i a
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
284 Insert the A version of this difference at point.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
285
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
286 @item i b
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
287 Insert the B version of this difference at point.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
288
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
289 @item m
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
290 Put point and mark around the difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
291
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
292 @item ^
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
293 Scroll all three windows down (like @kbd{M-v}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
294
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
295 @item v
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
296 Scroll all three windows up (like @kbd{C-v}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
297
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
298 @item <
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
299 Scroll all three windows left (like @kbd{C-x <}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
300
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
301 @item >
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
302 Scroll all three windows right (like @kbd{C-x >}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
303
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
304 @item |
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
305 Reset horizontal scroll on all three windows.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
306
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
307 @item x 1
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
308 Shrink the merge window to one line. (Use @kbd{C-u l} to restore it
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
309 to full size.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
310
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
311 @item x c
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
312 Combine the two versions of this difference (@pxref{Combining in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
313 Emerge}).
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
314
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
315 @item x f
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
316 Show the names of the files/buffers Emerge is operating on, in a Help
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
317 window. (Use @kbd{C-u l} to restore windows.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
318
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
319 @item x j
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
320 Join this difference with the following one.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
321 (@kbd{C-u x j} joins this difference with the previous one.)
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
322
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
323 @item x s
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
324 Split this difference into two differences. Before you use this
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
325 command, position point in each of the three buffers at the place where
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
326 you want to split the difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
327
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
328 @item x t
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
329 Trim identical lines off the top and bottom of the difference.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
330 Such lines occur when the A and B versions are
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
331 identical but differ from the ancestor version.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
332 @end table
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
333
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
334 @node Exiting Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
335 @subsection Exiting Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
336
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
337 The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
338 the results into the output file if you specified one. It restores the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
339 A and B buffers to their proper contents, or kills them if they were
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
340 created by Emerge and you haven't changed them. It also disables the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
341 Emerge commands in the merge buffer, since executing them later could
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
342 damage the contents of the various buffers.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
343
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
344 @kbd{C-]} aborts the merge. This means exiting without writing the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
345 output file. If you didn't specify an output file, then there is no
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
346 real difference between aborting and finishing the merge.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
347
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
348 If the Emerge command was called from another Lisp program, then its
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
349 return value is @code{t} for successful completion, or @code{nil} if you
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
350 abort.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
351
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
352 @node Combining in Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
353 @subsection Combining the Two Versions
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
354
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
355 Sometimes you want to keep @emph{both} alternatives for a particular
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
356 difference. To do this, use @kbd{x c}, which edits the merge buffer
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
357 like this:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
358
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
359 @example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
360 @group
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
361 #ifdef NEW
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
362 @var{version from A buffer}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
363 #else /* not NEW */
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
364 @var{version from B buffer}
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
365 #endif /* not NEW */
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
366 @end group
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
367 @end example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
368
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
369 @noindent
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
370 @vindex emerge-combine-versions-template
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
371 While this example shows C preprocessor conditionals delimiting the two
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
372 alternative versions, you can specify the strings to use by setting
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
373 the variable @code{emerge-combine-versions-template} to a string of your
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
374 choice. In the string, @samp{%a} says where to put version A, and
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
375 @samp{%b} says where to put version B. The default setting, which
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
376 produces the results shown above, looks like this:
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
377
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
378 @example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
379 @group
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
380 "#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
381 @end group
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
382 @end example
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
383
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
384 @node Fine Points of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
385 @subsection Fine Points of Emerge
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
386
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
387 During the merge, you mustn't try to edit the A and B buffers yourself.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
388 Emerge modifies them temporarily, but ultimately puts them back the way
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
389 they were.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
390
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
391 You can have any number of merges going at once---just don't use any one
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
392 buffer as input to more than one merge at once, since the temporary
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
393 changes made in these buffers would get in each other's way.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
394
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
395 Starting Emerge can take a long time because it needs to compare the
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
396 files fully. Emacs can't do anything else until @code{diff} finishes.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
397 Perhaps in the future someone will change Emerge to do the comparison in
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
398 the background when the input files are large---then you could keep on
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
399 doing other things with Emacs until Emerge is ready to accept
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
400 commands.
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
401
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
402 @vindex emerge-startup-hook
5e1c038e4afa New file, a portion of emacs-xtra.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
403 After setting up the merge, Emerge runs the hook
70462
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
404 @code{emerge-startup-hook}.
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
405 @iftex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
406 @xref{Hooks,,, emacs, the Emacs Manual}.
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
407 @end iftex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
408 @ifnottex
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
409 @xref{Hooks}.
d0129b429526 (Emerge, Overview of Emerge)
Eli Zaretskii <eliz@gnu.org>
parents: 70461
diff changeset
410 @end ifnottex
70461
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
411
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
412 @ignore
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
413 arch-tag: cda63f09-9c5f-4ea1-adb9-4a820fdfb24e
a6e9a00b021b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 70457
diff changeset
414 @end ignore