annotate man/emerge.txt @ 21:b88636d63495

Added tag r19-15b93 for changeset 859a2309aef8
author cvs
date Mon, 13 Aug 2007 08:50:06 +0200
parents ac2d302a0011
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 This is the documentation for version 5 of "emerge.el", an Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 package that allows you to combine two versions of a file by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 selecting, for each place where they differ, which version of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 difference you prefer. It is similar to Sun's "filemerge".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 Written by Dale R. Worley <drw@math.mit.edu>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 WARRANTY DISCLAIMER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 This software was created by Dale R. Worley and is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 distributed free of charge. It is placed in the public domain and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 permission is granted to anyone to use, duplicate, modify and redistribute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 it provided that this notice is attached.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 Dale R. Worley provides absolutely NO WARRANTY OF ANY KIND
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 with respect to this software. The entire risk as to the quality and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 performance of this software is with the user. IN NO EVENT WILL DALE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 R. WORLEY BE LIABLE TO ANYONE FOR ANY DAMAGES ARISING OUT THE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 USE OF THIS SOFTWARE, INCLUDING, WITHOUT LIMITATION, DAMAGES RESULTING FROM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 LOST DATA OR LOST PROFITS, OR FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 DAMAGES.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; LCD Archive Entry:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; emerge|Dale R. Worley|drw@math.mit.edu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; |File merge documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; |92-12-11|version 5 gamma|~/packages/emerge.doc.Z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 - Changes from version 4 to version 5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 Put in improved disclaimer of copyright and warranty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 Document autoload for emerge-execute-line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 Changes to support use with Ange-FTP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 Allow filenames containing shell metacharacters to be handled unscathed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 Certain internal problems were fixed so that bugs in "x s", "x j", and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "x t" were eliminated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 Non-existent and non-readable file names are rejected, even if Emerge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 is called non-interactively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 Add code to process the local-variables list in newly created merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 Add changes made by David Gudeman to allow the default directory for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 arguments to the emerge-files commands to be the directory of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 argument of that type to the last emerge-files command. See "Default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 directories" below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 Add emerge-process-line command to allow semi-automatic batching of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 merges.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Add David Gudeman's facility for merging RCS revisions of a file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 Add a few hooks to make customization easier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Still no Epoch support in this version, though. Talk to Dan Pierson
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 <pierson@xenna.encore.com> or check epoch-emerge-patch.el in the Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 Lisp Directory if you want Epoch support.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 And the document still isn't in TeXinfo format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 - Changes from version 3 to version 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 More configuration variables are marked as user options.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Code is included for an improved version of make-auto-save-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 which eliminates many problems with the default version. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 documentation of emerge-make-auto-save-file-name to see how to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 activate it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Emerge now works with Gnu diff3, which can produce the groups of lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 from the various files in the order 1, 2, 3 or 1, 3, 2.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 Add "x f" command to show what files or buffers are being operated on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 The merge buffer now starts read-only, which being in fast mode it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 should be.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 When merging buffers, Emerge writes their contents into temporary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 files in the directory $TMPDIR (if it is defined), or /tmp by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 Add "x j" command to join two differences.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 Add "x s" command to split a difference into two differences.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 Add emerge-version variable and function to report the version of Emerge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 being run.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 Add "x t" command to trim unchanged lines off top and bottom of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 difference region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 Add "x d", "x a", and "x b" commands to locate the differences at or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 near a given location in one of the buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 Emerge no longer tries to copy the minor modes from the A buffer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 the merge buffer, only the major mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 The programs executed to find the differences between versions of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 are no longer controlled by emerge-diff/diff3-command, but rather by:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 emerge-diff-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 Variable: *Name of the program which compares two files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 emerge-diff3-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 Variable: *Name of the program which compares an ancestor file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (first argument) and two variant files (second and third arguments).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 emerge-diff-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 Variable: *Options to be passed to emerge-diff/diff3-program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 The names of the files are expanded (see expand-file-name) before being
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 passed to emerge-diff/diff3-program, so diff need not invoked under a shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 that understands '~', for instance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 If the diff/diff3 program reports errors, the user is notified and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 errors are displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 The command "0j" can be used to suppress the flags from showing in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 A discussion of the effect of the merge flags on indentation of code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 has been added to the documentation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 If kill-fix.el is loaded, Emerge control variables now have their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 'preserved' property set, so setting the major mode in the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 buffer doesn't destroy Emerge's state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 Add "x c", "x C", and "x x" commands to allow the A and B versions to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 combined into #ifdef - #endif forms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 Replaced calls of "ding" to calls of "error" where appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 Add "x m" command to allow major mode of merge buffer to be changed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 Add "x 1" command to shrink the merge window to one line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 Add emerge-startup-hooks to allow customization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 Fixed a bug that is activated when a remote merge request is made when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 the minibuffer window is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 - Changes from version 2 to version 3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 The directory into which temporary files are written is now controlled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 by a user option (emerge-temp-file-prefix).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 The A and B versions of the difference can be loaded into the kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ring with the "c a" and "c b" commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 The A and B versions of the difference can be inserted into the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 buffer with the "i a" and "i b" commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 The difference region of the merge buffer can be surrounded by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 point and mark with the "m" command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 The three windows can be scrolled together with the "^", "v", "<",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ">", and "|" commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 The "s s" and "s a" commands report the state of the option in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 echo area. Similarly, the "f" and "e" commands report what they do in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 the echo area.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 The "q" command has been revamped, and its behavior is now controlled
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 by the manner in which Emerge is started. In particular, if you wish
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 to write the merge buffer into a file upon exiting, invoke
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 emerge-files[-with-ancestor] with a prefix argument, and it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 prompt you for the file name. Then exiting will write the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 buffer to the file, unless "q" is given a prefix argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 The "i a" and "i b" commands now work in fast mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 The modifications that Emerge makes to save-buffer and write-file are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 described.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 Emerge now handles merging narrowed buffers correctly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 Emerge now isn't fooled when the buffer visiting a file is not the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 same as the file on disk.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 - Starting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 To start Emerge, you must run one of four commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 emerge-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 emerge-files-with-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 emerge-buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 emerge-buffers-with-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 The "files" versions prompt you for two file names (the "A" and "B"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 files), the "buffers" versions prompt you for two buffer names (the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 "A" and "B" buffers). Emerge then runs a "diff" of the two entities
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (emerge-buffers writes the buffers into temporary files for input to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 diff) and digests the output to form a list of the differences between
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 the two files. Then three buffers are set up: two containing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 entities (emerge-files does a find-file (C-x C-f) on the files to get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 them into buffers), and one, the "merge buffer", which contains the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 working copy of the merged file that you are constructing. The three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 buffers are put up in a nice three-window display, showing the A and B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 buffers in the upper half and the merge buffer in the lower half.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 The versions of the command that say "with-ancestor" ask for a third
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 name, that of an entity which is a common ancestor from which the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 versions being merged were derived. These commands use "diff3" to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 compare all three versions. If one version of a difference agrees
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 with the ancestor, then it is presumed that the other version is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 "correct" version, and is said to be "preferred".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (Note that if you use emerge-files, Emerge attempts to make sure that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 file on disk and the file in the buffer are the same. If the file on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 disk has been changed, Emerge offers to revert the buffer. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 buffer has been modified, Emerge offers to save the buffer. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 user declines the offer, or if the file on disk and the buffer have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 both been modified, Emerge aborts with an error message. Emerge is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 careful to widen the buffers containing the files if they have been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 narrowed. If you use emerge-buffers, the buffers are not widened --
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 only the visible portion is used.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 During the merge, the A and B buffers are read-only, so you don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 damage them. (This is because the A and B versions of the differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 are extracted from these buffers.) When you quit the merge, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 read-only/read-write status and modified flag on the A and B buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 are restored. In addition, auto-saving of the A and B buffers is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 suppressed during the merge. This is because Emerge modifies the A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 and B buffers to point out the text of the differences, and it would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 be useless to save these changes. (Just before suppressing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 auto-saving, Emerge forces an auto-save.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 If you give a prefix argument to emerge-files or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 emerge-files-with-ancestor, it prompts you for another file name,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 which is the file into which the merged file is to be written when you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 exit Emerge. The output file name defaults to the A file name. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 you successfully quit Emerge, the merge buffer will be written to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 output file, and the buffers for the A, B, and ancestor buffers will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 be deleted (if they exist and are not modified). If you abort Emerge,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 the merge buffer will not be written and the buffers will not be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 deleted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 You can have any number of merges going at once -- just don't use any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 one buffer as input to more than one merge at once, since that will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 cause the read-only/modified/auto-save status save-and-restore to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 screw up.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 Beware that when Emerge starts up, it does a diff or diff3 of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 files, which can take many minutes for long files with many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 differences. Emacs can't do anything else until diff finishes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 If diff or diff3 produces error messages, Emerge will beep and display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 the error messages instead of the merge buffer. There will be a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 message in the echo area giving the name of the merge buffer. Note
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 that this is really just an informational message -- you still have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 switch to the merge buffer and abort the merge to restore the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 conditions before you ran Emerge. (Emerge considers any output line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 that does not match the regexp emerge-diff/diff3-ok-lines to be an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 error message.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 After the merge has been set up, Emerge runs the hooks in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 emerge-startup-hooks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 The major mode of the merge buffer is set from the major mode of the A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 file or buffer. You should not use the major-mode-setting commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (like c-mode or lisp-mode) to alter the major mode of the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 buffer, since they damage the state information of the merge.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (Emerge's information is maintained as local variables of the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 buffer.) You can use the "x m" command to change the major mode of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 the merge buffer safely.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 - Default directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 If the variable emerge-default-last-directories is not set, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 default directory for all filename arguments to the emerge-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 commands is the default directory of the current buffer, like any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 other Emacs command. This can be inconvenient if you are merging
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 files in two different directories, since you cannot arrange for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 default directories for all of the various arguments to be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 directories you want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 The default directories for filename arguments can be changed by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 setting the variable emerge-default-last-directories. When it is set,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 the default directory for each filename argument is the directory of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 the previous argument of that type. Thus, when merging files in two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 directories, the full filenames need only be entered for the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 emerge-files command; the arugments to later emerge-files commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 will default to the same directories as the first one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 In this mode of operation, when the default directory for a filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 argument is not the same as the directory of the file given as the A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 file, the argument acquires a default filename which is the filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 of the A file appended to the default directory for the argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 This simplifies the usual case when several sets of files with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 corresponding names in different directories are being merged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 - Merging
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 Once you have started the merge, you manipulate the merge buffer with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 special commands issued in the merge buffer. You may also edit the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 buffer with ordinary Emacs commands. Emerge keeps track of each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 difference between the A and B buffers and the corresponding section
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 of the merge buffer. Initially, all differences show the A version,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 except those for which B is preferred (because A agrees with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ancestor), which show the B version. Emerge always has its attention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 focused on one particular difference, which is marked off in the three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 buffers by "vvvvvvvvvvvvvvvvvvvv" above and "^^^^^^^^^^^^^^^^^^^^"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 below. The number of the difference is shown in the mode line. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 you are positioned before the first difference (that's where you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 start) or after the last difference, it displays as "diff 0 of nnn" or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 "diff nnn+1 of nnn".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 A merge buffer can be in two modes: "fast" mode and "edit" mode. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 fast mode, emerge commands are single characters, and ordinary Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 commands are disabled. This makes Emerge operations fast, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 prevents you from doing more than selecing the A or the B version of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 differences. In edit mode, all emerge commands must be prefixed with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 C-c, and all (non-conflicting) Emacs commands are available. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 allows editing the merge buffer, but slows down Emerge operations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 Edit and fast modes are indicated by "F" and "E" in the minor modes in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 The Emerge commands are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 p go to the previous difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 n go to the next difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 a select the A version of this difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 b select the B version of this difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 j go to a particular difference (prefix argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 specifies which difference) (0j suppresses display of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 the flags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 q quit - finish the merge*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 f go into fast mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 e go into edit mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 s a set/clear auto-advance mode*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 s s set/clear skip-prefers mode*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 l recenter (C-l) all three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 - and 0 through 9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 prefix numeric arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 d a select the A version as the default from here down in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 the merge buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 d b select the B version as the default from here down in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 the merge buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 c a copy the A version of the difference into the kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 c b copy the B version of the difference into the kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 i a insert the A version of the difference at the point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 i b insert the B version of the difference at the point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 m put the point and mark around the difference region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 ^ scroll-down (like M-v) the three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 v scroll-up (like C-v) the three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 < scroll-left (like C-x <) the three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 > scroll-right (like C-x >) the three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 | reset horizontal scroll on the three windows*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 x 1 shrink the merge window to one line (use C-u l to restore it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 to full size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 x a find the difference containing a location in the A buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 x b find the difference containing a location in the B buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 x c combine the two versions of this difference*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 x C combine the two versions of this difference, using a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 register's value as the template*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 x d find the difference containing a location in the merge buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 x f show the files/buffers Emerge is operating on in Help window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (use C-u l to restore windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 x j join this difference with the following one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (C-u x j joins this difference with the previous one)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 x l show line numbers of points in A, B, and merge buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 x m change major mode of merge buffer*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 x s split this difference into two differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (first position the point in all three buffers to the places
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 to split the difference)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 x t trim identical lines off top and bottom of difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (such lines occur when the A and B versions are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 identical but differ from the ancestor version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 x x set the template for the x c command*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 * - more details on these commands are given below
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 The variable emerge-version gives the version number of Emerge. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 emerge-version function displays emerge-version (when called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 interactively) or returns it (when called from a program).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 - Differences and their states
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 A difference can have one of seven states:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 A: the difference is showing the A version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 B: the difference is showing the B version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 default-A and default-B: the difference is showing the A or B state,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 but has never been selected by the user. All differences start in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 default-A state (and thus the merge buffer is a copy of the A buffer),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 except those for which one buffer or another is preferred. When the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 user selects the difference, it changes to the A or B state.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 prefer-A and prefer-B: the difference is showing the A or B state. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 addition, the other buffer (that is, for prefer-A, the B buffer; for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 prefer-B, the A buffer) agrees with the ancestor buffer. Thus,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 presumably, the displayed version is the correct one. The "a" and "b"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 commands override these states, and turn them into the A and B states.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 combined: the difference is showing a combination of the A and B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 states that was constructed by the "x c" or "x C" commands. Since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 this state is neither the A or B states, the "a" and "b" commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 won't alter the difference unless they are given a prefix argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 The state of the currently selected difference is shown in the mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 line of the merge window:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 state display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 A A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 B B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 prefer-A A*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 prefer-B B*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 combined comb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 - Select default commands (d a and d b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 The "d a" and "d b" commands change all default-A's to default-B's (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 vice-versa) from the selected difference on down to the end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 file to default-A or default-B, respectively. But remember, any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 difference that you have ever selected isn't in the default-A or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 default-B state, so it will never be affected by "d a" or "d b". This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 leads to the unexpected result that "d a" or "d b" never affects the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 difference selected at the moment, but prevents differences that you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 have already looked at from changing unexpectedly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 If you work your way down from the top of the file, using "d a" and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 "d b" at judicious points, you can effectivly make the A version the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 default for some sections of the merge buffer and the B version the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 default for others.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 Giving the "d a" or "d b" command a prefix argument causes it to change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 differences from the current point down that are in the B state (for d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 a) or A state (for "d b") as well. (Thus, the selected difference may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 be changed also.) Differences for which there is a preference will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 not be affected. (Selecting a difference won't erase its preference.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 - Exiting (q)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 The quit command finishes the merge session by restoring the state of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 the A and B buffers and removing the markers around the currently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 selected difference. It also disables the Emerge commands in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 merge buffer, since executing them later could damage the contents of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 the various buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 The action of "q" depends on how Emerge was started and whether "q"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 was given a prefix argument. If there was no prefix argument, it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 considered a "successful" finish. If there was a prefix argument, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 is considered an "unsuccessful" finish. In either case, you are asked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 to cofirm the exit, and the confirmation message tells which sort of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 exit you are confirming.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 If Emerge was started by some other process, success/failure is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 reported to the caller.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 If Emerge was started with emerge-files or emerge-files-with-ancestor,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 if a prefix argument was given to that command, then you specified a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 file into which the merge is to be written. A successful exit writes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 the merge into the output file and then kills the A, B, and ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 buffers (so they aren't lying around to confuse you, since they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 probably all have similar names).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 - Auto-advance mode (s a)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 If auto-advance mode is set, the "a" and "b" commands perform an "n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (select next difference) afterward. When auto-advance mode is set,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 it is indicated by "A" in the minor modes in the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 "s a" with a positive argument sets auto-advance, with a non-positive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 argument clears it, and with no argument toggles it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 - Skip-prefers mode (s s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 If skip-prefers mode is set, the "n" and "p" commands skip over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 differences with states prefer-A and prefer-B. Thus you will only see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 differences for which one version isn't presumed "correct". When
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 skip-prefers mode is set, it is indicated by "S" in the minor modes in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 the mode line. "s s" with a positive argument sets auto-advance, with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 a non-positive argument clears it, and with no argument toggles it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 - Recenter (l)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 The Emerge "l" command causes the selected difference to be brought
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 into view in the three windows, or at least, whichever of the three
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 merge buffers are visible at the moment. If a prefix argument is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 given, then the original three-window display is set up before the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 difference texts are shown.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 - Scrolling the text (^, v, <, >, and |)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 Emerge has several commands which scroll all three windows by the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 amount, thus allowing you to easily compare the versions of the text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 The commands are "^" (scroll-up), "v" (scroll-down), "<"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (scroll-left), ">" (scroll-right), and "|" (reset horizontal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 scrolling). (Remember that Emacs names scrolling commands by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 motion of the text with respect to the window, so C-v is called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 "scroll-up".)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 If these commands (except "|") are given an argument, that is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 number of lines or characters by which the windows are scrolled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 Otherwise, the amount of motion is computed based on the dimensions of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 the merge buffer window -- the height of the merge buffer window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (minus next-screen-context-lines), or half the width of the merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 buffer window. (The A and B version windows are assumed to be as high
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 as the merge window, but half as wide.) If the argument is just `C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 -', then the scrolling is half the default amount.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 - Finding the difference at or near a location (x d, x a, and x b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 The "x d" command selects the difference containing the current point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 in the merge buffer. If there is no difference containing the point,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 an error is given. An argument can be given to the command to change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 this behavior: if the argument is positive (e.g., C-u), the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 following difference is selected; if the argument is negative (e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 C-u -), the previous difference is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 The "x a" and "x b" commands select the difference containing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 current point in the A and B buffers, respectively. Otherwise, they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 act like the "x d" command. Note that although the point used in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 commands is not the merge buffer point, the commands can only be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 issued in the merge buffer, because it is the only buffer with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 Emerge keymap.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 - Combining the two versions (x c, x C, and x x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 Sometimes one wants to combine the two versions of a difference. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 instance, when merging two versions of a program, one wants to make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 something like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 #ifdef NEW
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 ...new version of code...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 #else /* NEW */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 ...old version of code...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 #endif /* NEW */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 The "x c" command will make such a combined version. (Note that any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 combined version is not the same as either the A or B versions, and so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 the "a" and "b" commands will refuse to alter it unless they are given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 a prefix argument.) The combination is made under control of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 template, which is a character string with the following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 interpolations:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 %a the A version of the difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 %b the B version of the difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 %% the character '%'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 Thus, the template used above is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 #ifdef NEW\n%b#else /* NEW */\n%a#endif /* NEW */\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (using \n here to represent newlines). The template is stored in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 variable emerge-combine-versions-template, and its initial value is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 the one given above. The template can be set (from the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 region) by the "x x" command. (Be careful to get the newlines in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 template in the right places!) ("x x" was chosen by analogy with "C-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 x".) ("x x" is only available in the merge buffer, of course.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 Elsewhere, M-x emerge-set-combine-versions-template can be used.) If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 "x x" is given a prefix argument, emerge-combine-versions-template is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 localized in the merge buffer before its value is set, so the "x x"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 command's effect (and the effect of any later "x x" command in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 merge buffer) is only on the merge buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 The "x C" command is like "x c", but it prompts for a character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 which is the register whose value is to be used as the template.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 This allows one to use multiple templates conveniently.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 - Changing the major mode of the edit buffer (x m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 The "x m" command prompts for the name of a major-mode-setting command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (such as "c-mode" or "emacs-lisp-mode") and executes it. Ordinarily,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 major-mode-setting commands change the mode line and local keymap, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 the "x m" command then resets the Emerge mode line and the fast or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 edit mode local keymap, as appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 If you have already changed the major mode of the merge buffer and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 lost the Emerge keymap, you can use M-x emerge-set-merge-mode to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 execute this command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 Beware that "x m" accepts any command name, not just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 major-mode-setting commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 In order to use "x m", the kill-fix.el package of improvements to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 kill-all-local-variables function must be installed. It can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 obtained from the Emacs Lisp archives by anonymous FTP from file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 /pub/gnu/emacs/elisp-archive/as-is/kill-fix.el.Z on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 archive.cis.ohio-state.edu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 - Writing the merge buffer manually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 Emerge places a wrapper (emerge-query-and-call) on the key bindings of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 save-buffer (usually "C-x C-s") and write-file (usually "C-x C-w"), in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 order to protect the user from writing out the merge before it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 finished. Emerge-query-and-call asks the user if he is sure he wants
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 to write out the incomplete merge. If he answers yes, the buffer is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 written out. The flags are suppressed while the write is being done.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 As a result of this, the displayed portions of the buffers are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 recentered (equivalent to "l").
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 - Running Emerge standalone
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 If you invoke emacs with the following arguments, you can execute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 Emerge as a standalone program:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 emacs -l emerge -f emerge-files-command file-a file-b file-out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 emacs -l emerge -f emerge-files-with-ancestor-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 file-a file-b file-ancestor file-out
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 When the user gives the "q" (quit) command, Emerge will write out the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 merge buffer in file-out and terminate Emacs. If a prefix argument is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 given, Emacs will terminate with an unsuccessful return code (1), if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 not, it will terminate with a successful return code (0).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 - Invoking Emerge remotely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 If you use the Emacs client/server code that supports remote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 execution, then you can invoke Emerge remotely by executing one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 Lisp calls:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (emerge-files-remote "file A" "file B" "output file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (emerge-files-with-ancestor-remote "file A" "file B"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 "ancestor file" "output file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 Returning a successful/unsuccessful return code is not yet supported
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 by the Emacs client/server code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 Beware that in systems of networked workstations, even though all user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 directories are shared between all the workstations, the /tmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 directory on each workstation is not shared, so writing files into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 /tmp and then remotely invoking Emerge is not likely to work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 - Effect of merge flags on indenting code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 The presence of the flags confuses the indentation code of C and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 Emacs-Lisp modes. Starting the flag strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (emerge-{before,after}-flag) with '#' (for C) or ';' (for Lisp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 prevents the indentation code from noticing the flags. Remember to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 change the flag strings before loading Emerge, or to execute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 emerge-new-flags after changing them. But never change the flag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 strings while a merge is being performed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 - Autoloading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 The following autoloads will make all top-level Emerge files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 autoloading. Make sure that "emerge" is in a directory on load-path.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (autoload 'emerge-files "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 "Run Emerge on two files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (autoload 'emerge-files-with-ancestor "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 "Run Emerge on two files, giving another file as the ancestor."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (autoload 'emerge-buffers "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 "Run Emerge on two buffers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (autoload 'emerge-buffers-with-ancestor "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 "Run Emerge on two buffers, giving another buffer as the ancestor."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (autoload 'emerge-files-command "emerge")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (autoload 'emerge-files-with-ancestor-command "emerge")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (autoload 'emerge-files-remote "emerge")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (autoload 'emerge-files-with-ancestor-remote "emerge")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (autoload 'emerge-revisions "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 "Emerge two RCS revisions of a file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (autoload 'emerge-revisions-with-ancestor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 "Emerge two RCS revisions of a file, giving another revision as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 the ancestor."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (autoload 'emerge-execute-line "emerge"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 "Process the current line. Based on entries found, call emerge correctly
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
673 on the files listed."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 - Use with Ange-FTP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 The Ange-FTP package allows Emacs to access files using FTP much as if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 they are local files. However, diff/diff3 cannot access non-local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 files, and so Emerge needs to provide additional support if non-local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 files are being used. Emerge uses the function emerge-remote-file-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 to test a file name to see whether that file name can be given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 directly to diff/diff3. If not, Emerge saves the file contents into a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 temporary file, and gives the temporary file name to diff/diff3. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 temporary file is deleted after diff/diff3 is done running.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 The function emerge-remote-file-p by default causes temporary files to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 be generated only for files read using Ange-FTP (which are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 distinguished via the variable ange-ftp-path-format). If Ange-FTP is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 not loaded, it causes no temporary files to be generated. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 function emerge-remote-file-p can be modified for customization.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 - Filenames containing shell metacharacters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 Emerge handles filenames containing shell metacharacters by quoting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 them with \ before passing them to the shell. This is normally not a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 problem, except that Emacs auto-save files begin with #, which is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 normally used to start comments. Which characters are considered
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 metacharacters is governed by the variable emerge-metachars, whose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 default value is suitable when the shell is sh, csh, or compatible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 shells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 - Local variables lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 Normally, Emerge ignores any local-variables list that is created in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 the merge buffer. However, sometimes it may be useful to have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 local-variables list processed. This can be done manually by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 executing the function "(hack-local-variables)". If the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 emerge-process-local-variables is true, when Emerge is started it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 will process any local variables list in the newly-created merge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 buffer. (If the merge has an ancestor, the selecting of default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 versions of differences is done before the local variables list is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 processed.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 - Semi-automatic batching of merges
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 If you have a large number of merges to execute, the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 emerge-execute-line can reduce the amount of work. To use it, create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 a buffer containing lines that describe the merges to be done. Each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 line describes a single merge by means of fields of the form:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 A=file1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 B=file2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 ancestor=file3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 output=file4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 The fields are seperated by whitespace, and the filenames given should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 be absolute, not relative. The buffer's contents can be generated by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 a program and read in as a file, or they can be generated by an Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 function. (See the sample function emerge-merge-directories, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 produces specifications to merge the entire contents of two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 directories, possibly with an ancestor directory and an output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 directory.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 If you position the cursor on one line of the buffer and execute
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 emerge-execute-line, the information on that line will be read and an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 appropriate merge will be started. When the merge is finished (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 aborted), the original buffer will be displayed again, with the cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 at the beginning of the next line, ready for the next invocation of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 emerge-execute-line. In this way, it is easy to start a sequence of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 merges that are described by a buffer of specifications.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 To perform a two-way merge, provide an "A" and a "B" field. To
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 perform a merge with an ancestor file, provide "A", "B", and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 "ancestor" fields. In either case, if an "output" field is provided,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 the results of a successful merge will be written into the designated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 file, just as if a prefix argument had been given to the Emerge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 In addition, emerge-process-line attempts to handle situations where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 one of the "A" or "B" fields are missing, showing that one version or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 another of the file does not exist. (In all cases, files that are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 specified in the "A", "B", or "ancestor" fields must exist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 Non-existent files are specified by omitting the appropriate field.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 The principles governing these cases are: (1) If no "output" file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 specified, it is an error. (2) If an "output" file is specified, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 the "A" or "B" file (whichever is present) is copied into the output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 file. (3) If an "ancestor" file is given, it is assumed that the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 in question has been deleted in one or another of the versions, and so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 should be deleted from the "merged" version of the files. Case (3) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 sufficiently dangerous that it is only activated if the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 emerge-execute-line-deletions is set; otherwise case (3) will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 handled as case (2), that is, the one existing version will be copied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 to the output file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 In all cases, the goal is to simplify the usual case of "merging two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 directories that contain two versions of a system of software".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 - Merging RCS versions of a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 You can merge RCS versions of a file using the commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 emerge-revisions and emerge-revisions-with-ancestor. For both
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 commands, all of the input files are RCS versions of one base file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 which are checked out automatically. If you provide a prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 argument, upon successful completion the merged file is checked in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 - Use with Lucid Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 Under Lucid Emacs, Emerge highlights the selected difference rather
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 that bordering it with character flags. This is probably more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 natural, but it has the problem that insertions made at the very ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 of the difference may go either inside or outside of the difference,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 at Emacs' discretion. The Lucid features should be disablable by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 setting emerge-lucid-p to nil, but that variable is also used to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 activate workarounds to bugs in Lucid Emacs, so the user shouldn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 change its value.