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