Mercurial > emacs
annotate lisp/ediff.el @ 15920:e67d0c1ec11c
(minibuffer-setup-hook): Fix misspelling of hook name.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 25 Aug 1996 02:31:33 +0000 |
parents | 43a3308fcf61 |
children | b2fae8abc5b0 |
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 |
14169 | 2 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. |
7267 | 4 |
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | |
6 ;; 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
|
7 ;; Keywords: comparing, merging, patching, version control. |
7267 | 8 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
9 (defconst ediff-version "2.61" "The current version of Ediff") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
10 (defconst ediff-date "June 10, 1996" "Date of last update") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
11 |
8874
716969785d08
(ediff-submit-report, ediff-revision)
Richard M. Stallman <rms@gnu.org>
parents:
8524
diff
changeset
|
12 |
7267 | 13 ;; This file is part of GNU Emacs. |
14 | |
15 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
16 ;; it under the terms of the GNU General Public License as published by | |
17 ;; the Free Software Foundation; either version 2, or (at your option) | |
18 ;; any later version. | |
19 | |
20 ;; GNU Emacs is distributed in the hope that it will be useful, | |
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 ;; GNU General Public License for more details. | |
24 | |
25 ;; You should have received a copy of the GNU General Public License | |
14169 | 26 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
28 ;; Boston, MA 02111-1307, USA. | |
7267 | 29 |
30 ;;; Commentary: | |
31 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
32 ;; Never read that diff output again! |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
33 ;; Apply patch interactively! |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
34 ;; Merge with ease! |
7267 | 35 |
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
|
36 ;; 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
|
37 ;; 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
|
38 ;; 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
|
39 ;; 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
|
40 ;; 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
|
41 ;; 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
|
42 ;; another (and recover old differences if you change your mind). |
7267 | 43 |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
44 ;; Ediff also supports merging operations on files and buffers, including |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
45 ;; merging using ancestor versions. Both comparison and merging operations can |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
46 ;; be performed on directories, i.e., by pairwise comparison of files in those |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
47 ;; directories. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
48 |
7267 | 49 ;; 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
|
50 ;; though both files, the patched and the original one, simultaneously, |
7267 | 51 ;; difference-by-difference. You can even apply a patch right out of a |
52 ;; mail buffer, i.e., patches received by mail don't even have to be saved. | |
53 ;; Since Ediff lets you copy differences between buffers, you can, in | |
54 ;; 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
|
55 ;; region from file_orig to file, thereby undoing any particular patch that |
7267 | 56 ;; you don't like). |
57 | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
58 ;; 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
|
59 ;; 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
|
60 ;; compressed files. Details are given below. |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
61 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
62 ;; Finally, Ediff supports directory-level comparison, merging and patching. |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
63 ;; See the on-line manual for details. |
7267 | 64 |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
65 ;; This package builds upon the ideas borrowed from emerge.el and several |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
66 ;; Ediff's functions are adaptations from emerge.el. Much of the functionality |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
67 ;; Ediff provides is also influenced by emerge.el. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
68 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
69 ;; The present version of Ediff supersedes Emerge. It provides a superior user |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
70 ;; interface and has numerous major features not found in Emerge. In |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
71 ;; particular, it can do patching, and 2-way and 3-way file comparison, |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
72 ;; merging, and directory operations. |
7267 | 73 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
74 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
75 |
7267 | 76 ;;; Bugs: |
77 | |
78 ;; 1. The undo command doesn't restore deleted regions well. That is, if | |
79 ;; 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
|
80 ;; `undo', the reinstated text will most likely be inserted outside of |
7424 | 81 ;; 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
|
82 ;; doesn't seem to exist with XEmacs.) |
7424 | 83 ;; |
84 ;; If at any point you feel that difference regions are no longer correct, | |
85 ;; you can hit '!' to recompute the differences. | |
86 | |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
87 ;; 2. On a monochrome display, the repertoire of faces with which to |
7424 | 88 ;; highlight fine differences is limited. By default, Ediff is using |
14040 | 89 ;; underlining. However, if the region is already underlined by some other |
7424 | 90 ;; overlays, there is no simple way to temporarily remove that residual |
91 ;; underlining. This problem occurs when a buffer is highlighted with | |
92 ;; hilit19.el or font-lock.el packages. If this residual highlighting gets | |
93 ;; in the way, you can do the following. Both font-lock.el and hilit19.el | |
94 ;; provide commands for unhighlighting buffers. You can either place these | |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
95 ;; commands in `ediff-prepare-buffer-hook' (which will unhighlight every |
7424 | 96 ;; buffer used by Ediff) or you can execute them interactively, at any time |
97 ;; and on any buffer. | |
98 | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
99 |
7424 | 100 ;;; Acknowledgements: |
101 | |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
102 ;; Ediff was inspired by Dale R. Worley's <drw@math.mit.edu> emerge.el. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
103 ;; Ediff would not have been possible without the help and encouragement of |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
104 ;; its many users. See Ediff on-line Info for the full list of those who |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
105 ;; helped. Improved defaults in Ediff file-name reading commands. |
7424 | 106 |
7267 | 107 ;;; Code: |
108 | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
109 (require 'ediff-init) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
110 ;; ediff-mult is always required, because of the registry stuff |
13604
81099f6b6fb1
(ediff-mult): Require ediff-mult.
Richard M. Stallman <rms@gnu.org>
parents:
13217
diff
changeset
|
111 (require 'ediff-mult) |
7424 | 112 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
113 (eval-when-compile |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
114 (load "dired") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
115 (load-file "./ediff-ptch.el") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
116 (load-file "./ediff-vers.el") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
117 (load "pcl-cvs" 'noerror)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
118 |
7267 | 119 (defvar ediff-use-last-dir nil |
7419 | 120 "*If t, Ediff uses previous directory as default when reading file name.") |
7267 | 121 |
122 (defvar ediff-last-dir-A nil | |
123 "Last directory used by an Ediff command for file-A.") | |
124 (defvar ediff-last-dir-B nil | |
125 "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
|
126 (defvar ediff-last-dir-C nil |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
127 "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
|
128 (defvar ediff-last-dir-ancestor nil |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
129 "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
|
130 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
131 ;; Some defvars to reduce the number of compiler warnings |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
132 (defvar cvs-cookie-handle) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
133 (defvar ediff-last-dir-patch) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
134 (defvar ediff-patch-default-directory) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
135 ;; end of compiler pacifier |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
136 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
137 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
138 ;; 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
|
139 (defun ediff-set-read-only-in-buf-A () |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
140 (ediff-eval-in-buffer ediff-buffer-A |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
141 (toggle-read-only 1))) |
7267 | 142 |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
143 ;; Return a plausible default for ediff's first file: |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
144 ;; In dired, return the file name under the point, unless it is a directory |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
145 ;; If the buffer has a file name, return that file name. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
146 (defun ediff-get-default-file-name () |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
147 (cond ((eq major-mode 'dired-mode) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
148 (let ((f (dired-get-filename nil 'no-error))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
149 (if (and (stringp f) (not (file-directory-p f))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
150 f))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
151 ((buffer-file-name (current-buffer)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
152 (file-name-nondirectory (buffer-file-name (current-buffer)))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
153 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
154 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
155 ;;; Compare files/buffers |
7267 | 156 |
157 ;;;###autoload | |
158 (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
|
159 "Run Ediff on a pair of files, FILE-A and FILE-B." |
7267 | 160 (interactive |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
161 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
162 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
163 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
164 dir-B f) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
165 (list (setq f (ediff-read-file-name |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
166 "File A to compare" dir-A |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
167 (ediff-get-default-file-name))) |
7267 | 168 (ediff-read-file-name "File B to compare" |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
169 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
170 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
171 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
172 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
173 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
174 (setq file-name-history |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
175 (cons (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
176 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
177 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
178 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
179 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
180 f)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
181 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
182 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
183 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
184 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
185 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
186 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
187 nil ; file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
188 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
189 'ediff-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
190 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
191 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
192 (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
|
193 "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
|
194 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
195 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
196 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
197 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
198 dir-B dir-C f ff) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
199 (list (setq f (ediff-read-file-name |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
200 "File A to compare" dir-A |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
201 (ediff-get-default-file-name))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
202 (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
|
203 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
204 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
205 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
206 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
207 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
208 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
209 (cons |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
210 (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
211 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
212 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
213 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
214 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
215 f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
216 (ediff-read-file-name "File C to compare" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
217 (setq dir-C (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
218 ediff-last-dir-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
219 (file-name-directory ff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
220 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
221 (setq file-name-history |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
222 (cons (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
223 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
224 (file-name-nondirectory ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
225 dir-C)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
226 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
227 ff)) |
7267 | 228 ))) |
7424 | 229 (ediff-files-internal file-A |
230 (if (file-directory-p file-B) | |
231 (expand-file-name | |
232 (file-name-nondirectory file-A) file-B) | |
233 file-B) | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
234 (if (file-directory-p file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
235 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
236 (file-name-nondirectory file-A) file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
237 file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
238 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
239 'ediff-files3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
240 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
241 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
242 (defalias 'ediff3 'ediff-files3) |
7267 | 243 |
244 | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
245 ;; Visit FILE and arrange its buffer to Ediff's liking. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
246 ;; FILE is actually a variable symbol that must contain a true file name. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
247 ;; BUFFER-NAME is a variable symbol, which will get the buffer object into |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
248 ;; which FILE is read. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
249 ;; LAST-DIR is the directory variable symbol where FILE's |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
250 ;; directory name should be returned. HOOKS-VAR is a variable symbol that will |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
251 ;; be assigned the hook to be executed after `ediff-startup' is finished. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
252 ;; `ediff-find-file' arranges that the temp files it might create will be |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
253 ;; deleted. |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
254 (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
|
255 (let* ((file (symbol-value file-var)) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
256 (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
|
257 (temp-file-name-prefix (file-name-nondirectory file))) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
258 (cond ((not (file-readable-p file)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
259 (error "File `%s' does not exist or is not readable" file)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
260 ((file-directory-p file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
261 (error "File `%s' is a directory" file))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
262 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
263 ;; some of the commands, below, require full file name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
264 (setq file (expand-file-name file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
265 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
266 ;; Record the directory of the file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
267 (if last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
268 (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
|
269 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
270 ;; Setup the buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
271 (set buffer-name (find-file-noselect file)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
272 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
273 (ediff-eval-in-buffer (symbol-value buffer-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
274 (widen) ; Make sure the entire file is seen |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
275 (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
|
276 ;; ange-ftp-hook-function--arrange for temp file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
277 (ediff-verify-file-buffer 'magic) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
278 (setq file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
279 (ediff-make-temp-file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
280 (current-buffer) temp-file-name-prefix)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
281 (set hooks-var (cons (` (lambda () (delete-file (, file)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
282 (symbol-value hooks-var)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
283 ;; 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
|
284 ((not (equal (file-truename file) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
285 (file-truename (buffer-file-name)))) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
286 (setq file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
287 (ediff-make-temp-file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
288 (current-buffer) temp-file-name-prefix)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
289 (set hooks-var (cons (` (lambda () (delete-file (, file)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
290 (symbol-value hooks-var)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
291 (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
|
292 (ediff-verify-file-buffer)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
293 (set file-var file))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
294 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
295 (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
|
296 (let (buf-A buf-B buf-C) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
297 (message "Reading file %s ... " file-A) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
298 ;;(sit-for 0) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
299 (ediff-find-file 'file-A 'buf-A 'ediff-last-dir-A 'startup-hooks) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
300 (message "Reading file %s ... " file-B) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
301 ;;(sit-for 0) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
302 (ediff-find-file 'file-B 'buf-B 'ediff-last-dir-B 'startup-hooks) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
303 (if (stringp file-C) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
304 (progn |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
305 (message "Reading file %s ... " file-C) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
306 ;;(sit-for 0) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
307 (ediff-find-file |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
308 'file-C 'buf-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
309 (if (eq job-name 'ediff-merge-files-with-ancestor) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
310 'ediff-last-dir-ancestor 'ediff-last-dir-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
311 'startup-hooks))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
312 (ediff-setup buf-A file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
313 buf-B file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
314 buf-C file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
315 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
316 (list (cons 'ediff-job-name job-name))))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
317 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
318 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
319 ;;;###autoload |
7267 | 320 (defalias 'ediff 'ediff-files) |
321 | |
322 | |
323 ;;;###autoload | |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
324 (defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) |
7267 | 325 "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
|
326 (interactive |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
327 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
328 (list (setq bf (read-buffer "Buffer A to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
329 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
330 (read-buffer "Buffer B to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
331 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
332 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
333 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
334 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
335 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
336 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
337 (or job-name (setq job-name 'ediff-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
338 (ediff-buffers-internal buffer-A buffer-B nil startup-hooks job-name)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
339 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
340 ;;;###autoload |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
341 (defalias 'ebuffers 'ediff-buffers) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
342 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
343 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
344 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
345 (defun ediff-buffers3 (buffer-A buffer-B buffer-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
346 &optional startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
347 "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
|
348 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
349 (let (bf bff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
350 (list (setq bf (read-buffer "Buffer A to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
351 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
352 (setq bff (read-buffer "Buffer B to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
353 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
354 ;; realign buffers so that two visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
355 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
356 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
357 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
358 t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
359 (read-buffer "Buffer C to compare: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
360 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
361 ;; realign buffers so that three visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
362 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
363 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
364 (ediff-other-buffer (list bf bff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
365 t) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
366 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
367 (or job-name (setq job-name 'ediff-buffers3)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
368 (ediff-buffers-internal buffer-A buffer-B buffer-C startup-hooks job-name)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
369 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
370 ;;;###autoload |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
371 (defalias 'ebuffers3 'ediff-buffers3) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
372 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
373 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
374 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
375 (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
|
376 (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
|
377 (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
|
378 (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
|
379 (buf-C-file-name (if buf-C-is-alive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
380 (buffer-file-name (get-buffer buf-B)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
381 file-A file-B file-C) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
382 (if (not (ediff-buffer-live-p buf-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
383 (error "Buffer %S doesn't exist" buf-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
384 (if (not (ediff-buffer-live-p buf-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
385 (error "Buffer %S doesn't exist" buf-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
386 (let ((ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
387 (if (and ediff-3way-comparison-job |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
388 (not buf-C-is-alive)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
389 (error "Buffer %S doesn't exist" buf-C))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
390 (if (stringp buf-A-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
391 (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
|
392 (if (stringp buf-B-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
393 (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
|
394 (if (stringp buf-C-file-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
395 (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
|
396 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
397 (setq file-A (ediff-make-temp-file buf-A buf-A-file-name) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
398 file-B (ediff-make-temp-file buf-B buf-B-file-name)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
399 (if buf-C-is-alive |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
400 (setq file-C (ediff-make-temp-file buf-C buf-C-file-name))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
401 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
402 (ediff-setup (get-buffer buf-A) file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
403 (get-buffer buf-B) file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
404 (if buf-C-is-alive (get-buffer buf-C)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
405 file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
406 (cons (` (lambda () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
407 (delete-file (, file-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
408 (delete-file (, file-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
409 (if (stringp (, file-C)) (delete-file (, file-C))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
410 )) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
411 startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
412 (list (cons 'ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
413 ))) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
414 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
415 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
416 ;;; Directory and file group operations |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
417 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
418 ;; Get appropriate default name for directory: |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
419 ;; If ediff-use-last-dir, use ediff-last-dir-A. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
420 ;; In dired mode, use the directory that is under the point (if any); |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
421 ;; otherwise, use default-directory |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
422 (defun ediff-get-default-directory-name () |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
423 (cond (ediff-use-last-dir ediff-last-dir-A) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
424 ((eq major-mode 'dired-mode) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
425 (let ((f (dired-get-filename nil 'noerror))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
426 (if (and (stringp f) (file-directory-p f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
427 f |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
428 default-directory))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
429 (t default-directory))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
430 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
431 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
432 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
433 (defun ediff-directories (dir1 dir2 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
434 "Run Ediff on a pair of directories, DIR1 and DIR2, comparing files that have |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
435 the same name in both. The third argument, REGEXP, is a regular expression that |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
436 can be used to filter out certain file names." |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
437 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
438 (let ((dir-A (ediff-get-default-directory-name)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
439 f) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
440 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
441 (ediff-read-file-name "Directory B to compare:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
442 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
443 ediff-last-dir-B |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
444 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
445 nil) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
446 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
447 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
448 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
449 (ediff-directories-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
450 dir1 dir2 nil regexp 'ediff-files 'ediff-directories |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
451 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
452 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
453 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
454 (defalias 'edirs 'ediff-directories) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
455 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
456 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
457 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
458 (defun ediff-directory-revisions (dir1 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
459 "Run Ediff on a directory, DIR1, comparing its files with their revisions. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
460 The second argument, REGEXP, is a regular expression that filters the file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
461 names. Only the files that are under revision control are taken into account." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
462 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
463 (let ((dir-A (ediff-get-default-directory-name))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
464 (list (ediff-read-file-name |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
465 "Directory to compare with revision:" dir-A nil) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
466 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
467 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
468 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
469 (ediff-directory-revisions-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
470 dir1 regexp 'ediff-revision 'ediff-directory-revisions |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
471 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
472 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
473 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
474 (defalias 'edir-revisions 'ediff-directory-revisions) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
475 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
476 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
477 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
478 (defun ediff-directories3 (dir1 dir2 dir3 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
479 "Run Ediff on three directories, DIR1, DIR2, and DIR3, comparing files that |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
480 have the same name in all three. The last argument, REGEXP, is a regular |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
481 expression that can be used to filter out certain file names." |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
482 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
483 (let ((dir-A (ediff-get-default-directory-name)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
484 f) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
485 (list (setq f (ediff-read-file-name "Directory A to compare:" dir-A nil)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
486 (setq f (ediff-read-file-name "Directory B to compare:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
487 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
488 ediff-last-dir-B |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
489 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
490 nil)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
491 (ediff-read-file-name "Directory C to compare:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
492 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
493 ediff-last-dir-C |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
494 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
495 nil) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
496 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
497 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
498 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
499 (ediff-directories-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
500 dir1 dir2 dir3 regexp 'ediff-files3 'ediff-directories3 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
501 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
502 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
503 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
504 (defalias 'edirs3 'ediff-directories3) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
505 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
506 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
507 (defun ediff-merge-directories (dir1 dir2 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
508 "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
509 the same name in both. The third argument, REGEXP, is a regular expression that |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
510 can be used to filter out certain file names." |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
511 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
512 (let ((dir-A (ediff-get-default-directory-name)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
513 f) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
514 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
515 (ediff-read-file-name "Directory B to merge:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
516 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
517 ediff-last-dir-B |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
518 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
519 nil) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
520 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
521 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
522 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
523 (ediff-directories-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
524 dir1 dir2 nil regexp 'ediff-merge-files 'ediff-merge-directories |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
525 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
526 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
527 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
528 (defalias 'edirs-merge 'ediff-merge-directories) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
529 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
530 ;;;###autoload |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
531 (defun ediff-merge-directories-with-ancestor (dir1 dir2 ancestor-dir regexp) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
532 "Merge files in directories DIR1 and DIR2 using files in ANCESTOR-DIR as ancestors. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
533 Ediff merges files that have identical names in DIR1, DIR2. If a pair of files |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
534 in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
535 without ancestor. The fourth argument, REGEXP, is a regular expression that |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
536 can be used to filter out certain file names." |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
537 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
538 (let ((dir-A (ediff-get-default-directory-name)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
539 f) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
540 (list (setq f (ediff-read-file-name "Directory A to merge:" dir-A nil)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
541 (setq f (ediff-read-file-name "Directory B to merge:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
542 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
543 ediff-last-dir-B |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
544 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
545 nil)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
546 (ediff-read-file-name "Ancestor directory:" |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
547 (if ediff-use-last-dir |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
548 ediff-last-dir-C |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
549 (ediff-strip-last-dir f)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
550 nil) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
551 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
552 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
553 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
554 (ediff-directories-internal |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
555 dir1 dir2 ancestor-dir regexp |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
556 'ediff-merge-files-with-ancestor 'ediff-merge-directories-with-ancestor |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
557 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
558 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
559 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
560 (defun ediff-merge-directory-revisions (dir1 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
561 "Run Ediff on a directory, DIR1, merging its files with their revisions. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
562 The second argument, REGEXP, is a regular expression that filters the file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
563 names. Only the files that are under revision control are taken into account." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
564 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
565 (let ((dir-A (ediff-get-default-directory-name))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
566 (list (ediff-read-file-name |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
567 "Directory to merge with revisions:" dir-A nil) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
568 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
569 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
570 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
571 (ediff-directory-revisions-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
572 dir1 regexp 'ediff-merge-revisions 'ediff-merge-directory-revisions |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
573 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
574 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
575 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
576 (defalias 'edir-merge-revisions 'ediff-merge-directory-revisions) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
577 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
578 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
579 (defun ediff-merge-directory-revisions-with-ancestor (dir1 regexp) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
580 "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
581 The second argument, REGEXP, is a regular expression that filters the file |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
582 names. Only the files that are under revision control are taken into account." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
583 (interactive |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
584 (let ((dir-A (ediff-get-default-directory-name))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
585 (list (ediff-read-file-name |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
586 "Directory to merge with revisions and ancestors:" dir-A nil) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
587 (read-string "Filter through regular expression: " |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
588 nil 'ediff-filtering-regexp-history) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
589 ))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
590 (ediff-directory-revisions-internal |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
591 dir1 regexp 'ediff-merge-revisions-with-ancestor |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
592 'ediff-merge-directory-revisions-with-ancestor |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
593 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
594 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
595 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
596 (defalias |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
597 'edir-merge-revisions-with-ancestor |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
598 'ediff-merge-directory-revisions-with-ancestor) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
599 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
600 ;;;###autoload |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
601 (defalias 'edirs-merge-with-ancestor 'ediff-merge-directories-with-ancestor) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
602 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
603 ;; Run ediff-action (ediff-files, ediff-merge, ediff-merge-with-ancestors) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
604 ;; on a pair of directories (three directories, in case of ancestor). |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
605 ;; The third argument, REGEXP, is a regular expression that can be used to |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
606 ;; filter out certain file names. |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
607 ;; JOBNAME is the symbol indicating the meta-job to be performed. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
608 (defun ediff-directories-internal (dir1 dir2 dir3 regexp |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
609 action jobname |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
610 &optional startup-hooks) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
611 ;; ediff-read-file-name is set to attach a previously entered file name if |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
612 ;; the currently entered file is a directory. This code takes care of that. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
613 (setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
614 dir2 (if (file-directory-p dir2) dir2 (file-name-directory dir2))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
615 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
616 (if (stringp dir3) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
617 (setq dir3 (if (file-directory-p dir3) dir3 (file-name-directory dir3)))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
618 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
619 (cond ((string= dir1 dir2) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
620 (error "Directories A and B are the same: %s" dir1)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
621 ((and (eq jobname 'ediff-directories3) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
622 (string= dir1 dir3)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
623 (error "Directories A and C are the same: %s" dir1)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
624 ((and (eq jobname 'ediff-directories3) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
625 (string= dir2 dir3)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
626 (error "Directories B and C are the same: %s" dir1))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
627 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
628 (let (diffs ; var where ediff-intersect-directories returns the diff list |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
629 file-list meta-buf) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
630 (setq file-list (ediff-intersect-directories |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
631 jobname 'diffs regexp dir1 dir2 dir3)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
632 (setq startup-hooks |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
633 ;; this sets various vars in the meta buffer inside |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
634 ;; ediff-prepare-meta-buffer |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
635 (cons (` (lambda () |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
636 ;; tell what to do if the user clicks on a session record |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
637 (setq ediff-session-action-function (quote (, action))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
638 ;; set ediff-dir-difference-list |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
639 (setq ediff-dir-difference-list (quote (, diffs))))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
640 startup-hooks)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
641 (setq meta-buf (ediff-prepare-meta-buffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
642 'ediff-filegroup-action |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
643 file-list |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
644 "*Ediff Session Group Panel" |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
645 'ediff-redraw-directory-group-buffer |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
646 jobname |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
647 startup-hooks)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
648 (ediff-show-meta-buffer meta-buf) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
649 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
650 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
651 (defun ediff-directory-revisions-internal (dir1 regexp action jobname |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
652 &optional startup-hooks) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
653 (setq dir1 (if (file-directory-p dir1) dir1 (file-name-directory dir1))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
654 (let (file-list meta-buf) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
655 (setq file-list |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
656 (ediff-get-directory-files-under-revision jobname regexp dir1)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
657 (setq startup-hooks |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
658 ;; this sets various vars in the meta buffer inside |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
659 ;; ediff-prepare-meta-buffer |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
660 (cons (` (lambda () |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
661 ;; tell what to do if the user clicks on a session record |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
662 (setq ediff-session-action-function (quote (, action))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
663 )) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
664 startup-hooks)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
665 (setq meta-buf (ediff-prepare-meta-buffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
666 'ediff-filegroup-action |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
667 file-list |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
668 "*Ediff Session Group Panel" |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
669 'ediff-redraw-directory-group-buffer |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
670 jobname |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
671 startup-hooks)) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
672 (ediff-show-meta-buffer meta-buf) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
673 )) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
674 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
675 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
676 ;;; Compare regions and windows |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
677 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
678 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
679 (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
|
680 "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
|
681 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
|
682 follows: |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
683 If WIND-A is nil, use selected window. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
684 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
|
685 (interactive "P") |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
686 (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
|
687 startup-hooks 'ediff-windows-wordwise 'word-mode)) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
688 |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
689 ;;;###autoload |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
690 (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
|
691 "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
|
692 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
|
693 follows: |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
694 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
|
695 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
|
696 (interactive "P") |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
697 (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
|
698 startup-hooks 'ediff-windows-linewise nil)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
699 |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
700 ;; 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
|
701 ;; 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
|
702 ;; works as follows: |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
703 ;; 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
|
704 ;; 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
|
705 (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
|
706 (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
|
707 (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
|
708 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
|
709 (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
|
710 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
|
711 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
712 (let ((buffer-A (window-buffer wind-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
713 (buffer-B (window-buffer wind-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
714 beg-A end-A beg-B end-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
715 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
716 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
717 (save-window-excursion |
14040 | 718 (sit-for 0) ; sync before using window-start/end -- a precaution |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
719 (select-window wind-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
720 (setq beg-A (window-start) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
721 end-A (window-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
722 (select-window wind-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
723 (setq beg-B (window-start) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
724 end-B (window-end)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
725 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
726 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
|
727 startup-hooks job-name word-mode))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
728 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
729 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
730 (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
|
731 "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
|
732 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
|
733 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
|
734 lines. For large regions, use `ediff-regions-linewise'." |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
735 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
736 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
737 (list (setq bf (read-buffer "Region's A buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
738 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
739 (read-buffer "Region's B buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
740 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
741 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
742 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
743 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
744 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
745 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
|
746 (if (not (ediff-buffer-live-p buffer-A)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
747 (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
|
748 (if (not (ediff-buffer-live-p buffer-B)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
749 (error "Buffer %S doesn't exist" buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
750 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
751 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
752 (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
|
753 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
754 (set-buffer buffer-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
755 (setq reg-A-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
756 reg-A-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
757 (set-buffer buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
758 (setq reg-B-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
759 reg-B-end (region-end))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
760 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
761 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
762 (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
|
763 (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
|
764 startup-hooks 'ediff-regions-wordwise 'word-mode))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
765 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
766 ;;;###autoload |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
767 (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
|
768 "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
|
769 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
|
770 Each region is enlarged to contain full lines. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
771 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
|
772 lines. For small regions, use `ediff-regions-wordwise'." |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
773 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
774 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
775 (list (setq bf (read-buffer "Region A's buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
776 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
777 (read-buffer "Region B's buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
778 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
779 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
780 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
781 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
782 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
783 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
784 (if (not (ediff-buffer-live-p buffer-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
785 (error "Buffer %S doesn't exist" buffer-A)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
786 (if (not (ediff-buffer-live-p buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
787 (error "Buffer %S doesn't exist" buffer-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
788 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
789 (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
|
790 (save-excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
791 (set-buffer buffer-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
792 (setq reg-A-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
793 reg-A-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
794 ;; enlarge the region to hold full lines |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
795 (goto-char reg-A-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
796 (beginning-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
797 (setq reg-A-beg (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
798 (goto-char reg-A-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
799 (end-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
800 (or (eobp) (forward-char)) ; include the newline char |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
801 (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
|
802 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
803 (set-buffer buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
804 (setq reg-B-beg (region-beginning) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
805 reg-B-end (region-end)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
806 ;; enlarge the region to hold full lines |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
807 (goto-char reg-A-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
808 (goto-char reg-B-beg) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
809 (beginning-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
810 (setq reg-B-beg (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
811 (goto-char reg-B-end) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
812 (end-of-line) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
813 (or (eobp) (forward-char)) ; include the newline char |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
814 (setq reg-B-end (point)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
815 ) ; save excursion |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
816 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
817 (ediff-regions-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
818 (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
|
819 (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
|
820 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
|
821 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
822 ;; 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
|
823 ;; to regions beg-B -- end-B in buffer-B. |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
824 (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
|
825 startup-hooks job-name word-mode) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
826 (let ((tmp-buffer (get-buffer-create ediff-tmp-buffer)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
827 overl-A overl-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
828 file-A file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
829 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
830 ;; 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
|
831 (ediff-eval-in-buffer buffer-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
832 (setq beg-A (move-marker (make-marker) beg-A) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
833 end-A (move-marker (make-marker) end-A))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
834 (ediff-eval-in-buffer buffer-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
835 (setq beg-B (move-marker (make-marker) beg-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
836 end-B (move-marker (make-marker) end-B))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
837 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
838 (if (and (eq buffer-A buffer-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
839 (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
|
840 (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
|
841 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
842 (with-output-to-temp-buffer ediff-msg-buffer |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
843 (princ " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
844 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
|
845 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
846 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
|
847 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
|
848 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
849 Continue anyway? (y/n) ")) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
850 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
851 (if (y-or-n-p "Continue anyway? ") |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
852 () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
853 (error "%S aborted" job-name)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
854 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
855 ;; make file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
856 (if word-mode |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
857 (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
|
858 (ediff-copy-to-buffer beg-A end-A buffer-A tmp-buffer)) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
859 (setq file-A (ediff-make-temp-file tmp-buffer "regA")) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
860 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
861 ;; make file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
862 (if word-mode |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
863 (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
|
864 (ediff-copy-to-buffer beg-B end-B buffer-B tmp-buffer)) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
865 (setq file-B (ediff-make-temp-file tmp-buffer "regB")) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
866 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
867 (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
|
868 (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
|
869 (ediff-setup buffer-A file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
870 buffer-B file-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
871 nil nil ; buffer & file C |
7267 | 872 (cons (` (lambda () |
7424 | 873 (delete-file (, file-A)) |
874 (delete-file (, file-B)))) | |
7267 | 875 startup-hooks) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
876 (list (cons 'ediff-word-mode word-mode) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
877 (cons 'ediff-narrow-bounds (list overl-A overl-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
878 (cons 'ediff-job-name job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
879 ) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
880 )) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
881 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
882 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
883 ;;; Merge files and buffers |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
884 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
885 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
886 (defalias 'ediff-merge 'ediff-merge-files) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
887 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
888 (defsubst ediff-merge-on-startup () |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
889 (ediff-do-merge 0) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
890 (ediff-eval-in-buffer ediff-buffer-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
891 (set-buffer-modified-p nil))) |
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 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
894 (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
|
895 "Merge two files without ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
896 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
897 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
898 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
899 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
900 dir-B f) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
901 (list (setq f (ediff-read-file-name |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
902 "File A to merge" dir-A |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
903 (ediff-get-default-file-name))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
904 (ediff-read-file-name "File B to merge" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
905 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
906 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
907 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
908 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
909 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
910 (setq file-name-history |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
911 (cons (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
912 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
913 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
914 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
915 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
916 f)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
917 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
918 (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
|
919 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
920 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
921 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
922 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
923 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
924 nil ; file-C |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
925 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
926 'ediff-merge-files)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
927 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
928 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
929 (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
|
930 &optional startup-hooks) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
931 "Merge two files with ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
932 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
933 (let ((dir-A (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
934 ediff-last-dir-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
935 default-directory)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
936 dir-B dir-ancestor f ff) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
937 (list (setq f (ediff-read-file-name |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
938 "File A to merge" dir-A |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
939 (ediff-get-default-file-name))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
940 (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
|
941 (setq dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
942 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
943 ediff-last-dir-B |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
944 (file-name-directory f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
945 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
946 (setq file-name-history |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
947 (cons |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
948 (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
949 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
950 (file-name-nondirectory f) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
951 dir-B)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
952 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
953 f))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
954 (ediff-read-file-name "Ancestor file" |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
955 (setq dir-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
956 (if ediff-use-last-dir |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
957 ediff-last-dir-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
958 (file-name-directory ff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
959 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
960 (setq file-name-history |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
961 (cons (ediff-abbreviate-file-name |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
962 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
963 (file-name-nondirectory ff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
964 dir-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
965 file-name-history)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
966 ff)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
967 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
968 (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
|
969 (ediff-files-internal file-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
970 (if (file-directory-p file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
971 (expand-file-name |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
972 (file-name-nondirectory file-A) file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
973 file-B) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
974 file-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
975 startup-hooks |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
976 'ediff-merge-files-with-ancestor)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
977 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
978 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
979 (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
|
980 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
981 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
982 (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
|
983 "Merge buffers without ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
984 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
985 (let (bf) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
986 (list (setq bf (read-buffer "Buffer A to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
987 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
988 (read-buffer "Buffer B to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
989 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
990 ;; realign buffers so that two visible bufs will be |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
991 ;; at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
992 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
993 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
994 t)))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
995 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
996 (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
|
997 (or job-name (setq job-name 'ediff-merge-buffers)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
998 (ediff-buffers-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
999 buffer-A buffer-B nil startup-hooks job-name)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1000 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1001 ;;;###autoload |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1002 (defun ediff-merge-buffers-with-ancestor (buffer-A |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1003 buffer-B buffer-ancestor |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1004 &optional startup-hooks job-name) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1005 "Merge buffers with ancestor." |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1006 (interactive |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1007 (let (bf bff) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1008 (list (setq bf (read-buffer "Buffer A to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1009 (ediff-other-buffer "") t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1010 (setq bff (read-buffer "Buffer B to merge: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1011 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1012 ;; realign buffers so that two visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1013 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1014 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1015 (ediff-other-buffer bf)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1016 t)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1017 (read-buffer "Ancestor buffer: " |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1018 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1019 ;; realign buffers so that three visible |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1020 ;; bufs will be at the top |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1021 (save-window-excursion (other-window 1)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1022 (ediff-other-buffer (list bf bff))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1023 t) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1024 ))) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1025 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1026 (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
|
1027 (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
|
1028 (ediff-buffers-internal |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1029 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
|
1030 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1031 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1032 ;;;###autoload |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1033 (defun ediff-merge-revisions (&optional file startup-hooks) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1034 "Run Ediff by merging two revisions of a file. |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1035 The file is the optional FILE argument or the file visited by the current |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1036 buffer." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1037 (interactive) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1038 (if (stringp file) (find-file file)) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1039 (let (rev1 rev2) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1040 (setq rev1 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1041 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1042 (format |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1043 "Version 1 to merge (default: %s's latest version): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1044 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1045 (file-name-nondirectory file) "current buffer"))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1046 rev2 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1047 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1048 (format |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1049 "Version 2 to merge (default: %s): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1050 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1051 (file-name-nondirectory file) "current buffer")))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1052 (ediff-load-version-control) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1053 ;; ancestor-revision=nil |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1054 (funcall |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1055 (intern (format "%S-ediff-merge-internal" ediff-version-control-package)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1056 rev1 rev2 nil startup-hooks))) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1057 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1058 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1059 ;;;###autoload |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1060 (defun ediff-merge-revisions-with-ancestor (&optional file startup-hooks) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1061 "Run Ediff by merging two revisions of a file with a common ancestor. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1062 The file is the the optional FILE argument or the file visited by the current |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1063 buffer." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1064 (interactive) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1065 (if (stringp file) (find-file file)) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1066 (let (rev1 rev2 ancestor-rev) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1067 (setq rev1 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1068 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1069 (format |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1070 "Version 1 to merge (default: %s's latest version): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1071 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1072 (file-name-nondirectory file) "current buffer"))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1073 rev2 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1074 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1075 (format |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1076 "Version 2 to merge (default: %s): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1077 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1078 (file-name-nondirectory file) "current buffer"))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1079 ancestor-rev |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1080 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1081 (format |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1082 "Ancestor version (default: %s): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1083 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1084 (file-name-nondirectory file) "current buffer")))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1085 (ediff-load-version-control) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1086 (funcall |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1087 (intern (format "%S-ediff-merge-internal" ediff-version-control-package)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1088 rev1 rev2 ancestor-rev startup-hooks))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1089 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1090 ;;;###autoload |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1091 (defun run-ediff-from-cvs-buffer (pos) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1092 "Run Ediff-merge on appropriate revisions of the selected file. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1093 First run after `M-x cvs-update'. Then place the cursor on a lide describing a |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1094 file and then run `run-ediff-from-cvs-buffer'." |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1095 (interactive "d") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1096 (ediff-load-version-control) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1097 (let ((tin (tin-locate cvs-cookie-handle pos))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1098 (if tin |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1099 (cvs-run-ediff-on-file-descriptor tin) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1100 (error "There is no file to merge")))) |
11041
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 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1103 ;;; Apply patch |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1104 |
7709
d88d94461e5d
(ediff-patch-buffer): Fix autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents:
7639
diff
changeset
|
1105 ;;;###autoload |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1106 (defun ediff-patch-file () |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1107 "Run Ediff by patching SOURCE-FILENAME." |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1108 ;; This now returns the control buffer |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1109 (interactive) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1110 (let (source-dir source-file patch-buf) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1111 (require 'ediff-ptch) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1112 (setq patch-buf (ediff-get-patch-buffer)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1113 (setq source-dir (cond (ediff-use-last-dir ediff-last-dir-patch) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1114 ((and (not ediff-patch-default-directory) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1115 (buffer-file-name patch-buf)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1116 (file-name-directory |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1117 (expand-file-name |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1118 (buffer-file-name patch-buf)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1119 (t default-directory))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1120 (setq source-file |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1121 ;; the default is the directory, not the visited file name |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1122 (ediff-read-file-name "Which file to patch? " source-dir source-dir)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1123 (ediff-dispatch-file-patching-job patch-buf source-file))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1124 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1125 ;;;###autoload |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1126 (defun ediff-patch-buffer () |
7267 | 1127 "Run Ediff by patching BUFFER-NAME." |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1128 (interactive) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1129 (let (patch-buf) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1130 (require 'ediff-ptch) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1131 (setq patch-buf (ediff-get-patch-buffer)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1132 (ediff-patch-buffer-internal |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1133 patch-buf |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1134 (read-buffer "Which buffer to patch? " |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1135 (cond ((eq patch-buf (current-buffer)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1136 (window-buffer (other-window 1))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1137 (t (current-buffer))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1138 'must-match)))) |
7267 | 1139 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1140 ;;;###autoload |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1141 (defalias 'epatch 'ediff-patch-file) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1142 ;;;###autoload |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1143 (defalias 'epatch-buffer 'ediff-patch-buffer) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1144 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1145 |
7267 | 1146 |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1147 |
7267 | 1148 ;;; Versions Control functions |
1149 | |
1150 ;;;###autoload | |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1151 (defun ediff-revision (&optional file startup-hooks) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1152 "Run Ediff by comparing versions of a file. |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1153 The file is an optional FILE argument or the file visited by the current |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1154 buffer. Use `vc.el' or `rcs.el' depending on `ediff-version-control-package'." |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1155 ;; if buffer is non-nil, use that buffer instead of the current buffer |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1156 (interactive "P") |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1157 (if (stringp file) (find-file file)) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1158 (let (rev1 rev2) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1159 (setq rev1 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1160 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1161 (format "Version 1 to compare (default: %s's latest version): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1162 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1163 (file-name-nondirectory file) "current buffer"))) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1164 rev2 |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1165 (read-string |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1166 (format "Version 2 to compare (default: %s): " |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1167 (if (stringp file) |
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1168 (file-name-nondirectory file) "current buffer")))) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1169 (ediff-load-version-control) |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1170 (funcall |
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1171 (intern (format "%S-ediff-internal" ediff-version-control-package)) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1172 rev1 rev2 startup-hooks) |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1173 )) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1174 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1175 |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1176 ;; 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
|
1177 ;; 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
|
1178 (defun ediff-load-version-control (&optional silent) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1179 (require 'ediff-vers) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1180 (or (featurep ediff-version-control-package) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1181 (if (locate-library (symbol-name ediff-version-control-package)) |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1182 (progn |
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1183 (message "") ; kill the message from `locate-library' |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1184 (require ediff-version-control-package)) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1185 (or silent |
12083
2bfc61a5fbe7
don't make the patch buffer RO.
Karl Heuer <kwzh@gnu.org>
parents:
11760
diff
changeset
|
1186 (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
|
1187 ediff-version-control-package))))) |
13133
0e069b2940ae
(ediff-files,ediff-merge-files): better file-name defaults.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12880
diff
changeset
|
1188 |
7267 | 1189 |
13217
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1190 ;;;###autoload |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1191 (defun ediff-version () |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1192 "Return string describing the version of Ediff. |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1193 When called interactively, displays the version." |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1194 (interactive) |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1195 (if (interactive-p) |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1196 (message (ediff-version)) |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1197 (format "Ediff %s of %s" ediff-version ediff-date))) |
c3f879af05db
(ediff-version): is now autoloaded.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13133
diff
changeset
|
1198 |
7267 | 1199 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1200 ;;;###autoload |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1201 (defun ediff-documentation () |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1202 "Display Ediff's manual." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1203 (interactive) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1204 (let ((ctl-window ediff-control-window) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1205 (ctl-buf ediff-control-buffer)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1206 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1207 (ediff-skip-unsuitable-frames) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1208 (condition-case nil |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1209 (progn |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1210 (pop-to-buffer (get-buffer-create "*info*")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1211 (info (if ediff-xemacs-p "ediff.info" "ediff")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1212 (message "Type `i' to search for a specific topic")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1213 (error (beep 1) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1214 (with-output-to-temp-buffer ediff-msg-buffer |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1215 (princ (format " |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1216 The Info file for Ediff does not seem to be installed. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1217 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1218 This file is part of the distribution of %sEmacs. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1219 Please contact your system administrator. " |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1220 (if ediff-xemacs-p "X" "")))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1221 (if (window-live-p ctl-window) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1222 (progn |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1223 (select-window ctl-window) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1224 (set-window-buffer ctl-window ctl-buf))))))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1225 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1226 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1227 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1228 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1229 ;;; Local Variables: |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1230 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1231 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1232 ;;; End: |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1233 |
7267 | 1234 (provide 'ediff) |
11041
17b319a26eea
Installed new version from author.
Karl Heuer <kwzh@gnu.org>
parents:
8874
diff
changeset
|
1235 (require 'ediff-util) |
7267 | 1236 |
1237 ;;; ediff.el ends here |