Mercurial > emacs
annotate lisp/ediff.el @ 13106:22011e724596
(Qmouse_leave_buffer_hook): New variable.
(syms_of_frame_1): Initialize it.
(Fhandle_switch_frame): Run the hooks.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 03 Oct 1995 09:14:54 +0000 |
parents | 273905baf4b3 |
children | 0e069b2940ae |
rev | line source |
---|---|
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1 ;;; ediff.el --- a comprehensive visual interface to diff & patch |
11234 | 2 ;;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. |
7267 | 3 |
4 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | |
5 ;; Created: February 2, 1994 | |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
6 ;; Keywords: comparing, merging, patching, version control. |
7267 | 7 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
8 (defconst ediff-version "2.26" "The current version of Ediff") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
9 (defconst ediff-date "June 3, 1995" "Date of last update") |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
10 |
7267 | 11 ;; This file is part of GNU Emacs. |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
25 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | |
27 ;;; Commentary: | |
28 ;; ---------- | |
29 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
30 ;; Never read that diff output again! |
7391 | 31 ;; Apply patch selectively, like a pro! |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
32 ;; Merge with ease! |
7267 | 33 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
34 ;; This package provides a convenient way of simultaneous browsing through |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
35 ;; the differences between a pair (or a triple) of files or buffers. The |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
36 ;; files being compared, file-A, file-B, and file-C (if applicable) are |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
37 ;; shown in separate windows (side by side, one above the another, or in |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
38 ;; separate frames), and the differences are highlighted as you step |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
39 ;; through them. You can also copy difference regions from one buffer to |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
40 ;; another (and recover old differences if you change your mind). |
7267 | 41 |
42 ;; In addition, Ediff can apply a patch to a file and then let you step | |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
43 ;; though both files, the patched and the original one, simultaneously, |
7267 | 44 ;; difference-by-difference. You can even apply a patch right out of a |
45 ;; mail buffer, i.e., patches received by mail don't even have to be saved. | |
46 ;; Since Ediff lets you copy differences between buffers, you can, in | |
47 ;; effect, apply patches selectively (i.e., you can copy a difference | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
48 ;; region from file_orig to file, thereby undoing any particular patch that |
7267 | 49 ;; you don't like). |
50 | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
51 ;; Ediff is aware of version control, which lets the user compare |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
52 ;; files with their older versions. Ediff can also work with remote and |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
53 ;; compressed files. Details are given below. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
54 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
55 ;; This package builds upon the ideas borrowed from emerge.el and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
56 ;; several Ediff's functions are adaptations from emerge.el. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
57 ;; Much of the functionality of Ediff is also influenced by emerge.el. |
7267 | 58 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
59 ;; The present version of Ediff supersedes Emerge. It provides a superior |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
60 ;; user interface and has many features not found in Emerge. In particular, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
61 ;; it can do patching and 2-way and 3-way file comparison in addition to |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
62 ;; merging. |
7267 | 63 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
64 |
7267 | 65 |
66 ;;; Compilation | |
67 ;; ----------- | |
68 ;; | |
69 ;; When you byte-compile Ediff, you will get some warnings about functions | |
70 ;; being undefined. These can be safely ignored. | |
7424 | 71 ;; |
7267 | 72 ;;; Bugs: |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
73 ;; ----- |
7267 | 74 |
75 ;; 1. The undo command doesn't restore deleted regions well. That is, if | |
76 ;; you delete all characters in a difference region and then invoke | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
77 ;; `undo', the reinstated text will most likely be inserted outside of |
7424 | 78 ;; what Ediff thinks is the current difference region. (This problem |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
79 ;; doesn't seem to exist with XEmacs.) |
7424 | 80 ;; |
81 ;; If at any point you feel that difference regions are no longer correct, | |
82 ;; you can hit '!' to recompute the differences. | |
83 | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
84 ;; 2. On a monochrome display, the repertoire of faces with which to |
7424 | 85 ;; highlight fine differences is limited. By default, Ediff is using |
86 ;; underlining. However, if the region is already underlied by some other | |
87 ;; overlays, there is no simple way to temporarily remove that residual | |
88 ;; underlining. This problem occurs when a buffer is highlighted with | |
89 ;; hilit19.el or font-lock.el packages. If this residual highlighting gets | |
90 ;; in the way, you can do the following. Both font-lock.el and hilit19.el | |
91 ;; provide commands for unhighlighting buffers. You can either place these | |
92 ;; commands in `ediff-prepare-buffer-hooks' (which will unhighlight every | |
93 ;; buffer used by Ediff) or you can execute them interactively, at any time | |
94 ;; and on any buffer. | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
95 ;; |
7267 | 96 |
97 ;;; Change Log: | |
98 ;; ---------- | |
99 | |
100 ;; Thu Feb 3, 1994 | |
101 | |
102 ;; Fixed a bug in ediff-setup-windows that caused control window to | |
103 ;; appear in a wrong place when split-window-keep-point is nil | |
104 ;; (Thanks to Kevin Broadey <KevinB@bartley.demon.co.uk>.) | |
105 ;; | |
106 ;; Added mechanism for using faces instead of before/after flags. This | |
107 ;; looks much better on an X display, especially on a color one. | |
108 ;; (Thanks to Boris Goldowsky <boris@cs.rochester.edu> for the code | |
109 ;; that led to ediff-highlight-diff. | |
110 ;; Also, thanks to Kevin Esler <esler@ch.hp.com> for suggestions | |
111 ;; regarding highlighting differences on X displays.) | |
112 ;; | |
113 ;; Added functions to apply patches. | |
114 ;; (Thanks to Kevin Broadey <KevinB@bartley.demon.co.uk> for this | |
115 ;; suggestion.) | |
116 | |
117 ;; Fri Feb 4, 1994 | |
118 | |
119 ;; Added mechanism for toggling vertical/horizontal window split. | |
120 ;; (Inspired by a suggestion from Allan Gottlieb | |
121 ;; <gottlieb@allan.ultra.nyu.edu> -- thanks.) | |
122 ;; | |
123 ;; Added mechanism for toggling between highlighting using faces and | |
124 ;; highlighting using ASCII flags. | |
125 ;; | |
126 ;; Fixed a problem with undo. Now, Ediff has smartened up and doesn't | |
127 ;; keep undo info on ASCII flags inserted in buffer-A and buffer-B. | |
128 ;; So, if you edit the files while browsing through them, undo behaves | |
129 ;; as you would expect, i.e., faces/flags don't get in the way. | |
130 | |
131 ;; Sun Feb 6, 1994 | |
132 | |
133 ;; Added horizontal scrolling. Added ediff-position-region to ensure | |
134 ;; that difference regions in buffer-A and buffer-B are aligned with | |
135 ;; each other. Disabled ediff-toggle-split when buffers are displayed | |
136 ;; in different frames. | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
137 ;; |
7267 | 138 ;; Added toggle-window help (Suggested by Boris Goldowsky |
139 ;; <boris@cs.rochester.edu>.) | |
140 ;; Added functions to copy differences from one buffer to another and to | |
141 ;; recover old differences. | |
142 ;; Added prefix arguments to ediff-next-difference and | |
143 ;; ediff-previous-difference. | |
144 | |
145 ;; Tue Feb 8, 1994 | |
146 | |
147 ;; Replaced text properties with overlays. Fixed ediff-setup-windows. | |
148 ;; Added ediff-save-buffer to local-write-file-hooks to prevent user | |
149 ;; from saving corrupted states. (Thanks to <boris@cs.rochester.edu> | |
150 ;; for suggestion.) Instead, Ediff now has a pair of functions for | |
151 ;; safe saving of buffers. | |
152 ;; Changed ediff-read-file-name to be more intuitive on ediff-files. | |
153 ;; Added ediff-prepare-buffer-hooks. (Thanks to Kevin Esler | |
154 ;; <esler@ch.hp.com> for the idea.) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
155 ;; |
7267 | 156 ;; Cleanups in ediff-patch-file. Protected ediff-copy-diff against |
157 ;; a bug that Emacs has in kill-region. | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
158 ;; |
7267 | 159 ;; Added support for Lemacs. (Thanks to Alastair Burt |
160 ;; <burt@dfki.uni-kl.de> for coercing Ediff into working under Lemacs.) | |
161 ;; Added ediff-kill-buffer-carefully and other suggestions by Boris | |
162 ;; Goldowsky <boris@cs.rochester.edu>. | |
163 ;; Refined the protection against interference with highlighting caused | |
164 ;; by Hilit19. Added the variable ediff-third-party-highlighting. | |
165 ;; Added mechanisn for unhighlighting regions highlighted with Hilit19 | |
166 ;; before hightlighting them with Ediff's overlays. (And for | |
167 ;; rehighlighting them with Hilit19, when the current difference moves on.) | |
168 | |
169 ;; Sun Feb 13, 1994 | |
170 | |
171 ;; Added ediff-place-flags-in-buffer and ediff-remote-exit, which are | |
172 ;; modifications of Emerge's similar functions. The difference is that | |
173 ;; in Ediff they make ediff-before-flag and ediff-after-flag into | |
174 ;; read-only regions, so the user can't change them by mistake. | |
175 ;; | |
176 ;; Adopted a suggestion by Boris Goldowsky <boris@cs.rochester.edu> | |
177 ;; that led to a more elegant treatment of faces. | |
178 ;; | |
179 ;; Added protection against interference with Font-Lock highlighting | |
180 ;; similar to that of Hilit19's protection. | |
181 | |
182 ;; Tue Feb 15, 1994 | |
183 | |
184 ;; Deleted spurious (auto-save-mode 1) in ediff-control-buffer, which | |
185 ;; was causing this buffer to be auto-saved for no good reason. | |
186 ;; Added read-only protection to ediff-before/after-flags in Lemacs. | |
187 ;; (Thanks to Alastair Burt <burt@dfki.uni-kl.de> for help in testing.) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
188 ;; |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
189 ;; Further fixes in the XEmacs part. Changed highlighted region in |
7267 | 190 ;; ediff-highlight-diff so that an extra character will be highlighted |
191 ;; only if a difference is empty (thereby allowing the user to see where an | |
192 ;; insertion or a deletion has taken place). | |
193 ;; | |
194 ;; Simplified interaction with other highlighting packages by giving | |
195 ;; Ediff overlays the highest priority. (Taking a cue from | |
196 ;; ediff-highlight-diff-lemacs written by Alastair Burt | |
197 ;; <burt@dfki.uni-kl.de>.) Zapped ediff-third-party-highlighting | |
198 ;; variable and hooks that were previously used to | |
199 ;; unhighlight/rehighlight buffers when hilit19/font-lock are on. | |
200 | |
201 ;; Fri Feb 18, 1994 | |
202 | |
203 ;; Added a bit more sophistication to ediff-read-file-name. Now, | |
204 ;; ediff-files remembers both, the file-A and the file-B directories. | |
205 ;; They are offered as defaults when ediff-use-last-dir is set to t. | |
206 | |
207 ;; Fri Feb 22, 1994 | |
208 | |
209 ;; Added ediff-before-change-guard to remove ASCII highlighting when | |
210 ;; the user attempts to change buffer-A/B. This is needed because | |
211 ;; otherwise the undo info may become screwed up in those buffers. | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
212 ;; Hitting `h' (ediff-toggle-hilit) on a dumb terminal will toggle |
7267 | 213 ;; between ASCII highlighting and no highlighting. |
214 | |
215 ;; Fri Feb 24, 1994 | |
216 | |
217 ;; Fixed problems with multiple Ediff sessions running simultaneously. | |
218 | |
219 ;; Tue Mar 1, 1994 | |
220 | |
221 ;; Added vc-ediff, the Ediff interface to vc.el. (Thanks to Eric | |
222 ;; Freudenthal <freudent@jan.ultra.nyu.edu> for contributing this | |
223 ;; function.) | |
224 | |
225 ;; Sun Mar 6, 1994 | |
226 | |
227 ;; Added rcs-ediff, an Ediff interface to RCS via rcs.el. (Thanks to | |
228 ;; Alastair Burt <burt@dfki.uni-kl.de>.) | |
229 ;; Some minor improvements. | |
230 | |
231 ;; Tue March 15, 1994 | |
232 | |
233 ;; Fixed a buglet in defining ediff-current-diff-face-A/B. | |
234 ;; (Thanks to Job Ganzevoort <Job.Ganzevoort@cwi.nl>.) | |
235 | |
236 ;; Tue March 22, 1994 | |
237 | |
238 ;; Fixed a bug with ediffing narrowed buffers, reported by Kevin | |
239 ;; Broadey <KevinB@bartley.demon.co.uk>. | |
240 ;; Made Ediff to work with files that have incomplete last line. | |
7391 | 241 ;; Made Ediff execute diff and patch using Bourne Shell, which |
7267 | 242 ;; should eliminate problems with $prompt that some people had. |
243 | |
244 ;; Thu March 24, 1994 | |
245 | |
246 ;; Achieved quadratic speedup in the size of the file by replacing the | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
247 ;; slow goto-line by forward-line. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
248 ;; Converted demarkation of difference regions |
7267 | 249 ;; from markers to overlays. This will later allow us to highlight all |
250 ;; diffs, not just the current one. | |
251 | |
252 ;; Wed March 30, 1994 | |
253 | |
254 ;; Under X, Ediff now highlights all differences in dim colors and the | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
255 ;; current difference in bright colors. Improved XEmacs support. |
7267 | 256 ;; Changed toggle hilit to cycle through 3 states: highlighting all |
257 ;; diffs, highlighting only the current diff, and highlighting using | |
258 ;; ASCII flags. | |
259 ;; Added support for difference regions that are not full lines. | |
260 | |
261 ;; Fri April 1, 1994 | |
262 | |
263 ;; Fixed bugs related to writing buffers A and B. | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
264 ;; Added commands `ga', `gb' to jump directly to the closest diff in |
7267 | 265 ;; buffer A and B, respectively. |
266 | |
7424 | 267 ;; Fri April 11, 1994 |
268 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
269 ;; Added `ediff-update-diffs', a function that lets the user recompute |
7424 | 270 ;; difference regions after extensive editing done to buffers A and B |
271 ;; (bound to `!'). | |
272 | |
273 ;; Wed April 13, 1994 | |
274 | |
275 ;; Added the new feature: refining the current difference region. | |
276 ;; This would highlight the precise differences between the regions in | |
277 ;; buffer A and B. (A way to implement this was suggested by Boris | |
278 ;; Goldowsky <boris@cs.rochester.edu>.) | |
279 ;; | |
280 ;; Fixed Ediff to be immune to several different versions of rcs.el | |
281 ;; that are currently in distribution. | |
282 | |
283 ;; Thu April 14, 1994 | |
284 | |
285 ;; Ediff now respects X resources for the faces it uses. It no longer | |
286 ;; barks when the colormap has no colors it is using; or when face | |
287 ;; fonts can't be italicized, etc. | |
288 | |
289 ;; Fri April 15, 1994 | |
290 | |
291 ;; Changed `ediff-setup-windows' to minimize the need to delete and | |
292 ;; create windows. Now jumps faster from diff to diff. | |
8348
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
293 ;; Added Ediff to the File menu on the menu bar (FSF's version). |
7424 | 294 |
295 ;; Mon April 18, 1994 | |
296 | |
297 ;; Fixed to work with OS/2's PM-Emacs. | |
298 | |
299 ;; Thu April 21, 1994 | |
300 | |
301 ;; Lemacs' menus added (thanks to Alastair Burt for the help). | |
302 | |
303 ;; Wed April 28, 1994 | |
304 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
305 ;; Fixed ediff-keep-window-config (thanks to Norbert Kiesel |
7424 | 306 ;; <norbert@i3.informatik.rwth-aachen.de>), ediff-shell and |
307 ;; ediff-protect-metachars (thanks to Richard Stanton | |
308 ;; <stanton@haas.berkeley.edu>). Made access to difference | |
309 ;; overlays structure-independent, making it less bug-prone. | |
310 ;; Patched ediff-read-file-name to work more intuitively with directory | |
311 ;; names (thanks to Kevin Broadey <KevinB@bartley.demon.co.uk>). | |
312 | |
313 ;; Mon May 2, 1994 | |
314 | |
315 ;; Added `ediff-frame-has-menubar' to guard against the possibility that | |
316 ;; the current frame has no menu bar. | |
317 | |
318 ;; Fri May 6, 1994 | |
319 | |
320 ;; Fixed buglet in vc-ediff (thanks to Ray Nickson <nickson@cs.uq.oz.au>). | |
321 | |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
322 ;; Wed May 18, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
323 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
324 ;; Modified ediff-read-file-name to not put long file names in the |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
325 ;; default prompt area, as suggested by KevinB@bartley.demon.co.uk. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
326 ;; Applied patch supplied by burt@dfki.uni-kl.de, fixing a problem with |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
327 ;; ediff-diff-to-diff in Lemacs. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
328 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
329 ;; Tue May 31, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
330 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
331 ;; Added ediff-forward-word-function (as suggested by Job Ganzevoort |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
332 ;; <Job.Ganzevoort@cwi.nl>). |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
333 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
334 ;; Thu Jun 2, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
335 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
336 ;; Added `ediff-toggle-regexp-match', which allows the user to step |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
337 ;; through only those difference regions that match some regexp; or, |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
338 ;; vice versa, to skip over regions that match a regexp. (This feature |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
339 ;; was suggested by Andy Scott <ascott@pcocd2.intel.com>.) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
340 ;; Added ediff-eval-in-buffer, which is a modified emerge-eval-in-buffer. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
341 ;; The function ediff-status-info, bound to `i', now replaces and extends |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
342 ;; ediff-file-names and ediff-line-numbers, which were bound to `f' |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
343 ;; and `i', respectively. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
344 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
345 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
346 ;; Wed Jun 10, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
347 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
348 ;; Improved `ediff-read-file-name' and `ediff-buffers' so they are now |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
349 ;; providing more intuitive defaults. Modified `ediff-read-file-name' |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
350 ;; so it won't cause problems under OS/2. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
351 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
352 ;; Fri Jun 24, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
353 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
354 ;; Modified ediff-find-file, ediff-files-internal, and made |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
355 ;; emerge-verify-file-buffer into ediff-verify-file-buffer so that |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
356 ;; Ediff will work correctly with remote and compressed |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
357 ;; files. (Suggested by Sandy Rutherford <sandy@ibm550.sissa.it>.) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
358 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
359 ;; Fri Jun 28, 1994 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
360 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
361 ;; Fixed ediff-patch-files to work with remote and compressed files. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
362 |
8348
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
363 ;; Wed July 20, 1994 |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
364 |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
365 ;; Changed menu bar items per RMS's suggestion. Changed odd/even faces |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
366 ;; in Lemacs to italic. Changed ediff-*-face-* variables so that they |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
367 ;; will contain names of faces instead of the face internal |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
368 ;; representation. (Copy-face works better with face names than with |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
369 ;; face internal representation. With face internal representation, if |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
370 ;; a face vector mentions a font explicitly, copy-face may attempt to |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
371 ;; copy this font, which would cause an error if the font has a wrong |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
372 ;; size for one of the existing frames.) Improved the way |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
373 ;; mode-line-buffer-identification is set in ediff-setup so that Ediff |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
374 ;; will accommodate the way buffers are identified in mode-line.el and |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
375 ;; uniquify.el. |
bf950cbd542c
Made menu bar's autoloaded stuff conditional on
Richard M. Stallman <rms@gnu.org>
parents:
8303
diff
changeset
|
376 |
8503
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
377 ;; Fri August 5, 1994 |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
378 |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
379 ;; Ediff can now automatically skip over regions that differ only in |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
380 ;; the white space and line breaks. This is controled with the variable |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
381 ;; `ediff-ignore-similar-regions' and can be toggled on/off by typing |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
382 ;; `##'. |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
383 |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
384 ;; Mon August 8, 1994 |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
385 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
386 ;; If ediff-save-buffer is invoked with `wd', it'll save the diff |
8503
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
387 ;; output in a file. |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
388 |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
389 ;; Wed August 24, 1994 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
390 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
391 ;; Fixed ediff-toggle-read-only and ediff-patch-file so that they will |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
392 ;; check out version-controled files before modifying them. This will |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
393 ;; permit checking the modified versions back in. In earlier |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
394 ;; versions, such modifications could be lost, unless the user takes |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
395 ;; special care of preserving them. |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
396 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
397 ;; Tue August 30, 1994 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
398 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
399 ;; Added ediff-submit-report. |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
400 ;; Introduced ediff-revision as a uniform way of calling vc.el and |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
401 ;; rcs.el. This is controled by ediff-version-control-package |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
402 ;; variable. Functions vc-ediff, rcs-ediff are replaced by their |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
403 ;; internal versions. |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
404 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
405 ;; Thu September 1, 1994 |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
406 |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
407 ;; Made ediff-overlay-put and ediff-move-overlay into bona fide |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
408 ;; functions (rather than fset symbols). These now check if overlay's |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
409 ;; buffer is alive. If not, overlay is deleted. This overcomes some of |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
410 ;; the problems with Lemacs. |
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
411 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
412 ;; Thu September 8, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
413 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
414 ;; Added ediff-revision-key, ediff-load-version-control and streamlined |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
415 ;; vc/rcs-ediff[-internal]. Eliminated dependency on emerge.el. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
416 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
417 ;; Fri September 23, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
418 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
419 ;; Added ediff-windows and ediff-regions. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
420 ;; Changed ediff-setup-windows and related procedures to create |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
421 ;; a separate dedicated control frame for each invocation of Ediff. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
422 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
423 ;; Tue September 27, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
424 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
425 ;; Added redraw-display everywhere before creating or deleting |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
426 ;; frames. It appears that this cures Emacs' bug where it trashes some |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
427 ;; fonts which leads to crashes. Also, some code cleanups and bug fixes. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
428 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
429 ;; Fri September 30, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
430 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
431 ;; Fixed ediff-update-diffs so it'll work correctly with |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
432 ;; ediff-windows and ediff-regions. Added narrowing and widening to the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
433 ;; suite of commands available for ediff-windows and ediff-regions. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
434 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
435 ;; Fri October 7, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
436 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
437 ;; Changed ediff-setup-windows to funcall the actual window setting |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
438 ;; function, which is either ediff-setup-windows-multiframe or |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
439 ;; ediff-setup-windows-plain. Changed all temp file names to use `_' |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
440 ;; instead of `.'. Presumably, this makes VMS happier. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
441 ;; Ported to VMS (thanks to Richard Levitte <levitte@e.kth.se>). |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
442 ;; Added ediff-prefer-long-help-message and changed defaults. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
443 ;; Fighting with XEmacs bugs. Made it possible to switch between plain |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
444 ;; and multiframe display easier, but XEmacs is still getting confused |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
445 ;; at times. Added ediff-check-version and ediff-set-help-message. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
446 ;; Made more sensible temp file names, which is important when |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
447 ;; generating context diffs. Added ediff-make-frame-position and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
448 ;; ediff-control-frame-position-function. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
449 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
450 ;; Wed October 12, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
451 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
452 ;; ediff-window-visible-p now makes a call to frame-visible-p |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
453 ;; only when window-system is non-nil. Rearranged the block of fset's |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
454 ;; so that the wrong things won't be defined when window-system is nil. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
455 ;; Added ediff-revert-buffers-then-recompute-diffs function. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
456 ;; Removed flag-argument from a background call to shell-command. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
457 ;; Added ediff-shell-command to enable custom diff execute in the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
458 ;; background and insert output in ediff-custom-diff-buffer. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
459 ;; Added ediff-shell-command-filter, because XEmacs doesn't have it. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
460 ;; Made ediff-revision set up ediff-job-name to `ediff-revision'. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
461 ;; This enables users do ediff-revision-specific actions on exiting |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
462 ;; Ediff using ediff-quit-hooks. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
463 ;; Reshaffled some fset's so that functions for checking color and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
464 ;; faces won't be touched on a non-windowing display. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
465 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
466 ;; Thu October 20, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
467 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
468 ;; Modified ediff-make-fine-diffs so that no fine diffs are computed if |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
469 ;; one of the diff regions is empty. Saves time and also works around |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
470 ;; the buggy diff program in AIX. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
471 ;; ediff no longer loads the version control package |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
472 ;; automatically---only when ediff-revision is called. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
473 ;; Enabled focusing/hiding diff regions that match both or just one of the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
474 ;; regexps. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
475 ;; Changed ediff-regions to ediff-small-regions. Added ediff-large-regions. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
476 ;; Modified ediff-next/previous-difference to work right when both |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
477 ;; skipping regexp matches and skipping similar regions is enabled. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
478 ;; Fixed bugs in positioning the control frame. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
479 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
480 ;; Fri October 28, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
481 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
482 ;; Fixed bugs in ediff-next/previous-difference, ediff-set-visible-region |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
483 ;; Changed/added ediff-word-[1-4]. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
484 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
485 ;; Tue November 1, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
486 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
487 ;; Made ediff-revision delete the temporary version files it creates. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
488 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
489 ;; Tue November 29, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
490 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
491 ;; Added ediff-swap-buffers. Split ediff-difference-vector into |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
492 ;; ediff-difference-vector-A and ediff-difference-vector-B, which |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
493 ;; allowed to factor out a lot of stuff. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
494 ;; Made the code buffer-C ready. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
495 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
496 ;; Thu December 1, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
497 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
498 ;; Lotsa bug fixes. Further rationalized the code. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
499 ;; Added ediff-display-help-hooks, ediff-mode-hooks. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
500 ;; Replaced almost identical ediff-scroll-up/down with |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
501 ;; ediff-scroll-vertically. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
502 ;; Replaced almost identical ediff-scroll-left/right with |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
503 ;; ediff-scroll-horizontally. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
504 ;; Made the code buffer-C ready. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
505 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
506 ;; Thu December 8, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
507 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
508 ;; Added ediff-toggle-wide-display. In plain display, help message is |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
509 ;; now centered correctly. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
510 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
511 ;; Fri December 9, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
512 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
513 ;; Added ediff-toggle-multiframe. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
514 ;; Fixed ediff-pop-diff and ediff-copy-diff, so that they will |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
515 ;; invoke auto-refining, if necessary. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
516 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
517 ;; Mon December 12, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
518 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
519 ;; Modified ediff-toggle-wide-display so it would funcall |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
520 ;; ediff-make-wide-display-function. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
521 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
522 ;; Tue December 13, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
523 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
524 ;; Ediff now chooses its surrogate minibuffer from frame A. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
525 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
526 ;; Mon December 20, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
527 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
528 ;; Added ediff-keymap-setup-hooks. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
529 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
530 ;; Fri December 23, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
531 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
532 ;; Changed the representation in ediff-killed-diffs-alist so that |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
533 ;; ediff-save-diff-region and ediff-pop-diff won't be confused when the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
534 ;; user swaps buffers. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
535 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
536 ;; Mon December 26, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
537 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
538 ;; Placated OS/2 by making Ediff to synchronize the call to startup |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
539 ;; hooks with the acynchronous process that computes custom diffs. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
540 ;; This has no effect on Unix installations (and VMS?), but |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
541 ;; may increase Ediff's startup time under OS/2 by 1 or 2 seconds. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
542 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
543 ;; Thu December 29, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
544 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
545 ;; ediff-recenter now deactivates the mark, so that transient mark mode |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
546 ;; highlighting won't interfere with Ediff's highlighting. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
547 ;; Also, ediff-recenter tries to not deiconify control frame, if it is |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
548 ;; not needed. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
549 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
550 ;; Fri December 30, 1994 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
551 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
552 ;; Small bugs. Worked around the OS/2 bug where |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
553 ;; modify-frame-parameters has no effect on iconified frames. Ediff |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
554 ;; now remembers the iconification status of the control frame and uses |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
555 ;; it as a preferred way of displaying it when help is toggled |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
556 ;; off. (This can be observed only in Emacs (not XEmacs) and only if |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
557 ;; the window manager lets icons accept keyboard input.) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
558 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
559 ;; Tue January 3, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
560 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
561 ;; Some futher work on incorporating buffer C in ediff-extract-diffs, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
562 ;; ediff-focus/hide-on-regexp-matches, and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
563 ;; ediff-setup-windows-plain/multiframe. The preceding two functions |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
564 ;; now dispatch the appropriate setup function depending on whether the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
565 ;; current job is comparison or merge. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
566 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
567 ;; Wed January 4, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
568 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
569 ;; Made it work under Emacs built without the X support. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
570 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
571 ;; Fri January 6, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
572 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
573 ;; Slightly changed the prompting behavior of ediff-files. Bug fix in |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
574 ;; mode-line-buffer-identification. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
575 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
576 ;; Wed January 18, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
577 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
578 ;; Added 3way comparison and support for diff3. Ported to NeXTStep |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
579 ;; |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
580 ;; Fri January 20, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
581 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
582 ;; Added ediff-merge-files, ediff-merge-buffers, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
583 ;; ediff-merge-files-with-ancestor, ediff-merge-buffers-with-ancestor, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
584 ;; ediff-merge-revisions, ediff-merge-revisions-with-ancestor. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
585 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
586 ;; Tue January 24, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
587 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
588 ;; Bug fixes. Split into several files. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
589 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
590 ;; Thu January 26, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
591 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
592 ;; `*' is now bound to ediff-make-or-kill-fine-diffs. This lets the |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
593 ;; user to kill fine diffs for the current region (by providing a |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
594 ;; negative prefix arg), if there are so many of them as to hamper |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
595 ;; the viewing. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
596 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
597 ;; Mon January 30, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
598 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
599 ;; Changed ediff-selective-display to ediff-set-visible-region, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
600 ;; ediff-toggle-selective-display to ediff-toggle-narrow-region. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
601 ;; Ediff now turns selective display off before starting. Restores |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
602 ;; selective display on exit. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
603 ;; In 2-way comparison, `a' now copies to buf `b' and `b' to buf `a'. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
604 ;; Previously, the bindings were `ab' and `ba'. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
605 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
606 ;; Wed February 1, 1995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
607 |
12880 | 608 ;; Added ediff-undo-selective-display (thanks to Stig <stig@hackvan.com>). |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
609 ;; Rearranged autoloads. Renamed ediff-entry.el into ediff.el and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
610 ;; ediff.el into ediff-util.el. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
611 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
612 ;; Fri February 3 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
613 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
614 ;; Added ediff-toggle-show-clashes-only, which is bound to `$'. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
615 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
616 ;; Fri February 19 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
617 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
618 ;; Some minor patches from Stig. Also, made ediff-xemacs-p and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
619 ;; ediff-*-job into variables for better performance. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
620 ;; In ediff-setup, diff regions are now computed after buffers A/B/C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
621 ;; are set up. Previously, it didn't work right with selective display. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
622 ;; Also, added ediff-profile to time Ediff commands and |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
623 ;; ediff-debug-info for civilized display of the difference vectors |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
624 ;; (and possibly more in the future). |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
625 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
626 ;; Tue March 18 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
627 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
628 ;; Fixed ediff-diff-at-point and ediff-toggle-multiframe. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
629 ;; Added ediff-destroy-control-frame, ediff-window-display-p. The latter |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
630 ;; replaces window-system in many cases. Needed because in XEmacs 19.12 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
631 ;; window-system returns 'tty on a tty display. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
632 ;; Converted xemacs *screen* nomenclature to *frame*. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
633 ;; Made ediff-patch-buffer cope with buffers that don't visit any file. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
634 ;; Fixed ediff-toggle-read-only so it knows the difference between |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
635 ;; version-controlled files and others. It also knows whether we are using |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
636 ;; patch or not. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
637 ;; Renamed ediff-windows to ediff-windows-wordwise, added |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
638 ;; ediff-windows-linewise. Changed ediff-small/large-regions to |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
639 ;; ediff-regions-wordwise/linewise |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
640 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
641 ;; Tue May 2 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
642 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
643 ;; Added ediff-documentation. Fixes for XEmacs 19.12. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
644 ;; Merge buffer now assumes the major mode of ediff-default-variant. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
645 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
646 ;; Mon May 31, 1995 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
647 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
648 ;; Ediff-revision now takes a prefix argument. Can compare two versions of |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
649 ;; the same file. Cleaned up ediff-make-control-frame. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
650 ;; Fixed a bug in ediff-get-visible-buffer-window. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
651 ;; Added ediff-cleanup-hooks, ediff-janitor. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
652 ;; ediff-cleanup-hooks is called before ediff-quit-hooks. |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
653 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
654 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
655 ;;; TO DO: |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
656 ;; ------ |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
657 ;; |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
658 ;; 1. Add support for multiple sessions. (At present, one can run |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
659 ;; multiple Ediff sessions, but they won't be related.) The idea is to |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
660 ;; have vars local to each control buffer, which will tell which buffer is |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
661 ;; the next and which is the previous one. The user could then go forward |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
662 ;; and backward by typing C-SPC and C-DEL (or C-n and C-p). |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
663 ;; This will probably entail some minor modifications to ediff-setup. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
664 ;; The primary use of this feature would be comparing directories of |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
665 ;; similarly named files and multi-file patch. For the latter, Ediff will |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
666 ;; have to parse patches to extract the names of files. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
667 |
7424 | 668 |
669 ;;; Acknowledgements: | |
670 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
671 ;; Special thanks to Alastair Burt <burt@dfki.uni-kl.de>, Kevin Broadey |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
672 ;; <KevinB@bartley.demon.co.uk>, Harald Boegeholz |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
673 ;; <hwb@machnix.mathematik.uni-stuttgart.de>, Jin S. Choi" <jin@atype.com>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
674 ;; Eric Eide <eeide@asylum.cs.utah.edu>, Kevin Esler <esler@ch.hp.com>, Robert |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
675 ;; Estes <estes@ece.ucdavis.edu>, Eric Freudenthal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
676 ;; <freudent@jan.ultra.nyu.edu>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
677 ;; Job Ganzevoort <Job.Ganzevoort@cwi.nl>, Boris Goldowsky |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
678 ;; <boris@cs.rochester.edu>, Allan Gottlieb <gottlieb@allan.ultra.nyu.edu>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
679 ;; Xiaoli Huang <hxl@epic.com>, Larry Gouge <larry@itginc.com>, |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
680 ;; Karl Heuer <kwzh@gnu.ai.mit.edu>, <irvine@lks.csi.com>, |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
681 ;; <jaffe@chipmunk.cita.utoronto.ca>, David Karr |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
682 ;; <dkarr@nmo.gtegsc.com>, Norbert Kiesel |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
683 ;; <norbert@i3.informatik.rwth-aachen.de>, Fritz Knabe <Fritz.Knabe@ecrc.de>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
684 ;; Heinz Knutzen <hk@informatik.uni-kiel.d400.de>, Ken Laprade |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
685 ;; <laprade@dw3f.ess.harris.com>, Richard Levitte |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
686 ;; <levitte@e.kth.se>, Martin Maechler <maechler@stat.math.ethz.ch>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
687 ;; Richard Mlynarik <mly@adoc.xerox.com>, Chris Murphy |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
688 ;; <murphycm@sun.aston.ac.uk>, Eyvind Ness <Eyvind.Ness@hrp.no>, Ray Nickson |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
689 ;; <nickson@cs.uq.oz.au>, Paul Raines <raines@slac.stanford.edu>, Tibor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
690 ;; Polgar <tlp00@spg.amdahl.com>, C.S. Roberson <roberson@aur.alcatel.com>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
691 ;; Kevin Rodgers <kevin.rodgers@ihs.com>, Sandy Rutherford |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
692 ;; <sandy@ibm550.sissa.it>, Heribert Schuetz <schuetz@ecrc.de>, Andy Scott |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
693 ;; <ascott@pcocd2.intel.com>, Axel Seibert |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
694 ;; <axel@tumbolia.ppp.informatik.uni-muenchen.de>, Richard Stallman |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
695 ;; <rms@gnu.ai.mit.edu>, Richard Stanton <stanton@haas.berkeley.edu>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
696 ;; Ake Stenhoff <etxaksf@aom.ericsson.se>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
697 ;; Stig <stig@hackvan.com>, Peter Stout <Peter_Stout@cs.cmu.edu>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
698 ;; Raymond Toy <toy@rtp.ericsson.se>, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
699 ;; and Ilya Zakharevich <ilya@math.ohio-state.edu> |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
700 ;; for contributing ideas, patches, and bug reports. |
7424 | 701 ;; |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
702 ;; Thanks also to many others who felt obliged to drop a thank you note. |
7424 | 703 |
7267 | 704 |
705 ;;; Code: | |
706 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
707 (require 'ediff-init) |
7267 | 708 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
709 (defvar ediff-version-control-package 'vc |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
710 "Version control package used. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
711 Currently, Ediff supports vc.el and rcs.el. Set this to `rcs' if you have |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
712 rcs.el and want to use it instead of the standard vc.el. |
7424 | 713 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
714 Note: both packages provide access to RCS, but only vc.el comes with Emacs |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
715 distribution.") |
7424 | 716 |
11760
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
717 (defvar ediff-revision-key nil |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
718 "Key to which `ediff-revision' is to be bound.") |
7267 | 719 |
720 (defvar ediff-use-last-dir nil | |
7419 | 721 "*If t, Ediff uses previous directory as default when reading file name.") |
7267 | 722 |
723 (defvar ediff-last-dir-A nil | |
724 "Last directory used by an Ediff command for file-A.") | |
725 (defvar ediff-last-dir-B nil | |
726 "Last directory used by an Ediff command for file-B.") | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
727 (defvar ediff-last-dir-C nil |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
728 "Last directory used by an Ediff command for file-C.") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
729 (defvar ediff-last-dir-ancestor nil |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
730 "Last directory used by an Ediff command for the ancestor file.") |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
731 (defvar ediff-last-dir-patch nil |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
732 "Last directory used by an Ediff command for file to patch.") |
7267 | 733 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
734 ;;; Patching |
7267 | 735 |
736 ;;;###autoload | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
737 (defun ediff-patch-file (source-filename &optional startup-hooks job-name) |
7424 | 738 "Run Ediff by patching FILE-TP-PATCH." |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
739 ;; This now returns the control buffer |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
740 (interactive |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
741 (list (ediff-read-file-name "File to patch" |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
742 (if ediff-use-last-dir |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
743 ediff-last-dir-patch |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
744 default-directory) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
745 nil))) |
7267 | 746 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
747 (setq source-filename (expand-file-name source-filename)) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
748 (ediff-get-patch-buffer |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
749 (if (eq job-name 'ediff-patch-buffer) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
750 (ediff-eval-in-buffer (get-file-buffer source-filename) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
751 default-directory) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
752 (file-name-directory source-filename))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
753 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
754 (let* ((backup-extension |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
755 ;; if the user specified a -b option, extract the backup |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
756 ;; extension from there; else use `_orig' |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
757 (substring ediff-patch-options |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
758 (if (string-match "-b[ \t]+" ediff-patch-options) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
759 (match-end 0) 0) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
760 (if (string-match "-b[ \t]+[^ \t]+" ediff-patch-options) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
761 (match-end 0) 0))) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
762 (shell-file-name ediff-shell) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
763 ;; ediff-find-file may use a temp file to do the patch |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
764 ;; so, we save source-filename and true-source-filename as a var |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
765 ;; that initially is source-filename but may be changed to a temp |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
766 ;; file for the purpose of patching. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
767 (true-source-filename source-filename) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
768 (target-filename source-filename) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
769 target-buf buf-to-patch file-name-magic-p ctl-buf) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
770 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
771 ;; if the user didn't specify a backup extension, use _orig |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
772 (if (string= backup-extension "") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
773 (setq backup-extension "_orig")) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
774 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
775 ;; Make a temp file, if source-filename has a magic file handler (or if |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
776 ;; it is handled via auto-mode-alist and similar magic). |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
777 ;; Check if there is a buffer visiting source-filename and if they are in |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
778 ;; synch; arrange for the deletion of temp file. |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
779 (ediff-find-file 'true-source-filename 'buf-to-patch |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
780 'ediff-last-dir-patch 'startup-hooks) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
781 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
782 ;; Check if source file name has triggered black magic, such as file name |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
783 ;; handlers or auto mode alist, and make a note of it. |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
784 ;; true-source-filename should be either the original name or a |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
785 ;; temporary file where we put the after-product of the file handler. |
8503
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
786 (setq file-name-magic-p (not (equal (file-truename true-source-filename) |
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
787 (file-truename source-filename)))) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
788 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
789 ;; Checkout orig file, if necessary, so that the patched file could be |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
790 ;; checked back in. |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
791 (if (ediff-file-checked-in-p (buffer-file-name buf-to-patch)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
792 (ediff-toggle-read-only buf-to-patch)) |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
793 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
794 (ediff-eval-in-buffer ediff-patch-diagnostics |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
795 (message "Applying patch ... ")(sit-for 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
796 ;; always pass patch the -f option, so it won't ask any questions |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
797 (shell-command-on-region |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
798 (point-min) (point-max) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
799 (format "%s -f %s -b %s %s" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
800 ediff-patch-program ediff-patch-options |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
801 backup-extension |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
802 (expand-file-name true-source-filename)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
803 t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
804 (message "Applying patch ... done")(sit-for 0) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
805 (switch-to-buffer ediff-patch-diagnostics) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
806 (sit-for 0) ; synchronize |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
807 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
808 (or (file-exists-p (concat true-source-filename backup-extension)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
809 (error "Patch failed or didn't modify the original file")) |
7267 | 810 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
811 ;; If black magic is involved, apply patch to a temp copy of the |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
812 ;; file. Otherwise, apply patch to the orig copy. If patch is applied |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
813 ;; to temp copy, we name the result old-name_patched for local files |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
814 ;; and temp-copy_patched for remote files. The orig file name isn't |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
815 ;; changed, and the temp copy of the original is later deleted. |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
816 ;; Without magic, the original file is renamed (usually into |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
817 ;; old-name_orig) and the result of patching will have the same name as |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
818 ;; the original. |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
819 (if (not file-name-magic-p) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
820 (ediff-eval-in-buffer buf-to-patch |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
821 (set-visited-file-name (concat source-filename backup-extension)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
822 (set-buffer-modified-p nil)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
823 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
824 ;; Black magic in effect. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
825 ;; If orig file was remote, put the patched file in the temp directory. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
826 ;; If orig file is local, put the patched file in the directory of |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
827 ;; the orig file. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
828 (setq target-filename |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
829 (concat |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
830 (if (ediff-file-remote-p (file-truename source-filename)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
831 true-source-filename |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
832 source-filename) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
833 "_patched")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
834 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
835 (rename-file true-source-filename target-filename t) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
836 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
837 ;; arrange that the temp copy of orig will be deleted |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
838 (rename-file (concat true-source-filename backup-extension) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
839 true-source-filename t)) |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
840 |
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
841 ;; make orig buffer read-only |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
842 (setq startup-hooks |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
843 (cons 'ediff-set-read-only-in-buf-A startup-hooks)) |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
844 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
845 ;; set up a buf for the patched file |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
846 (setq target-buf (find-file-noselect target-filename)) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
847 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
848 (setq ctl-buf |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
849 (ediff-buffers-internal |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
850 buf-to-patch target-buf nil |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
851 startup-hooks '(or job-name ediff-patch-file))) |
7267 | 852 |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
853 (bury-buffer ediff-patch-diagnostics) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
854 (message "Patch diagnostics are available in buffer %s" |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
855 (buffer-name ediff-patch-diagnostics)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
856 ctl-buf)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
857 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
858 (defun ediff-set-read-only-in-buf-A () |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
859 "Used as a startup hook to set `_orig' patch file read-only." |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
860 (ediff-eval-in-buffer ediff-buffer-A |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
861 (toggle-read-only 1))) |
7267 | 862 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
863 ;;;###autoload |
7267 | 864 (defalias 'epatch 'ediff-patch-file) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
865 ;;;###autoload |
7424 | 866 (defalias 'epatch-buffer 'ediff-patch-buffer) |
7267 | 867 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
868 ;;; Compare files/buffers |
7267 | 869 |
870 ;;;###autoload | |
871 (defun ediff-files (file-A file-B &optional startup-hooks) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
872 "Run Ediff on a pair of files, FILE-A and FILE-B." |
7267 | 873 (interactive |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
874 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
875 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
876 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
877 dir-B f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
878 (list (setq f (ediff-read-file-name "File A to compare" dir-A nil)) |
7267 | 879 (ediff-read-file-name "File B to compare" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
880 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
881 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
882 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
883 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
884 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
885 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
886 (cons (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
887 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
888 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
889 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
890 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
891 f)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
892 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
893 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
894 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
895 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
896 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
897 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
898 nil ; file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
899 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
900 'ediff-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
901 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
902 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
903 (defun ediff-files3 (file-A file-B file-C &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
904 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
905 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
906 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
907 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
908 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
909 dir-B dir-C f ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
910 (list (setq f (ediff-read-file-name "File A to compare" dir-A nil)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
911 (setq ff (ediff-read-file-name "File B to compare" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
912 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
913 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
914 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
915 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
916 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
917 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
918 (cons |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
919 (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
920 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
921 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
922 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
923 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
924 f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
925 (ediff-read-file-name "File C to compare" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
926 (setq dir-C (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
927 ediff-last-dir-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
928 (file-name-directory ff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
929 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
930 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
931 (cons (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
932 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
933 (file-name-nondirectory ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
934 dir-C)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
935 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
936 ff)) |
7267 | 937 ))) |
7424 | 938 (ediff-files-internal file-A |
939 (if (file-directory-p file-B) | |
940 (expand-file-name | |
941 (file-name-nondirectory file-A) file-B) | |
942 file-B) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
943 (if (file-directory-p file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
944 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
945 (file-name-nondirectory file-A) file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
946 file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
947 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
948 'ediff-files3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
949 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
950 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
951 (defalias 'ediff3 'ediff-files3) |
7267 | 952 |
953 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
954 (defun ediff-find-file (file-var buffer-name &optional last-dir hooks-var) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
955 "Visit FILE and arrange its buffer to Ediff's liking. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
956 FILE is actually a variable symbol that must contain a true file name. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
957 BUFFER-NAME is a variable symbol, which will get the buffer object into which |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
958 FILE is read. LAST-DIR is the directory variable symbol where FILE's |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
959 directory name should be returned. HOOKS is a variable symbol that will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
960 assigned the hook to be executed after `ediff-startup' is finished. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
961 `ediff-find-file' arranges that the temp files it might create will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
962 deleted." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
963 (let* ((file (symbol-value file-var)) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
964 (file-magic (find-file-name-handler file 'find-file-noselect)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
965 (temp-file-name-prefix (file-name-nondirectory file))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
966 (if (not (file-readable-p file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
967 (error "File `%s' does not exist or is not readable" file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
968 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
969 ;; some of the command, below, require full file name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
970 (setq file (expand-file-name file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
971 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
972 ;; Record the directory of the file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
973 (if last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
974 (set last-dir (expand-file-name (file-name-directory file)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
975 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
976 ;; Setup the buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
977 (set buffer-name (find-file-noselect file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
978 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
979 (ediff-eval-in-buffer (symbol-value buffer-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
980 (widen) ; Make sure the entire file is seen |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
981 (cond (file-magic ;; file has handler, such as jka-compr-handler or |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
982 ;; ange-ftp-hook-function--arrange for temp file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
983 (ediff-verify-file-buffer 'magic) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
984 (setq file (ediff-make-temp-file temp-file-name-prefix)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
985 (set hooks-var (cons (` (lambda () (delete-file (, file)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
986 (symbol-value hooks-var)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
987 ;; file processed via auto-mode-alist, a la uncompress.el |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
988 ((not (equal (file-truename file) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
989 (file-truename (buffer-file-name)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
990 (setq file (ediff-make-temp-file temp-file-name-prefix)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
991 (set hooks-var (cons (` (lambda () (delete-file (, file)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
992 (symbol-value hooks-var)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
993 (t ;; plain file---just check that the file matches the buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
994 (ediff-verify-file-buffer)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
995 (set file-var file))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
996 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
997 (defun ediff-files-internal (file-A file-B file-C startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
998 (let (buf-A buf-B buf-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
999 (message "Reading file %s ... " file-A)(sit-for 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1000 (ediff-find-file 'file-A 'buf-A 'ediff-last-dir-A 'startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1001 (message "Reading file %s ... " file-B)(sit-for 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1002 (ediff-find-file 'file-B 'buf-B 'ediff-last-dir-B 'startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1003 (if (and (stringp file-C) (not ediff-merge-job)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1004 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1005 (message "Reading file %s ... " file-C)(sit-for 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1006 (ediff-find-file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1007 'file-C 'buf-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1008 (if (eq job-name 'ediff-merge-files-with-ancestor) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1009 'ediff-last-dir-ancestor 'ediff-last-dir-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1010 'startup-hooks))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1011 (ediff-setup buf-A file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1012 buf-B file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1013 buf-C file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1014 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1015 (list (cons 'ediff-job-name job-name))))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1016 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1017 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1018 ;;;###autoload |
7267 | 1019 (defalias 'ediff 'ediff-files) |
1020 | |
1021 | |
1022 ;;;###autoload | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1023 (defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) |
7267 | 1024 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B." |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
1025 (interactive |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1026 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1027 (list (setq bf (read-buffer "Buffer A to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1028 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1029 (read-buffer "Buffer B to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1030 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1031 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1032 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1033 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1034 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1035 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1036 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1037 (or job-name (setq job-name 'ediff-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1038 (ediff-buffers-internal buffer-A buffer-B nil startup-hooks job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1039 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1040 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1041 (defun ediff-buffers3 (buffer-A buffer-B buffer-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1042 &optional startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1043 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1044 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1045 (let (bf bff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1046 (list (setq bf (read-buffer "Buffer A to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1047 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1048 (setq bff (read-buffer "Buffer B to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1049 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1050 ;; realign buffers so that two visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1051 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1052 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1053 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1054 t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1055 (read-buffer "Buffer C to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1056 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1057 ;; realign buffers so that three visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1058 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1059 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1060 (ediff-other-buffer (list bf bff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1061 t) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1062 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1063 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1064 (or job-name (setq job-name 'ediff-buffers3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1065 (ediff-buffers-internal buffer-A buffer-B buffer-C startup-hooks job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1066 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1067 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1068 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1069 (defun ediff-buffers-internal (buf-A buf-B buf-C startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1070 (let* ((buf-A-file-name (buffer-file-name (get-buffer buf-A))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1071 (buf-B-file-name (buffer-file-name (get-buffer buf-B))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1072 (buf-C-is-alive (ediff-buffer-live-p buf-C)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1073 (buf-C-file-name (if buf-C-is-alive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1074 (buffer-file-name (get-buffer buf-B)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1075 file-A file-B file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1076 (if (not (ediff-buffer-live-p buf-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1077 (error "Buffer %S doesn't exist" buf-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1078 (if (not (ediff-buffer-live-p buf-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1079 (error "Buffer %S doesn't exist" buf-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1080 (let ((ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1081 (if (and ediff-3way-comparison-job |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1082 (not buf-C-is-alive)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1083 (error "Buffer %S doesn't exist" buf-C))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1084 (if (stringp buf-A-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1085 (setq buf-A-file-name (file-name-nondirectory buf-A-file-name))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1086 (if (stringp buf-B-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1087 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1088 (if (stringp buf-C-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1089 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1090 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1091 ;; these three need to be evaluated in their buffers, since |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1092 ;; ediff-make-temp-file checks the current buffer when assigning file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1093 ;; names |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1094 (ediff-eval-in-buffer buf-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1095 (setq file-A (ediff-make-temp-file buf-A-file-name))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1096 (ediff-eval-in-buffer buf-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1097 (setq file-B (ediff-make-temp-file buf-B-file-name))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1098 (if buf-C-is-alive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1099 (ediff-eval-in-buffer buf-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1100 (setq file-C (ediff-make-temp-file buf-C-file-name)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1101 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1102 (ediff-setup (get-buffer buf-A) file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1103 (get-buffer buf-B) file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1104 (if buf-C-is-alive (get-buffer buf-C)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1105 file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1106 (cons (` (lambda () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1107 (delete-file (, file-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1108 (delete-file (, file-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1109 (if (stringp (, file-C)) (delete-file (, file-C))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1110 )) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1111 startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1112 (list (cons 'ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1113 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1114 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1115 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1116 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1117 ;;; Compare regions and windows |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1118 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1119 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1120 (defun ediff-windows-wordwise (dumb-mode &optional wind-A wind-B startup-hooks) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1121 "Compare WIND-A and WIND-B, which are selected by clicking, wordwise. |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1122 With prefix argument, DUMB-MODE, or on a non-windowing display, works as |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1123 follows: |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1124 If WIND-A is nil, use selected window. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1125 If WIND-B is nil, use window next to WIND-A." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1126 (interactive "P") |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1127 (ediff-windows dumb-mode wind-A wind-B |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1128 startup-hooks 'ediff-windows-wordwise 'word-mode)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1129 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1130 ;;;###autoload |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1131 (defun ediff-windows-linewise (dumb-mode &optional wind-A wind-B startup-hooks) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1132 "Compare WIND-A and WIND-B, which are selected by clicking, linewise. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1133 With prefix argument, DUMB-MODE, or on a non-windowing display, works as |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1134 follows: |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1135 If WIND-A is nil, use selected window. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1136 If WIND-B is nil, use window next to WIND-A." |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1137 (interactive "P") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1138 (ediff-windows dumb-mode wind-A wind-B |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1139 startup-hooks 'ediff-windows-linewise nil)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1140 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1141 ;; Compare WIND-A and WIND-B, which are selected by clicking. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1142 ;; With prefix argument, DUMB-MODE, or on a non-windowing display, |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1143 ;; works as follows: |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1144 ;; If WIND-A is nil, use selected window. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1145 ;; If WIND-B is nil, use window next to WIND-A. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1146 (defun ediff-windows (dumb-mode wind-A wind-B startup-hooks job-name word-mode) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1147 (if (or dumb-mode (not (ediff-window-display-p))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1148 (setq wind-A (ediff-get-next-window wind-A nil) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1149 wind-B (ediff-get-next-window wind-B wind-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1150 (setq wind-A (ediff-get-window-by-clicking wind-A nil 1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1151 wind-B (ediff-get-window-by-clicking wind-B wind-A 2))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1152 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1153 (let ((buffer-A (window-buffer wind-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1154 (buffer-B (window-buffer wind-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1155 beg-A end-A beg-B end-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1156 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1157 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1158 (save-window-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1159 (sit-for 0) ; synch before using window-start/end -- a precaution |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1160 (select-window wind-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1161 (setq beg-A (window-start) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1162 end-A (window-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1163 (select-window wind-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1164 (setq beg-B (window-start) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1165 end-B (window-end)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1166 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1167 buffer-A beg-A end-A buffer-B beg-B end-B |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1168 startup-hooks job-name word-mode))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1169 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1170 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1171 (defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1172 "Run Ediff on a pair of regions in two different buffers. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1173 Regions \(i.e., point and mark\) are assumed to be set in advance. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1174 This function is effective only for relatively small regions, up to 200 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1175 lines. For large regions, use `ediff-regions-linewise'." |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1176 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1177 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1178 (list (setq bf (read-buffer "Region's A buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1179 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1180 (read-buffer "Region's B buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1181 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1182 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1183 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1184 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1185 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1186 t)))) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
1187 (if (not (ediff-buffer-live-p buffer-A)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1188 (error "Buffer %S doesn't exist" buffer-A)) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
1189 (if (not (ediff-buffer-live-p buffer-B)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1190 (error "Buffer %S doesn't exist" buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1191 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1192 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1193 (let (reg-A-beg reg-A-end reg-B-beg reg-B-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1194 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1195 (set-buffer buffer-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1196 (setq reg-A-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1197 reg-A-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1198 (set-buffer buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1199 (setq reg-B-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1200 reg-B-end (region-end))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1201 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1202 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1203 (get-buffer buffer-A) reg-A-beg reg-A-end |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1204 (get-buffer buffer-B) reg-B-beg reg-B-end |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1205 startup-hooks 'ediff-regions-wordwise 'word-mode))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1206 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1207 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1208 (defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1209 "Run Ediff on a pair of regions in two different buffers. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1210 Regions \(i.e., point and mark\) are assumed to be set in advance. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1211 Each region is enlarged to contain full lines. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1212 This function is effective for large regions, over 100-200 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1213 lines. For small regions, use `ediff-regions-wordwise'." |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1214 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1215 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1216 (list (setq bf (read-buffer "Region A's buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1217 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1218 (read-buffer "Region B's buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1219 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1220 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1221 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1222 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1223 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1224 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1225 (if (not (ediff-buffer-live-p buffer-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1226 (error "Buffer %S doesn't exist" buffer-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1227 (if (not (ediff-buffer-live-p buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1228 (error "Buffer %S doesn't exist" buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1229 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1230 (let (reg-A-beg reg-A-end reg-B-beg reg-B-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1231 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1232 (set-buffer buffer-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1233 (setq reg-A-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1234 reg-A-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1235 ;; enlarge the region to hold full lines |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1236 (goto-char reg-A-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1237 (beginning-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1238 (setq reg-A-beg (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1239 (goto-char reg-A-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1240 (end-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1241 (or (eobp) (forward-char)) ; include the newline char |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1242 (setq reg-A-end (point)) |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
1243 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1244 (set-buffer buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1245 (setq reg-B-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1246 reg-B-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1247 ;; enlarge the region to hold full lines |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1248 (goto-char reg-A-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1249 (goto-char reg-B-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1250 (beginning-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1251 (setq reg-B-beg (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1252 (goto-char reg-B-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1253 (end-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1254 (or (eobp) (forward-char)) ; include the newline char |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1255 (setq reg-B-end (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1256 ) ; save excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1257 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1258 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1259 (get-buffer buffer-A) reg-A-beg reg-A-end |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1260 (get-buffer buffer-B) reg-B-beg reg-B-end |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1261 startup-hooks 'ediff-regions-linewise nil))) ; no word mode |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1262 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1263 ;; compare region beg-A to end-A of buffer-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1264 ;; to regions beg-B -- end-B in buffer-B. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1265 (defun ediff-regions-internal (buffer-A beg-A end-A buffer-B beg-B end-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1266 startup-hooks job-name word-mode) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1267 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1268 overl-A overl-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1269 file-A file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1270 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1271 ;; in case beg/end-A/B aren't markers--make them into markers |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1272 (ediff-eval-in-buffer buffer-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1273 (setq beg-A (move-marker (make-marker) beg-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1274 end-A (move-marker (make-marker) end-A))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1275 (ediff-eval-in-buffer buffer-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1276 (setq beg-B (move-marker (make-marker) beg-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1277 end-B (move-marker (make-marker) end-B))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1278 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1279 (if (and (eq buffer-A buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1280 (or (and (< beg-A end-B) (<= beg-B beg-A)) ; b-B b-A e-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1281 (and (< beg-B end-A) (<= end-A end-B)))) ; b-B e-A e-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1282 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1283 (with-output-to-temp-buffer ediff-msg-buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1284 (princ " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1285 You have requested to compare overlapping regions of the same buffer. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1286 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1287 In this case, Ediff's highlighting may be confusing---in the same window, |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1288 you may see highlighted regions that belong to different regions. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1289 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1290 Continue anyway? (y/n) ")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1291 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1292 (if (y-or-n-p "Continue anyway? ") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1293 () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1294 (error "%S aborted" job-name)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1295 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1296 ;; make file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1297 (if word-mode |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1298 (ediff-wordify beg-A end-A buffer-A tmp-buffer) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1299 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1300 (ediff-eval-in-buffer tmp-buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1301 (setq file-A (ediff-make-temp-file "regA"))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1302 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1303 ;; make file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1304 (if word-mode |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1305 (ediff-wordify beg-B end-B buffer-B tmp-buffer) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1306 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1307 (ediff-eval-in-buffer tmp-buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1308 (setq file-B (ediff-make-temp-file "regB"))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1309 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1310 (setq overl-A (ediff-make-bullet-proof-overlay beg-A end-A buffer-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1311 (setq overl-B (ediff-make-bullet-proof-overlay beg-B end-B buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1312 (ediff-setup buffer-A file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1313 buffer-B file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1314 nil nil ; buffer & file C |
7267 | 1315 (cons (` (lambda () |
7424 | 1316 (delete-file (, file-A)) |
1317 (delete-file (, file-B)))) | |
7267 | 1318 startup-hooks) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1319 (list (cons 'ediff-word-mode word-mode) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1320 (cons 'ediff-narrow-bounds (list overl-A overl-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1321 (cons 'ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1322 ) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1323 )) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1324 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1325 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1326 ;;; Merge files and buffers |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1327 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1328 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1329 (defalias 'ediff-merge 'ediff-merge-files) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1330 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1331 (defsubst ediff-merge-on-startup () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1332 (ediff-do-merge 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1333 (ediff-eval-in-buffer ediff-buffer-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1334 (set-buffer-modified-p nil))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1335 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1336 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1337 (defun ediff-merge-files (file-A file-B &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1338 "Merge two files without ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1339 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1340 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1341 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1342 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1343 dir-B f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1344 (list (setq f (ediff-read-file-name "File A to merge" dir-A nil)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1345 (ediff-read-file-name "File B to merge" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1346 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1347 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1348 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1349 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1350 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1351 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1352 (cons (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1353 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1354 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1355 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1356 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1357 f)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1358 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1359 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1360 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1361 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1362 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1363 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1364 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1365 nil ; file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1366 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1367 'ediff-merge-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1368 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1369 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1370 (defun ediff-merge-files-with-ancestor (file-A file-B file-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1371 &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1372 "Merge two files with ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1373 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1374 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1375 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1376 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1377 dir-B dir-ancestor f ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1378 (list (setq f (ediff-read-file-name "File A to merge" dir-A nil)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1379 (setq ff (ediff-read-file-name "File B to merge" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1380 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1381 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1382 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1383 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1384 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1385 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1386 (cons |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1387 (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1388 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1389 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1390 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1391 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1392 f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1393 (ediff-read-file-name "Ancestor file" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1394 (setq dir-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1395 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1396 ediff-last-dir-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1397 (file-name-directory ff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1398 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1399 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1400 (cons (abbreviate-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1401 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1402 (file-name-nondirectory ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1403 dir-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1404 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1405 ff)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1406 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1407 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1408 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1409 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1410 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1411 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1412 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1413 file-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1414 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1415 'ediff-merge-files-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1416 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1417 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1418 (defalias 'ediff-merge-with-ancestor 'ediff-merge-files-with-ancestor) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1419 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1420 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1421 (defun ediff-merge-buffers (buffer-A buffer-B &optional startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1422 "Merge buffers without ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1423 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1424 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1425 (list (setq bf (read-buffer "Buffer A to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1426 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1427 (read-buffer "Buffer B to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1428 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1429 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1430 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1431 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1432 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1433 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1434 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1435 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1436 (or job-name (setq job-name 'ediff-merge-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1437 (ediff-buffers-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1438 buffer-A buffer-B nil startup-hooks job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1439 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1440 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1441 (defun ediff-merge-buffers-with-ancestor (buffer-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1442 buffer-B buffer-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1443 &optional startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1444 "Merge buffers with ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1445 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1446 (let (bf bff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1447 (list (setq bf (read-buffer "Buffer A to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1448 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1449 (setq bff (read-buffer "Buffer B to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1450 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1451 ;; realign buffers so that two visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1452 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1453 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1454 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1455 t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1456 (read-buffer "Ancestor buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1457 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1458 ;; realign buffers so that three visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1459 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1460 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1461 (ediff-other-buffer (list bf bff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1462 t) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1463 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1464 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1465 (setq startup-hooks (cons 'ediff-merge-on-startup startup-hooks)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1466 (or job-name (setq job-name 'ediff-merge-buffers-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1467 (ediff-buffers-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1468 buffer-A buffer-B buffer-ancestor startup-hooks job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1469 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1470 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1471 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1472 (defun ediff-merge-revisions (rev1 rev2 &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1473 "Run Ediff by merging two revisions of a file. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1474 The file is the one visited by the current buffer." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1475 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1476 "sVersion 1 to merge (default is the latest version): \nsVersion 2 to merge (default is the latest version): ") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1477 (ediff-load-version-control) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1478 (let (buf1 buf2) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1479 (if (eq ediff-version-control-package 'vc) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1480 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1481 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1482 (vc-version-other-window rev1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1483 (setq buf1 (current-buffer))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1484 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1485 (vc-version-other-window rev2) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1486 (setq buf2 (current-buffer))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1487 (setq startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1488 (list (` (lambda () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1489 (delete-file (, (buffer-file-name buf1))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1490 (delete-file (, (buffer-file-name buf2)))))))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1491 (setq buf1 (rcs-ediff-view-revision rev1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1492 buf2 (rcs-ediff-view-revision rev2))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1493 (ediff-merge-buffers buf1 buf2 startup-hooks 'ediff-merge-revisions))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1494 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1495 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1496 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1497 (defun ediff-merge-revisions-with-ancestor (rev1 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1498 rev2 ancestor-rev |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1499 &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1500 "Run Ediff by merging with ancestor of two revisions of a file. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1501 The file is the one visited by the current buffer." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1502 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1503 "sVersion 1 to merge (default: the latest version): \nsVersion 2 to merge (default: the latest version): \nsAncestor version (default: the latest version): ") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1504 (ediff-load-version-control) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1505 (let (buf1 buf2 ancestor-buf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1506 (if (eq ediff-version-control-package 'vc) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1507 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1508 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1509 (vc-version-other-window rev1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1510 (setq buf1 (current-buffer))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1511 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1512 (vc-version-other-window rev2) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1513 (setq buf2 (current-buffer))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1514 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1515 (vc-version-other-window ancestor-rev) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1516 (setq ancestor-buf (current-buffer))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1517 (setq startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1518 (list (` (lambda () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1519 (delete-file (, (buffer-file-name buf1))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1520 (delete-file (, (buffer-file-name buf2))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1521 (delete-file (, (buffer-file-name ancestor-buf))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1522 ))))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1523 (setq buf1 (rcs-ediff-view-revision rev1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1524 buf2 (rcs-ediff-view-revision rev2) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1525 ancestor-buf (rcs-ediff-view-revision ancestor-rev))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1526 (ediff-merge-buffers-with-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1527 buf1 buf2 ancestor-buf |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1528 startup-hooks 'ediff-merge-revisions-with-ancestor))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1529 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1530 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1531 ;;; Apply patch |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1532 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1533 |
7709
d88d94461e5d
(ediff-patch-buffer): Fix autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents:
7639
diff
changeset
|
1534 ;;;###autoload |
7267 | 1535 (defun ediff-patch-buffer (buffer-name &optional startup-hooks) |
1536 "Run Ediff by patching BUFFER-NAME." | |
1537 (interactive "bBuffer to patch: ") | |
1538 | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1539 (let* ((buf-to-patch (get-buffer buffer-name)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1540 (file-name-ok (if buf-to-patch (buffer-file-name buf-to-patch))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1541 (buf-mod-status (buffer-modified-p buf-to-patch)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1542 default-dir file-name ctl-buf) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1543 (if file-name-ok |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1544 (setq file-name file-name-ok) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1545 (ediff-eval-in-buffer buffer-name |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1546 (setq default-dir default-directory) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1547 (setq file-name (ediff-make-temp-file)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1548 (set-visited-file-name file-name) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1549 (setq buffer-auto-save-file-name nil) ; don't create auto-save file |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1550 (rename-buffer buffer-name) ; don't confuse the user with new buf name |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1551 (set-buffer-modified-p nil) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1552 (set-visited-file-modtime) ; sync buffer and temp file |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1553 (setq default-directory default-dir) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1554 )) |
7267 | 1555 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1556 (setq ctl-buf |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1557 (ediff-patch-file file-name startup-hooks 'ediff-patch-buffer)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1558 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1559 (if file-name-ok |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1560 () |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1561 (ediff-eval-in-buffer ctl-buf |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1562 (delete-file (buffer-file-name ediff-buffer-A)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1563 (delete-file (buffer-file-name ediff-buffer-B)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1564 (ediff-eval-in-buffer ediff-buffer-A |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1565 (if default-dir (setq default-directory default-dir)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1566 (set-visited-file-name nil) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1567 (rename-buffer buffer-name) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1568 (set-buffer-modified-p buf-mod-status)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1569 (ediff-eval-in-buffer ediff-buffer-B |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1570 (setq buffer-auto-save-file-name nil) ; don't create auto-save file |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1571 (if default-dir (setq default-directory default-dir)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1572 (set-visited-file-name nil) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1573 (rename-buffer (ediff-unique-buffer-name |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1574 (concat buffer-name "_patched") "")) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1575 (set-buffer-modified-p t)))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1576 )) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1577 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1578 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1579 (defun ediff-get-patch-buffer (dir) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1580 "Obtain patch buffer. If patch is already in a buffer---use it. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1581 Else, read patch file into a new buffer." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1582 (if (y-or-n-p "Is the patch file already in a buffer? ") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1583 (setq ediff-patch-buf |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1584 (get-buffer (read-buffer "Patch buffer name: " nil t))) ;must match |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1585 (setq ediff-patch-buf |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1586 (find-file-noselect (read-file-name "Patch file name: " dir)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1587 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1588 (setq ediff-patch-diagnostics |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1589 (get-buffer-create "*ediff patch diagnostics*")) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1590 (ediff-eval-in-buffer ediff-patch-diagnostics |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1591 (insert-buffer ediff-patch-buf))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1592 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1593 |
7267 | 1594 |
1595 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1596 |
7267 | 1597 ;;; Versions Control functions |
1598 | |
1599 ;;;###autoload | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1600 (defun ediff-revision (arg) |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
1601 "Call `vc.el' or `rcs.el' depending on `ediff-version-control-package'. |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1602 Without prefix argument, compares the current buffer with an older version. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1603 With prefix argument, compares two older versions of the current buffer." |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1604 (interactive "P") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1605 (let (rev1 rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1606 (if arg |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1607 (setq rev1 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1608 (read-string |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1609 "This buffer's version-1 to compare (default: the latest version): ") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1610 rev2 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1611 (read-string "This buffer's version-2 to compare (default: the latest version): ")) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1612 (setq rev1 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1613 (read-string "Version to compare the current buffer with (default: the latest version): "))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1614 (ediff-load-version-control) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1615 (funcall |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1616 (intern (format "%S-ediff-internal" ediff-version-control-package)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1617 rev1 rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1618 )) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1619 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1620 ;; Backward compatibility |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1621 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1622 (defun vc-ediff () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1623 (interactive) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1624 (beep 1) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1625 (with-output-to-temp-buffer ediff-msg-buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1626 (princ " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1627 You have invoked an obsolete function `vc-ediff' or `rcs-ediff'. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1628 Please use `M-x ediff-revision' instead. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1629 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1630 Also, please check the variables `ediff-version-control-package' |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1631 and `ediff-revision-key' for customization."))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1632 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1633 (defalias 'rcs-ediff 'vc-ediff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1634 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1635 ;; Test if version control package is loaded and load if not |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1636 ;; Is SILENT is non-nil, don't report error if package is not found. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1637 (defun ediff-load-version-control (&optional silent) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1638 (or (featurep ediff-version-control-package) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1639 (if (locate-library (symbol-name ediff-version-control-package)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1640 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1641 (message "") ; kill the message from `locate-library' |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1642 (require ediff-version-control-package) |
11760
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1643 (if ediff-revision-key |
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1644 (define-key |
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1645 (cond ((eq ediff-version-control-package 'vc) vc-prefix-map) |
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1646 ((eq ediff-version-control-package 'rcs) global-map) |
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1647 (t global-map)) |
898ec89f5379
(ediff-revision-key): Default value nil.
Richard M. Stallman <rms@gnu.org>
parents:
11234
diff
changeset
|
1648 ediff-revision-key 'ediff-revision))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1649 (or silent |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1650 (error "Version control package %S.el not found. Use vc.el instead" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1651 ediff-version-control-package))))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1652 |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
1653 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1654 (defun vc-ediff-internal (rev1 &optional rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1655 "Run Ediff on versions of the current buffer. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1656 If both REV1 and REV2 are given then these two versions are compared. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1657 If only REV1 is given then the current buffer is compared against version REV1. |
7267 | 1658 If the current buffer is named `F', the version is named `F.~REV~'. |
7391 | 1659 If `F.~REV~' already exists, it is used instead of being re-created." |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1660 (let ((curbuf (current-buffer)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1661 (curwind (selected-window)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1662 file1 file2 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1663 rev1buf rev2buf) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1664 (vc-version-other-window rev1) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1665 (setq rev1buf (current-buffer) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1666 file1 (buffer-file-name)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1667 (select-window curwind) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1668 (if (not (stringp rev2)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1669 (setq rev2buf curbuf) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1670 (vc-version-other-window rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1671 (setq rev2buf (current-buffer) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1672 file2 (buffer-file-name))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1673 (ediff-buffers |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1674 rev1buf rev2buf |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1675 (list (` (lambda () |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1676 (delete-file (, file1)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1677 (if (, file2) (delete-file (, file2))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1678 ))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1679 'ediff-revision))) |
7267 | 1680 |
1681 (defun rcs-ediff-view-revision (&optional rev) | |
7424 | 1682 "View previous RCS revision of current file. |
7267 | 1683 With prefix argument, prompts for a revision name." |
1684 (interactive (list (if current-prefix-arg | |
1685 (read-string "Revision: ")))) | |
1686 (let* ((filename (buffer-file-name (current-buffer))) | |
1687 (switches (append '("-p") | |
1688 (if rev (list (concat "-r" rev)) nil))) | |
1689 (buff (concat (file-name-nondirectory filename) ".~" rev "~"))) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1690 (message "Working ...") |
7267 | 1691 (setq filename (expand-file-name filename)) |
8503
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
1692 (with-output-to-temp-buffer buff |
7424 | 1693 (let ((output-buffer (ediff-rcs-get-output-buffer filename buff))) |
7267 | 1694 (delete-windows-on output-buffer) |
1695 (save-excursion | |
1696 (set-buffer output-buffer) | |
1697 (apply 'call-process "co" nil t nil | |
1698 ;; -q: quiet (no diagnostics) | |
1699 (append switches rcs-default-co-switches | |
1700 (list "-q" filename))))) | |
1701 (message "") | |
1702 buff))) | |
7424 | 1703 |
1704 (defun ediff-rcs-get-output-buffer (file name) | |
1705 ;; Get a buffer for RCS output for FILE, make it writable and clean it up. | |
1706 ;; Optional NAME is name to use instead of `*RCS-output*'. | |
8303
33ef3e3234dd
(Emacs 19 menu setup): Move back to top level and do it only if purify-flag.
Richard M. Stallman <rms@gnu.org>
parents:
7709
diff
changeset
|
1707 ;; This is a modified version from rcs.el v1.1. I use it here to make |
7424 | 1708 ;; Ediff immune to changes in rcs.el |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1709 (let* ((default-major-mode 'fundamental-mode) ; no frills! |
7424 | 1710 (buf (get-buffer-create name))) |
1711 (save-excursion | |
1712 (set-buffer buf) | |
1713 (setq buffer-read-only nil | |
1714 default-directory (file-name-directory (expand-file-name file))) | |
1715 (erase-buffer)) | |
1716 buf)) | |
7267 | 1717 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1718 (defun rcs-ediff-internal (rev1 &optional rev2) |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
1719 "Run Ediff on the current buffer, comparing it with previous RCS revision." |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1720 (let ((rev2buf (if (stringp rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1721 (rcs-ediff-view-revision rev2) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1722 (current-buffer))) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1723 (rev1buf (rcs-ediff-view-revision rev1))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1724 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1725 ;; rcs.el doesn't create temp version files, so we don't have to delete |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1726 ;; anything in startup hooks to ediff-buffers |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1727 (ediff-buffers rev1buf rev2buf nil 'ediff-revision) |
7424 | 1728 )) |
7267 | 1729 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1730 ;;; Menu bar |
7267 | 1731 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1732 ;;; This is split in several parts to avoid |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1733 ;;; making a line in loaddefs.el that is too long for patch. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1734 ;;; Note that autoload.el currently looks for cookies |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1735 ;;; only at top level in the file. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1736 ;;; So I moved these to top level. But the conditionals on |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1737 ;;; purify-flag make these no-ops when you load ediff. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1738 ;;; They only do something in loaddefs.el. |
7267 | 1739 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1740 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1741 (if purify-flag |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1742 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1743 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1744 () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1745 (defvar menu-bar-epatch-menu (make-sparse-keymap "Epatch")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1746 (fset 'menu-bar-epatch-menu (symbol-value 'menu-bar-epatch-menu)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1747 (defvar menu-bar-ediff-merge-menu (make-sparse-keymap "Ediff merge")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1748 (fset 'menu-bar-ediff-merge-menu |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1749 (symbol-value 'menu-bar-ediff-merge-menu)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1750 (defvar menu-bar-ediff-menu (make-sparse-keymap "Ediff")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1751 (fset 'menu-bar-ediff-menu (symbol-value 'menu-bar-ediff-menu)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1752 )) |
7267 | 1753 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1754 ;;; These must be placed in menu-bar.el in Emacs |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1755 ;; |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1756 ;; (define-key menu-bar-tools-menu [epatch] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1757 ;; '("Apply Patch" . menu-bar-epatch-menu)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1758 ;; (define-key menu-bar-tools-menu [ediff-merge] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1759 ;; '("Merge" . menu-bar-ediff-merge-menu)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1760 ;; (define-key menu-bar-tools-menu [ediff] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1761 ;; '("Compare" . menu-bar-ediff-menu)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1762 |
7424 | 1763 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1764 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1765 (if purify-flag |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1766 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1767 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1768 () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1769 (define-key menu-bar-ediff-menu [ediff-revision] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1770 '("File with Revision ..." . ediff-revision)) |
12291
5724b13e7b7b
Fixed bogus references to menu-bar-file-menu in define-key forms.
Roland McGrath <roland@gnu.org>
parents:
12083
diff
changeset
|
1771 (define-key menu-bar-ediff-menu [separator-ediff-files] '("--")) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1772 (define-key menu-bar-ediff-menu [ediff-buffers3] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1773 '("Three Buffers ..." . ediff-buffers3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1774 (define-key menu-bar-ediff-menu [ediff-files3] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1775 '("Three Files ..." . ediff-files3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1776 (define-key menu-bar-ediff-menu [ediff-buffers] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1777 '("Two Buffers ..." . ediff-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1778 (define-key menu-bar-ediff-menu [ediff-files] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1779 '("Two Files ..." . ediff-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1780 )) |
8503
084456e12635
(ediff-find-file, ediff-patch-file): Handle symlinks.
Richard M. Stallman <rms@gnu.org>
parents:
8441
diff
changeset
|
1781 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1782 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1783 (if purify-flag |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1784 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1785 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1786 () |
12291
5724b13e7b7b
Fixed bogus references to menu-bar-file-menu in define-key forms.
Roland McGrath <roland@gnu.org>
parents:
12083
diff
changeset
|
1787 (define-key menu-bar-ediff-menu [separator-ediff-regions] '("--")) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1788 (define-key menu-bar-ediff-menu [ediff-regions-linewise] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1789 '("Regions Line-by-line ..." . ediff-regions-linewise)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1790 (define-key menu-bar-ediff-menu [ediff-regions-wordwise] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1791 '("Regions Word-by-word ..." . ediff-regions-wordwise)) |
12291
5724b13e7b7b
Fixed bogus references to menu-bar-file-menu in define-key forms.
Roland McGrath <roland@gnu.org>
parents:
12083
diff
changeset
|
1792 (define-key menu-bar-ediff-menu [separator-ediff-windows] '("--")) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1793 (define-key menu-bar-ediff-menu [ediff-windows-linewise] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1794 '("Windows Line-by-line ..." . ediff-windows-linewise)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1795 (define-key menu-bar-ediff-menu [ediff-windows-wordwise] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1796 '("Windows Word-by-word ..." . ediff-windows-wordwise)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1797 )) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1798 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1799 ;;;###autoload |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1800 (if purify-flag |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1801 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1802 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1803 () |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1804 (define-key |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1805 menu-bar-ediff-merge-menu [ediff-merge-revisions-with-ancestor] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1806 '("Revisions with Ancestor ..." . ediff-merge-revisions-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1807 (define-key menu-bar-ediff-merge-menu [ediff-merge-revisions] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1808 '("Revisions ..." . ediff-merge-revisions)) |
12291
5724b13e7b7b
Fixed bogus references to menu-bar-file-menu in define-key forms.
Roland McGrath <roland@gnu.org>
parents:
12083
diff
changeset
|
1809 (define-key menu-bar-ediff-merge-menu [separator-ediff-merge] '("--")) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1810 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers-with-ancestor] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1811 '("Buffers with Ancestor ..." . ediff-merge-buffers-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1812 (define-key menu-bar-ediff-merge-menu [ediff-merge-buffers] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1813 '("Buffers ..." . ediff-merge-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1814 (define-key menu-bar-ediff-merge-menu [ediff-merge-files-with-ancestor] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1815 '("Files with Ancestor ..." . ediff-merge-files-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1816 (define-key menu-bar-ediff-merge-menu [ediff-merge-files] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1817 '("Files ..." . ediff-merge-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1818 )) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1819 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1820 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1821 (if purify-flag |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1822 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1823 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1824 () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1825 (define-key menu-bar-epatch-menu [ediff-patch-buffer] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1826 '("To a Buffer ..." . ediff-patch-buffer)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1827 (define-key menu-bar-epatch-menu [ediff-patch-file] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1828 '("To a File ..." . ediff-patch-file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1829 )) |
7267 | 1830 |
1831 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1832 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1833 (if purify-flag |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1834 ;; explicit string-match, as ediff-xemacs-p is not defined at build time |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1835 (if (string-match "\\(Lucid\\|Xemacs\\)" emacs-version) |
7424 | 1836 (progn |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1837 (defvar ediff-menu |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1838 '("Compare" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1839 ["Two Files ..." ediff-files t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1840 ["Two Buffers ..." ediff-buffers t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1841 ["Three Files ..." ediff-files3 t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1842 ["Three Buffers ..." ediff-buffers3 t] |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1843 "---" |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1844 ["File with Revision ..." ediff-revision t] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1845 "---" |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1846 ["Windows Word-by-word ..." ediff-windows-wordwise t] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1847 ["Windows Line-by-line ..." ediff-windows-linewise t] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1848 "---" |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1849 ["Regions Word-by-word ..." ediff-regions-wordwise t] |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1850 ["Regions Line-by-line ..." ediff-regions-linewise t])) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1851 (defvar ediff-merge-menu |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1852 '("Merge" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1853 ["Files ..." ediff-merge-files t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1854 ["Files with Ancestor ..." ediff-merge-files-with-ancestor t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1855 ["Buffers ..." ediff-merge-buffers t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1856 ["Buffers with Ancestor ..." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1857 ediff-merge-buffers-with-ancestor t] |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1858 "---" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1859 ["Revisions ..." ediff-merge-revisions t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1860 ["Revisions with Ancestor ..." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1861 ediff-merge-revisions-with-ancestor t])) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1862 (defvar epatch-menu |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1863 '("Apply Patch" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1864 ["To a file ..." ediff-patch-file t] |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1865 ["To a buffer ..." ediff-patch-buffer t])) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1866 (add-submenu '("Tools") ediff-menu "VC") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1867 (add-submenu '("Tools") ediff-merge-menu "VC") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1868 (add-submenu '("Tools") epatch-menu "VC") |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1869 ;; Display a solid horizontal line |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1870 (add-menu-button '("Tools") ["---" nil nil] "VC") |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1871 ))) |
7267 | 1872 |
1873 | |
1874 (provide 'ediff) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1875 (require 'ediff-util) |
7267 | 1876 |
1877 ;;; ediff.el ends here |