annotate lisp/ediff/ediff-mult.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 9ee227acff29
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; ediff-mult.el --- support for multi-file/multi-buffer processing in Ediff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
3 ;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; Users are encouraged to add functionality to this file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; The present file contains all the infrastructure needed for that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
29 ;; Generally, to to implement a new multisession capability within Ediff,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; you need to tell it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; 1. How to display the session group buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; This function must indicate which Ediff sessions are active (+) and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; which are finished (-).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; See ediff-redraw-directory-group-buffer for an example.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; In all likelihood, ediff-redraw-directory-group-buffer can be used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; directly or after a small modification.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; 2. What action to take when the user clicks button 2 or types v,e, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; RET. See ediff-filegroup-action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; 3. Provide a list of pairs or triples of file names (or buffers,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; depending on the particular Ediff operation you want to invoke)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; in the following format:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; (descriptor (obj1 obj2 obj3) (...) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; Actually, the format of this list is pretty much up to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; developer. The only thing is that it must be a list of lists,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; and the first list must describe the meta session, and subsequent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; elements must describe individual sessions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; This descriptor must be a list of two, three, or four elements (nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; or string). The function ediff-redraw-registry-buffer displays the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; second through last of these in the registry buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; Also, keep in mind that the function ediff-prepare-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; (which see) prepends the session group buffer to the descriptor and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; nil in front of each subsequent list (i.e., the above list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; will become
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; ((meta-buf descriptor) (nil obj1 obj2 obj3) (nil ...) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; Ediff expects that your function (in 2 above) will arrange to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; replace this prepended nil (via setcar) with the actual ediff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; control buffer associated with an appropriate Ediff session.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;; This is arranged through internal startup hooks that can be passed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;; to any of Ediff major entries (such as ediff-files, epatch, etc.).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; See how this is done in ediff-filegroup-action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; Session descriptions are of the form (obj1 obj2 obj3), which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;; describe objects relevant to the session. Usually they are names of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; files, but sometimes they may be other things. For instance, obj3 is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; nil for jobs that involve only two files. For patch jobs, obj2 and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;; obj3 are markers that specify the patch corresponding to the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; (whose name is obj1).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; 4. Write a function that makes a call to ediff-prepare-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; passing all this info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; You may be able to use ediff-directories-internal as a template.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; 5. If you intend to add several related pieces of functionality,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;; you may want to keep the function in 4 as an internal version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; and then write several top-level interactive functions that call it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;; with different parameters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; See how ediff-directories, ediff-merge-directories, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;; ediff-merge-directories-with-ancestor all use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;; ediff-directories-internal.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; A useful addition here could be session groups selected by patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;; (which are different in each directory). For instance, one may want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;; compare files of the form abc{something}.c to files old{something}.d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;; which may be in the same or different directories. Or, one may want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; compare all files of the form {something} to files of the form {something}~.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; Implementing this requires writing an collating function, which should pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; up appropriate files. It will also require a generalization of the functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; that do the layout of the meta- and differences buffers and of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; ediff-filegroup-action.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
93 (provide 'ediff-mult)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
94
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
95 ;; compiler pacifier
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
96 (eval-when-compile
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
97 (let ((load-path (cons (expand-file-name ".") load-path)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
98 (or (featurep 'ediff-init)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
99 (load "ediff-init.el" nil nil 'nosuffix))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
100 (or (featurep 'ediff-util)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
101 (load "ediff-util.el" nil nil 'nosuffix))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
102 ))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
103 ;; end pacifier
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
104
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (require 'ediff-init)
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
106 (require 'ediff-util)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (ediff-defvar-local ediff-meta-buffer nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (ediff-defvar-local ediff-parent-meta-buffer nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ;; the registry buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (defvar ediff-registry-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defconst ediff-meta-buffer-message "This is an Ediff Session Group Panel: %s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 Useful commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 button2, `v', RET over a session line: start that Ediff session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 `M':\tin any session invoked from here, brings back this group panel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 `R':\tdisplay the registry of active Ediff sessions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 `h':\tmark session for hiding (toggle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 `x':\thide marked sessions; with prefix arg--unhide hidden sessions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 `m':\tmark session for a non-hiding operation (toggle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 SPC:\tnext session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 DEL:\tprevious session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 `E':\tbrowse Ediff on-line manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 `q':\tquit this session group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (ediff-defvar-local ediff-meta-buffer-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "The keymap for the meta buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (defvar ediff-dir-diffs-buffer-map (make-sparse-keymap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 "The keymap to be installed in the buffer showing differences between
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 directories.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;; Variable specifying the action to take when the use invokes ediff in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;; meta buffer. This is usually ediff-registry-action or ediff-filegroup-action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (ediff-defvar-local ediff-meta-action-function nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;; Tells ediff-update-meta-buffer how to redraw it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (ediff-defvar-local ediff-meta-redraw-function nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 ;; Tells ediff-filegroup-action and similar procedures how to invoke Ediff for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;; the sessions in a given session group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (ediff-defvar-local ediff-session-action-function nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (ediff-defvar-local ediff-metajob-name nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; buffer used to collect custom diffs from individual sessions in the group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (ediff-defvar-local ediff-meta-diff-buffer nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;; history var to use for filtering groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (defvar ediff-filtering-regexp-history nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;; This has the form ((ctl-buf file1 file2) (stl-buf file1 file2) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; If ctl-buf is nil, the file-pair wasn't processed yet. If it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; killed-buffer object, the file pair has been processed. If it is a live
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;; buffer, this means ediff is still working on the pair
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (ediff-defvar-local ediff-meta-list nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; the difference list between directories in a directory session group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (ediff-defvar-local ediff-dir-difference-list nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (ediff-defvar-local ediff-dir-diffs-buffer nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; The registry of Ediff sessions. A list of control buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defvar ediff-session-registry nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (defvar ediff-registry-setup-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 "*Hooks run just after the registry control panel is set up.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defvar ediff-session-group-setup-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 "*Hooks run just after a meta-buffer controlling a session group, such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ediff-directories, is run.")
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
171 (defvar ediff-quit-session-group-hook nil
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
172 "*Hooks run just before exiting a session group.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (defvar ediff-show-registry-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "*Hooks run just after the registry buffer is shown.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (defvar ediff-show-session-group-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 "*Hooks run just after a session group buffer is shown.")
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
177 (defvar ediff-meta-buffer-keymap-setup-hook nil
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
178 "*Hooks run just after setting up the ediff-meta-buffer-map.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
179 This keymap controls key bindings in the meta buffer and is a local variable.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
180 This means that you can set different bindings for different kinds of meta
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
181 buffers.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;; buffer holding the multi-file patch. local to the meta buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (ediff-defvar-local ediff-meta-patchbufer nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ;;; API for ediff-meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; group buffer/regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (defun ediff-get-group-buffer (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (nth 0 (car meta-list)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
191
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (defun ediff-get-group-regexp (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (nth 1 (car meta-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;; group objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defun ediff-get-group-objA (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (nth 2 (car meta-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defun ediff-get-group-objB (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (nth 3 (car meta-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defun ediff-get-group-objC (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (nth 4 (car meta-list)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
201 (defun ediff-get-group-merge-autostore-dir (meta-list)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
202 (nth 5 (car meta-list)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
203
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;; session buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defun ediff-get-session-buffer (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (nth 0 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defun ediff-get-session-status (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (nth 1 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defun ediff-set-session-status (session-info new-status)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (setcar (cdr session-info) new-status))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;; session objects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (defun ediff-get-session-objA (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (nth 2 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defun ediff-get-session-objB (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (nth 3 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (defun ediff-get-session-objC (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (nth 4 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (defun ediff-get-session-objA-name (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (car (nth 2 elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (defun ediff-get-session-objB-name (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (car (nth 3 elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (defun ediff-get-session-objC-name (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (car (nth 4 elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;; equality indicators
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (defsubst ediff-get-file-eqstatus (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (nth 1 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defsubst ediff-set-file-eqstatus (elt value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (setcar (cdr elt) value))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ;; set up the keymap in the meta buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (defun ediff-setup-meta-map()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (setq ediff-meta-buffer-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (suppress-keymap ediff-meta-buffer-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (define-key ediff-meta-buffer-map "R" 'ediff-show-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (define-key ediff-meta-buffer-map "E" 'ediff-documentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (define-key ediff-meta-buffer-map "v" ediff-meta-action-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (define-key ediff-meta-buffer-map "\C-m" ediff-meta-action-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (define-key ediff-meta-buffer-map " " 'ediff-next-meta-item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (define-key ediff-meta-buffer-map "\C-?" 'ediff-previous-meta-item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (define-key ediff-meta-buffer-map [delete] 'ediff-previous-meta-item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (define-key ediff-meta-buffer-map [backspace] 'ediff-previous-meta-item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (or (ediff-one-filegroup-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (define-key ediff-meta-buffer-map "=" 'ediff-meta-mark-equal-files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (if ediff-no-emacs-help-in-control-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (define-key ediff-meta-buffer-map "\C-h" 'ediff-previous-meta-item))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (if ediff-emacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (define-key ediff-meta-buffer-map [mouse-2] ediff-meta-action-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (define-key ediff-meta-buffer-map [button2] ediff-meta-action-function))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
251 (use-local-map ediff-meta-buffer-map)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
252 ;; modify ediff-meta-buffer-map here
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
253 (run-hooks 'ediff-meta-buffer-keymap-setup-hook))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (defun ediff-meta-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 "This mode controls all operations on Ediff session groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 It is entered through one of the following commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 `ediff-directories'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 `edirs'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 `ediff-directories3'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 `edirs3'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 `ediff-merge-directories'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 `edirs-merge'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 `ediff-merge-directories-with-ancestor'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 `edirs-merge-with-ancestor'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 `ediff-directory-revisions'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 `edir-revisions'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 `ediff-merge-directory-revisions'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 `edir-merge-revisions'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 `ediff-merge-directory-revisions-with-ancestor'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 `edir-merge-revisions-with-ancestor'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 Commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 \\{ediff-meta-buffer-map}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (setq major-mode 'ediff-meta-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (setq mode-name "MetaEdiff"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ;; the keymap for the buffer showing directory differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (suppress-keymap ediff-dir-diffs-buffer-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (define-key ediff-dir-diffs-buffer-map "q" 'ediff-bury-dir-diffs-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (define-key ediff-dir-diffs-buffer-map " " 'next-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (define-key ediff-dir-diffs-buffer-map "\C-?" 'previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (define-key ediff-dir-diffs-buffer-map [delete] 'previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (define-key ediff-dir-diffs-buffer-map [backspace] 'previous-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (defun ediff-next-meta-item (count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 "Move to the next item in Ediff registry or session group buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 Moves in circular fashion. With numeric prefix arg, skip this many items."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (or count (setq count 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (while (< 0 count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (setq count (1- count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (ediff-next-meta-item1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ;; Move to the next meta item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (defun ediff-next-meta-item1 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (let (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (setq pos (ediff-next-meta-overlay-start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ;;; ;; skip deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 ;;; (while (memq (ediff-get-session-status
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ;;; (ediff-get-meta-info (current-buffer) pos 'noerror))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ;;; '(?H ?I))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ;;; (setq pos (ediff-next-meta-overlay-start pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (if pos (goto-char pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (if (eq ediff-metajob-name 'ediff-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (if (and (ediff-get-meta-info (current-buffer) pos 'noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (search-forward "*Ediff" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (skip-chars-backward "a-zA-Z*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (if (> (skip-chars-forward "-+?H* \t0-9") 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (backward-char 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (defun ediff-previous-meta-item (count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 "Move to the previous item in Ediff registry or session group buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 Moves in circular fashion. With numeric prefix arg, skip this many items."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (or count (setq count 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (while (< 0 count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (setq count (1- count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (ediff-previous-meta-item1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (defun ediff-previous-meta-item1 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (let (pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (setq pos (ediff-previous-meta-overlay-start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ;;; ;; skip deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ;;; (while (ediff-get-session-status
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ;;; (ediff-get-meta-info (current-buffer) pos 'noerror))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 ;;; (setq pos (ediff-previous-meta-overlay-start pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (if pos (goto-char pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (if (eq ediff-metajob-name 'ediff-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (if (and (ediff-get-meta-info (current-buffer) pos 'noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (search-forward "*Ediff" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (skip-chars-backward "a-zA-Z*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (if (> (skip-chars-forward "-+?H* \t0-9") 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (backward-char 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
342 (defsubst ediff-add-slash-if-directory (dir file)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
343 (if (file-directory-p (concat dir file))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
344 (file-name-as-directory file)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
345 file))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
348 ;; DIR1, DIR2, DIR3 are directories. DIR3 can be nil.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
349 ;; OUTPUT-DIR is a directory for auto-storing the results of merge jobs.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
350 ;; Can be nil.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
351 ;; REGEXP is a regexp used to filter out files in the directories.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ;; If a file is a directory in dir1 but not dir2 (or vice versa), it is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 ;; included in the intersection. However, a regular file that is a dir in dir3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 ;; is included, since dir3 files are supposed to be ancestors for merging.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 ;; Returns a list of the form:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 ;; ((dir1 dir2 dir3) (f1 f2 f3) (f1 f2 f3) ...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 ;; dir3, f3 can be nil if intersecting only 2 directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 ;; If COMPARISON-FUNC is given, use it. Otherwise, use string=
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
359 ;; DIFF-VAR contains the name of the variable in which to return the
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
360 ;; difference list (which represents the differences among the contents of
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
361 ;; directories). The diff list is of the form:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;; ((dir1 dir2 dir3) (file . num) (file . num)...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ;; where num encodes the set of dirs where the file is found:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 ;; 2 - only dir1; 3 - only dir2; 5 - only dir3; 6 - dir1&2; 10 - dir1&3; etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (defun ediff-intersect-directories (jobname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 diff-var regexp dir1 dir2
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
367 &optional
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
368 dir3 merge-autostore-dir comparison-func)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (setq comparison-func (or comparison-func 'string=))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (let (lis1 lis2 lis3 common auxdir1 auxdir2 auxdir3 difflist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (setq auxdir1 (file-name-as-directory dir1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 lis1 (directory-files auxdir1 nil regexp)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
374 lis1 (delete "." lis1)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
375 lis1 (delete ".." lis1)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
376 lis1 (mapcar
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
377 (function
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
378 (lambda (elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
379 (ediff-add-slash-if-directory auxdir1 elt)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
380 lis1)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 auxdir2 (file-name-as-directory dir2)
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
382 lis2 (mapcar
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
383 (function
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
384 (lambda (elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
385 (ediff-add-slash-if-directory auxdir2 elt)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
386 (directory-files auxdir2 nil regexp)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (if (stringp dir3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (setq auxdir3 (file-name-as-directory dir3)
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
390 lis3 (mapcar
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
391 (function
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
392 (lambda (elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
393 (ediff-add-slash-if-directory auxdir3 elt)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
394 (directory-files auxdir3 nil regexp))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
396 (if (stringp merge-autostore-dir)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
397 (setq merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
398 (file-name-as-directory merge-autostore-dir)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (setq common (ediff-intersection lis1 lis2 comparison-func))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
400
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
401 ;; In merge with ancestor jobs, we don't intersect with lis3.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
402 ;; If there is no ancestor, we'll offer to merge without the ancestor.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
403 ;; So, we intersect with lis3 only when we are doing 3-way file comparison
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
404 (if (and lis3 (ediff-comparison-metajob3 jobname))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
405 (setq common (ediff-intersection common lis3 comparison-func)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 ;; copying is needed because sort sorts via side effects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (setq common (sort (ediff-copy-list common) 'string-lessp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;; compute difference list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (setq difflist (ediff-set-difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (ediff-union (ediff-union lis1 lis2 comparison-func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 lis3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 comparison-func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 common
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 comparison-func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 difflist (delete "." difflist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 ;; copying is needed because sort sorts via side effects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 difflist (sort (ediff-copy-list (delete ".." difflist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 'string-lessp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (setq difflist (mapcar (function (lambda (elt) (cons elt 1))) difflist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ;; check for files belonging to lis1/2/3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (mapcar (function (lambda (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (if (member (car elt) lis1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (setcdr elt (* (cdr elt) 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (if (member (car elt) lis2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (setcdr elt (* (cdr elt) 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (if (member (car elt) lis3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (setcdr elt (* (cdr elt) 5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 difflist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (setq difflist (cons (list regexp auxdir1 auxdir2 auxdir3) difflist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
436 ;; return the difference list back to the calling function
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (set diff-var difflist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 ;; return result
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
440 (cons (list regexp auxdir1 auxdir2 auxdir3 merge-autostore-dir)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
441 (mapcar
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
442 (function
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
443 (lambda (elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
444 (list (concat auxdir1 elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
445 (concat auxdir2 elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
446 (if lis3
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
447 (progn
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
448 ;; The following is done because:
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
449 ;; In merging with ancestor, we don't intersect
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
450 ;; with lis3. So, it is possible that elt is a
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
451 ;; file in auxdir1/2 but a directory in auxdir3
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
452 ;; Or elt may not exist in auxdir3 at all.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
453 ;; In the first case, we add a slash at the end.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
454 ;; In the second case, we insert nil.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
455 (setq elt (ediff-add-slash-if-directory auxdir3 elt))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
456 (if (file-exists-p (concat auxdir3 elt))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
457 (concat auxdir3 elt)))))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
458 common))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 ;; find directory files that are under revision.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
462 ;; Include subdirectories, since we may visit them recursively.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
463 ;; DIR1 is the directory to inspect.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
464 ;; OUTPUT-DIR is the directory where to auto-store the results of merges. Can
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
465 ;; be nil.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
466 (defun ediff-get-directory-files-under-revision (jobname
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
467 regexp dir1
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
468 &optional merge-autostore-dir)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (let (lis1 elt common auxdir1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (setq auxdir1 (file-name-as-directory dir1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 lis1 (directory-files auxdir1 nil regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
473 (if (stringp merge-autostore-dir)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
474 (setq merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
475 (file-name-as-directory merge-autostore-dir)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
476
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (while lis1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (setq elt (car lis1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 lis1 (cdr lis1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 ;; take files under revision control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (cond ((file-directory-p (concat auxdir1 elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (setq common (cons elt common)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 ((file-exists-p (concat auxdir1 elt ",v"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (setq common (cons elt common)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 ((file-exists-p (concat auxdir1 "RCS/" elt ",v"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (setq common (cons elt common)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 ) ; cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ) ; while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (setq common (delete "." common)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
491 common (delete ".." common)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
492 common (delete "RCS" common))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 ;; copying is needed because sort sorts via side effects
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (setq common (sort (ediff-copy-list common) 'string-lessp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ;; return result
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
498 (cons (list regexp auxdir1 nil nil merge-autostore-dir)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (mapcar (function (lambda (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (list (concat auxdir1 elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 nil nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 common))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 ;; If file groups selected by patterns will ever be implemented, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 ;; comparison function might become useful.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 ;;;; uses external variables PAT1 PAT2 to compare str1/2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 ;;;; patterns must be of the form ???*???? where ??? are strings of chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 ;;;; containing no *.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 ;;(defun ediff-pattern= (str1 str2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ;; (let (pos11 pos12 pos21 pos22 len1 len2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 ;; (setq pos11 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 ;; len (length epat1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 ;; pos12 len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 ;; (while (and (< pos11 len) (not (= (aref epat1 pos11) ?*)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 ;; (setq pos11 (1+ pos11)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 ;; (while (and (> pos12 0) (not (= (aref epat1 (1- pos12)) ?*)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 ;; (setq pos12 (1- pos12)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 ;; (setq pos21 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 ;; len (length epat2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ;; pos22 len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 ;; (while (and (< pos21 len) (not (= (aref epat2 pos21) ?*)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ;; (setq pos21 (1+ pos21)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 ;; (while (and (> pos22 0) (not (= (aref epat2 (1- pos22)) ?*)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ;; (setq pos22 (1- pos22)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 ;; (if (and (> (length str1) pos12) (>= pos12 pos11) (> pos11 -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 ;; (> (length str2) pos22) (>= pos22 pos21) (> pos21 -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 ;; (string= (substring str1 pos11 pos12)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 ;; (substring str2 pos21 pos22)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 ;; ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 ;; Prepare meta-buffer in accordance with the argument-function and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 ;; redraw-function. Must return the created meta-buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (defun ediff-prepare-meta-buffer (action-func meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 meta-buffer-name redraw-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 jobname &optional startup-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (let* ((meta-buffer-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (ediff-unique-buffer-name meta-buffer-name "*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (meta-buffer (get-buffer-create meta-buffer-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (ediff-eval-in-buffer meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 ;; comes first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (ediff-meta-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (setq ediff-meta-action-function action-func
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 ediff-meta-redraw-function redraw-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ediff-metajob-name jobname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 ediff-meta-buffer meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 ;; comes after ediff-meta-action-function is set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (ediff-setup-meta-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (if (eq ediff-metajob-name 'ediff-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (setq ediff-registry-buffer meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 ediff-meta-list meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 ;; this func is used only from registry buffer, not from other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 ;; meta-buffs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (define-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ediff-meta-buffer-map "M" 'ediff-show-meta-buff-from-registry))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
565 ;; Initialize the meta list -- don't do this for registry.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
566 ;;
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
567 ;; We prepend '(nil nil) to all elts of meta-list, except the first.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
568 ;; The first nil will later be replaced by the session buffer. The
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
569 ;; second is reserved for session status.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
570 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;; (car ediff-meta-list) gets cons'ed with the session group buffer.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
572 ;; Also, session objects A/B/C are turned into lists of the form
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
573 ;; (obj eq-indicator). Eq-indicator is either nil or =. Initialized to
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
574 ;; nil. If later it is discovered that this file is = to some other
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
575 ;; file in the same session, eq-indicator is changed to `='.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 ;; For now, the eq-indicator is used only for 2 and 3-file jobs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (setq ediff-meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (cons (cons meta-buffer (car meta-list))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
579 (mapcar
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
580 (function
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
581 (lambda (elt)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
582 (cons nil
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
583 (cons nil
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
584 ;; convert each obj to (obj nil),
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
585 ;; where nil is the initial value
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
586 ;; for eq-indicator -- see above
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
587 (mapcar
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
588 (function (lambda (obj) (list obj nil)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
589 elt)))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
590 (cdr meta-list)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (or (eq meta-buffer ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (setq ediff-session-registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (cons meta-buffer ediff-session-registry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ;; redraw-function uses ediff-meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (funcall redraw-function ediff-meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ;; set read-only/non-modified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (run-hooks 'startup-hooks)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
604
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
605 ;; Arrange to show directory contents differences
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
606 ;; Must be after run startup-hooks, since ediff-dir-difference-list is
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 ;; set inside these hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (if (eq action-func 'ediff-filegroup-action)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 ;; put meta buffer in (car ediff-dir-difference-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 (setq ediff-dir-difference-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 (cons (cons meta-buffer (car ediff-dir-difference-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (cdr ediff-dir-difference-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (or (ediff-one-filegroup-metajob jobname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (ediff-draw-dir-diffs ediff-dir-difference-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (define-key ediff-meta-buffer-map "h" 'ediff-mark-for-hiding)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (define-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 ediff-meta-buffer-map "x" 'ediff-hide-marked-sessions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (define-key ediff-meta-buffer-map "m" 'ediff-mark-for-operation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (cond ((ediff-collect-diffs-metajob jobname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (define-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ediff-meta-buffer-map "P" 'ediff-collect-custom-diffs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ((ediff-patch-metajob jobname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (define-key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ediff-meta-buffer-map "P" 'ediff-meta-show-patch)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (define-key ediff-meta-buffer-map "u" 'ediff-up-meta-hierarchy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (define-key ediff-meta-buffer-map "D" 'ediff-show-dir-diffs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (if (eq ediff-metajob-name 'ediff-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (run-hooks 'ediff-registry-setup-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (run-hooks 'ediff-session-group-setup-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 ) ; eval in meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 meta-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 ;; this is a setup function for ediff-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 ;; must return meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (defun ediff-redraw-directory-group-buffer (meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 ;; extract directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (let ((meta-buf (ediff-get-group-buffer meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (empty t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (sessionNum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 regexp elt session-buf f1 f2 f3 pt
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
645 merge-autostore-dir
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 point tmp-list buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (ediff-eval-in-buffer meta-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (setq point (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (insert (format ediff-meta-buffer-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (ediff-abbrev-jobname ediff-metajob-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
653 (setq regexp (ediff-get-group-regexp meta-list)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
654 merge-autostore-dir (ediff-get-group-merge-autostore-dir meta-list))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (cond ((ediff-collect-diffs-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 " `P':\tcollect custom diffs of all marked sessions\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 ((ediff-patch-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 " `P':\tshow patch appropriately for the context (session or group)\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 " `u':\tshow parent session group\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (or (ediff-one-filegroup-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 " `D':\tshow differences among directories\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 " `=':\tmark identical files in each session\n\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (if (and (stringp regexp) (> (length regexp) 0))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
670 (insert
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
671 (format "\n*** Filter-through regular expression: %s\n" regexp)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
672 (if (and ediff-autostore-merges (ediff-merge-metajob)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
673 (stringp merge-autostore-dir))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
674 (insert (format
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
675 "\nMerges are automatically stored in directory: %s\n"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
676 merge-autostore-dir)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (insert "\n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 Size Last modified Name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 -----------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 ;; discard info on directories and regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (setq meta-list (cdr meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 tmp-list meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (while (and tmp-list empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (if (and (car tmp-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (not (eq (ediff-get-session-status (car tmp-list)) ?I)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 (setq empty nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (setq tmp-list (cdr tmp-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (if empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 " ****** ****** This session group has no members\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 ;; now organize file names like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 ;; use-mark sizeA dateA sizeB dateB filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 ;; make sure directories are displayed with a trailing slash.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (while meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (setq elt (car meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 meta-list (cdr meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 sessionNum (1+ sessionNum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (if (eq (ediff-get-session-status elt) ?I)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (setq session-buf (ediff-get-session-buffer elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 f1 (ediff-get-session-objA elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 f2 (ediff-get-session-objB elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 f3 (ediff-get-session-objC elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (setq pt (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 ;; insert markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (insert (cond ((null session-buf) " ") ; virgin session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 ((ediff-buffer-live-p session-buf) "+") ;active session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (t "-"))) ; finished session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (insert (cond ((ediff-get-session-status elt)) ; session has status,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 ;;; e.g., ?H, ?I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (t " "))) ; normal session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (insert " Session " (int-to-string sessionNum) ":\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (ediff-meta-insert-file-info f1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (ediff-meta-insert-file-info f2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (ediff-meta-insert-file-info f3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (ediff-set-meta-overlay pt (point) elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (goto-char point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 meta-buf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 ;; Check if this is a problematic session.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 ;; Return nil if not. Otherwise, return symbol representing the problem
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 ;; At present, problematic sessions occur only in -with-ancestor comparisons
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
729 ;; when the ancestor is a directory rather than a file, or when there is no
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
730 ;; suitable ancestor file in the ancestor directory
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (defun ediff-problematic-session-p (session)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (let ((f1 (ediff-get-session-objA-name session))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (f2 (ediff-get-session-objB-name session))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (f3 (ediff-get-session-objC-name session)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (cond ((and (stringp f1) (not (file-directory-p f1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (stringp f2) (not (file-directory-p f2))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
737 ;; either invalid file name or a directory
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
738 (or (not (stringp f3)) (file-directory-p f3))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (ediff-ancestor-metajob))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 ;; more may be added later
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 'ancestor-is-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (t nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (defun ediff-meta-insert-file-info (fileinfo)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
745 (let ((fname (car fileinfo))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (feq (ediff-get-file-eqstatus fileinfo))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
747 file-modtime file-size)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
749 (cond ((not (stringp fname)) (setq file-size -2)) ; file doesn't exits
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
750 ((not (ediff-file-remote-p fname))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
751 (if (file-exists-p fname)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
752 ;; set real size and modtime
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
753 (setq file-size (ediff-file-size fname)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
754 file-modtime (ediff-file-modtime fname))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
755 (setq file-size -2))) ; file doesn't exist
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
756 ( t (setq file-size -1))) ; remote file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (if (stringp fname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 "%s %s %-20s %s\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 (if feq "=" " ") ; equality indicator
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
762 (format "%10s" (cond ((= file-size -1) "--")
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
763 ((< file-size -1) "--")
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
764 (t file-size)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
765 (cond ((= file-size -1) "*remote file*")
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
766 ((< file-size -1) "*file doesn't exist*")
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
767 (t (ediff-format-date (decode-time file-modtime))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
768
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
769 ;; dir names in meta lists have training slashes, so we just
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
770 ;; abbreviate the file name, if file exists
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
771 (if (and (not (stringp fname)) (< file-size -1))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
772 "-------" ; file doesn't exist
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
773 (ediff-abbreviate-file-name fname)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (defconst ediff-months '((1 . "Jan") (2 . "Feb") (3 . "Mar") (4 . "Apr")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (5 . "May") (6 . "Jun") (7 . "Jul") (8 . "Aug")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (9 . "Sep") (10 . "Oct") (11 . "Nov") (12 . "Dec"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 "Months' associative array.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
780 ;; returns 2char string
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
781 (defsubst ediff-fill-leading-zero (num)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
782 (if (< num 10)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
783 (format "0%d" num)
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
784 (number-to-string num)))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
785
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 ;; TIME is like the output of decode-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (defun ediff-format-date (time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (format "%s %2d %4d %s:%s:%s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (cdr (assoc (nth 4 time) ediff-months)) ; month
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (nth 3 time) ; day
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (nth 5 time) ; year
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (ediff-fill-leading-zero (nth 2 time)) ; hour
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (ediff-fill-leading-zero (nth 1 time)) ; min
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (ediff-fill-leading-zero (nth 0 time)) ; sec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (defun ediff-draw-dir-diffs (diff-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (if (null diff-list) (error "Lost difference info on these directories"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (let* ((buf-name (ediff-unique-buffer-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 "*Ediff File Group Differences" "*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (regexp (ediff-get-group-regexp diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (dir1 (ediff-abbreviate-file-name (ediff-get-group-objA diff-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (dir2 (ediff-abbreviate-file-name (ediff-get-group-objB diff-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (dir3 (ediff-get-group-objC diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (dir3 (if (stringp dir3) (ediff-abbreviate-file-name dir3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (meta-buf (ediff-get-group-buffer diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (underline (make-string 26 ?-))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 file code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 ;; skip the directory part
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (setq diff-list (cdr diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (setq ediff-dir-diffs-buffer (get-buffer-create buf-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (ediff-eval-in-buffer ediff-dir-diffs-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (use-local-map ediff-dir-diffs-buffer-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (setq ediff-meta-buffer meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (insert "\t\t*** Directory Differences ***\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (insert "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 Useful commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 `q': hide this buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 SPC: next line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 DEL: previous line\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 (if (and (stringp regexp) (> (length regexp) 0))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
825 (insert
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
826 (format "\n*** Filter-through regular expression: %s\n" regexp)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 (insert (format "\n%-27s%-26s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 (file-name-as-directory dir1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 25)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (file-name-as-directory dir2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 25)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (if dir3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (insert (format " %-25s\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (file-name-as-directory dir3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 25)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (insert (format "%s%s" underline underline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (if (stringp dir3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 (insert (format "%s\n\n" underline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (insert "\n\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 (if (null diff-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (insert "\n\t*** No differences ***\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (while diff-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (setq file (car (car diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 code (cdr (car diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 diff-list (cdr diff-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (if (= (mod code 2) 0) ; dir1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (insert (format "%-27s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (if (file-directory-p (concat dir1 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (file-name-as-directory file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 24)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (insert (format "%-27s" "---")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (if (= (mod code 3) 0) ; dir2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (insert (format "%-26s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (if (file-directory-p (concat dir2 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (file-name-as-directory file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 24)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (insert (format "%-26s" "---")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (if (stringp dir3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (if (= (mod code 5) 0) ; dir3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (insert (format " %-25s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (ediff-truncate-string-left
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (if (file-directory-p (concat dir3 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (file-name-as-directory file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 24)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (insert (format " %-25s" "---"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (set-buffer-modified-p nil)) ; eval in diff buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (defun ediff-bury-dir-diffs-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 "Bury the directory difference buffer. Display the meta buffer instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (let ((buf ediff-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 wind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (bury-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (if (setq wind (ediff-get-visible-buffer-window buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 (select-window wind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 (set-window-buffer (selected-window) buf))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 ;; executes in dir session group buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 ;; show buffer differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (defun ediff-show-dir-diffs ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 "Display differences among the directories involved in session group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (if (ediff-one-filegroup-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 (error "This command is inapplicable in the present context"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (or (ediff-buffer-live-p ediff-dir-diffs-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (ediff-draw-dir-diffs ediff-dir-difference-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 (let ((buf ediff-dir-diffs-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (set-window-buffer (selected-window) buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (goto-char (point-min))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (defun ediff-up-meta-hierarchy ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 "Go to the parent session group buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 (if (ediff-buffer-live-p ediff-parent-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 (ediff-show-meta-buffer ediff-parent-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 (error "This session group has no parent")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 ;; argument is ignored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 (defun ediff-redraw-registry-buffer (&optional ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (ediff-eval-in-buffer ediff-registry-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (let ((point (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 elt bufAname bufBname bufCname cur-diff total-diffs pt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 job-name meta-list registry-list buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (insert "This is a registry of all active Ediff sessions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 Useful commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 button2, `v', RET over a session record: switch to that session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 `M' over a session record: display the associated session group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 `R' in any Ediff session: display session registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 SPC:\tnext session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 DEL:\tprevious session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 `E':\tbrowse Ediff on-line manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 `q':\tbury registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 \t\tActive Ediff Sessions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 \t\t----------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 ;; purge registry list from dead buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 (mapcar (function (lambda (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (if (not (ediff-buffer-live-p elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 (setq ediff-session-registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (delq elt ediff-session-registry)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 ediff-session-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (if (null ediff-session-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (insert " ******* No active Ediff sessions *******\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (setq registry-list ediff-session-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (while registry-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (setq elt (car registry-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 registry-list (cdr registry-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (if (ediff-buffer-live-p elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (if (ediff-eval-in-buffer elt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (setq job-name ediff-metajob-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 meta-list ediff-meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (and ediff-metajob-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (not (eq ediff-metajob-name 'ediff-registry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (setq pt (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (insert (format " *group*\t%s: %s\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (buffer-name elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (ediff-abbrev-jobname job-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (insert (format "\t\t %s %s %s\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (ediff-get-group-objA meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (if (stringp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (ediff-get-group-objB meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (ediff-get-group-objB meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (ediff-abbreviate-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (if (stringp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (ediff-get-group-objC meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 (ediff-get-group-objC meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 (ediff-set-meta-overlay pt (point) elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (ediff-eval-in-buffer elt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (setq bufAname (if (ediff-buffer-live-p ediff-buffer-A)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (buffer-name ediff-buffer-A)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 "!!!killed buffer!!!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 bufBname (if (ediff-buffer-live-p ediff-buffer-B)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (buffer-name ediff-buffer-B)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 "!!!killed buffer!!!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 bufCname (cond ((not (ediff-3way-job))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 ((ediff-buffer-live-p ediff-buffer-C)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 (buffer-name ediff-buffer-C))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (t "!!!killed buffer!!!")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (setq total-diffs (format "%-4d" ediff-number-of-differences)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 cur-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (cond ((= ediff-current-difference -1) " _")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 ((= ediff-current-difference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 ediff-number-of-differences)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 " $")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (t (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 "%4d" (1+ ediff-current-difference))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 job-name ediff-job-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 ;; back in the meta buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (setq pt (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (insert cur-diff "/" total-diffs "\t"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (buffer-name elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (format ": %s" (ediff-abbrev-jobname job-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 "\n\t\t " bufAname " " bufBname " " bufCname "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (ediff-set-meta-overlay pt (point) elt))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 ) ; while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (goto-char point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 ;; sets overlay around a meta record with 'ediff-meta-info property PROP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 (defun ediff-set-meta-overlay (b e prop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 (let (overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (setq overl (ediff-make-overlay b e))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 (if ediff-emacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (ediff-overlay-put overl 'mouse-face 'highlight)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (ediff-overlay-put overl 'highlight t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (ediff-overlay-put overl 'ediff-meta-info prop)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (defun ediff-mark-for-hiding (unmark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 "Mark session for hiding. With prefix arg, unmark."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (info (ediff-get-meta-info meta-buf pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (session-buf (ediff-get-session-buffer info)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (if (eq (ediff-get-session-status info) ?H)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (setq unmark t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 (if unmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (ediff-set-session-status info nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 (if (ediff-buffer-live-p session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 (error "Can't hide active session, %s" (buffer-name session-buf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (ediff-set-session-status info ?H))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 (or unmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (ediff-next-meta-item 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (ediff-update-meta-buffer meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (defun ediff-mark-for-operation (unmark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 "Mark session for a group operation. With prefix arg, unmark."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (info (ediff-get-meta-info meta-buf pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 (if (eq (ediff-get-session-status info) ?*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (setq unmark t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 (if unmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 (ediff-set-session-status info nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (ediff-set-session-status info ?*))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (or unmark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (ediff-next-meta-item 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (ediff-update-meta-buffer meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (defun ediff-hide-marked-sessions (unhide)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 "Hide marked sessions. With prefix arg, unhide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (let ((grp-buf (ediff-get-group-buffer ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (meta-list (cdr ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 (from (if unhide ?I ?H))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 (to (if unhide ?H ?I))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 (numMarked 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 active-sessions-exist session-buf elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 (while meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 (setq elt (car meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 meta-list (cdr meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 session-buf (ediff-get-session-buffer elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (if (eq (ediff-get-session-status elt) from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (setq numMarked (1+ numMarked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 (if (and (eq to ?I) (buffer-live-p session-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 ;; shouldn't hide active sessions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 (setq active-sessions-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 (ediff-set-session-status elt to)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (if (> numMarked 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 (ediff-update-meta-buffer grp-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (if unhide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (message "Nothing to reveal...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (message "Nothing to hide...")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 (if active-sessions-exist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (message "Note: didn't hide active sessions!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 ;; Apply OPERATION to marked sessions. Operation expects one argument of type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 ;; meta-list member (not the first one), i.e., a regular session description.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 ;; Returns number of marked sessions on which operation was performed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (defun ediff-operate-on-marked-sessions (operation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 (let ((grp-buf (ediff-get-group-buffer ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 (meta-list (cdr ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 (marksym ?*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (numMarked 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 (sessionNum 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (while meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 (setq elt (car meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 meta-list (cdr meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 sessionNum (1+ sessionNum))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (if (eq (ediff-get-session-status elt) marksym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (setq numMarked (1+ numMarked))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (funcall operation elt sessionNum))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 (ediff-update-meta-buffer grp-buf) ; just in case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 numMarked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (defun ediff-append-custom-diff (session sessionNum)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 (or (ediff-collect-diffs-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 (error "Sorry, I don't do this for everyone..."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (let ((session-buf (ediff-get-session-buffer session))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 (meta-diff-buff ediff-meta-diff-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 (metajob ediff-metajob-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 tmp-buf custom-diff-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (if (ediff-buffer-live-p session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 (ediff-eval-in-buffer session-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 (if (eq ediff-control-buffer session-buf) ; individual session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 (ediff-compute-custom-diffs-maybe)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 (setq custom-diff-buf ediff-custom-diff-buffer)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 (or (ediff-buffer-live-p meta-diff-buff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (error "Ediff: something wrong--no multiple diffs buffer"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (cond ((ediff-buffer-live-p custom-diff-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 (set-buffer meta-diff-buff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (insert-buffer custom-diff-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (insert "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 ((memq metajob '(ediff-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 ediff-merge-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 ediff-merge-directories-with-ancestor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 ;; get diffs by calling shell command on ediff-custom-diff-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (set-buffer (setq tmp-buf (get-buffer-create ediff-tmp-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 (shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (format "%s %s %s %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 ediff-custom-diff-program ediff-custom-diff-options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 (ediff-get-session-objA-name session)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 (ediff-get-session-objB-name session))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 (set-buffer meta-diff-buff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (insert-buffer tmp-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (insert "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (error "Can't make context diff for Session %d" sessionNum )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (defun ediff-collect-custom-diffs ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 "Collect custom diffs of marked sessions in buffer `*Ediff Multifile Diffs*'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 This operation is defined only for `ediff-directories' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 `ediff-directory-revisions', since its intent is to produce
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 multifile patches. For `ediff-directory-revisions', we insist that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 all marked sessions must be active."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (or (ediff-buffer-live-p ediff-meta-diff-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (setq ediff-meta-diff-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (ediff-unique-buffer-name "*Ediff Multifile Diffs" "*"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (ediff-eval-in-buffer ediff-meta-diff-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (erase-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (if (> (ediff-operate-on-marked-sessions 'ediff-append-custom-diff) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 ;; did something
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (display-buffer ediff-meta-diff-buffer 'not-this-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (message "No marked sessions found")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (defun ediff-meta-show-patch ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 "Show the multi-file patch associated with this group session."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (info (ediff-get-meta-info meta-buf pos 'noerror))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 (patchbuffer ediff-meta-patchbufer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (if (ediff-buffer-live-p patchbuffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 (ediff-eval-in-buffer patchbuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (if (not info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (narrow-to-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 (ediff-get-session-objB-name info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (ediff-get-session-objC-name info)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (set-buffer (get-buffer-create ediff-tmp-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (insert-buffer patchbuffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (display-buffer ediff-tmp-buffer 'not-this-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (error "The patch buffer wasn't found"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 ;; This function executes in meta buffer. It knows where event happened.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (defun ediff-filegroup-action ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 "Execute appropriate action for the selected session."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 (info (ediff-get-meta-info meta-buf pos))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 12
diff changeset
1215 merge-autostore-dir
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 session-buf file1 file2 file3 regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 (setq session-buf (ediff-get-session-buffer info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 file1 (ediff-get-session-objA-name info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 file2 (ediff-get-session-objB-name info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 file3 (ediff-get-session-objC-name info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 ;; make sure we don't start on hidden sessions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 ;; ?H means marked for hiding. ?I means invalid (hidden).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 (if (memq (ediff-get-session-status info) '(?I))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 (if (y-or-n-p "This session is marked as hidden, unmark? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 (ediff-set-session-status info nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (ediff-update-meta-buffer meta-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 (error "Aborted"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (ediff-eval-in-buffer meta-buf
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1235 (setq merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1236 (ediff-get-group-merge-autostore-dir ediff-meta-list))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 (goto-char pos) ; if the user clicked on session--move point there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 ;; First handle sessions involving directories (which are themselves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 ;; session groups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 ;; After that handle individual sessions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 (cond ((and (file-directory-p file1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (stringp file2) (file-directory-p file2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (if (stringp file3) (file-directory-p file1) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 ;; do ediff/ediff-merge on subdirectories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (if (ediff-buffer-live-p session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (ediff-show-meta-buffer session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (setq regexp (read-string "Filter through regular expression: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 nil 'ediff-filtering-regexp-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (ediff-directories-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 file1 file2 file3 regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 ediff-session-action-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 ediff-metajob-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 ;; make it update car info after startup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 (` (list (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 ;; child session group should know its parent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 (setq ediff-parent-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 (quote (, ediff-meta-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 ;; and parent will know its child
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (setcar (quote (, info)) ediff-meta-buffer)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 ;; Do ediff-revision on a subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 ((and (ediff-one-filegroup-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (ediff-revision-metajob)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 (file-directory-p file1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 (if (ediff-buffer-live-p session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (ediff-show-meta-buffer session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 (setq regexp (read-string "Filter through regular expression: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 nil 'ediff-filtering-regexp-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (ediff-directory-revisions-internal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 file1 regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 ediff-session-action-function ediff-metajob-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 ;; make it update car info after startup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 (` (list (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 ;; child session group should know its parent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (setq ediff-parent-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 (quote (, ediff-meta-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 ;; and parent will know its child
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (setcar (quote (, info)) ediff-meta-buffer)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 ;; From here on---only individual session handlers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 ;; handle an individual session with a live control buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 ((ediff-buffer-live-p session-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (ediff-eval-in-buffer session-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (setq ediff-mouse-pixel-position (mouse-pixel-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (ediff-recenter 'no-rehighlight)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 ((ediff-problematic-session-p info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 (if (y-or-n-p
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1291 "This session has no ancestor. Merge without the ancestor? ")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (ediff-merge-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 file1 file2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 ;; provide startup hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (` (list (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (setq ediff-meta-buffer (, (current-buffer)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1297 (setq ediff-merge-store-file
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1298 (, (concat
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1299 merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1300 "mrg_"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1301 (file-name-nondirectory file1))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1302 ;; make ediff-startup pass
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1303 ;; ediff-control-buffer back to the meta
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1304 ;; level; see below
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 (setcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (quote (, info)) ediff-control-buffer)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (error "Aborted")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 ((ediff-one-filegroup-metajob) ; needs 1 file arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (funcall ediff-session-action-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 file1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 ;; provide startup hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (` (list (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (setq ediff-meta-buffer (, (current-buffer)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1314 (setq ediff-merge-store-file
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1315 (, (concat
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1316 merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1317 "mrg_"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1318 (file-name-nondirectory file1))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1319 ;; make ediff-startup pass
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1320 ;; ediff-control-buffer back to the meta
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1321 ;; level; see below
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (setcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (quote (, info)) ediff-control-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 ((not (ediff-metajob3)) ; need 2 file args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 (funcall ediff-session-action-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 file1 file2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 ;; provide startup hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 (` (list (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 (setq ediff-meta-buffer (, (current-buffer)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1330 (setq ediff-merge-store-file
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1331 (, (concat
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1332 merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1333 "mrg_"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1334 (file-name-nondirectory file1))))
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1335 ;; make ediff-startup pass
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 ;; ediff-control-buffer back to the meta
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1337 ;; level; see below
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (setcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (quote (, info)) ediff-control-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 ((ediff-metajob3) ; need 3 file args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (funcall ediff-session-action-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 file1 file2 file3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 ;; arrange startup hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 (` (list (lambda ()
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1345 (setq ediff-merge-store-file
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1346 (, (concat
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1347 merge-autostore-dir
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1348 "mrg_"
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1349 (file-name-nondirectory file1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 (setq ediff-meta-buffer (, (current-buffer)))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1351 ;; this arranges that ediff-startup will pass
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1352 ;; the value of ediff-control-buffer back to
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1353 ;; the meta level, to the record in the meta
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1354 ;; list containing the information about the
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1355 ;; session associated with that
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1356 ;; ediff-control-buffer
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (setcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (quote (, info)) ediff-control-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 ) ; cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 ) ; eval in meta-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (defun ediff-registry-action ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 "Switch to a selected session."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 (ctl-buf (ediff-get-meta-info buf pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 (if (ediff-buffer-live-p ctl-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 ;; check if this is ediff-control-buffer or ediff-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (if (ediff-eval-in-buffer ctl-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (eq (key-binding "q") 'ediff-quit-meta-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 ;; it's a meta-buffer -- last action should just display it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 (ediff-show-meta-buffer ctl-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 ;; it's a session buffer -- invoke go back to session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (ediff-eval-in-buffer ctl-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (setq ediff-mouse-pixel-position (mouse-pixel-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (ediff-recenter 'no-rehighlight)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (beep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (message "You've selected a stale session --- try again")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (ediff-update-registry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (ediff-eval-in-buffer buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (goto-char pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (defun ediff-show-meta-buffer (&optional meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 "Show the session group buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (let (wind frame silent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (if meta-buf (setq silent t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 (setq meta-buf (or meta-buf ediff-meta-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (cond ((not (bufferp meta-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (error "This Ediff session is not part of a session group"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 ((not (ediff-buffer-live-p meta-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 "Can't find this session's group panel -- session itself is ok")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (ediff-cleanup-meta-buffer meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (ediff-eval-in-buffer meta-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (cond ((setq wind (ediff-get-visible-buffer-window meta-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 (or silent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 "Already showing the group panel for this session"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (set-window-buffer wind meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (select-window wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 ((window-live-p (setq wind ediff-window-C)) ;in merge--merge buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (set-window-buffer ediff-window-C meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 (select-window wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 ((window-live-p (setq wind ediff-window-A))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (set-window-buffer ediff-window-A meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 (select-window wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 ((window-live-p (setq wind ediff-window-B))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (set-window-buffer ediff-window-B meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (select-window wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 ((and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (setq wind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (ediff-get-visible-buffer-window ediff-registry-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (ediff-window-display-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (select-window wind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (set-window-buffer (selected-window) meta-buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (t (ediff-skip-unsuitable-frames 'ok-unsplittable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 (set-window-buffer (selected-window) meta-buf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 (if (and (ediff-window-display-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 (window-live-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 (setq wind (ediff-get-visible-buffer-window meta-buf))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (setq frame (window-frame wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 (raise-frame frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 (ediff-reset-mouse frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 (run-hooks 'ediff-show-session-group-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (defun ediff-show-meta-buff-from-registry ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 "Display the session group buffer for a selected session group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 (info (ediff-get-meta-info meta-buf pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 (meta-or-session-buf info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (ediff-eval-in-buffer meta-or-session-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 (ediff-show-meta-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 (defun ediff-show-registry ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 "Display Ediff's registry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (ediff-update-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 (if (not (ediff-buffer-live-p ediff-registry-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (error "No active Ediff sessions or corrupted session registry"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 (let (wind frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 ;; for some reason, point moves in ediff-registry-buffer, so we preserve it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 ;; explicitly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 (ediff-eval-in-buffer ediff-registry-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (cond ((setq wind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 (ediff-get-visible-buffer-window ediff-registry-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 (message "Already showing the registry")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 (set-window-buffer wind ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 (select-window wind))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 ((window-live-p ediff-window-C)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 (set-window-buffer ediff-window-C ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 (select-window ediff-window-C))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 ((window-live-p ediff-window-A)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (set-window-buffer ediff-window-A ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 (select-window ediff-window-A))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 ((window-live-p ediff-window-B)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 (set-window-buffer ediff-window-B ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (select-window ediff-window-B))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 ((and (setq wind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (ediff-get-visible-buffer-window ediff-meta-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (ediff-window-display-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (select-window wind)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (other-window 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 (set-window-buffer (selected-window) ediff-registry-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 (t (ediff-skip-unsuitable-frames 'ok-unsplittable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (set-window-buffer (selected-window) ediff-registry-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 (if (ediff-window-display-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 (setq frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 (window-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (ediff-get-visible-buffer-window ediff-registry-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 (raise-frame frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (ediff-reset-mouse frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (run-hooks 'ediff-show-registry-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (defalias 'eregistry 'ediff-show-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 ;; If meta-buf doesn't exist, it is created. In that case, id doesn't have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 ;; parent meta-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 ;; Check if META-BUF exists before calling this function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 (defun ediff-update-meta-buffer (meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 (ediff-eval-in-buffer (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (if (ediff-buffer-live-p meta-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (ediff-eval-in-buffer meta-buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 (funcall ediff-meta-redraw-function ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (defun ediff-update-registry ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 (ediff-eval-in-buffer (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (if (ediff-buffer-live-p ediff-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (ediff-redraw-registry-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (ediff-prepare-meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 'ediff-registry-action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 ediff-session-registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 "*Ediff Registry"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 'ediff-redraw-registry-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 'ediff-registry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1519 ;; If meta-buf exists, it is redrawn along with parent.
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1520 ;; Otherwise, nothing happens.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (defun ediff-cleanup-meta-buffer (meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 (if (ediff-buffer-live-p meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (ediff-eval-in-buffer meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (ediff-update-meta-buffer meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 (if (ediff-buffer-live-p ediff-parent-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (ediff-update-meta-buffer ediff-parent-meta-buffer)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 ;; t if no session in progress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (defun ediff-safe-to-quit (meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (if (ediff-buffer-live-p meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (let ((lis ediff-meta-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 (cont t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 buffer-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (ediff-update-meta-buffer meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (ediff-eval-in-buffer meta-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (setq lis (cdr lis)) ; discard the description part of meta-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 (while (and cont lis)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 (if (ediff-buffer-live-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (ediff-get-group-buffer lis)) ; in progress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (setq cont nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (setq lis (cdr lis)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 cont))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (defun ediff-quit-meta-buffer ()
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1545 "If the group has no active session, delete the meta buffer.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 If no session is in progress, ask to confirm before deleting meta buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 Otherwise, bury the meta buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 If this is a session registry buffer then just bury it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 (let* ((buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (dir-diffs-buffer ediff-dir-diffs-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 (meta-diff-buffer ediff-meta-diff-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 (parent-buf ediff-parent-meta-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 (dont-show-registry (eq buf ediff-registry-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (if dont-show-registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (bury-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (ediff-cleanup-meta-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 (cond ((and (ediff-safe-to-quit buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (y-or-n-p "Quit this session group? "))
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1560 (run-hooks 'ediff-quit-session-group-hook)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 (message "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (ediff-dispose-of-meta-buffer buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 ((ediff-safe-to-quit buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 (bury-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 "This session group has active sessions---cannot exit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 (ediff-cleanup-meta-buffer parent-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (ediff-kill-buffer-carefully dir-diffs-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (ediff-kill-buffer-carefully meta-diff-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 (if (ediff-buffer-live-p parent-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 (setq dont-show-registry t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (ediff-show-meta-buffer parent-buf)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (or dont-show-registry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (ediff-show-registry))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (defun ediff-dispose-of-meta-buffer (buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (setq ediff-session-registry (delq buf ediff-session-registry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 (ediff-eval-in-buffer buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 (if (ediff-buffer-live-p ediff-dir-diffs-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 (kill-buffer ediff-dir-diffs-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (kill-buffer buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 ;; Obtain information on a meta record where the user clicked or typed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 ;; BUF is the buffer where this happened and POINT is the position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 ;; If optional NOERROR arg is given, don't report error and return nil if no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 ;; meta info is found on line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 (defun ediff-get-meta-info (buf point &optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 (let (result olist tmp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 (if (and point (ediff-buffer-live-p buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 (ediff-eval-in-buffer buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (if ediff-xemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 (setq result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 (if (setq tmp (extent-at point buf 'ediff-meta-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 (ediff-overlay-get tmp 'ediff-meta-info)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 (setq olist (overlays-at point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 (setq olist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 (mapcar (function (lambda (elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 (overlay-get elt 'ediff-meta-info)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 olist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 (while (and olist (null (car olist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 (overlay-get (car olist) 'invisible))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (setq olist (cdr olist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 (setq result (car olist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 (if result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 (if noerror
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 (ediff-update-registry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (error "No session info in this line")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 ;; return location of the next meta overlay after point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (defun ediff-next-meta-overlay-start (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 (if (eobp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 (let (overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 (if ediff-xemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 (setq overl (extent-at point (current-buffer) 'ediff-meta-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 (if overl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 (setq overl (next-extent overl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 (setq overl (next-extent (current-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 (if overl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 (extent-start-position overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 (setq overl (car (overlays-at point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 (if (and overl (overlay-get overl 'ediff-meta-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 ;; note: end of current overlay is the beginning of the next one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 (overlay-end overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 (next-overlay-change point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 (defun ediff-previous-meta-overlay-start (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 (if (bobp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 (let (overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 (if ediff-xemacs-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (setq overl (extent-at point (current-buffer) 'ediff-meta-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 (if overl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 (setq overl (previous-extent overl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 (setq overl (previous-extent (current-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (if overl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (extent-start-position overl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (setq overl (car (overlays-at point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (if (and overl (overlay-get overl 'ediff-meta-info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (setq point (overlay-start overl)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 ;; to get to the beginning of prev overlay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (if (not (bobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 ;; trickery to overcome an emacs bug--doesn't always find previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 ;; overlay change correctly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 (setq point (1- point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 (setq point (previous-overlay-change point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 ;; If we are not over an overlay after subtracting 1, it means we are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 ;; in the description area preceding session records. In this case,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 ;; goto the top of the registry buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (or (car (overlays-at point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 (setq point (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 ;; this is the action invoked when the user selects a patch from the meta
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 ;; buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (defun ediff-patch-file-form-meta (file &optional startup-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 (let* ((pos (ediff-event-point last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 (meta-buf (ediff-event-buffer last-command-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 ;; ediff-get-meta-info gives error if meta-buf or pos are invalid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 (info (ediff-get-meta-info meta-buf pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 (meta-patchbuf ediff-meta-patchbufer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 session-buf beg-marker end-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (if (or (file-directory-p file) (string-match "/dev/null" file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 (error "`%s' is not an ordinary file" (file-name-as-directory file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 (setq session-buf (ediff-get-session-buffer info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 beg-marker (ediff-get-session-objB-name info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 end-marker (ediff-get-session-objC-name info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (or (ediff-buffer-live-p session-buf) ; either an active patch session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 (null session-buf) ; or it is a virgin session
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 "Patch has been already applied to this file--cannot be repeated!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 (ediff-eval-in-buffer meta-patchbuf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 (narrow-to-region beg-marker end-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 (ediff-patch-file-internal meta-patchbuf file startup-hooks)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 (defun ediff-meta-mark-equal-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 "Run though the session list and mark identical files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 This is used only for sessions that involve 2 or 3 files at the same time."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 (let ((list (cdr ediff-meta-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 fileinfo1 fileinfo2 fileinfo3 elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (while (setq elt (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 (setq fileinfo1 (ediff-get-session-objA elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 fileinfo2 (ediff-get-session-objB elt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 fileinfo3 (ediff-get-session-objC elt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 (ediff-set-file-eqstatus fileinfo1 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 (ediff-set-file-eqstatus fileinfo2 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 (ediff-set-file-eqstatus fileinfo3 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 (ediff-mark-if-equal fileinfo1 fileinfo2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 (if (ediff-metajob3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 (ediff-mark-if-equal fileinfo1 fileinfo3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 (ediff-mark-if-equal fileinfo2 fileinfo3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 (setq list (cdr list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 (ediff-update-meta-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 ;; mark files 1 and 2 as equal, if they are.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 (defun ediff-mark-if-equal (fileinfo1 fileinfo2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 (get-buffer-create ediff-tmp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 (or (file-directory-p (car fileinfo1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (file-directory-p (car fileinfo2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 (if (= (ediff-make-diff2-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 ediff-tmp-buffer (car fileinfo1) (car fileinfo2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 (ediff-set-file-eqstatus fileinfo1 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (ediff-set-file-eqstatus fileinfo2 t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 ;;; Local Variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 ;;; eval: (put 'ediff-eval-in-buffer 'lisp-indent-hook 1)
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
1733 ;;; eval: (put 'ediff-eval-in-buffer 'edebug-form-spec '(form body))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 ;;; End:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 ;;; ediff-mult.el ends here