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