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