Mercurial > emacs
annotate lisp/ediff-mult.el @ 31933:ebf9d20c93c0
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 27 Sep 2000 11:46:33 +0000 |
parents | 641e43bad886 |
children | 6306740f6938 |
rev | line source |
---|---|
13607
71a4a349d998
Renamed from ediff-meta.el. Changed provide.
Richard M. Stallman <rms@gnu.org>
parents:
13216
diff
changeset
|
1 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff |
14169 | 2 |
18054 | 3 ;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. |
13130 | 4 |
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu> | |
6 | |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
11 ;; the Free Software Foundation; either version 2, or (at your option) | |
12 ;; any later version. | |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
14169 | 20 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
13130 | 23 |
14169 | 24 ;;; Commentary: |
25 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
26 ;; Users are encouraged to add functionality to this file. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
27 ;; The present file contains all the infrastructure needed for that. |
13130 | 28 ;; |
29 ;; Generally, to to implement a new multisession capability within Ediff, | |
30 ;; you need to tell it | |
31 ;; | |
32 ;; 1. How to display the session group buffer. | |
33 ;; This function must indicate which Ediff sessions are active (+) and | |
34 ;; which are finished (-). | |
35 ;; See ediff-redraw-directory-group-buffer for an example. | |
36 ;; In all likelihood, ediff-redraw-directory-group-buffer can be used | |
37 ;; directly or after a small modification. | |
38 ;; 2. What action to take when the user clicks button 2 or types v,e, or | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
39 ;; RET. See ediff-filegroup-action. |
13130 | 40 ;; 3. Provide a list of pairs or triples of file names (or buffers, |
41 ;; depending on the particular Ediff operation you want to invoke) | |
42 ;; in the following format: | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
43 ;; (descriptor (obj1 obj2 obj3) (...) ...) |
13130 | 44 ;; Actually, the format of this list is pretty much up to the |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
45 ;; developer. The only thing is that it must be a list of lists, |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
46 ;; and the first list must describe the meta session, and subsequent |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
47 ;; elements must describe individual sessions. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
48 ;; This descriptor must be a list of two, three, or four elements (nil |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
49 ;; or string). The function ediff-redraw-registry-buffer displays the |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
50 ;; second through last of these in the registry buffer. |
13130 | 51 ;; Also, keep in mind that the function ediff-prepare-meta-buffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
52 ;; (which see) prepends the session group buffer to the descriptor and |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
53 ;; nil in front of each subsequent list (i.e., the above list |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
54 ;; will become |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
55 ;; ((meta-buf descriptor) (nil obj1 obj2 obj3) (nil ...) ...) |
13130 | 56 ;; Ediff expects that your function (in 2 above) will arrange to |
57 ;; replace this prepended nil (via setcar) with the actual ediff | |
58 ;; control buffer associated with an appropriate Ediff session. | |
59 ;; This is arranged through internal startup hooks that can be passed | |
60 ;; to any of Ediff major entries (such as ediff-files, epatch, etc.). | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
61 ;; See how this is done in ediff-filegroup-action. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
62 ;; |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
63 ;; Session descriptions are of the form (obj1 obj2 obj3), which |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
64 ;; describe objects relevant to the session. Usually they are names of |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
65 ;; files, but sometimes they may be other things. For instance, obj3 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
66 ;; is nil for jobs that involve only two files. For patch jobs, obj2 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
67 ;; and obj3 are markers that specify the patch corresponding to the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
68 ;; file (whose name is obj1). |
13130 | 69 ;; 4. Write a function that makes a call to ediff-prepare-meta-buffer |
70 ;; passing all this info. | |
71 ;; You may be able to use ediff-directories-internal as a template. | |
72 ;; 5. If you intend to add several related pieces of functionality, | |
73 ;; you may want to keep the function in 4 as an internal version | |
74 ;; and then write several top-level interactive functions that call it | |
75 ;; with different parameters. | |
76 ;; See how ediff-directories, ediff-merge-directories, and | |
77 ;; ediff-merge-directories-with-ancestor all use | |
78 ;; ediff-directories-internal. | |
79 ;; | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
80 ;; A useful addition here could be session groups selected by patterns |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
81 ;; (which are different in each directory). For instance, one may want to |
13130 | 82 ;; compare files of the form abc{something}.c to files old{something}.d |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
83 ;; which may be in the same or different directories. Or, one may want to |
13130 | 84 ;; compare all files of the form {something} to files of the form {something}~. |
85 ;; | |
13216
b9dc8cc658d5
Moved defsubsts up.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
13130
diff
changeset
|
86 ;; Implementing this requires writing an collating function, which should pair |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
87 ;; up appropriate files. It will also require a generalization of the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
88 ;; functions that do the layout of the meta- and differences buffers and of |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
89 ;; ediff-filegroup-action. |
13130 | 90 |
14169 | 91 ;;; Code: |
92 | |
18054 | 93 (provide 'ediff-mult) |
94 | |
95 (defgroup ediff-mult nil | |
19241 | 96 "Multi-file and multi-buffer processing in Ediff" |
18054 | 97 :prefix "ediff-" |
98 :group 'ediff) | |
99 | |
100 | |
101 ;; compiler pacifier | |
102 (eval-when-compile | |
103 (let ((load-path (cons (expand-file-name ".") load-path))) | |
104 (or (featurep 'ediff-init) | |
105 (load "ediff-init.el" nil nil 'nosuffix)) | |
106 (or (featurep 'ediff-util) | |
107 (load "ediff-util.el" nil nil 'nosuffix)) | |
108 )) | |
109 ;; end pacifier | |
110 | |
13130 | 111 (require 'ediff-init) |
18054 | 112 (require 'ediff-util) |
13130 | 113 |
114 ;; meta-buffer | |
115 (ediff-defvar-local ediff-meta-buffer nil "") | |
116 (ediff-defvar-local ediff-parent-meta-buffer nil "") | |
117 ;; the registry buffer | |
118 (defvar ediff-registry-buffer nil) | |
119 | |
120 (defconst ediff-meta-buffer-message "This is an Ediff Session Group Panel: %s | |
121 | |
122 Useful commands: | |
20206 | 123 button2, v, or RET over session record: start that Ediff session |
124 M:\tin sessions invoked from here, brings back this group panel | |
125 R:\tdisplay the registry of active Ediff sessions | |
126 h:\tmark session for hiding (toggle) | |
127 x:\thide marked sessions; with prefix arg: unhide | |
128 m:\tmark session for a non-hiding operation (toggle) | |
22286 | 129 uh/um:\tunmark all sessions marked for hiding/operation |
20206 | 130 n,SPC:\tnext session |
131 p,DEL:\tprevious session | |
132 E:\tbrowse Ediff on-line manual | |
133 T:\ttoggle truncation of long file names | |
134 q:\tquit this session group | |
13130 | 135 ") |
136 | |
137 (ediff-defvar-local ediff-meta-buffer-map nil | |
138 "The keymap for the meta buffer.") | |
139 (defvar ediff-dir-diffs-buffer-map (make-sparse-keymap) | |
140 "The keymap to be installed in the buffer showing differences between | |
141 directories.") | |
142 | |
143 ;; Variable specifying the action to take when the use invokes ediff in the | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
144 ;; meta buffer. This is usually ediff-registry-action or ediff-filegroup-action |
13130 | 145 (ediff-defvar-local ediff-meta-action-function nil "") |
146 ;; Tells ediff-update-meta-buffer how to redraw it | |
147 (ediff-defvar-local ediff-meta-redraw-function nil "") | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
148 ;; Tells ediff-filegroup-action and similar procedures how to invoke Ediff for |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
149 ;; the sessions in a given session group |
13130 | 150 (ediff-defvar-local ediff-session-action-function nil "") |
151 | |
152 (ediff-defvar-local ediff-metajob-name nil "") | |
153 | |
154 ;; buffer used to collect custom diffs from individual sessions in the group | |
155 (ediff-defvar-local ediff-meta-diff-buffer nil "") | |
156 | |
157 ;; history var to use for filtering groups | |
158 (defvar ediff-filtering-regexp-history nil "") | |
159 | |
19774 | 160 ;; This has the form ((meta-buf regexp dir1 dir2 dir3 merge-auto-store-dir) |
161 ;; (ctl-buf session-status (file1 . eq-status) (file2 . eq-status) (file3 | |
162 ;; . eq-status)) (ctl-buf session-status (file1 . eq-status) (file2 | |
163 ;; . eq-status)) ...) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
164 ;; If ctl-buf is nil, the file-pair hasn't processed yet. If it is |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
165 ;; killed-buffer object, the file pair has been processed. If it is a live |
19774 | 166 ;; buffer, this means ediff is still working on the pair. |
167 ;; Eq-status of a file is t if the file equals some other file in the same | |
168 ;; group. | |
13130 | 169 (ediff-defvar-local ediff-meta-list nil "") |
170 | |
20206 | 171 (ediff-defvar-local ediff-meta-session-number nil "") |
172 | |
13130 | 173 |
174 ;; the difference list between directories in a directory session group | |
175 (ediff-defvar-local ediff-dir-difference-list nil "") | |
176 (ediff-defvar-local ediff-dir-diffs-buffer nil "") | |
177 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
178 ;; The registry of Ediff sessions. A list of control buffers. |
13130 | 179 (defvar ediff-session-registry nil) |
180 | |
20206 | 181 (defcustom ediff-meta-truncate-filenames t |
182 "*If non-nil, truncate long file names in the session group buffers. | |
183 This can be toggled with `ediff-toggle-filename-truncation'." | |
184 :type 'hook | |
185 :group 'ediff-mult) | |
18054 | 186 (defcustom ediff-registry-setup-hook nil |
187 "*Hooks run just after the registry control panel is set up." | |
188 :type 'hook | |
189 :group 'ediff-mult) | |
190 (defcustom ediff-session-group-setup-hook nil | |
13130 | 191 "*Hooks run just after a meta-buffer controlling a session group, such as |
18054 | 192 ediff-directories, is run." |
193 :type 'hook | |
194 :group 'ediff-mult) | |
195 (defcustom ediff-quit-session-group-hook nil | |
196 "*Hooks run just before exiting a session group." | |
197 :type 'hook | |
198 :group 'ediff-mult) | |
199 (defcustom ediff-show-registry-hook nil | |
200 "*Hooks run just after the registry buffer is shown." | |
201 :type 'hook | |
202 :group 'ediff-mult) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
203 (defcustom ediff-show-session-group-hook '(delete-other-windows) |
18054 | 204 "*Hooks run just after a session group buffer is shown." |
205 :type 'hook | |
206 :group 'ediff-mult) | |
207 (defcustom ediff-meta-buffer-keymap-setup-hook nil | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
208 "*Hooks run just after setting up the ediff-meta-buffer-map. |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
209 This keymap controls key bindings in the meta buffer and is a local variable. |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
210 This means that you can set different bindings for different kinds of meta |
18054 | 211 buffers." |
212 :type 'hook | |
213 :group 'ediff-mult) | |
13130 | 214 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
215 ;; Buffer holding the multi-file patch. Local to the meta buffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
216 (ediff-defvar-local ediff-meta-patchbufer nil "") |
13130 | 217 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
218 ;;; API for ediff-meta-list |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
219 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
220 ;; group buffer/regexp |
19774 | 221 (defsubst ediff-get-group-buffer (meta-list) |
13130 | 222 (nth 0 (car meta-list))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
223 |
19774 | 224 (defsubst ediff-get-group-regexp (meta-list) |
13130 | 225 (nth 1 (car meta-list))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
226 ;; group objects |
19774 | 227 (defsubst ediff-get-group-objA (meta-list) |
13130 | 228 (nth 2 (car meta-list))) |
19774 | 229 (defsubst ediff-get-group-objB (meta-list) |
13130 | 230 (nth 3 (car meta-list))) |
19774 | 231 (defsubst ediff-get-group-objC (meta-list) |
13130 | 232 (nth 4 (car meta-list))) |
19774 | 233 (defsubst ediff-get-group-merge-autostore-dir (meta-list) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
234 (nth 5 (car meta-list))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
235 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
236 ;; session buffer |
19774 | 237 (defsubst ediff-get-session-buffer (elt) |
13130 | 238 (nth 0 elt)) |
19774 | 239 (defsubst ediff-get-session-status (elt) |
13130 | 240 (nth 1 elt)) |
19774 | 241 (defsubst ediff-set-session-status (session-info new-status) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
242 (setcar (cdr session-info) new-status)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
243 ;; session objects |
19774 | 244 (defsubst ediff-get-session-objA (elt) |
13130 | 245 (nth 2 elt)) |
19774 | 246 (defsubst ediff-get-session-objB (elt) |
13130 | 247 (nth 3 elt)) |
19774 | 248 (defsubst ediff-get-session-objC (elt) |
13130 | 249 (nth 4 elt)) |
19774 | 250 (defsubst ediff-get-session-objA-name (elt) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
251 (car (nth 2 elt))) |
19774 | 252 (defsubst ediff-get-session-objB-name (elt) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
253 (car (nth 3 elt))) |
19774 | 254 (defsubst ediff-get-session-objC-name (elt) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
255 (car (nth 4 elt))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
256 ;; equality indicators |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
257 (defsubst ediff-get-file-eqstatus (elt) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
258 (nth 1 elt)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
259 (defsubst ediff-set-file-eqstatus (elt value) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
260 (setcar (cdr elt) value)) |
13130 | 261 |
20206 | 262 ;; The activity marker is either or + (active session, i.e., ediff is currently |
263 ;; run in it), or - (finished session, i.e., we've ran ediff in it and then | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
264 ;; exited). Return nil, if session is neither active nor finished |
20206 | 265 (defun ediff-get-session-activity-marker (session) |
266 (let ((session-buf (ediff-get-session-buffer session))) | |
267 (cond ((null session-buf) nil) ; virgin session | |
268 ((ediff-buffer-live-p session-buf) ?+) ;active session | |
269 (t ?-)))) | |
270 | |
19774 | 271 ;; checks if the session is a meta session |
272 (defun ediff-meta-session-p (session-info) | |
273 (and (stringp (ediff-get-session-objA-name session-info)) | |
274 (file-directory-p (ediff-get-session-objA-name session-info)) | |
275 (stringp (ediff-get-session-objB-name session-info)) | |
276 (file-directory-p (ediff-get-session-objB-name session-info)) | |
277 (if (stringp (ediff-get-session-objC-name session-info)) | |
278 (file-directory-p (ediff-get-session-objC-name session-info)) t))) | |
279 | |
13130 | 280 ;; set up the keymap in the meta buffer |
281 (defun ediff-setup-meta-map() | |
282 (setq ediff-meta-buffer-map (make-sparse-keymap)) | |
283 (suppress-keymap ediff-meta-buffer-map) | |
284 (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer) | |
20206 | 285 (define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation) |
13130 | 286 (define-key ediff-meta-buffer-map "R" 'ediff-show-registry) |
287 (define-key ediff-meta-buffer-map "E" 'ediff-documentation) | |
288 (define-key ediff-meta-buffer-map "v" ediff-meta-action-function) | |
289 (define-key ediff-meta-buffer-map "\C-m" ediff-meta-action-function) | |
290 (define-key ediff-meta-buffer-map " " 'ediff-next-meta-item) | |
20206 | 291 (define-key ediff-meta-buffer-map "n" 'ediff-next-meta-item) |
13130 | 292 (define-key ediff-meta-buffer-map "\C-?" 'ediff-previous-meta-item) |
20206 | 293 (define-key ediff-meta-buffer-map "p" 'ediff-previous-meta-item) |
13130 | 294 (define-key ediff-meta-buffer-map [delete] 'ediff-previous-meta-item) |
295 (define-key ediff-meta-buffer-map [backspace] 'ediff-previous-meta-item) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
296 (or (ediff-one-filegroup-metajob) |
22286 | 297 (progn |
298 (define-key ediff-meta-buffer-map "=" nil) | |
299 (define-key ediff-meta-buffer-map "==" 'ediff-meta-mark-equal-files) | |
300 (define-key ediff-meta-buffer-map "=m" 'ediff-meta-mark-equal-files) | |
301 (define-key ediff-meta-buffer-map "=h" 'ediff-meta-mark-equal-files))) | |
13130 | 302 (if ediff-no-emacs-help-in-control-buffer |
303 (define-key ediff-meta-buffer-map "\C-h" 'ediff-previous-meta-item)) | |
304 (if ediff-emacs-p | |
305 (define-key ediff-meta-buffer-map [mouse-2] ediff-meta-action-function) | |
306 (define-key ediff-meta-buffer-map [button2] ediff-meta-action-function)) | |
307 | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
308 (use-local-map ediff-meta-buffer-map) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
309 ;; modify ediff-meta-buffer-map here |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
310 (run-hooks 'ediff-meta-buffer-keymap-setup-hook)) |
13130 | 311 |
312 (defun ediff-meta-mode () | |
313 "This mode controls all operations on Ediff session groups. | |
314 It is entered through one of the following commands: | |
315 `ediff-directories' | |
316 `edirs' | |
317 `ediff-directories3' | |
318 `edirs3' | |
319 `ediff-merge-directories' | |
320 `edirs-merge' | |
321 `ediff-merge-directories-with-ancestor' | |
322 `edirs-merge-with-ancestor' | |
323 `ediff-directory-revisions' | |
324 `edir-revisions' | |
325 `ediff-merge-directory-revisions' | |
326 `edir-merge-revisions' | |
327 `ediff-merge-directory-revisions-with-ancestor' | |
328 `edir-merge-revisions-with-ancestor' | |
329 | |
330 Commands: | |
331 \\{ediff-meta-buffer-map}" | |
332 (kill-all-local-variables) | |
333 (setq major-mode 'ediff-meta-mode) | |
334 (setq mode-name "MetaEdiff")) | |
335 | |
336 | |
337 ;; the keymap for the buffer showing directory differences | |
338 (suppress-keymap ediff-dir-diffs-buffer-map) | |
339 (define-key ediff-dir-diffs-buffer-map "q" 'ediff-bury-dir-diffs-buffer) | |
340 (define-key ediff-dir-diffs-buffer-map " " 'next-line) | |
20206 | 341 (define-key ediff-dir-diffs-buffer-map "n" 'next-line) |
13130 | 342 (define-key ediff-dir-diffs-buffer-map "\C-?" 'previous-line) |
20206 | 343 (define-key ediff-dir-diffs-buffer-map "p" 'previous-line) |
13130 | 344 (define-key ediff-dir-diffs-buffer-map [delete] 'previous-line) |
345 (define-key ediff-dir-diffs-buffer-map [backspace] 'previous-line) | |
346 | |
347 (defun ediff-next-meta-item (count) | |
348 "Move to the next item in Ediff registry or session group buffer. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
349 Moves in circular fashion. With numeric prefix arg, skip this many items." |
13130 | 350 (interactive "p") |
351 (or count (setq count 1)) | |
20206 | 352 (let (overl) |
353 (while (< 0 count) | |
354 (setq count (1- count)) | |
355 (ediff-next-meta-item1) | |
356 (setq overl (ediff-get-meta-overlay-at-pos (point))) | |
357 ;; skip invisible ones | |
358 (while (and overl (ediff-overlay-get overl 'invisible)) | |
359 (ediff-next-meta-item1) | |
360 (setq overl (ediff-get-meta-overlay-at-pos (point))))))) | |
13130 | 361 |
362 ;; Move to the next meta item | |
363 (defun ediff-next-meta-item1 () | |
364 (let (pos) | |
365 (setq pos (ediff-next-meta-overlay-start (point))) | |
366 (if pos (goto-char pos)) | |
367 (if (eq ediff-metajob-name 'ediff-registry) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
368 (if (and (ediff-get-meta-info (current-buffer) pos 'noerror) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
369 (search-forward "*Ediff" nil t)) |
13130 | 370 (skip-chars-backward "a-zA-Z*")) |
371 (if (> (skip-chars-forward "-+?H* \t0-9") 0) | |
372 (backward-char 1))))) | |
373 | |
374 | |
375 (defun ediff-previous-meta-item (count) | |
376 "Move to the previous item in Ediff registry or session group buffer. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
377 Moves in circular fashion. With numeric prefix arg, skip this many items." |
13130 | 378 (interactive "p") |
379 (or count (setq count 1)) | |
20206 | 380 (let (overl) |
381 (while (< 0 count) | |
382 (setq count (1- count)) | |
383 (ediff-previous-meta-item1) | |
384 (setq overl (ediff-get-meta-overlay-at-pos (point))) | |
385 ;; skip invisible ones | |
386 (while (and overl (ediff-overlay-get overl 'invisible)) | |
387 (ediff-previous-meta-item1) | |
388 (setq overl (ediff-get-meta-overlay-at-pos (point))))))) | |
13130 | 389 |
390 (defun ediff-previous-meta-item1 () | |
391 (let (pos) | |
392 (setq pos (ediff-previous-meta-overlay-start (point))) | |
393 ;;; ;; skip deleted | |
394 ;;; (while (ediff-get-session-status | |
395 ;;; (ediff-get-meta-info (current-buffer) pos 'noerror)) | |
396 ;;; (setq pos (ediff-previous-meta-overlay-start pos))) | |
397 | |
398 (if pos (goto-char pos)) | |
399 (if (eq ediff-metajob-name 'ediff-registry) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
400 (if (and (ediff-get-meta-info (current-buffer) pos 'noerror) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
401 (search-forward "*Ediff" nil t)) |
13130 | 402 (skip-chars-backward "a-zA-Z*")) |
403 (if (> (skip-chars-forward "-+?H* \t0-9") 0) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
404 (backward-char 1))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
405 )) |
13130 | 406 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
407 (defsubst ediff-add-slash-if-directory (dir file) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
408 (if (file-directory-p (concat dir file)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
409 (file-name-as-directory file) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
410 file)) |
13130 | 411 |
20206 | 412 (defun ediff-toggle-filename-truncation () |
413 "Toggle truncation of long file names in session group buffers. | |
414 Set `ediff-meta-truncate-filenames' variable if you want to change the default | |
415 behavior." | |
416 (interactive) | |
417 (setq ediff-meta-truncate-filenames (not ediff-meta-truncate-filenames)) | |
418 (ediff-update-meta-buffer (current-buffer) 'must-redraw)) | |
419 | |
13130 | 420 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
421 ;; DIR1, DIR2, DIR3 are directories. DIR3 can be nil. |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
422 ;; OUTPUT-DIR is a directory for auto-storing the results of merge jobs. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
423 ;; Can be nil. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
424 ;; REGEXP is a regexp used to filter out files in the directories. |
13130 | 425 ;; If a file is a directory in dir1 but not dir2 (or vice versa), it is not |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
426 ;; included in the intersection. However, a regular file that is a dir in dir3 |
13130 | 427 ;; is included, since dir3 files are supposed to be ancestors for merging. |
428 ;; Returns a list of the form: | |
429 ;; ((dir1 dir2 dir3) (f1 f2 f3) (f1 f2 f3) ...) | |
430 ;; dir3, f3 can be nil if intersecting only 2 directories. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
431 ;; If COMPARISON-FUNC is given, use it. Otherwise, use string= |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
432 ;; DIFF-VAR contains the name of the variable in which to return the |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
433 ;; difference list (which represents the differences among the contents of |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
434 ;; directories). The diff list is of the form: |
13130 | 435 ;; ((dir1 dir2 dir3) (file . num) (file . num)...) |
436 ;; where num encodes the set of dirs where the file is found: | |
437 ;; 2 - only dir1; 3 - only dir2; 5 - only dir3; 6 - dir1&2; 10 - dir1&3; etc. | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
438 (defun ediff-intersect-directories (jobname |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
439 diff-var regexp dir1 dir2 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
440 &optional |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
441 dir3 merge-autostore-dir comparison-func) |
13130 | 442 (setq comparison-func (or comparison-func 'string=)) |
443 (let (lis1 lis2 lis3 common auxdir1 auxdir2 auxdir3 difflist) | |
444 | |
445 (setq auxdir1 (file-name-as-directory dir1) | |
446 lis1 (directory-files auxdir1 nil regexp) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
447 lis1 (delete "." lis1) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
448 lis1 (delete ".." lis1) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
449 lis1 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
450 (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
451 (ediff-add-slash-if-directory auxdir1 elt)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
452 lis1) |
13130 | 453 auxdir2 (file-name-as-directory dir2) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
454 lis2 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
455 (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
456 (ediff-add-slash-if-directory auxdir2 elt)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
457 (directory-files auxdir2 nil regexp))) |
13130 | 458 |
459 (if (stringp dir3) | |
460 (setq auxdir3 (file-name-as-directory dir3) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
461 lis3 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
462 (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
463 (ediff-add-slash-if-directory auxdir3 elt)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
464 (directory-files auxdir3 nil regexp)))) |
13130 | 465 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
466 (if (ediff-nonempty-string-p merge-autostore-dir) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
467 (setq merge-autostore-dir |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
468 (file-name-as-directory merge-autostore-dir))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
469 (setq common (ediff-intersection lis1 lis2 comparison-func)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
470 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
471 ;; In merge with ancestor jobs, we don't intersect with lis3. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
472 ;; If there is no ancestor, we'll offer to merge without the ancestor. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
473 ;; So, we intersect with lis3 only when we are doing 3-way file comparison |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
474 (if (and lis3 (ediff-comparison-metajob3 jobname)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
475 (setq common (ediff-intersection common lis3 comparison-func))) |
13130 | 476 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
477 ;; copying is needed because sort sorts via side effects |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
478 (setq common (sort (ediff-copy-list common) 'string-lessp)) |
13130 | 479 |
480 ;; compute difference list | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
481 (setq difflist (ediff-set-difference |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
482 (ediff-union (ediff-union lis1 lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
483 lis3 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
484 comparison-func) |
13130 | 485 common |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
486 comparison-func) |
13130 | 487 difflist (delete "." difflist) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
488 ;; copying is needed because sort sorts via side effects |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
489 difflist (sort (ediff-copy-list (delete ".." difflist)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
490 'string-lessp)) |
13130 | 491 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
492 (setq difflist (mapcar (lambda (elt) (cons elt 1)) difflist)) |
13130 | 493 |
494 ;; check for files belonging to lis1/2/3 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
495 (mapcar (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
496 (if (member (car elt) lis1) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
497 (setcdr elt (* (cdr elt) 2))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
498 (if (member (car elt) lis2) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
499 (setcdr elt (* (cdr elt) 3))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
500 (if (member (car elt) lis3) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
501 (setcdr elt (* (cdr elt) 5))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
502 ) |
13130 | 503 difflist) |
504 (setq difflist (cons (list regexp auxdir1 auxdir2 auxdir3) difflist)) | |
505 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
506 ;; return the difference list back to the calling function |
13130 | 507 (set diff-var difflist) |
508 | |
509 ;; return result | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
510 (cons (list regexp auxdir1 auxdir2 auxdir3 merge-autostore-dir) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
511 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
512 (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
513 (list (concat auxdir1 elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
514 (concat auxdir2 elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
515 (if lis3 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
516 (progn |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
517 ;; The following is done because: |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
518 ;; In merging with ancestor, we don't intersect |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
519 ;; with lis3. So, it is possible that elt is a |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
520 ;; file in auxdir1/2 but a directory in auxdir3 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
521 ;; Or elt may not exist in auxdir3 at all. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
522 ;; In the first case, we add a slash at the end. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
523 ;; In the second case, we insert nil. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
524 (setq elt (ediff-add-slash-if-directory auxdir3 elt)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
525 (if (file-exists-p (concat auxdir3 elt)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
526 (concat auxdir3 elt)))))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
527 common)) |
13130 | 528 )) |
529 | |
20206 | 530 ;; find directory files that are under revision. Include subdirectories, since |
531 ;; we may visit them recursively. DIR1 is the directory to inspect. | |
532 ;; MERGE-AUTOSTORE-DIR is the directory where to auto-store the results of | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
533 ;; merges. Can be nil. |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
534 (defun ediff-get-directory-files-under-revision (jobname |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
535 regexp dir1 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
536 &optional merge-autostore-dir) |
13130 | 537 (let (lis1 elt common auxdir1) |
538 (setq auxdir1 (file-name-as-directory dir1) | |
539 lis1 (directory-files auxdir1 nil regexp)) | |
540 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
541 (if (ediff-nonempty-string-p merge-autostore-dir) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
542 (setq merge-autostore-dir |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
543 (file-name-as-directory merge-autostore-dir))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
544 |
13130 | 545 (while lis1 |
546 (setq elt (car lis1) | |
547 lis1 (cdr lis1)) | |
548 ;; take files under revision control | |
549 (cond ((file-directory-p (concat auxdir1 elt)) | |
20206 | 550 (setq common |
551 (cons (ediff-add-slash-if-directory auxdir1 elt) common))) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
552 ((and (featurep 'vc-hooks) (vc-backend (concat auxdir1 elt))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
553 (setq common (cons elt common))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
554 ;; The following two are needed only if vc-hooks isn't loaded. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
555 ;; They won't recognize CVS files. |
13130 | 556 ((file-exists-p (concat auxdir1 elt ",v")) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
557 (setq common (cons elt common))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
558 ((file-exists-p (concat auxdir1 "RCS/" elt ",v")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
559 (setq common (cons elt common))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
560 ) ; cond |
13130 | 561 ) ; while |
562 | |
20206 | 563 (setq common (delete "./" common) |
564 common (delete "../" common) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
565 common (delete "RCS" common) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
566 common (delete "CVS" common) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
567 ) |
13130 | 568 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
569 ;; copying is needed because sort sorts via side effects |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
570 (setq common (sort (ediff-copy-list common) 'string-lessp)) |
13130 | 571 |
572 ;; return result | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
573 (cons (list regexp auxdir1 nil nil merge-autostore-dir) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
574 (mapcar (lambda (elt) (list (concat auxdir1 elt) nil nil)) |
13130 | 575 common)) |
576 )) | |
577 | |
578 | |
579 ;; If file groups selected by patterns will ever be implemented, this | |
580 ;; comparison function might become useful. | |
581 ;;;; uses external variables PAT1 PAT2 to compare str1/2 | |
582 ;;;; patterns must be of the form ???*???? where ??? are strings of chars | |
583 ;;;; containing no *. | |
584 ;;(defun ediff-pattern= (str1 str2) | |
585 ;; (let (pos11 pos12 pos21 pos22 len1 len2) | |
586 ;; (setq pos11 0 | |
587 ;; len (length epat1) | |
588 ;; pos12 len) | |
589 ;; (while (and (< pos11 len) (not (= (aref epat1 pos11) ?*))) | |
590 ;; (setq pos11 (1+ pos11))) | |
591 ;; (while (and (> pos12 0) (not (= (aref epat1 (1- pos12)) ?*))) | |
592 ;; (setq pos12 (1- pos12))) | |
593 ;; | |
594 ;; (setq pos21 0 | |
595 ;; len (length epat2) | |
596 ;; pos22 len) | |
597 ;; (while (and (< pos21 len) (not (= (aref epat2 pos21) ?*))) | |
598 ;; (setq pos21 (1+ pos21))) | |
599 ;; (while (and (> pos22 0) (not (= (aref epat2 (1- pos22)) ?*))) | |
600 ;; (setq pos22 (1- pos22))) | |
601 ;; | |
602 ;; (if (and (> (length str1) pos12) (>= pos12 pos11) (> pos11 -1) | |
603 ;; (> (length str2) pos22) (>= pos22 pos21) (> pos21 -1)) | |
604 ;; (string= (substring str1 pos11 pos12) | |
605 ;; (substring str2 pos21 pos22))) | |
606 ;; )) | |
607 | |
608 | |
609 ;; Prepare meta-buffer in accordance with the argument-function and | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
610 ;; redraw-function. Must return the created meta-buffer. |
13130 | 611 (defun ediff-prepare-meta-buffer (action-func meta-list |
612 meta-buffer-name redraw-function | |
613 jobname &optional startup-hooks) | |
614 (let* ((meta-buffer-name | |
615 (ediff-unique-buffer-name meta-buffer-name "*")) | |
616 (meta-buffer (get-buffer-create meta-buffer-name))) | |
19047 | 617 (ediff-with-current-buffer meta-buffer |
13130 | 618 |
619 ;; comes first | |
620 (ediff-meta-mode) | |
621 | |
622 (setq ediff-meta-action-function action-func | |
623 ediff-meta-redraw-function redraw-function | |
624 ediff-metajob-name jobname | |
625 ediff-meta-buffer meta-buffer) | |
626 | |
627 ;; comes after ediff-meta-action-function is set | |
628 (ediff-setup-meta-map) | |
629 | |
630 (if (eq ediff-metajob-name 'ediff-registry) | |
631 (progn | |
632 (setq ediff-registry-buffer meta-buffer | |
633 ediff-meta-list meta-list) | |
634 ;; this func is used only from registry buffer, not from other | |
635 ;; meta-buffs. | |
636 (define-key | |
637 ediff-meta-buffer-map "M" 'ediff-show-meta-buff-from-registry)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
638 ;; Initialize the meta list -- don't do this for registry. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
639 ;; |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
640 ;; We prepend '(nil nil) to all elts of meta-list, except the first. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
641 ;; The first nil will later be replaced by the session buffer. The |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
642 ;; second is reserved for session status. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
643 ;; |
13130 | 644 ;; (car ediff-meta-list) gets cons'ed with the session group buffer. |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
645 ;; Also, session objects A/B/C are turned into lists of the form |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
646 ;; (obj eq-indicator). Eq-indicator is either nil or =. Initialized to |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
647 ;; nil. If later it is discovered that this file is = to some other |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
648 ;; file in the same session, eq-indicator is changed to `='. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
649 ;; For now, the eq-indicator is used only for 2 and 3-file jobs. |
13130 | 650 (setq ediff-meta-list |
651 (cons (cons meta-buffer (car meta-list)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
652 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
653 (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
654 (cons nil |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
655 (cons nil |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
656 ;; convert each obj to (obj nil), |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
657 ;; where nil is the initial value |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
658 ;; for eq-indicator -- see above |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
659 (mapcar (lambda (obj) (list obj nil)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
660 elt)))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
661 (cdr meta-list))))) |
13130 | 662 |
663 (or (eq meta-buffer ediff-registry-buffer) | |
664 (setq ediff-session-registry | |
665 (cons meta-buffer ediff-session-registry))) | |
666 | |
667 ;; redraw-function uses ediff-meta-list | |
668 (funcall redraw-function ediff-meta-list) | |
669 | |
670 ;; set read-only/non-modified | |
671 (setq buffer-read-only t) | |
672 (set-buffer-modified-p nil) | |
673 | |
674 (run-hooks 'startup-hooks) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
675 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
676 ;; Arrange to show directory contents differences |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
677 ;; Must be after run startup-hooks, since ediff-dir-difference-list is |
13130 | 678 ;; set inside these hooks |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
679 (if (eq action-func 'ediff-filegroup-action) |
13130 | 680 (progn |
681 ;; put meta buffer in (car ediff-dir-difference-list) | |
682 (setq ediff-dir-difference-list | |
683 (cons (cons meta-buffer (car ediff-dir-difference-list)) | |
684 (cdr ediff-dir-difference-list))) | |
685 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
686 (or (ediff-one-filegroup-metajob jobname) |
13130 | 687 (ediff-draw-dir-diffs ediff-dir-difference-list)) |
22286 | 688 (define-key |
689 ediff-meta-buffer-map "h" 'ediff-mark-for-hiding-at-pos) | |
690 (define-key ediff-meta-buffer-map "x" 'ediff-hide-marked-sessions) | |
691 (define-key | |
692 ediff-meta-buffer-map "m" 'ediff-mark-for-operation-at-pos) | |
693 (define-key ediff-meta-buffer-map "u" nil) | |
13130 | 694 (define-key |
22286 | 695 ediff-meta-buffer-map "um" 'ediff-unmark-all-for-operation) |
696 (define-key | |
697 ediff-meta-buffer-map "uh" 'ediff-unmark-all-for-hiding) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
698 (cond ((ediff-collect-diffs-metajob jobname) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
699 (define-key |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
700 ediff-meta-buffer-map "P" 'ediff-collect-custom-diffs)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
701 ((ediff-patch-metajob jobname) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
702 (define-key |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
703 ediff-meta-buffer-map "P" 'ediff-meta-show-patch))) |
22286 | 704 (define-key ediff-meta-buffer-map "^" 'ediff-up-meta-hierarchy) |
13130 | 705 (define-key ediff-meta-buffer-map "D" 'ediff-show-dir-diffs))) |
706 | |
707 (if (eq ediff-metajob-name 'ediff-registry) | |
708 (run-hooks 'ediff-registry-setup-hook) | |
709 (run-hooks 'ediff-session-group-setup-hook)) | |
710 ) ; eval in meta-buffer | |
711 meta-buffer)) | |
712 | |
20206 | 713 ;; Insert the activity marker for session SESSION in the meta buffer at point |
714 ;; The activity marker is either SPC (untouched session), or + (active session, | |
715 ;; i.e., ediff is currently run in it), or - (finished session, i.e., we've ran | |
716 ;; ediff in it and then exited) | |
717 (defun ediff-insert-session-activity-marker-in-meta-buffer (session) | |
718 (insert | |
719 (cond ((ediff-get-session-activity-marker session)) | |
720 ;; virgin session | |
721 (t " ")))) | |
722 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
723 ;; Insert session status at point. Status is either ?H (marked for hiding), or |
20206 | 724 ;; ?I (hidden or invalid), or ?* (meaning marked for an operation; currently, |
725 ;; such op can only be checking for equality)), or SPC (meaning neither marked | |
726 ;; nor invalid) | |
727 (defun ediff-insert-session-status-in-meta-buffer (session) | |
728 (insert | |
729 (cond ((ediff-get-session-status session)) ; session has status: ?H, ?I, ?* | |
730 ;; normal session, no marks or hidings | |
731 (t " ")))) | |
732 | |
733 ;; If NEW-MARKER is non-nil, use it to substitute the current activity marker | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
734 ;; in the meta buffer. If nil, use SPC |
20206 | 735 (defun ediff-replace-session-activity-marker-in-meta-buffer (point new-marker) |
736 (let* ((overl (ediff-get-meta-overlay-at-pos point)) | |
737 (session-info (ediff-overlay-get overl 'ediff-meta-info)) | |
738 (activity-marker (ediff-get-session-activity-marker session-info)) | |
739 buffer-read-only) | |
740 (or new-marker activity-marker (setq new-marker ?\ )) | |
741 (goto-char (ediff-overlay-start overl)) | |
742 (if (eq (char-after (point)) new-marker) | |
743 () ; if marker shown in buffer is the same as new-marker, do nothing | |
744 (insert new-marker) | |
745 (delete-char 1) | |
746 (set-buffer-modified-p nil)))) | |
747 | |
748 ;; If NEW-STATUS is non-nil, use it to substitute the current status marker in | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
749 ;; the meta buffer. If nil, use SPC |
20206 | 750 (defun ediff-replace-session-status-in-meta-buffer (point new-status) |
751 (let* ((overl (ediff-get-meta-overlay-at-pos point)) | |
752 (session-info (ediff-overlay-get overl 'ediff-meta-info)) | |
753 (status (ediff-get-session-status session-info)) | |
754 buffer-read-only) | |
755 (setq new-status (or new-status status ?\ )) | |
756 (goto-char (ediff-overlay-start overl)) | |
757 (forward-char 1) ; status is the second char in session record | |
758 (if (eq (char-after (point)) new-status) | |
759 () ; if marker shown in buffer is the same as new-marker, do nothing | |
760 (insert new-status) | |
761 (delete-char 1) | |
762 (set-buffer-modified-p nil)))) | |
763 | |
764 ;; insert all file info in meta buffer for a given session | |
765 (defun ediff-insert-session-info-in-meta-buffer (session-info sessionNum) | |
766 (let ((f1 (ediff-get-session-objA session-info)) | |
767 (f2 (ediff-get-session-objB session-info)) | |
768 (f3 (ediff-get-session-objC session-info)) | |
769 (pt (point)) | |
770 (hidden (eq (ediff-get-session-status session-info) ?I))) | |
771 ;; insert activity marker, i.e., SPC, - or + | |
772 (ediff-insert-session-activity-marker-in-meta-buffer session-info) | |
773 ;; insert session status, i.e., *, H | |
774 (ediff-insert-session-status-in-meta-buffer session-info) | |
775 (insert " Session " (int-to-string sessionNum) ":\n") | |
776 (ediff-meta-insert-file-info1 f1) | |
777 (ediff-meta-insert-file-info1 f2) | |
778 (ediff-meta-insert-file-info1 f3) | |
779 (ediff-set-meta-overlay pt (point) session-info sessionNum hidden))) | |
780 | |
13130 | 781 |
782 ;; this is a setup function for ediff-directories | |
783 ;; must return meta-buffer | |
784 (defun ediff-redraw-directory-group-buffer (meta-list) | |
785 ;; extract directories | |
786 (let ((meta-buf (ediff-get-group-buffer meta-list)) | |
787 (empty t) | |
788 (sessionNum 0) | |
20206 | 789 regexp elt merge-autostore-dir |
13130 | 790 point tmp-list buffer-read-only) |
19047 | 791 (ediff-with-current-buffer meta-buf |
13130 | 792 (setq point (point)) |
793 (erase-buffer) | |
20206 | 794 ;; delete phony overlays that used to represent sessions before the buff |
795 ;; was redrawn | |
796 (if ediff-emacs-p | |
797 (mapcar 'delete-overlay (overlays-in 1 1)) | |
798 (map-extents 'delete-extent)) | |
799 | |
13130 | 800 (insert (format ediff-meta-buffer-message |
801 (ediff-abbrev-jobname ediff-metajob-name))) | |
802 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
803 (setq regexp (ediff-get-group-regexp meta-list) |
20206 | 804 merge-autostore-dir |
805 (ediff-get-group-merge-autostore-dir meta-list)) | |
13130 | 806 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
807 (cond ((ediff-collect-diffs-metajob) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
808 (insert |
20206 | 809 " P:\tcollect custom diffs of all marked sessions\n")) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
810 ((ediff-patch-metajob) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
811 (insert |
20206 | 812 " P:\tshow patch appropriately for the context (session or group)\n"))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
813 (insert |
22286 | 814 " ^:\tshow parent session group\n") |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
815 (or (ediff-one-filegroup-metajob) |
13130 | 816 (insert |
20206 | 817 " D:\tshow differences among directories\n" |
22286 | 818 " ==:\tfor each session, show which files are identical\n" |
819 " =h:\tlike ==, but also marks those sessions for hiding\n" | |
820 " =m:\tlike ==, but also marks those sessions for operation\n\n")) | |
13130 | 821 |
20206 | 822 (insert "\n") |
13130 | 823 (if (and (stringp regexp) (> (length regexp) 0)) |
18054 | 824 (insert |
20206 | 825 (format "*** Filter-through regular expression: %s\n" regexp))) |
826 (ediff-insert-dirs-in-meta-buffer meta-list) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
827 (if (and ediff-autostore-merges (ediff-merge-metajob) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
828 (ediff-nonempty-string-p merge-autostore-dir)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
829 (insert (format |
20206 | 830 "\nMerge results are automatically stored in:\n\t%s\n" |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
831 merge-autostore-dir))) |
13130 | 832 (insert "\n |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
833 Size Last modified Name |
20206 | 834 ---------------------------------------------- |
13130 | 835 |
836 ") | |
837 | |
838 ;; discard info on directories and regexp | |
839 (setq meta-list (cdr meta-list) | |
840 tmp-list meta-list) | |
841 (while (and tmp-list empty) | |
842 (if (and (car tmp-list) | |
843 (not (eq (ediff-get-session-status (car tmp-list)) ?I))) | |
844 (setq empty nil)) | |
845 (setq tmp-list (cdr tmp-list))) | |
846 | |
847 (if empty | |
848 (insert | |
849 " ****** ****** This session group has no members\n")) | |
850 | |
851 ;; now organize file names like this: | |
852 ;; use-mark sizeA dateA sizeB dateB filename | |
853 ;; make sure directories are displayed with a trailing slash. | |
854 (while meta-list | |
855 (setq elt (car meta-list) | |
856 meta-list (cdr meta-list) | |
857 sessionNum (1+ sessionNum)) | |
858 (if (eq (ediff-get-session-status elt) ?I) | |
859 () | |
20206 | 860 (ediff-insert-session-info-in-meta-buffer elt sessionNum))) |
13130 | 861 (set-buffer-modified-p nil) |
862 (goto-char point) | |
863 meta-buf))) | |
864 | |
20206 | 865 (defun ediff-update-markers-in-dir-meta-buffer (meta-list) |
866 (let ((meta-buf (ediff-get-group-buffer meta-list)) | |
867 session-info point overl buffer-read-only) | |
868 (ediff-with-current-buffer meta-buf | |
869 (setq point (point)) | |
870 (goto-char (point-min)) | |
871 (ediff-next-meta-item1) | |
872 (while (not (bobp)) | |
873 (setq session-info (ediff-get-meta-info meta-buf (point) 'no-error) | |
874 overl (ediff-get-meta-overlay-at-pos (point))) | |
875 (if session-info | |
876 (progn | |
877 (cond ((eq (ediff-get-session-status session-info) ?I) | |
878 ;; Do hiding | |
879 (if overl (ediff-overlay-put overl 'invisible t))) | |
880 ((and (eq (ediff-get-session-status session-info) ?H) | |
881 overl (ediff-overlay-get overl 'invisible)) | |
882 ;; Do unhiding | |
883 (ediff-overlay-put overl 'invisible nil)) | |
884 (t (ediff-replace-session-activity-marker-in-meta-buffer | |
885 (point) | |
886 (ediff-get-session-activity-marker session-info)) | |
887 (ediff-replace-session-status-in-meta-buffer | |
888 (point) | |
889 (ediff-get-session-status session-info)))))) | |
890 (ediff-next-meta-item1) ; advance to the next item | |
891 ) ; end while | |
892 (set-buffer-modified-p nil) | |
893 (goto-char point)) | |
894 meta-buf)) | |
895 | |
896 (defun ediff-update-session-marker-in-dir-meta-buffer (session-num) | |
897 (let (buffer-meta-overlays session-info overl buffer-read-only) | |
898 (setq overl | |
899 (if ediff-xemacs-p | |
900 (map-extents | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
901 (lambda (ext maparg) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
902 (if (and |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
903 (ediff-overlay-get ext 'ediff-meta-info) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
904 (eq (ediff-overlay-get ext 'ediff-meta-session-number) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
905 session-num)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
906 ext))) |
20206 | 907 ;; Emacs doesn't have map-extents, so try harder |
908 ;; Splice overlay lists to get all buffer overlays | |
909 (setq buffer-meta-overlays (overlay-lists) | |
910 buffer-meta-overlays (append (car buffer-meta-overlays) | |
911 (cdr buffer-meta-overlays))) | |
912 (car | |
913 (delq nil | |
914 (mapcar | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
915 (lambda (overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
916 (if (and |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
917 (ediff-overlay-get overl 'ediff-meta-info) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
918 (eq (ediff-overlay-get |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
919 overl 'ediff-meta-session-number) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
920 session-num)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
921 overl)) |
20206 | 922 buffer-meta-overlays))))) |
923 (or overl | |
924 (error | |
925 "Bug in ediff-update-session-marker-in-dir-meta-buffer: no overlay with given number %S" | |
926 session-num)) | |
927 (setq session-info (ediff-overlay-get overl 'ediff-meta-info)) | |
928 (goto-char (ediff-overlay-start overl)) | |
929 (ediff-replace-session-activity-marker-in-meta-buffer | |
930 (point) | |
931 (ediff-get-session-activity-marker session-info)) | |
932 (ediff-replace-session-status-in-meta-buffer | |
933 (point) | |
934 (ediff-get-session-status session-info))) | |
935 (ediff-next-meta-item1)) | |
936 | |
937 | |
938 | |
13130 | 939 ;; Check if this is a problematic session. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
940 ;; Return nil if not. Otherwise, return symbol representing the problem |
13130 | 941 ;; At present, problematic sessions occur only in -with-ancestor comparisons |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
942 ;; when the ancestor is a directory rather than a file, or when there is no |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
943 ;; suitable ancestor file in the ancestor directory |
13130 | 944 (defun ediff-problematic-session-p (session) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
945 (let ((f1 (ediff-get-session-objA-name session)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
946 (f2 (ediff-get-session-objB-name session)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
947 (f3 (ediff-get-session-objC-name session))) |
13130 | 948 (cond ((and (stringp f1) (not (file-directory-p f1)) |
949 (stringp f2) (not (file-directory-p f2)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
950 ;; either invalid file name or a directory |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
951 (or (not (stringp f3)) (file-directory-p f3)) |
13130 | 952 (ediff-ancestor-metajob)) |
953 ;; more may be added later | |
954 'ancestor-is-dir) | |
955 (t nil)))) | |
956 | |
20206 | 957 (defun ediff-meta-insert-file-info1 (fileinfo) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
958 (let ((fname (car fileinfo)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
959 (feq (ediff-get-file-eqstatus fileinfo)) |
20206 | 960 (max-filename-width (if ediff-meta-truncate-filenames |
961 (- (window-width) 41) | |
962 500)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
963 file-modtime file-size) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
964 (cond ((not (stringp fname)) (setq file-size -2)) ; file doesn't exits |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
965 ((not (ediff-file-remote-p fname)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
966 (if (file-exists-p fname) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
967 ;; set real size and modtime |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
968 (setq file-size (ediff-file-size fname) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
969 file-modtime (ediff-file-modtime fname)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
970 (setq file-size -2))) ; file doesn't exist |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
971 ( t (setq file-size -1))) ; remote file |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
972 (if (stringp fname) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
973 (insert |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
974 (format |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
975 "%s %s %-20s %s\n" |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
976 (if feq "=" " ") ; equality indicator |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
977 (format "%10s" (cond ((= file-size -1) "--") |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
978 ((< file-size -1) "--") |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
979 (t file-size))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
980 (cond ((= file-size -1) "*remote file*") |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
981 ((< file-size -1) "*file doesn't exist*") |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
982 (t (ediff-format-date (decode-time file-modtime)))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
983 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
984 ;; dir names in meta lists have training slashes, so we just |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
985 ;; abbreviate the file name, if file exists |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
986 (if (and (not (stringp fname)) (< file-size -1)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
987 "-------" ; file doesn't exist |
20206 | 988 (ediff-truncate-string-left |
989 (ediff-abbreviate-file-name fname) | |
990 max-filename-width))))))) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
991 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
992 (defconst ediff-months '((1 . "Jan") (2 . "Feb") (3 . "Mar") (4 . "Apr") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
993 (5 . "May") (6 . "Jun") (7 . "Jul") (8 . "Aug") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
994 (9 . "Sep") (10 . "Oct") (11 . "Nov") (12 . "Dec")) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
995 "Months' associative array.") |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
996 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
997 ;; returns 2char string |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
998 (defsubst ediff-fill-leading-zero (num) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
999 (if (< num 10) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1000 (format "0%d" num) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1001 (number-to-string num))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1002 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1003 ;; TIME is like the output of decode-time |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1004 (defun ediff-format-date (time) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1005 (format "%s %2d %4d %s:%s:%s" |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1006 (cdr (assoc (nth 4 time) ediff-months)) ; month |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1007 (nth 3 time) ; day |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1008 (nth 5 time) ; year |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1009 (ediff-fill-leading-zero (nth 2 time)) ; hour |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1010 (ediff-fill-leading-zero (nth 1 time)) ; min |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1011 (ediff-fill-leading-zero (nth 0 time)) ; sec |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1012 )) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1013 |
20206 | 1014 ;; Draw the directories |
1015 (defun ediff-insert-dirs-in-meta-buffer (meta-list) | |
1016 (let* ((dir1 (ediff-abbreviate-file-name (ediff-get-group-objA meta-list))) | |
1017 (dir2 (ediff-get-group-objB meta-list)) | |
1018 (dir2 (if (stringp dir2) (ediff-abbreviate-file-name dir2))) | |
1019 (dir3 (ediff-get-group-objC meta-list)) | |
1020 (dir3 (if (stringp dir3) (ediff-abbreviate-file-name dir3)))) | |
1021 (insert "*** Directory A: " dir1 "\n") | |
1022 (if dir2 (insert "*** Directory B: " dir2 "\n")) | |
1023 (if dir3 (insert "*** Directory C: " dir3 "\n")) | |
1024 (insert "\n"))) | |
1025 | |
13130 | 1026 (defun ediff-draw-dir-diffs (diff-list) |
1027 (if (null diff-list) (error "Lost difference info on these directories")) | |
1028 (let* ((buf-name (ediff-unique-buffer-name | |
1029 "*Ediff File Group Differences" "*")) | |
1030 (regexp (ediff-get-group-regexp diff-list)) | |
1031 (dir1 (ediff-abbreviate-file-name (ediff-get-group-objA diff-list))) | |
1032 (dir2 (ediff-abbreviate-file-name (ediff-get-group-objB diff-list))) | |
1033 (dir3 (ediff-get-group-objC diff-list)) | |
1034 (dir3 (if (stringp dir3) (ediff-abbreviate-file-name dir3))) | |
1035 (meta-buf (ediff-get-group-buffer diff-list)) | |
1036 (underline (make-string 26 ?-)) | |
1037 file code | |
1038 buffer-read-only) | |
1039 ;; skip the directory part | |
1040 (setq diff-list (cdr diff-list)) | |
1041 (setq ediff-dir-diffs-buffer (get-buffer-create buf-name)) | |
19047 | 1042 (ediff-with-current-buffer ediff-dir-diffs-buffer |
13130 | 1043 (use-local-map ediff-dir-diffs-buffer-map) |
1044 (erase-buffer) | |
1045 (setq ediff-meta-buffer meta-buf) | |
1046 (insert "\t\t*** Directory Differences ***\n") | |
1047 (insert " | |
1048 Useful commands: | |
1049 `q': hide this buffer | |
20206 | 1050 n,SPC: next line |
1051 p,DEL: previous line\n\n") | |
13130 | 1052 |
1053 (if (and (stringp regexp) (> (length regexp) 0)) | |
18054 | 1054 (insert |
1055 (format "\n*** Filter-through regular expression: %s\n" regexp))) | |
13130 | 1056 (insert "\n") |
1057 (insert (format "\n%-27s%-26s" | |
1058 (ediff-truncate-string-left | |
1059 (ediff-abbreviate-file-name | |
1060 (file-name-as-directory dir1)) | |
1061 25) | |
1062 (ediff-truncate-string-left | |
1063 (ediff-abbreviate-file-name | |
1064 (file-name-as-directory dir2)) | |
1065 25))) | |
1066 (if dir3 | |
1067 (insert (format " %-25s\n" | |
1068 (ediff-truncate-string-left | |
1069 (ediff-abbreviate-file-name | |
1070 (file-name-as-directory dir3)) | |
1071 25))) | |
1072 (insert "\n")) | |
1073 (insert (format "%s%s" underline underline)) | |
1074 (if (stringp dir3) | |
1075 (insert (format "%s\n\n" underline)) | |
1076 (insert "\n\n")) | |
1077 | |
1078 (if (null diff-list) | |
1079 (insert "\n\t*** No differences ***\n")) | |
1080 | |
1081 (while diff-list | |
1082 (setq file (car (car diff-list)) | |
1083 code (cdr (car diff-list)) | |
1084 diff-list (cdr diff-list)) | |
1085 (if (= (mod code 2) 0) ; dir1 | |
1086 (insert (format "%-27s" | |
1087 (ediff-truncate-string-left | |
1088 (ediff-abbreviate-file-name | |
1089 (if (file-directory-p (concat dir1 file)) | |
1090 (file-name-as-directory file) | |
1091 file)) | |
1092 24))) | |
1093 (insert (format "%-27s" "---"))) | |
1094 (if (= (mod code 3) 0) ; dir2 | |
1095 (insert (format "%-26s" | |
1096 (ediff-truncate-string-left | |
1097 (ediff-abbreviate-file-name | |
1098 (if (file-directory-p (concat dir2 file)) | |
1099 (file-name-as-directory file) | |
1100 file)) | |
1101 24))) | |
1102 (insert (format "%-26s" "---"))) | |
1103 (if (stringp dir3) | |
1104 (if (= (mod code 5) 0) ; dir3 | |
1105 (insert (format " %-25s" | |
1106 (ediff-truncate-string-left | |
1107 (ediff-abbreviate-file-name | |
1108 (if (file-directory-p (concat dir3 file)) | |
1109 (file-name-as-directory file) | |
1110 file)) | |
1111 24))) | |
1112 (insert (format " %-25s" "---")))) | |
1113 (insert "\n")) | |
1114 (setq buffer-read-only t) | |
1115 (set-buffer-modified-p nil)) ; eval in diff buffer | |
1116 )) | |
1117 | |
1118 (defun ediff-bury-dir-diffs-buffer () | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1119 "Bury the directory difference buffer. Display the meta buffer instead." |
13130 | 1120 (interactive) |
1121 (let ((buf ediff-meta-buffer) | |
1122 wind) | |
1123 (bury-buffer) | |
1124 (if (setq wind (ediff-get-visible-buffer-window buf)) | |
1125 (select-window wind) | |
1126 (set-window-buffer (selected-window) buf)))) | |
1127 | |
1128 ;; executes in dir session group buffer | |
1129 ;; show buffer differences | |
1130 (defun ediff-show-dir-diffs () | |
1131 "Display differences among the directories involved in session group." | |
1132 (interactive) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1133 (if (ediff-one-filegroup-metajob) |
13130 | 1134 (error "This command is inapplicable in the present context")) |
1135 (or (ediff-buffer-live-p ediff-dir-diffs-buffer) | |
1136 (ediff-draw-dir-diffs ediff-dir-difference-list)) | |
1137 (let ((buf ediff-dir-diffs-buffer)) | |
1138 (other-window 1) | |
1139 (set-window-buffer (selected-window) buf) | |
1140 (goto-char (point-min)))) | |
1141 | |
1142 (defun ediff-up-meta-hierarchy () | |
1143 "Go to the parent session group buffer." | |
1144 (interactive) | |
1145 (if (ediff-buffer-live-p ediff-parent-meta-buffer) | |
20206 | 1146 (ediff-show-meta-buffer |
1147 ediff-parent-meta-buffer ediff-meta-session-number) | |
13130 | 1148 (error "This session group has no parent"))) |
1149 | |
1150 | |
1151 ;; argument is ignored | |
1152 (defun ediff-redraw-registry-buffer (&optional ignore) | |
19047 | 1153 (ediff-with-current-buffer ediff-registry-buffer |
13130 | 1154 (let ((point (point)) |
1155 elt bufAname bufBname bufCname cur-diff total-diffs pt | |
1156 job-name meta-list registry-list buffer-read-only) | |
1157 (erase-buffer) | |
20206 | 1158 ;; delete phony overlays that used to represent sessions before the buff |
1159 ;; was redrawn | |
1160 (if ediff-emacs-p | |
1161 (mapcar 'delete-overlay (overlays-in 1 1)) | |
1162 (map-extents 'delete-extent)) | |
1163 | |
13130 | 1164 (insert "This is a registry of all active Ediff sessions. |
1165 | |
1166 Useful commands: | |
1167 button2, `v', RET over a session record: switch to that session | |
20206 | 1168 M over a session record: display the associated session group |
1169 R in any Ediff session: display session registry | |
1170 n,SPC: next session | |
1171 p,DEL: previous session | |
1172 E: browse Ediff on-line manual | |
1173 q: bury registry | |
13130 | 1174 |
1175 | |
1176 \t\tActive Ediff Sessions: | |
1177 \t\t---------------------- | |
1178 | |
1179 ") | |
1180 ;; purge registry list from dead buffers | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1181 (mapcar (lambda (elt) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1182 (if (not (ediff-buffer-live-p elt)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1183 (setq ediff-session-registry |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1184 (delq elt ediff-session-registry)))) |
13130 | 1185 ediff-session-registry) |
1186 | |
1187 (if (null ediff-session-registry) | |
1188 (insert " ******* No active Ediff sessions *******\n")) | |
1189 | |
1190 (setq registry-list ediff-session-registry) | |
1191 (while registry-list | |
1192 (setq elt (car registry-list) | |
1193 registry-list (cdr registry-list)) | |
1194 | |
1195 (if (ediff-buffer-live-p elt) | |
19047 | 1196 (if (ediff-with-current-buffer elt |
13130 | 1197 (setq job-name ediff-metajob-name |
1198 meta-list ediff-meta-list) | |
1199 (and ediff-metajob-name | |
1200 (not (eq ediff-metajob-name 'ediff-registry)))) | |
1201 (progn | |
1202 (setq pt (point)) | |
1203 (insert (format " *group*\t%s: %s\n" | |
1204 (buffer-name elt) | |
1205 (ediff-abbrev-jobname job-name))) | |
1206 (insert (format "\t\t %s %s %s\n" | |
1207 (ediff-abbreviate-file-name | |
1208 (ediff-get-group-objA meta-list)) | |
1209 (ediff-abbreviate-file-name | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1210 (if (stringp |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1211 (ediff-get-group-objB meta-list)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1212 (ediff-get-group-objB meta-list) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1213 "")) |
13130 | 1214 (ediff-abbreviate-file-name |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1215 (if (stringp |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1216 (ediff-get-group-objC meta-list)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1217 (ediff-get-group-objC meta-list) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1218 "")))) |
13130 | 1219 (ediff-set-meta-overlay pt (point) elt)) |
1220 (progn | |
19047 | 1221 (ediff-with-current-buffer elt |
13130 | 1222 (setq bufAname (if (ediff-buffer-live-p ediff-buffer-A) |
1223 (buffer-name ediff-buffer-A) | |
1224 "!!!killed buffer!!!") | |
1225 bufBname (if (ediff-buffer-live-p ediff-buffer-B) | |
1226 (buffer-name ediff-buffer-B) | |
1227 "!!!killed buffer!!!") | |
1228 bufCname (cond ((not (ediff-3way-job)) | |
1229 "") | |
1230 ((ediff-buffer-live-p ediff-buffer-C) | |
1231 (buffer-name ediff-buffer-C)) | |
1232 (t "!!!killed buffer!!!"))) | |
1233 (setq total-diffs (format "%-4d" ediff-number-of-differences) | |
1234 cur-diff | |
1235 (cond ((= ediff-current-difference -1) " _") | |
1236 ((= ediff-current-difference | |
1237 ediff-number-of-differences) | |
1238 " $") | |
1239 (t (format | |
1240 "%4d" (1+ ediff-current-difference)))) | |
1241 job-name ediff-job-name)) | |
1242 ;; back in the meta buf | |
1243 (setq pt (point)) | |
1244 (insert cur-diff "/" total-diffs "\t" | |
1245 (buffer-name elt) | |
1246 (format ": %s" (ediff-abbrev-jobname job-name))) | |
1247 (insert | |
1248 "\n\t\t " bufAname " " bufBname " " bufCname "\n") | |
1249 (ediff-set-meta-overlay pt (point) elt)))) | |
1250 ) ; while | |
1251 (set-buffer-modified-p nil) | |
1252 (goto-char point) | |
1253 ))) | |
1254 | |
20206 | 1255 ;; Sets overlay around a meta record with 'ediff-meta-info property PROP |
1256 ;; If optional SESSION-NUMBER, make it a property of the overlay, | |
1257 ;; ediff-meta-session-number | |
1258 (defun ediff-set-meta-overlay (b e prop &optional session-number hidden) | |
13130 | 1259 (let (overl) |
1260 (setq overl (ediff-make-overlay b e)) | |
1261 (if ediff-emacs-p | |
1262 (ediff-overlay-put overl 'mouse-face 'highlight) | |
1263 (ediff-overlay-put overl 'highlight t)) | |
20206 | 1264 (ediff-overlay-put overl 'ediff-meta-info prop) |
1265 (ediff-overlay-put overl 'invisible hidden) | |
1266 (if (numberp session-number) | |
1267 (ediff-overlay-put overl 'ediff-meta-session-number session-number)))) | |
13130 | 1268 |
22286 | 1269 (defun ediff-mark-for-hiding-at-pos (unmark) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1270 "Mark session for hiding. With prefix arg, unmark." |
13130 | 1271 (interactive "P") |
1272 (let* ((pos (ediff-event-point last-command-event)) | |
1273 (meta-buf (ediff-event-buffer last-command-event)) | |
1274 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid | |
1275 (info (ediff-get-meta-info meta-buf pos)) | |
20206 | 1276 (session-number (ediff-get-session-number-at-pos pos))) |
22286 | 1277 (ediff-mark-session-for-hiding info unmark) |
1278 (ediff-next-meta-item 1) | |
1279 (save-excursion | |
1280 (ediff-update-meta-buffer meta-buf nil session-number)) | |
13130 | 1281 )) |
1282 | |
22286 | 1283 ;; Returns whether session was marked or unmarked |
1284 (defun ediff-mark-session-for-hiding (info unmark) | |
1285 (let ((session-buf (ediff-get-session-buffer info)) | |
1286 ignore) | |
1287 (cond ((eq unmark 'mark) (setq unmark nil)) | |
1288 ((eq (ediff-get-session-status info) ?H) (setq unmark t)) | |
1289 (unmark ; says unmark, but the marker is different from H | |
1290 (setq ignore t))) | |
1291 (cond (ignore) | |
1292 (unmark (ediff-set-session-status info nil)) | |
1293 ;;; (if (ediff-buffer-live-p session-buf) | |
1294 ;;; (error "Can't hide active session, %s" (buffer-name session-buf))) | |
1295 (t (ediff-set-session-status info ?H)))) | |
1296 unmark) | |
1297 | |
1298 | |
1299 (defun ediff-mark-for-operation-at-pos (unmark) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1300 "Mark session for a group operation. With prefix arg, unmark." |
13130 | 1301 (interactive "P") |
1302 (let* ((pos (ediff-event-point last-command-event)) | |
1303 (meta-buf (ediff-event-buffer last-command-event)) | |
1304 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid | |
20206 | 1305 (info (ediff-get-meta-info meta-buf pos)) |
1306 (session-number (ediff-get-session-number-at-pos pos))) | |
22286 | 1307 (ediff-mark-session-for-operation info unmark) |
1308 (ediff-next-meta-item 1) | |
1309 (save-excursion | |
1310 (ediff-update-meta-buffer meta-buf nil session-number)) | |
13130 | 1311 )) |
1312 | |
22286 | 1313 |
1314 ;; returns whether session was unmarked. | |
1315 ;; remember: this is a toggle op | |
1316 (defun ediff-mark-session-for-operation (info unmark) | |
1317 (let (ignore) | |
1318 (cond ((eq unmark 'mark) (setq unmark nil)) | |
1319 ((eq (ediff-get-session-status info) ?*) (setq unmark t)) | |
1320 (unmark ; says unmark, but the marker is different from * | |
1321 (setq ignore t))) | |
1322 (cond (ignore) | |
1323 (unmark (ediff-set-session-status info nil)) | |
1324 (t (ediff-set-session-status info ?*)))) | |
1325 unmark) | |
1326 | |
1327 | |
13130 | 1328 (defun ediff-hide-marked-sessions (unhide) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1329 "Hide marked sessions. With prefix arg, unhide." |
13130 | 1330 (interactive "P") |
1331 (let ((grp-buf (ediff-get-group-buffer ediff-meta-list)) | |
1332 (meta-list (cdr ediff-meta-list)) | |
1333 (from (if unhide ?I ?H)) | |
1334 (to (if unhide ?H ?I)) | |
1335 (numMarked 0) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1336 active-sessions-exist session-buf elt) |
13130 | 1337 (while meta-list |
1338 (setq elt (car meta-list) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1339 meta-list (cdr meta-list) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1340 session-buf (ediff-get-session-buffer elt)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1341 |
13130 | 1342 (if (eq (ediff-get-session-status elt) from) |
1343 (progn | |
1344 (setq numMarked (1+ numMarked)) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1345 (if (and (eq to ?I) (buffer-live-p session-buf)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1346 ;; shouldn't hide active sessions |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1347 (setq active-sessions-exist t) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1348 (ediff-set-session-status elt to))))) |
13130 | 1349 (if (> numMarked 0) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1350 (ediff-update-meta-buffer grp-buf 'must-redraw) |
13130 | 1351 (beep) |
1352 (if unhide | |
1353 (message "Nothing to reveal...") | |
1354 (message "Nothing to hide..."))) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1355 (if active-sessions-exist |
20206 | 1356 (message "Note: Ediff didn't hide active sessions!")) |
13130 | 1357 )) |
1358 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1359 ;; Apply OPERATION to marked sessions. Operation expects one argument of type |
13130 | 1360 ;; meta-list member (not the first one), i.e., a regular session description. |
1361 ;; Returns number of marked sessions on which operation was performed | |
1362 (defun ediff-operate-on-marked-sessions (operation) | |
1363 (let ((grp-buf (ediff-get-group-buffer ediff-meta-list)) | |
1364 (meta-list (cdr ediff-meta-list)) | |
1365 (marksym ?*) | |
1366 (numMarked 0) | |
1367 (sessionNum 0) | |
19774 | 1368 (diff-buffer ediff-meta-diff-buffer) |
1369 session-buf elt) | |
13130 | 1370 (while meta-list |
1371 (setq elt (car meta-list) | |
1372 meta-list (cdr meta-list) | |
1373 sessionNum (1+ sessionNum)) | |
19774 | 1374 (cond ((eq (ediff-get-session-status elt) marksym) |
1375 (save-excursion | |
1376 (setq numMarked (1+ numMarked)) | |
1377 (funcall operation elt sessionNum))) | |
1378 ((and (ediff-meta-session-p elt) | |
1379 (ediff-buffer-live-p | |
1380 (setq session-buf (ediff-get-session-buffer elt)))) | |
1381 (setq numMarked | |
1382 (+ numMarked | |
1383 (ediff-with-current-buffer session-buf | |
1384 ;; pass meta-diff along | |
1385 (setq ediff-meta-diff-buffer diff-buffer) | |
1386 ;; collect diffs in child group | |
1387 (ediff-operate-on-marked-sessions operation))))))) | |
20206 | 1388 (ediff-update-meta-buffer grp-buf 'must-redraw) ; just in case |
13130 | 1389 numMarked |
1390 )) | |
1391 | |
1392 (defun ediff-append-custom-diff (session sessionNum) | |
1393 (or (ediff-collect-diffs-metajob) | |
19774 | 1394 (error "Hmm, I'd hate to do it to you ...")) |
13130 | 1395 (let ((session-buf (ediff-get-session-buffer session)) |
1396 (meta-diff-buff ediff-meta-diff-buffer) | |
1397 (metajob ediff-metajob-name) | |
1398 tmp-buf custom-diff-buf) | |
1399 (if (ediff-buffer-live-p session-buf) | |
19047 | 1400 (ediff-with-current-buffer session-buf |
13130 | 1401 (if (eq ediff-control-buffer session-buf) ; individual session |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1402 (progn |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1403 (ediff-compute-custom-diffs-maybe) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1404 (setq custom-diff-buf ediff-custom-diff-buffer))))) |
13130 | 1405 |
1406 (or (ediff-buffer-live-p meta-diff-buff) | |
1407 (error "Ediff: something wrong--no multiple diffs buffer")) | |
1408 | |
1409 (cond ((ediff-buffer-live-p custom-diff-buf) | |
1410 (save-excursion | |
1411 (set-buffer meta-diff-buff) | |
1412 (goto-char (point-max)) | |
1413 (insert-buffer custom-diff-buf) | |
1414 (insert "\n"))) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1415 ((memq metajob '(ediff-directories |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1416 ediff-merge-directories |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1417 ediff-merge-directories-with-ancestor)) |
13130 | 1418 ;; get diffs by calling shell command on ediff-custom-diff-program |
1419 (save-excursion | |
1420 (set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer))) | |
1421 (erase-buffer) | |
1422 (shell-command | |
1423 (format "%s %s %s %s" | |
1424 ediff-custom-diff-program ediff-custom-diff-options | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1425 (ediff-get-session-objA-name session) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1426 (ediff-get-session-objB-name session)) |
13130 | 1427 t)) |
1428 (save-excursion | |
1429 (set-buffer meta-diff-buff) | |
1430 (goto-char (point-max)) | |
1431 (insert-buffer tmp-buf) | |
1432 (insert "\n"))) | |
1433 (t | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1434 (error "Can't make context diff for Session %d" sessionNum ))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1435 )) |
13130 | 1436 |
1437 (defun ediff-collect-custom-diffs () | |
1438 "Collect custom diffs of marked sessions in buffer `*Ediff Multifile Diffs*'. | |
1439 This operation is defined only for `ediff-directories' and | |
1440 `ediff-directory-revisions', since its intent is to produce | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1441 multifile patches. For `ediff-directory-revisions', we insist that |
13130 | 1442 all marked sessions must be active." |
1443 (interactive) | |
1444 (or (ediff-buffer-live-p ediff-meta-diff-buffer) | |
1445 (setq ediff-meta-diff-buffer | |
1446 (get-buffer-create | |
1447 (ediff-unique-buffer-name "*Ediff Multifile Diffs" "*")))) | |
19047 | 1448 (ediff-with-current-buffer ediff-meta-diff-buffer |
13130 | 1449 (erase-buffer)) |
1450 (if (> (ediff-operate-on-marked-sessions 'ediff-append-custom-diff) 0) | |
1451 ;; did something | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1452 (progn |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1453 (display-buffer ediff-meta-diff-buffer 'not-this-window) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1454 (ediff-with-current-buffer ediff-meta-diff-buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1455 (set-buffer-modified-p nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1456 (setq buffer-read-only t))) |
13130 | 1457 (beep) |
1458 (message "No marked sessions found"))) | |
1459 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1460 (defun ediff-meta-show-patch () |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1461 "Show the multi-file patch associated with this group session." |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1462 (interactive) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1463 (let* ((pos (ediff-event-point last-command-event)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1464 (meta-buf (ediff-event-buffer last-command-event)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1465 (info (ediff-get-meta-info meta-buf pos 'noerror)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1466 (patchbuffer ediff-meta-patchbufer)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1467 (if (ediff-buffer-live-p patchbuffer) |
19047 | 1468 (ediff-with-current-buffer patchbuffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1469 (save-restriction |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1470 (if (not info) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1471 (widen) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1472 (narrow-to-region |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1473 (ediff-get-session-objB-name info) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1474 (ediff-get-session-objC-name info))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1475 (set-buffer (get-buffer-create ediff-tmp-buffer)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1476 (erase-buffer) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1477 (insert-buffer patchbuffer) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1478 (display-buffer ediff-tmp-buffer 'not-this-window) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1479 )) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1480 (error "The patch buffer wasn't found")))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1481 |
13130 | 1482 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1483 ;; This function executes in meta buffer. It knows where event happened. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1484 (defun ediff-filegroup-action () |
13130 | 1485 "Execute appropriate action for the selected session." |
1486 (interactive) | |
1487 (let* ((pos (ediff-event-point last-command-event)) | |
1488 (meta-buf (ediff-event-buffer last-command-event)) | |
1489 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid | |
1490 (info (ediff-get-meta-info meta-buf pos)) | |
20206 | 1491 (session-buf (ediff-get-session-buffer info)) |
20343 | 1492 (session-number (ediff-get-session-number-at-pos pos meta-buf)) |
20206 | 1493 merge-autostore-dir file1 file2 file3 regexp) |
13130 | 1494 |
20206 | 1495 (setq file1 (ediff-get-session-objA-name info) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1496 file2 (ediff-get-session-objB-name info) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1497 file3 (ediff-get-session-objC-name info)) |
13130 | 1498 |
1499 ;; make sure we don't start on hidden sessions | |
1500 ;; ?H means marked for hiding. ?I means invalid (hidden). | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1501 (if (memq (ediff-get-session-status info) '(?I)) |
13130 | 1502 (progn |
1503 (beep) | |
1504 (if (y-or-n-p "This session is marked as hidden, unmark? ") | |
1505 (progn | |
1506 (ediff-set-session-status info nil) | |
20206 | 1507 (ediff-update-meta-buffer meta-buf nil session-number)) |
13130 | 1508 (error "Aborted")))) |
1509 | |
19047 | 1510 (ediff-with-current-buffer meta-buf |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1511 (setq merge-autostore-dir |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1512 (ediff-get-group-merge-autostore-dir ediff-meta-list)) |
13130 | 1513 (goto-char pos) ; if the user clicked on session--move point there |
1514 ;; First handle sessions involving directories (which are themselves | |
1515 ;; session groups) | |
1516 ;; After that handle individual sessions | |
19774 | 1517 (cond ((ediff-meta-session-p info) |
13130 | 1518 ;; do ediff/ediff-merge on subdirectories |
1519 (if (ediff-buffer-live-p session-buf) | |
1520 (ediff-show-meta-buffer session-buf) | |
1521 (setq regexp (read-string "Filter through regular expression: " | |
1522 nil 'ediff-filtering-regexp-history)) | |
1523 (ediff-directories-internal | |
1524 file1 file2 file3 regexp | |
1525 ediff-session-action-function | |
1526 ediff-metajob-name | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1527 ;; make it update (car info) after startup |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1528 `(list (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1529 ;; child session group should know its parent |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1530 (setq ediff-parent-meta-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1531 (quote ,ediff-meta-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1532 ediff-meta-session-number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1533 ,session-number) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1534 ;; and parent will know its child |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1535 (setcar (quote ,info) ediff-meta-buffer)))))) |
13130 | 1536 |
1537 ;; Do ediff-revision on a subdirectory | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1538 ((and (ediff-one-filegroup-metajob) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1539 (ediff-revision-metajob) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1540 (file-directory-p file1)) |
13130 | 1541 (if (ediff-buffer-live-p session-buf) |
1542 (ediff-show-meta-buffer session-buf) | |
1543 (setq regexp (read-string "Filter through regular expression: " | |
1544 nil 'ediff-filtering-regexp-history)) | |
1545 (ediff-directory-revisions-internal | |
1546 file1 regexp | |
1547 ediff-session-action-function ediff-metajob-name | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1548 ;; make it update (car info) after startup |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1549 `(list (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1550 ;; child session group should know its parent and |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1551 ;; its number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1552 (setq ediff-parent-meta-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1553 (quote ,ediff-meta-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1554 ediff-meta-session-number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1555 ,session-number) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1556 ;; and parent will know its child |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1557 (setcar (quote ,info) ediff-meta-buffer)))))) |
13130 | 1558 |
1559 ;; From here on---only individual session handlers | |
1560 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1561 ;; handle an individual session with a live control buffer |
13130 | 1562 ((ediff-buffer-live-p session-buf) |
19047 | 1563 (ediff-with-current-buffer session-buf |
13130 | 1564 (setq ediff-mouse-pixel-position (mouse-pixel-position)) |
1565 (ediff-recenter 'no-rehighlight))) | |
1566 | |
1567 ((ediff-problematic-session-p info) | |
1568 (beep) | |
1569 (if (y-or-n-p | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1570 "This session has no ancestor. Merge without the ancestor? ") |
13130 | 1571 (ediff-merge-files |
1572 file1 file2 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1573 ;; provide startup hooks |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1574 `(list (lambda () |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1575 (add-hook |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1576 'ediff-after-quit-hook-internal |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1577 (lambda () |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1578 (if (ediff-buffer-live-p ,(current-buffer)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1579 (ediff-show-meta-buffer |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1580 ,(current-buffer) ,session-number))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1581 nil 'local) |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1582 (setq ediff-meta-buffer ,(current-buffer) |
20206 | 1583 ediff-meta-session-number |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1584 ,session-number) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1585 (setq ediff-merge-store-file |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1586 ,(if (ediff-nonempty-string-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1587 merge-autostore-dir) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1588 (concat |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1589 merge-autostore-dir |
29165
641e43bad886
2000-05-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
1590 ediff-merge-filename-prefix |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1591 (file-name-nondirectory file1)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1592 )) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1593 ;; make ediff-startup pass |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1594 ;; ediff-control-buffer back to the meta |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1595 ;; level; see below |
13130 | 1596 (setcar |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1597 (quote ,info) ediff-control-buffer)))) |
13130 | 1598 (error "Aborted"))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1599 ((ediff-one-filegroup-metajob) ; needs 1 file arg |
13130 | 1600 (funcall ediff-session-action-function |
1601 file1 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1602 ;; provide startup hooks |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1603 `(list (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1604 (add-hook |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1605 'ediff-after-quit-hook-internal |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1606 (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1607 (if (ediff-buffer-live-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1608 ,(current-buffer)) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1609 (ediff-show-meta-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1610 ,(current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1611 ,session-number))) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1612 nil 'local) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1613 (setq ediff-meta-buffer ,(current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1614 ediff-meta-session-number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1615 ,session-number) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1616 (setq ediff-merge-store-file |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1617 ,(if (ediff-nonempty-string-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1618 merge-autostore-dir) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1619 (concat |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1620 merge-autostore-dir |
29165
641e43bad886
2000-05-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
1621 ediff-merge-filename-prefix |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1622 (file-name-nondirectory file1))) ) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1623 ;; make ediff-startup pass |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1624 ;; ediff-control-buffer back to the meta |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1625 ;; level; see below |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1626 (setcar |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1627 (quote ,info) ediff-control-buffer))))) |
13130 | 1628 ((not (ediff-metajob3)) ; need 2 file args |
1629 (funcall ediff-session-action-function | |
1630 file1 file2 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1631 ;; provide startup hooks |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1632 `(list (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1633 (add-hook |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1634 'ediff-after-quit-hook-internal |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1635 (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1636 (if (ediff-buffer-live-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1637 ,(current-buffer)) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1638 (ediff-show-meta-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1639 ,(current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1640 ,session-number))) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1641 nil 'local) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1642 (setq ediff-meta-buffer ,(current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1643 ediff-meta-session-number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1644 ,session-number) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1645 (setq ediff-merge-store-file |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1646 ,(if (ediff-nonempty-string-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1647 merge-autostore-dir) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1648 (concat |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1649 merge-autostore-dir |
29165
641e43bad886
2000-05-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
1650 ediff-merge-filename-prefix |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1651 (file-name-nondirectory file1))) ) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1652 ;; make ediff-startup pass |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1653 ;; ediff-control-buffer back to the meta |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1654 ;; level; see below |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1655 (setcar |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1656 (quote ,info) ediff-control-buffer))))) |
13130 | 1657 ((ediff-metajob3) ; need 3 file args |
1658 (funcall ediff-session-action-function | |
1659 file1 file2 file3 | |
1660 ;; arrange startup hooks | |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1661 `(list (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1662 (add-hook |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1663 'ediff-after-quit-hook-internal |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1664 (lambda () |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1665 (if (ediff-buffer-live-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1666 ,(current-buffer)) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1667 (ediff-show-meta-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1668 ,(current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1669 ,session-number))) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1670 nil 'local) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1671 (setq ediff-merge-store-file |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1672 ,(if (ediff-nonempty-string-p |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1673 merge-autostore-dir) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1674 (concat |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1675 merge-autostore-dir |
29165
641e43bad886
2000-05-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26585
diff
changeset
|
1676 ediff-merge-filename-prefix |
26585
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1677 (file-name-nondirectory file1))) ) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1678 (setq ediff-meta-buffer , (current-buffer) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1679 ediff-meta-session-number |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1680 ,session-number) |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1681 ;; this arranges that ediff-startup will pass |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1682 ;; the value of ediff-control-buffer back to |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1683 ;; the meta level, to the record in the meta |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1684 ;; list containing the information about the |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1685 ;; session associated with that |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1686 ;; ediff-control-buffer |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1687 (setcar |
3ec5a485d0ab
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
1688 (quote ,info) ediff-control-buffer))))) |
13130 | 1689 ) ; cond |
1690 ) ; eval in meta-buf | |
1691 )) | |
1692 | |
1693 (defun ediff-registry-action () | |
1694 "Switch to a selected session." | |
1695 (interactive) | |
1696 (let* ((pos (ediff-event-point last-command-event)) | |
1697 (buf (ediff-event-buffer last-command-event)) | |
1698 (ctl-buf (ediff-get-meta-info buf pos))) | |
1699 | |
1700 (if (ediff-buffer-live-p ctl-buf) | |
1701 ;; check if this is ediff-control-buffer or ediff-meta-buffer | |
19047 | 1702 (if (ediff-with-current-buffer ctl-buf |
13130 | 1703 (eq (key-binding "q") 'ediff-quit-meta-buffer)) |
1704 ;; it's a meta-buffer -- last action should just display it | |
20206 | 1705 (ediff-show-meta-buffer ctl-buf t) |
13130 | 1706 ;; it's a session buffer -- invoke go back to session |
19047 | 1707 (ediff-with-current-buffer ctl-buf |
13130 | 1708 (setq ediff-mouse-pixel-position (mouse-pixel-position)) |
1709 (ediff-recenter 'no-rehighlight))) | |
1710 (beep) | |
1711 (message "You've selected a stale session --- try again") | |
1712 (ediff-update-registry)) | |
19047 | 1713 (ediff-with-current-buffer buf |
13130 | 1714 (goto-char pos)) |
1715 )) | |
1716 | |
1717 | |
20206 | 1718 ;; If session number is t, means don't update meta buffer |
1719 (defun ediff-show-meta-buffer (&optional meta-buf session-number) | |
13130 | 1720 "Show the session group buffer." |
1721 (interactive) | |
1722 (let (wind frame silent) | |
1723 (if meta-buf (setq silent t)) | |
1724 | |
1725 (setq meta-buf (or meta-buf ediff-meta-buffer)) | |
1726 (cond ((not (bufferp meta-buf)) | |
1727 (error "This Ediff session is not part of a session group")) | |
1728 ((not (ediff-buffer-live-p meta-buf)) | |
1729 (error | |
1730 "Can't find this session's group panel -- session itself is ok"))) | |
1731 | |
20206 | 1732 (cond ((numberp session-number) |
1733 (ediff-update-meta-buffer meta-buf nil session-number)) | |
1734 ;; if session-number is t, don't update | |
1735 (session-number) | |
1736 (t (ediff-cleanup-meta-buffer meta-buf))) | |
1737 | |
19047 | 1738 (ediff-with-current-buffer meta-buf |
13130 | 1739 (save-excursion |
1740 (cond ((setq wind (ediff-get-visible-buffer-window meta-buf)) | |
1741 (or silent | |
1742 (message | |
1743 "Already showing the group panel for this session")) | |
1744 (set-window-buffer wind meta-buf) | |
1745 (select-window wind)) | |
1746 ((window-live-p (setq wind ediff-window-C)) ;in merge--merge buf | |
1747 (set-window-buffer ediff-window-C meta-buf) | |
1748 (select-window wind)) | |
1749 ((window-live-p (setq wind ediff-window-A)) | |
1750 (set-window-buffer ediff-window-A meta-buf) | |
1751 (select-window wind)) | |
1752 ((window-live-p (setq wind ediff-window-B)) | |
1753 (set-window-buffer ediff-window-B meta-buf) | |
1754 (select-window wind)) | |
1755 ((and | |
1756 (setq wind | |
1757 (ediff-get-visible-buffer-window ediff-registry-buffer)) | |
1758 (ediff-window-display-p)) | |
1759 (select-window wind) | |
1760 (other-window 1) | |
1761 (set-window-buffer (selected-window) meta-buf)) | |
1762 (t (ediff-skip-unsuitable-frames 'ok-unsplittable) | |
1763 (set-window-buffer (selected-window) meta-buf))) | |
1764 )) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1765 (if (and (ediff-window-display-p) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1766 (window-live-p |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1767 (setq wind (ediff-get-visible-buffer-window meta-buf)))) |
13130 | 1768 (progn |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1769 (setq frame (window-frame wind)) |
13130 | 1770 (raise-frame frame) |
1771 (ediff-reset-mouse frame))) | |
1772 (run-hooks 'ediff-show-session-group-hook) | |
1773 )) | |
1774 | |
20206 | 1775 (defun ediff-show-current-session-meta-buffer () |
1776 (interactive) | |
1777 (ediff-show-meta-buffer nil ediff-meta-session-number)) | |
1778 | |
13130 | 1779 (defun ediff-show-meta-buff-from-registry () |
1780 "Display the session group buffer for a selected session group." | |
1781 (interactive) | |
1782 (let* ((pos (ediff-event-point last-command-event)) | |
1783 (meta-buf (ediff-event-buffer last-command-event)) | |
1784 (info (ediff-get-meta-info meta-buf pos)) | |
1785 (meta-or-session-buf info)) | |
19047 | 1786 (ediff-with-current-buffer meta-or-session-buf |
20206 | 1787 (ediff-show-meta-buffer nil t)))) |
13130 | 1788 |
1789 ;;;###autoload | |
1790 (defun ediff-show-registry () | |
1791 "Display Ediff's registry." | |
1792 (interactive) | |
1793 (ediff-update-registry) | |
1794 (if (not (ediff-buffer-live-p ediff-registry-buffer)) | |
1795 (error "No active Ediff sessions or corrupted session registry")) | |
1796 (let (wind frame) | |
1797 ;; for some reason, point moves in ediff-registry-buffer, so we preserve it | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1798 ;; explicitly |
19047 | 1799 (ediff-with-current-buffer ediff-registry-buffer |
13130 | 1800 (save-excursion |
1801 (cond ((setq wind | |
1802 (ediff-get-visible-buffer-window ediff-registry-buffer)) | |
1803 (message "Already showing the registry") | |
1804 (set-window-buffer wind ediff-registry-buffer) | |
1805 (select-window wind)) | |
1806 ((window-live-p ediff-window-C) | |
1807 (set-window-buffer ediff-window-C ediff-registry-buffer) | |
1808 (select-window ediff-window-C)) | |
1809 ((window-live-p ediff-window-A) | |
1810 (set-window-buffer ediff-window-A ediff-registry-buffer) | |
1811 (select-window ediff-window-A)) | |
1812 ((window-live-p ediff-window-B) | |
1813 (set-window-buffer ediff-window-B ediff-registry-buffer) | |
1814 (select-window ediff-window-B)) | |
1815 ((and (setq wind | |
1816 (ediff-get-visible-buffer-window ediff-meta-buffer)) | |
1817 (ediff-window-display-p)) | |
1818 (select-window wind) | |
1819 (other-window 1) | |
1820 (set-window-buffer (selected-window) ediff-registry-buffer)) | |
1821 (t (ediff-skip-unsuitable-frames 'ok-unsplittable) | |
1822 (set-window-buffer (selected-window) ediff-registry-buffer))) | |
1823 )) | |
1824 (if (ediff-window-display-p) | |
1825 (progn | |
1826 (setq frame | |
1827 (window-frame | |
1828 (ediff-get-visible-buffer-window ediff-registry-buffer))) | |
1829 (raise-frame frame) | |
1830 (ediff-reset-mouse frame))) | |
1831 (run-hooks 'ediff-show-registry-hook) | |
1832 )) | |
1833 | |
1834 ;;;###autoload | |
1835 (defalias 'eregistry 'ediff-show-registry) | |
1836 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1837 ;; If meta-buf doesn't exist, it is created. In that case, id doesn't have a |
13130 | 1838 ;; parent meta-buf |
1839 ;; Check if META-BUF exists before calling this function | |
20206 | 1840 ;; Optional MUST-REDRAW, if non-nil, would force redrawal of the whole meta |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1841 ;; buffer. Otherwise, it will just go over the buffer and update activity marks |
20206 | 1842 ;; and session status. |
1843 ;; SESSION-NUMBER, if specified, says which session caused the update. | |
1844 (defun ediff-update-meta-buffer (meta-buf &optional must-redraw session-number) | |
1845 (if (ediff-buffer-live-p meta-buf) | |
1846 (ediff-with-current-buffer meta-buf | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1847 (let (overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1848 (cond (must-redraw ; completely redraw the meta buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1849 (funcall ediff-meta-redraw-function ediff-meta-list)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1850 ((numberp session-number) ; redraw only for the given session |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1851 (ediff-update-session-marker-in-dir-meta-buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1852 session-number)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1853 (t ; update what changed only, but scan the entire meta buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1854 (ediff-update-markers-in-dir-meta-buffer ediff-meta-list))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1855 (setq overl (ediff-get-meta-overlay-at-pos (point))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1856 ;; skip the invisible sessions |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1857 (while (and overl (ediff-overlay-get overl 'invisible)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1858 (ediff-next-meta-item1) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1859 (setq overl (ediff-get-meta-overlay-at-pos (point)))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1860 )))) |
13130 | 1861 |
1862 (defun ediff-update-registry () | |
19047 | 1863 (ediff-with-current-buffer (current-buffer) |
13130 | 1864 (if (ediff-buffer-live-p ediff-registry-buffer) |
1865 (ediff-redraw-registry-buffer) | |
1866 (ediff-prepare-meta-buffer | |
1867 'ediff-registry-action | |
1868 ediff-session-registry | |
1869 "*Ediff Registry" | |
1870 'ediff-redraw-registry-buffer | |
1871 'ediff-registry)) | |
1872 )) | |
1873 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1874 ;; If meta-buf exists, it is redrawn along with parent. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1875 ;; Otherwise, nothing happens. |
13130 | 1876 (defun ediff-cleanup-meta-buffer (meta-buffer) |
1877 (if (ediff-buffer-live-p meta-buffer) | |
19047 | 1878 (ediff-with-current-buffer meta-buffer |
13130 | 1879 (ediff-update-meta-buffer meta-buffer) |
1880 (if (ediff-buffer-live-p ediff-parent-meta-buffer) | |
20206 | 1881 (ediff-update-meta-buffer |
1882 ediff-parent-meta-buffer nil ediff-meta-session-number))))) | |
13130 | 1883 |
20206 | 1884 ;; t if no session is in progress |
13130 | 1885 (defun ediff-safe-to-quit (meta-buffer) |
1886 (if (ediff-buffer-live-p meta-buffer) | |
1887 (let ((lis ediff-meta-list) | |
1888 (cont t) | |
1889 buffer-read-only) | |
20206 | 1890 ;;(ediff-update-meta-buffer meta-buffer) |
19047 | 1891 (ediff-with-current-buffer meta-buffer |
13130 | 1892 (setq lis (cdr lis)) ; discard the description part of meta-list |
1893 (while (and cont lis) | |
1894 (if (ediff-buffer-live-p | |
1895 (ediff-get-group-buffer lis)) ; in progress | |
1896 (setq cont nil)) | |
1897 (setq lis (cdr lis))) | |
1898 cont)))) | |
1899 | |
1900 (defun ediff-quit-meta-buffer () | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1901 "If the group has no active session, delete the meta buffer. |
13130 | 1902 If no session is in progress, ask to confirm before deleting meta buffer. |
1903 Otherwise, bury the meta buffer. | |
1904 If this is a session registry buffer then just bury it." | |
1905 (interactive) | |
1906 (let* ((buf (current-buffer)) | |
1907 (dir-diffs-buffer ediff-dir-diffs-buffer) | |
1908 (meta-diff-buffer ediff-meta-diff-buffer) | |
20206 | 1909 (session-number ediff-meta-session-number) |
13130 | 1910 (parent-buf ediff-parent-meta-buffer) |
1911 (dont-show-registry (eq buf ediff-registry-buffer))) | |
1912 (if dont-show-registry | |
1913 (bury-buffer) | |
20206 | 1914 ;;(ediff-cleanup-meta-buffer buf) |
13130 | 1915 (cond ((and (ediff-safe-to-quit buf) |
1916 (y-or-n-p "Quit this session group? ")) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
1917 (run-hooks 'ediff-quit-session-group-hook) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1918 (message "") |
13130 | 1919 (ediff-dispose-of-meta-buffer buf)) |
1920 ((ediff-safe-to-quit buf) | |
1921 (bury-buffer)) | |
1922 (t | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1923 (error |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1924 "This session group has active sessions---cannot exit"))) |
20206 | 1925 (ediff-update-meta-buffer parent-buf nil session-number) |
13130 | 1926 (ediff-kill-buffer-carefully dir-diffs-buffer) |
1927 (ediff-kill-buffer-carefully meta-diff-buffer) | |
1928 (if (ediff-buffer-live-p parent-buf) | |
1929 (progn | |
1930 (setq dont-show-registry t) | |
20206 | 1931 (ediff-show-meta-buffer parent-buf session-number))) |
13130 | 1932 ) |
1933 (or dont-show-registry | |
1934 (ediff-show-registry)))) | |
1935 | |
1936 (defun ediff-dispose-of-meta-buffer (buf) | |
1937 (setq ediff-session-registry (delq buf ediff-session-registry)) | |
19047 | 1938 (ediff-with-current-buffer buf |
13130 | 1939 (if (ediff-buffer-live-p ediff-dir-diffs-buffer) |
1940 (kill-buffer ediff-dir-diffs-buffer))) | |
1941 (kill-buffer buf)) | |
1942 | |
1943 | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1944 ;; Obtain information on a meta record where the user clicked or typed |
13130 | 1945 ;; BUF is the buffer where this happened and POINT is the position |
1946 ;; If optional NOERROR arg is given, don't report error and return nil if no | |
1947 ;; meta info is found on line. | |
1948 (defun ediff-get-meta-info (buf point &optional noerror) | |
1949 (let (result olist tmp) | |
1950 (if (and point (ediff-buffer-live-p buf)) | |
19047 | 1951 (ediff-with-current-buffer buf |
13130 | 1952 (if ediff-xemacs-p |
1953 (setq result | |
1954 (if (setq tmp (extent-at point buf 'ediff-meta-info)) | |
1955 (ediff-overlay-get tmp 'ediff-meta-info))) | |
1956 (setq olist (overlays-at point)) | |
1957 (setq olist | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
1958 (mapcar (lambda (elt) (overlay-get elt 'ediff-meta-info)) |
13130 | 1959 olist)) |
1960 (while (and olist (null (car olist)) | |
1961 (overlay-get (car olist) 'invisible)) | |
1962 (setq olist (cdr olist))) | |
1963 (setq result (car olist))))) | |
1964 (if result | |
1965 result | |
1966 (if noerror | |
1967 nil | |
1968 (ediff-update-registry) | |
1969 (error "No session info in this line"))))) | |
1970 | |
20206 | 1971 |
1972 (defun ediff-get-meta-overlay-at-pos (point) | |
1973 (if ediff-xemacs-p | |
1974 (extent-at point (current-buffer) 'ediff-meta-info) | |
1975 (let* ((overl-list (overlays-at point)) | |
1976 (overl (car overl-list))) | |
1977 (while (and overl (null (overlay-get overl 'ediff-meta-info))) | |
1978 (setq overl-list (cdr overl-list) | |
1979 overl (car overl-list))) | |
1980 overl))) | |
1981 | |
20343 | 1982 (defsubst ediff-get-session-number-at-pos (point &optional meta-buffer) |
1983 (setq meta-buffer (if (ediff-buffer-live-p meta-buffer) | |
1984 meta-buffer | |
1985 (current-buffer))) | |
1986 (ediff-with-current-buffer meta-buffer | |
1987 (ediff-overlay-get | |
1988 (ediff-get-meta-overlay-at-pos point) 'ediff-meta-session-number))) | |
20206 | 1989 |
1990 | |
1991 ;; Return location of the next meta overlay after point | |
13130 | 1992 (defun ediff-next-meta-overlay-start (point) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1993 (if (eobp) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1994 (goto-char (point-min)) |
20206 | 1995 (let ((overl (ediff-get-meta-overlay-at-pos point))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1996 (if ediff-xemacs-p |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1997 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1998 (if overl |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1999 (setq overl (next-extent overl)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2000 (setq overl (next-extent (current-buffer)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2001 (if overl |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2002 (extent-start-position overl) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2003 (point-max))) |
20206 | 2004 (if overl |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2005 ;; note: end of current overlay is the beginning of the next one |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2006 (overlay-end overl) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2007 (next-overlay-change point)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2008 )) |
13130 | 2009 |
20206 | 2010 |
13130 | 2011 (defun ediff-previous-meta-overlay-start (point) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2012 (if (bobp) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2013 (goto-char (point-max)) |
20206 | 2014 (let ((overl (ediff-get-meta-overlay-at-pos point))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2015 (if ediff-xemacs-p |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2016 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2017 (if overl |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2018 (setq overl (previous-extent overl)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2019 (setq overl (previous-extent (current-buffer)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2020 (if overl |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2021 (extent-start-position overl) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2022 (point-min))) |
20206 | 2023 (if overl (setq point (overlay-start overl))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2024 ;; to get to the beginning of prev overlay |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2025 (if (not (bobp)) |
20206 | 2026 ;; trick to overcome an emacs bug--doesn't always find previous |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2027 ;; overlay change correctly |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2028 (setq point (1- point))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2029 (setq point (previous-overlay-change point)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2030 ;; If we are not over an overlay after subtracting 1, it means we are |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2031 ;; in the description area preceding session records. In this case, |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2032 ;; goto the top of the registry buffer. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2033 (or (car (overlays-at point)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2034 (setq point (point-min))) |
20206 | 2035 point)))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2036 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2037 ;; this is the action invoked when the user selects a patch from the meta |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2038 ;; buffer. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2039 (defun ediff-patch-file-form-meta (file &optional startup-hooks) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2040 (let* ((pos (ediff-event-point last-command-event)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2041 (meta-buf (ediff-event-buffer last-command-event)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2042 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2043 (info (ediff-get-meta-info meta-buf pos)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2044 (meta-patchbuf ediff-meta-patchbufer) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2045 session-buf beg-marker end-marker) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2046 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2047 (if (or (file-directory-p file) (string-match "/dev/null" file)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2048 (error "`%s' is not an ordinary file" (file-name-as-directory file))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2049 (setq session-buf (ediff-get-session-buffer info) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2050 beg-marker (ediff-get-session-objB-name info) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2051 end-marker (ediff-get-session-objC-name info)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2052 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2053 (or (ediff-buffer-live-p session-buf) ; either an active patch session |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2054 (null session-buf) ; or it is a virgin session |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2055 (error |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2056 "Patch has been already applied to this file--cannot be repeated!")) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2057 |
19047 | 2058 (ediff-with-current-buffer meta-patchbuf |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2059 (save-restriction |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2060 (widen) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2061 (narrow-to-region beg-marker end-marker) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2062 (ediff-patch-file-internal meta-patchbuf file startup-hooks))))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2063 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2064 |
22286 | 2065 (defun ediff-unmark-all-for-operation () |
2066 "Unmark all sessions marked for operation." | |
2067 (interactive) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2068 (let ((list (cdr ediff-meta-list)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2069 elt) |
22286 | 2070 (while (setq elt (car list)) |
2071 (ediff-mark-session-for-operation elt 'unmark) | |
2072 (setq list (cdr list)))) | |
2073 (ediff-update-meta-buffer (current-buffer) 'must-redraw)) | |
2074 | |
2075 (defun ediff-unmark-all-for-hiding () | |
2076 "Unmark all sessions marked for hiding." | |
2077 (interactive) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2078 (let ((list (cdr ediff-meta-list)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2079 elt) |
22286 | 2080 (while (setq elt (car list)) |
2081 (ediff-mark-session-for-hiding elt 'unmark) | |
2082 (setq list (cdr list)))) | |
2083 (ediff-update-meta-buffer (current-buffer) 'must-redraw)) | |
2084 | |
2085 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2086 (defun ediff-meta-mark-equal-files () |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2087 "Run though the session list and mark identical files. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2088 This is used only for sessions that involve 2 or 3 files at the same time." |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2089 (interactive) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2090 (let ((list (cdr ediff-meta-list)) |
22286 | 2091 marked1 marked2 marked3 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2092 fileinfo1 fileinfo2 fileinfo3 elt) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2093 (message "Comparing files ...") |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2094 (while (setq elt (car list)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2095 (setq fileinfo1 (ediff-get-session-objA elt) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2096 fileinfo2 (ediff-get-session-objB elt) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2097 fileinfo3 (ediff-get-session-objC elt)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2098 (ediff-set-file-eqstatus fileinfo1 nil) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2099 (ediff-set-file-eqstatus fileinfo2 nil) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2100 (ediff-set-file-eqstatus fileinfo3 nil) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2101 |
22286 | 2102 (setq marked1 t |
2103 marked2 t | |
2104 marked3 t) | |
2105 (or (ediff-mark-if-equal fileinfo1 fileinfo2) | |
2106 (setq marked1 nil)) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2107 (if (ediff-metajob3) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2108 (progn |
22286 | 2109 (or (ediff-mark-if-equal fileinfo1 fileinfo3) |
2110 (setq marked2 nil)) | |
2111 (or (ediff-mark-if-equal fileinfo2 fileinfo3) | |
2112 (setq marked3 nil)))) | |
2113 (if (and marked1 marked2 marked3) | |
2114 (cond ((eq last-command-char ?h) | |
2115 (ediff-mark-session-for-hiding elt 'mark)) | |
2116 ((eq last-command-char ?m) | |
2117 (ediff-mark-session-for-operation elt 'mark)) | |
2118 )) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2119 (setq list (cdr list))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
22286
diff
changeset
|
2120 (message "Comparing files ... Done")) |
20206 | 2121 (ediff-update-meta-buffer (current-buffer) 'must-redraw)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2122 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2123 ;; mark files 1 and 2 as equal, if they are. |
22286 | 2124 ;; returns t, if something was marked |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2125 (defun ediff-mark-if-equal (fileinfo1 fileinfo2) |
20206 | 2126 (let ((f1 (car fileinfo1)) |
2127 (f2 (car fileinfo2))) | |
22286 | 2128 (cond ((file-directory-p f1) nil) |
2129 ((file-directory-p f2) nil) | |
2130 ((ediff-same-file-contents f1 f2) | |
2131 (ediff-set-file-eqstatus fileinfo1 t) | |
2132 (ediff-set-file-eqstatus fileinfo2 t) | |
2133 t)) | |
2134 )) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2135 |
13130 | 2136 |
2137 | |
2138 ;;; Local Variables: | |
2139 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | |
19047 | 2140 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
2141 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) | |
13130 | 2142 ;;; End: |
2143 | |
13607
71a4a349d998
Renamed from ediff-meta.el. Changed provide.
Richard M. Stallman <rms@gnu.org>
parents:
13216
diff
changeset
|
2144 ;;; ediff-mult.el ends here |