annotate lisp/ediff-mult.el @ 88413:418777d5ccd4

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