annotate lisp/ediff-mult.el @ 91220:a60f39047e64

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