annotate lisp/ediff-mult.el @ 30167:83e9db7aeddb

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