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