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