annotate lisp/ediff-init.el @ 11841:c93c1c56a8bb

(Fdump_emacs): Don't take address of array.
author Karl Heuer <kwzh@gnu.org>
date Wed, 17 May 1995 20:47:39 +0000
parents 4d2a2fe1d8d7
children 589a32fa67a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11042
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1 ;;; ediff-init.el --- Macros, variables and defsubsts used by Ediff
11234
4d2a2fe1d8d7 Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 11042
diff changeset
2 ;;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
11042
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
3
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
4 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
5
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
6 ;; This file is part of GNU Emacs.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
7
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
8 ;; GNU Emacs is free software; you can redistribute it and/or modify
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
11 ;; any later version.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
12
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is distributed in the hope that it will be useful,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
16 ;; GNU General Public License for more details.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
17
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
21
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
22
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
23 (defconst ediff-xemacs-p (string-match "\\(Lucid\\|Xemacs\\)" emacs-version)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
24 "Whether it is XEmacs.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
25 (defconst ediff-emacs-p (not ediff-xemacs-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
26 "Whether it is Emacs.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
27
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
28 ;;; Macros
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
29 (defmacro ediff-odd-p (arg)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
30 (` (eq (logand (, arg) 1) 1)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
31
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
32 (defmacro ediff-buffer-live-p (buf)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
33 (` (and (, buf) (get-buffer (, buf)) (buffer-name (get-buffer (, buf))))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
34
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
35 (defmacro ediff-get-buffer (arg)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
36 (` (cond ((eq (, arg) 'A) ediff-buffer-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
37 ((eq (, arg) 'B) ediff-buffer-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
38 ((eq (, arg) 'C) ediff-buffer-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
39 )
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
40 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
41
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
42 (defmacro ediff-get-value-according-to-buffer-type (buf-type list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
43 (` (cond ((eq (, buf-type) 'A) (nth 0 (, list)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
44 ((eq (, buf-type) 'B) (nth 1 (, list)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
45 ((eq (, buf-type) 'C) (nth 2 (, list))))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
46
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
47 (defmacro ediff-char-to-buftype (arg)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
48 (` (cond ((memq (, arg) '(?a ?A)) 'A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
49 ((memq (, arg) '(?b ?B)) 'B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
50 ((memq (, arg) '(?c ?C)) 'C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
51 )
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
52 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
53
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
54 (defmacro ediff-get-difference (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
55 (` (aref
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
56 (symbol-value
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
57 (intern (format "ediff-difference-vector-%S" (, buf-type)))) (, n))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
58
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
59 ;; tell if it has been previously determined that the region has
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
60 ;; no diffs other than the white space and newlines
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
61 ;; The argument, N, is the diff region number used by Ediff to index the
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
62 ;; diff vector. It is 1 less than the number seen by the user.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
63 ;;
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
64 ;; A difference vector has the form:
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
65 ;; [diff diff diff ...]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
66 ;; where each diff has the form:
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
67 ;; [overlay fine-diff-vector no-fine-diffs-flag]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
68 ;; fine-diff-vector is a vector [fine-diff fine-diff fine-diff ...]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
69 (defmacro ediff-no-fine-diffs-p (n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
70 (` (aref (ediff-get-difference (, n) 'A) 2)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
71
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
72 (defmacro ediff-get-diff-overlay-from-diff-record (diff-rec)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
73 (` (aref (, diff-rec) 0)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
74
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
75 (defmacro ediff-get-diff-overlay (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
76 (` (ediff-get-diff-overlay-from-diff-record
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
77 (ediff-get-difference (, n) (, buf-type)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
78
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
79 (defmacro ediff-get-fine-diff-vector-from-diff-record (diff-rec)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
80 (` (aref (, diff-rec) 1)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
81
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
82 (defmacro ediff-set-fine-diff-vector (n buf-type fine-vec)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
83 (` (aset (ediff-get-difference (, n) (, buf-type)) 1 (, fine-vec))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
84
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
85 (defmacro ediff-get-state-of-diff (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
86 (` (if (ediff-buffer-live-p ediff-buffer-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
87 (aref (ediff-get-difference (, n) (, buf-type)) 3))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
88 (defmacro ediff-set-state-of-diff (n buf-type val)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
89 (` (aset (ediff-get-difference (, n) (, buf-type)) 3 (, val))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
90 (defmacro ediff-get-state-of-merge (n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
91 (` (if (ediff-buffer-live-p ediff-buffer-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
92 (aref (ediff-get-difference (, n) 'C) 4))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
93 (defmacro ediff-set-state-of-merge (n val)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
94 (` (aset (ediff-get-difference (, n) 'C) 4 (, val))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
95
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
96 ;; if flag is t, puts a mark on diff region saying that
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
97 ;; the differences are in white space only. If flag is nil,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
98 ;; the region is marked as essential (i.e., differences are
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
99 ;; not just in the white space and newlines.)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
100 (defmacro ediff-mark-diff-as-space-only (n flag)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
101 (` (aset (ediff-get-difference (, n) 'A) 2 (, flag))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
102
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
103 (defmacro ediff-get-fine-diff-vector (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
104 (` (ediff-get-fine-diff-vector-from-diff-record
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
105 (ediff-get-difference (, n) (, buf-type)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
106
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
107
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
108 ;; Defines SYMBOL as an advertised local variable.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
109 ;; Performs a defvar, then executes `make-variable-buffer-local' on
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
110 ;; the variable. Also sets the `permanent-local' property,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
111 ;; so that `kill-all-local-variables' (called by major-mode setting
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
112 ;; commands) won't destroy Ediff control variables.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
113 ;;
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
114 ;; Plagiarised from `emerge-defvar-local' for XEmacs.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
115 (defmacro ediff-defvar-local (var value doc)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
116 (` (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
117 (defvar (, var) (, value) (, doc))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
118 (make-variable-buffer-local '(, var))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
119 (put '(, var) 'permanent-local t))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
120
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
121 ;; Macro to switch to BUFFER, evaluate FORMS, returns to original buffer.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
122 ;; Differs from `save-excursion' in that it doesn't save the point and mark.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
123 ;; This is essentially `emerge-eval-in-buffer' with the test for live buffers."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
124 (defmacro ediff-eval-in-buffer (buffer &rest forms)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
125 (` (let ((StartBuffer (current-buffer)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
126 (if (ediff-buffer-live-p (, buffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
127 (unwind-protect
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
128 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
129 (set-buffer (, buffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
130 (,@ forms))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
131 (set-buffer StartBuffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
132 (or (eq this-command 'ediff-quit)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
133 (error
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
134 "You've killed an essential Ediff buffer---Please quit Ediff"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
135 ))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
136
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
137
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
138 (defmacro ediff-multiframe-setup-p ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
139 (` (and window-system ediff-multiframe)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
140
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
141 (defmacro ediff-narrow-control-frame-p ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
142 (` (and (ediff-multiframe-setup-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
143 (equal ediff-help-message ediff-brief-message-string))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
144
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
145 (defmacro ediff-3way-comparison-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
146 (` (memq
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
147 ediff-job-name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
148 '(ediff-files3 ediff-buffers3))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
149 (ediff-defvar-local ediff-3way-comparison-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
150
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
151 (defmacro ediff-merge-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
152 (` (memq
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
153 ediff-job-name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
154 '(ediff-merge-files
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
155 ediff-merge-buffers
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
156 ediff-merge-files-with-ancestor
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
157 ediff-merge-buffers-with-ancestor
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
158 ediff-merge-revisions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
159 ediff-merge-revisions-with-ancestor))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
160 (ediff-defvar-local ediff-merge-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
161
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
162 (defmacro ediff-merge-with-ancestor-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
163 (` (memq
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
164 ediff-job-name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
165 '(ediff-merge-files-with-ancestor
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
166 ediff-merge-buffers-with-ancestor
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
167 ediff-merge-revisions-with-ancestor))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
168 (ediff-defvar-local ediff-merge-with-ancestor-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
169
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
170 (defmacro ediff-3way-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
171 (` (or ediff-3way-comparison-job ediff-merge-job)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
172 (ediff-defvar-local ediff-3way-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
173
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
174 ;; A diff3 job is like a 3way job, but ediff-merge doesn't require the use
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
175 ;; of diff3.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
176 (defmacro ediff-diff3-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
177 (` (or ediff-3way-comparison-job
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
178 ediff-merge-with-ancestor-job)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
179 (ediff-defvar-local ediff-diff3-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
180
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
181 (defmacro ediff-word-mode-job ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
182 (` (memq
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
183 ediff-job-name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
184 '(ediff-windows ediff-small-regions ediff-large-regions))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
185 (ediff-defvar-local ediff-word-mode-job nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
186
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
187
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
188 ;; Hook variables
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
189
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
190 (defvar ediff-before-setup-windows-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
191 "*Hooks to run before Ediff sets its own window config.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
192 This can be used to save the previous window config, which can be restored
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
193 on ediff-quit or ediff-suspend.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
194 (defvar ediff-after-setup-windows-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
195 "*Hooks to run after Ediff sets its own window config.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
196 This can be used to set up control window or icon in a desired place.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
197 (defvar ediff-before-setup-control-frame-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
198 "*Hooks run before setting up the frame to display Ediff Control Panel.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
199 Can be used to change control frame parameters to position it where it
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
200 is desirable.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
201 (defvar ediff-after-setup-control-frame-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
202 "*Hooks run after setting up the frame to display Ediff Control Panel.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
203 Can be used to move the frame where it is desired.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
204 (defvar ediff-startup-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
205 "*Hooks to run in the control buffer after Ediff has been set up.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
206 (defvar ediff-select-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
207 "*Hooks to run after a difference has been selected.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
208 (defvar ediff-unselect-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
209 "*Hooks to run after a difference has been unselected.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
210 (defvar ediff-prepare-buffer-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
211 "*Hooks called after buffers A, B, and C are set up.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
212 (defvar ediff-load-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
213 "*Hook run after Ediff is loaded. Can be used to change defaults.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
214
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
215 (defvar ediff-mode-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
216 "*Hook run just after ediff-mode is set up in the control buffer.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
217 This is done before any windows or frames are created. One can use it to
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
218 set local variables that determine how the display looks like.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
219 (defvar ediff-keymap-setup-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
220 "*Hook run just after the default bindings in Ediff keymap are set up.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
221
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
222 (defvar ediff-display-help-hooks nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
223 "*Hooks run after preparing the help message.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
224
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
225 (defvar ediff-suspend-hooks (list 'ediff-default-suspend-hook)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
226 "*Hooks to run in the Ediff control buffer when Ediff is suspended.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
227 (defvar ediff-quit-hooks (list 'ediff-cleanup-mess)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
228 "*Hooks to run in the Ediff control buffer after finishing Ediff.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
229
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
230 ;; There will be deleted in due time
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
231 (make-variable-buffer-local 'local-write-file-hooks)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
232 (make-variable-buffer-local 'before-change-function)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
233
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
234
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
235 ;; Help messages
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
236
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
237 (defconst ediff-long-help-message-head
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
238 " Moving around | Toggling features | Manipulations
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
239 =====================|===========================|============================="
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
240 "The head of the full help message.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
241 (defconst ediff-long-help-message-tail
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
242 "=====================|===========================|=============================
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
243 i -status info | ? -help off | G -send bug report
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
244 -------------------------------------------------------------------------------
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
245 X,Y (x,y) on the left are meta-symbols for the keys A,B,C (a,b,c).
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
246 X,Y on the right are meta-symbols for buffers A,B,C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
247 A,B,C on the right denote the working buffers A,B,C, respectively."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
248 "The tail of the full-help message.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
249
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
250 (defconst ediff-long-help-message-compare3
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
251 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
252 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
253 n,SPC -next diff | h -hiliting | rx -restore buf X's old diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
254 j -jump to diff | @ -auto-refinement | * -refine current region
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
255 gx -goto X's point| | ! -update diff regions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
256 C-l -recenter | ## -ignore whitespace |
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
257 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
258 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
259 z/q -suspend/quit | m -wide display | ~ -rotate buffers
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
260 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
261 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
262
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
263 (defconst ediff-long-help-message-compare2
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
264 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
265 p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
266 n,SPC -next diff | h -hiliting | rx -restore buf X's old diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
267 j -jump to diff | @ -auto-refinement | * -refine current region
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
268 gx -goto X's point| | ! -update diff regions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
269 C-l -recenter | ## -ignore whitespace |
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
270 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
271 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
272 z/q -suspend/quit | m -wide display | ~ -swap buffers
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
273 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
274 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
275
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
276 (defconst ediff-long-help-message-word-mode
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
277 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
278 p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
279 n,SPC -next diff | h -hiliting | rx -restore buf X's old diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
280 j -jump to diff | |
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
281 gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
282 C-l -recenter | |
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
283 v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
284 </> -scroll lt/rt | X -read-only in buf X | wd -save diff output
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
285 z/q -suspend/quit | m -wide display | ~ -swap buffers
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
286 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
287 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
288
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
289 (defconst ediff-long-help-message-merge
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
290 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
291 p,DEL -previous diff | | -vert/horiz split | x -copy buf X's region to C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
292 n,SPC -next diff | h -hiliting | r -restore buf C's old diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
293 j -jump to diff | @ -auto-refinement | * -refine current region
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
294 gx -goto X's point| ## -ignore whitespace | ! -update diff regions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
295 C-l -recenter | #f/#h -focus/hide regions | + -combine diff regions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
296 v/V -scroll up/dn | X -read-only in buf X | wx -save buf X
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
297 </> -scroll lt/rt | m -wide display | wd -save diff output
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
298 z/q -suspend/quit | s -shrink window C | ~ -swap buffers
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
299 | $ -show clashes only | & -merge w/new default
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
300 "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
301 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
302
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
303 ;; The actual long help message.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
304 (ediff-defvar-local ediff-long-help-message ""
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
305 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
306
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
307 (defconst ediff-brief-message-string
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
308 " ? - help "
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
309 "Contents of the brief help message.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
310 ;; The actual brief help message
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
311 (ediff-defvar-local ediff-brief-help-message ""
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
312 "Normally, not a user option. See `ediff-help-message' for details.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
313
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
314 (ediff-defvar-local ediff-brief-help-message-custom nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
315 "The brief help message that the user can customize.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
316 If the user sets this to a parameter-less function, Ediff will use it to
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
317 produce the brief help message. This function must return a string.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
318 (ediff-defvar-local ediff-long-help-message-custom nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
319 "The long help message that the user can customize.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
320 See `ediff-brief-help-message-custom' for more.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
321
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
322 (defvar ediff-prefer-long-help-message nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
323 "*If t, Ediff starts with a long help message. Short help msg otherwise.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
324
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
325 ;; The actual help message.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
326 (ediff-defvar-local ediff-help-message ""
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
327 "The actual help message.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
328 Normally, the user shouldn't touch this. However, if you want Ediff to
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
329 start up with different help messages for different jobs, you can change
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
330 the value of this variable and the variables `ediff-help-message-*' in
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
331 `ediff-startup-hooks'.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
332
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
333 ;; Selective browsing
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
334
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
335 (ediff-defvar-local ediff-skip-diff-region-function 'ediff-show-all-diffs
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
336 "Function that determines the next/previous diff region to show.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
337 Should return t for regions to be ignored and nil otherwise.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
338 This function gets a region number as an argument. The region number
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
339 is the one used internally by Ediff. It is 1 less than the number seen
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
340 by the user.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
341
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
342 ;; Regexp that determines buf A regions to focus on when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
343 (ediff-defvar-local ediff-regexp-focus-A "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
344 ;; Regexp that determines buf B regions to focus on when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
345 (ediff-defvar-local ediff-regexp-focus-B "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
346 ;; Regexp that determines buf C regions to focus on when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
347 (ediff-defvar-local ediff-regexp-focus-C "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
348 ;; connective that determines whether to focus regions that match both or
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
349 ;; one of the regexps
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
350 (ediff-defvar-local ediff-focus-regexp-connective 'and "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
351
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
352 ;; Regexp that determines buf A regions to ignore when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
353 (ediff-defvar-local ediff-regexp-hide-A "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
354 ;; Regexp that determines buf B regions to ignore when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
355 (ediff-defvar-local ediff-regexp-hide-B "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
356 ;; Regexp that determines buf C regions to ignore when skipping to diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
357 (ediff-defvar-local ediff-regexp-hide-C "" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
358 ;; connective that determines whether to hide regions that match both or
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
359 ;; one of the regexps
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
360 (ediff-defvar-local ediff-hide-regexp-connective 'and "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
361
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
362
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
363 (defvar ediff-ange-ftp-ftp-name (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
364 'ange-ftp-ftp-path
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
365 'ange-ftp-ftp-name)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
366 "Function ange-ftp uses to find out if file is remote.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
367
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
368
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
369 ;; Copying difference regions between buffers.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
370 (ediff-defvar-local ediff-killed-diffs-alist nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
371 "A list of killed diffs.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
372 A diff is saved here if it is replaced by a diff
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
373 from another buffer. This alist has the form:
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
374 \((num (buff-object . diff) (buff-object . diff) (buff-object . diff)) ...),
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
375 where some buffer-objects may be missing.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
376
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
377
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
378 ;; Highlighting
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
379 (defvar ediff-before-flag-bol "->>\n"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
380 "*Flag placed above the highlighted block of differences.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
381 Must end with newline.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
382 (defvar ediff-after-flag-eol "<<-\n"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
383 "*Flag placed below the highlighted block of differences.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
384 Must end with newline.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
385
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
386 (defvar ediff-before-flag-mol "->>"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
387 "*Like ediff-before-flag, used when a difference starts in mid-line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
388 (defvar ediff-after-flag-mol "<<-"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
389 "*Like ediff-after-flag, used when a difference starts in mid-line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
390
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
391 (ediff-defvar-local ediff-before-flag-A nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
392 "This is the actual ASCII before-flag in effect in buffer A.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
393 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
394 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
395 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
396 (ediff-defvar-local ediff-after-flag-A nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
397 "This is the actual ASCII after-flag in effect in buffer A.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
398 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
399 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
400 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
401
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
402 (ediff-defvar-local ediff-before-flag-B nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
403 "This is the actual ASCII before-flag in effect in buffer B.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
404 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
405 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
406 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
407 (ediff-defvar-local ediff-after-flag-B nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
408 "This is the actual ASCII after-flag in effect in buffer B.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
409 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
410 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
411 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
412
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
413 (ediff-defvar-local ediff-before-flag-C nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
414 "This is the actual ASCII before-flag in effect in buffer C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
415 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
416 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
417 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
418 (ediff-defvar-local ediff-after-flag-C nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
419 "This is the actual ASCII after-flag in effect in buffer C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
420 It is either `ediff-before-flag-mol' or `ediff-before-flag-bol' depending
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
421 on whether the selected difference region starts in the middle of a line
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
422 or at the beginning of a line.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
423
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
424
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
425 (ediff-defvar-local ediff-use-faces t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
426 "If t, differences are highlighted using faces on a window system.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
427 If nil, they are highlighted using ASCII flags, ediff-before-flag
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
428 and ediff-after-flag. On a non-window system, differences are always
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
429 highlighted using ASCII flags.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
430 This variable can be set either in .emacs or toggled interactively.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
431 Use `setq-default' if setting it in .emacs")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
432
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
433
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
434 ;; this indicates that diff regions are word-size, so fine diffs are
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
435 ;; permanently nixed; used in ediff-windows and ediff-small-regions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
436 (ediff-defvar-local ediff-word-mode nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
437 ;; Name of the job (ediff-files, ediff-windows, etc.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
438 (ediff-defvar-local ediff-job-name nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
439
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
440 ;; Narrowing and ediff-region/windows support
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
441 ;; This is a list (overlay-A overlay-B overlay-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
442 ;; If set, Ediff compares only those parts of buffers A/B/C that lie within
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
443 ;; the bounds of these overlays.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
444 (ediff-defvar-local ediff-narrow-bounds nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
445
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
446 ;; List (overlay-A overlay-B overlay-C), where each overlay spans the
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
447 ;; entire corresponding buffer.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
448 (ediff-defvar-local ediff-wide-bounds nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
449
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
450 ;; Current visibility boundaries in buffers A, B, and C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
451 ;; This is also a list of overlays. When the user toggles narrow/widen,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
452 ;; this list changes from ediff-wide-bounds to ediff-narrow-bounds.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
453 ;; and back.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
454 (ediff-defvar-local ediff-visible-bounds nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
455
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
456 (ediff-defvar-local ediff-start-narrowed t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
457 "Non-nil means start narrowed, if doing ediff-windows, ediff-small-regions,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
458 or ediff-large-regions.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
459 (ediff-defvar-local ediff-quit-widened t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
460 "*Non-nil means: when finished, Ediff widens buffers A/B.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
461 Actually, Ediff restores the scope of visibility that existed at startup.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
462
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
463 (ediff-defvar-local ediff-highlight-all-diffs t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
464 "If nil, only the selected differences are highlighted.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
465 This variable can be set either in .emacs or toggled interactively, using
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
466 ediff-toggle-hilit. Use `setq-default' to set it.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
467
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
468 ;; A var local to each control panel buffer. Indicates highlighting style
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
469 ;; in effect for this buffer: `face', `ascii', nil -- temporarily
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
470 ;; unhighlighted, `off' -- turned off \(on a dumb terminal only\).
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
471 (ediff-defvar-local ediff-highlighting-style nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
472
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
473
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
474 ;; Variables that control each Ediff session. They are local to the
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
475 ;; control buffer.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
476
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
477 ;; Mode variables
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
478 ;; The buffer in which the A variant is stored.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
479 (ediff-defvar-local ediff-buffer-A nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
480 ;; The buffer in which the B variant is stored.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
481 (ediff-defvar-local ediff-buffer-B nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
482 ;; The buffer in which the C variant is stored.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
483 (ediff-defvar-local ediff-buffer-C nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
484 ;; Ancestor buffer
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
485 (ediff-defvar-local ediff-ancestor-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
486 ;; The control buffer of ediff.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
487 (ediff-defvar-local ediff-control-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
488
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
489
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
490 ;; The suffix of the control buffer name.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
491 (ediff-defvar-local ediff-control-buffer-suffix nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
492 ;; Same as ediff-control-buffer-suffix, but without <,>.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
493 ;; It's a number rather than string.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
494 (ediff-defvar-local ediff-control-buffer-number nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
495
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
496
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
497 ;; There three are to be deleted in due time
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
498 ;; Working values of ediff-saved-variables for buffer A.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
499 (ediff-defvar-local ediff-buffer-A-values nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
500 ;; working values of ediff-saved-variables for buffer B.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
501 (ediff-defvar-local ediff-buffer-B-values nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
502 ;; working values of ediff-saved-variables for buffer C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
503 (ediff-defvar-local ediff-buffer-C-values nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
504
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
505 ;; The original values of ediff-protected-variables for buffer A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
506 (ediff-defvar-local ediff-buffer-A-values-orig nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
507 ;; The original values of ediff-protected-variables for buffer B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
508 (ediff-defvar-local ediff-buffer-B-values-orig nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
509 ;; The original values of ediff-protected-variables for buffer C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
510 (ediff-defvar-local ediff-buffer-C-values-orig nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
511 ;; Buffer-local variables to be saved then restored during Ediff sessions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
512 (defconst ediff-protected-variables '(buffer-read-only
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
513 mode-line-format))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
514
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
515 ;; These three vars are to be deleted when emacs gets before/after strings
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
516 ;; Remember ediff-saved-variables for ediff-buffer-A as they were at setup.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
517 (ediff-defvar-local ediff-buffer-A-values-setup nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
518 ;; Remembers ediff-saved-variables for ediff-buffer-B as they were at setup.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
519 (ediff-defvar-local ediff-buffer-B-values-setup nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
520 ;; Remembers ediff-saved-variables for ediff-buffer-C as they were at setup.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
521 (ediff-defvar-local ediff-buffer-C-values-setup nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
522
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
523 ;; Vector of differences between the variants. Each difference is
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
524 ;; represented by a vector of two overlays plus a vector of fine diffs,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
525 ;; plus a no-fine-diffs flag. The first overlay spans the
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
526 ;; difference region in the A buffer and the second overlays the diff in
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
527 ;; the B buffer. If a difference section is empty, the corresponding
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
528 ;; overlay's endpoints coincide.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
529 ;;
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
530 ;; The precise form of a difference vector for one buffer is:
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
531 ;; [diff diff diff ...]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
532 ;; where each diff has the form:
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
533 ;; [diff-overlay fine-diff-vector no-fine-diffs-flag state-of-difference
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
534 ;; state-of-merge]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
535 ;; fine-diff-vector is a vector [fine-diff-overlay fine-diff-overlay ...]
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
536 ;; no-fine-diffs-flag says if there are fine differences.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
537 ;; state-of-difference is A, B, C, or nil, indicating which buffer is
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
538 ;; different from the other two (used only in 3-way jobs.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
539 ;; state-of-merge is default-A, default-B, prefer-A, or prefer-B. It
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
540 ;; indicates the way a diff region was created in buffer C.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
541 (ediff-defvar-local ediff-difference-vector-A nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
542 (ediff-defvar-local ediff-difference-vector-B nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
543 (ediff-defvar-local ediff-difference-vector-C nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
544
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
545 ;; The difference that is currently selected.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
546 (ediff-defvar-local ediff-current-difference -1 "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
547 ;; Number of differences found.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
548 (ediff-defvar-local ediff-number-of-differences nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
549
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
550 ;; Buffer containing the output of diff, which is used by Ediff to step
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
551 ;; through files.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
552 (ediff-defvar-local ediff-diff-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
553 ;; Like ediff-diff-buffer, but contains context diff. It is not used by
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
554 ;; Ediff, but it is saved in a file, if user requests so.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
555 (ediff-defvar-local ediff-custom-diff-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
556 ;; Buffer used for diff-style fine differences between regions.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
557 (ediff-defvar-local ediff-fine-diff-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
558 ;; Temporary buffer used for computing fine differences.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
559 (defconst ediff-tmp-buffer " *ediff-tmp*" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
560 ;; Buffer used for messages
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
561 (defconst ediff-msg-buffer " *ediff-message*" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
562 ;; Buffer containing the output of diff when diff returns errors.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
563 (ediff-defvar-local ediff-error-buffer nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
564 ;; Buffer to display debug info
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
565 (ediff-defvar-local ediff-debug-buffer "*ediff-debug*" "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
566
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
567 ;; to be deleted in due time
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
568 ;; List of ediff control panels associated with each buffer A/B.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
569 (ediff-defvar-local ediff-this-buffer-control-sessions nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
570
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
571 ;; to be deleted in due time
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
572 ;; List of difference overlays disturbed by working with the current diff.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
573 (defvar ediff-disturbed-overlays nil "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
574
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
575 ;; Priority of non-selected overlays.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
576 (defvar ediff-shadow-overlay-priority 100 "")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
577
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
578
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
579 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
580 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
581 (fset 'ediff-read-event (symbol-function 'next-command-event))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
582 (fset 'ediff-overlayp (symbol-function 'extentp))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
583 (fset 'ediff-make-overlay (symbol-function 'make-extent))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
584 (fset 'ediff-delete-overlay (symbol-function 'delete-extent))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
585 (fset 'ediff-overlay-buffer (symbol-function 'extent-buffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
586 (fset 'ediff-overlay-p (symbol-function 'extentp))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
587 (fset 'ediff-overlay-get (symbol-function 'extent-property)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
588 (fset 'ediff-read-event (symbol-function 'read-event))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
589 (fset 'ediff-overlayp (symbol-function 'overlayp))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
590 (fset 'ediff-make-overlay (symbol-function 'make-overlay))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
591 (fset 'ediff-delete-overlay (symbol-function 'delete-overlay))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
592 (fset 'ediff-overlay-buffer (symbol-function 'overlay-buffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
593 (fset 'ediff-overlay-p (symbol-function 'overlayp))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
594 (fset 'ediff-overlay-get (symbol-function 'overlay-get)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
595
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
596 ;; A fix for NeXT Step
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
597 ;; Should probably be eliminated in later versions.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
598 (if (and window-system (eq window-system 'ns))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
599 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
600 (fset 'x-display-color-p (symbol-function 'ns-display-color-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
601 (fset 'x-color-defined-p (symbol-function 'ns-color-defined-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
602 (fset 'x-display-pixel-height (symbol-function 'ns-display-pixel-height))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
603 (fset 'x-display-pixel-width (symbol-function 'ns-display-pixel-width))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
604 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
605
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
606 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
607 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
608 (fset 'ediff-make-frame (symbol-function 'make-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
609 ;;(fset 'ediff-make-frame-invisible
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
610 ;; (symbol-function 'make-screen-invisible))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
611 (fset 'ediff-raise-frame (symbol-function 'raise-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
612 (fset 'ediff-iconify-frame (symbol-function 'iconify-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
613 (fset 'ediff-delete-frame (symbol-function 'delete-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
614 (fset 'ediff-frame-visible-p (symbol-function 'screen-visible-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
615 (fset 'ediff-select-frame (symbol-function 'select-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
616 (fset 'ediff-selected-frame (symbol-function 'selected-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
617 ;;(fset 'ediff-frame-selected-window
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
618 ;; (symbol-function 'screen-selected-window))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
619 (fset 'ediff-frame-parameters (symbol-function 'screen-parameters))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
620 ;;(fset 'ediff-frame-pixel-width (symbol-function 'screen-pixel-width))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
621 (fset 'ediff-frame-width (symbol-function 'screen-width))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
622 (fset 'ediff-modify-frame-parameters
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
623 (symbol-function 'modify-screen-parameters))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
624 (fset 'ediff-frame-live-p (symbol-function 'screen-live-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
625 (fset 'ediff-window-frame (symbol-function 'window-screen))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
626 (if window-system
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
627 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
628 (fset 'ediff-display-color-p (symbol-function 'x-color-display-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
629 (fset 'ediff-valid-color-p (symbol-function 'x-valid-color-name-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
630 (fset 'ediff-get-face (symbol-function 'get-face)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
631 (if window-system
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
632 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
633 (fset 'ediff-make-frame (symbol-function 'make-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
634 ;;(fset 'ediff-make-frame-invisible
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
635 ;; (symbol-function 'make-frame-invisible))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
636 (fset 'ediff-raise-frame (symbol-function 'raise-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
637 (fset 'ediff-iconify-frame (symbol-function 'iconify-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
638 (fset 'ediff-delete-frame (symbol-function 'delete-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
639 (fset 'ediff-frame-visible-p (symbol-function 'frame-visible-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
640 (fset 'ediff-window-frame (symbol-function 'window-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
641 (fset 'ediff-select-frame (symbol-function 'select-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
642 (fset 'ediff-selected-frame (symbol-function 'selected-frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
643 ;;(fset 'ediff-frame-selected-window
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
644 ;; (symbol-function 'frame-selected-window))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
645 (fset 'ediff-frame-parameters (symbol-function 'frame-parameters))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
646 ;;(fset 'ediff-frame-pixel-width (symbol-function 'frame-pixel-width))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
647 (fset 'ediff-frame-width (symbol-function 'frame-width))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
648 (fset 'ediff-modify-frame-parameters
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
649 (symbol-function 'modify-frame-parameters))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
650 (fset 'ediff-frame-live-p (symbol-function 'frame-live-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
651 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
652
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
653 (if window-system
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
654 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
655 (fset 'ediff-display-color-p (symbol-function 'x-display-color-p))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
656 ;; Temporary fix for OS/2 users
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
657 ;; pm-win.el in PM-Emacs should be fixed.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
658 (if (eq window-system 'pm)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
659 (fset 'ediff-valid-color-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
660 (function (lambda (color) (assoc color pm-color-alist))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
661 (fset 'ediff-valid-color-p (symbol-function 'x-color-defined-p)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
662
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
663 (fset 'ediff-get-face (symbol-function 'internal-get-face))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
664 )
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
665
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
666 ;; not a window system
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
667 (if (not window-system)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
668 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
669 (fset 'ediff-window-frame (function (lambda (wind) (if wind 1 nil)) ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
670 (fset 'ediff-selected-frame 'selected-window)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
671 (fset 'ediff-frame-width 'window-width)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
672 (fset 'ediff-make-current-diff-overlay (function (lambda (type) nil)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
673
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
674 (if (not window-system)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
675 ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
676 (defun ediff-set-face (ground face color)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
677 "Sets face foreground/background."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
678 (if (ediff-valid-color-p color)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
679 (if (eq ground 'foreground)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
680 (set-face-foreground face color)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
681 (set-face-background face color))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
682 (cond ((memq face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
683 '(ediff-current-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
684 ediff-current-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
685 ediff-current-diff-face-C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
686 (copy-face 'highlight face))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
687 ((memq face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
688 '(ediff-fine-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
689 ediff-fine-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
690 ediff-fine-diff-face-C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
691 ;; ediff-combined-diff-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
692 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
693 (copy-face 'secondary-selection face)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
694 (set-face-underline-p face t))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
695 ((memq face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
696 '(ediff-even-diff-face-A ediff-odd-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
697 ediff-even-diff-face-B ediff-odd-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
698 ediff-even-diff-face-C ediff-odd-diff-face-C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
699 (copy-face 'secondary-selection face)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
700
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
701 (defvar ediff-current-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
702 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
703 (make-face 'ediff-current-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
704 (or (face-differs-from-default-p 'ediff-current-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
705 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
706 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
707 'foreground 'ediff-current-diff-face-A "firebrick")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
708 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
709 'background 'ediff-current-diff-face-A "pale green"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
710 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
711 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
712 (copy-face 'modeline 'ediff-current-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
713 (copy-face 'highlight 'ediff-current-diff-face-A))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
714 )))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
715 'ediff-current-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
716 "Face for highlighting the selected difference in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
717
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
718 (defvar ediff-current-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
719 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
720 (make-face 'ediff-current-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
721 (or (face-differs-from-default-p 'ediff-current-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
722 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
723 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
724 'foreground 'ediff-current-diff-face-B "DarkOrchid")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
725 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
726 'background 'ediff-current-diff-face-B "Yellow"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
727 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
728 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
729 (copy-face 'modeline 'ediff-current-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
730 (copy-face 'highlight 'ediff-current-diff-face-B))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
731 )))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
732 'ediff-current-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
733 "Face for highlighting the selected difference in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
734
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
735
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
736 (defvar ediff-current-diff-face-C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
737 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
738 (make-face 'ediff-current-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
739 (or (face-differs-from-default-p 'ediff-current-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
740 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
741 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
742 'foreground 'ediff-current-diff-face-C "Navy")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
743 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
744 'background 'ediff-current-diff-face-C "Pink"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
745 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
746 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
747 (copy-face 'modeline 'ediff-current-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
748 (copy-face 'highlight 'ediff-current-diff-face-C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
749 )))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
750 'ediff-current-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
751 "Face for highlighting the selected difference in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
752
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
753 (defvar ediff-fine-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
754 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
755 (make-face 'ediff-fine-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
756 (or (face-differs-from-default-p 'ediff-fine-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
757 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
758 (ediff-set-face 'foreground 'ediff-fine-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
759 "Navy")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
760 (ediff-set-face 'background 'ediff-fine-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
761 "sky blue"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
762 (t (set-face-underline-p 'ediff-fine-diff-face-A t))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
763 'ediff-fine-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
764 "Face for highlighting the refinement of the selected diff in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
765
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
766 (defvar ediff-fine-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
767 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
768 (make-face 'ediff-fine-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
769 (or (face-differs-from-default-p 'ediff-fine-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
770 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
771 (ediff-set-face 'foreground 'ediff-fine-diff-face-B "Black")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
772 (ediff-set-face 'background 'ediff-fine-diff-face-B "cyan"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
773 (t (set-face-underline-p 'ediff-fine-diff-face-B t))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
774 'ediff-fine-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
775 "Face for highlighting the refinement of the selected diff in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
776
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
777 (defvar ediff-fine-diff-face-C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
778 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
779 (make-face 'ediff-fine-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
780 (or (face-differs-from-default-p 'ediff-fine-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
781 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
782 (ediff-set-face 'foreground 'ediff-fine-diff-face-C "black")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
783 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
784 'background 'ediff-fine-diff-face-C "Turquoise"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
785 (t (set-face-underline-p 'ediff-fine-diff-face-C t))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
786 'ediff-fine-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
787 "Face for highlighting the refinement of the selected diff in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
788
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
789 ;; (defvar ediff-combined-diff-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
790 ;; (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
791 ;; (make-face 'ediff-combined-diff-face)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
792 ;; (or (face-differs-from-default-p 'ediff-combined-diff-face)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
793 ;; (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
794 ;; (ediff-set-face 'foreground 'ediff-combined-diff-face "black")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
795 ;; (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
796 ;; 'background 'ediff-combined-diff-face "Plum"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
797 ;; (t (set-face-underline-p 'ediff-combined-diff-face t))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
798 ;; 'ediff-combined-diff-face)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
799 ;; "Face for highlighting combined selected diff regions in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
800
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
801 (defvar ediff-even-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
802 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
803 (make-face 'ediff-even-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
804 (or (face-differs-from-default-p 'ediff-even-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
805 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
806 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
807 'foreground 'ediff-even-diff-face-A "black")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
808 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
809 'background 'ediff-even-diff-face-A "light grey"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
810 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
811 (copy-face 'italic 'ediff-even-diff-face-A))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
812 'ediff-even-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
813 "Face used to highlight even-numbered differences in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
814
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
815 (defvar ediff-even-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
816 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
817 (make-face 'ediff-even-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
818 (or (face-differs-from-default-p 'ediff-even-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
819 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
820 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
821 'foreground 'ediff-even-diff-face-B "White")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
822 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
823 'background 'ediff-even-diff-face-B "Gray"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
824 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
825 (copy-face 'italic 'ediff-even-diff-face-B))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
826 'ediff-even-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
827 "Face used to highlight even-numbered differences in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
828
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
829 (defvar ediff-even-diff-face-C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
830 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
831 (make-face 'ediff-even-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
832 (copy-face 'ediff-even-diff-face-A 'ediff-even-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
833 'ediff-even-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
834 "Face used to highlight even-numbered differences in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
835
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
836 (defvar ediff-odd-diff-face-A
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
837 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
838 (make-face 'ediff-odd-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
839 (or (face-differs-from-default-p 'ediff-odd-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
840 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
841 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
842 'foreground 'ediff-odd-diff-face-A "White")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
843 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
844 'background 'ediff-odd-diff-face-A "Gray"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
845 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
846 (copy-face 'italic 'ediff-odd-diff-face-A))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
847 'ediff-odd-diff-face-A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
848 "Face used to highlight odd-numbered differences in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
849
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
850 (defvar ediff-odd-diff-face-B
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
851 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
852 (make-face 'ediff-odd-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
853 (or (face-differs-from-default-p 'ediff-odd-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
854 (cond ((ediff-display-color-p)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
855 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
856 'foreground 'ediff-odd-diff-face-B "Black")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
857 (ediff-set-face
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
858 'background 'ediff-odd-diff-face-B "light grey"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
859 (t
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
860 (copy-face 'italic 'ediff-odd-diff-face-B))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
861 'ediff-odd-diff-face-B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
862 "Face used to highlight odd-numbered differences in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
863
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
864 (defvar ediff-odd-diff-face-C
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
865 (progn
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
866 (make-face 'ediff-odd-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
867 (copy-face 'ediff-odd-diff-face-A 'ediff-odd-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
868 'ediff-odd-diff-face-C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
869 "Face used to highlight odd-numbered differences in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
870
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
871 ;; Create *-var faces. These are the actual faces used to highlight
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
872 ;; odd-numbered difference regions.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
873 ;; They are used as follows: when highlighting is turned on,
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
874 ;; ediff-odd/even-diff-face-A/B/C are copied
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
875 ;; into ediff-odd/even-diff-face-A/B/C-var, and all odd/even overlays become
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
876 ;; highlighted. When highlighting is turned off, then the face 'default is
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
877 ;; copied into ediff-odd/even-diff-face-A/B/C-var, thereby unhighlighting all
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
878 ;; difference regions.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
879 (make-face 'ediff-even-diff-face-A-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
880 (make-face 'ediff-even-diff-face-B-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
881 (make-face 'ediff-even-diff-face-C-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
882 (make-face 'ediff-odd-diff-face-A-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
883 (make-face 'ediff-odd-diff-face-B-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
884 (make-face 'ediff-odd-diff-face-C-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
885
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
886 ;; initialize *-var faces
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
887 (defun ediff-init-var-faces ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
888 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
889 ediff-even-diff-face-A 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
890 'ediff-even-diff-face-A-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
891 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
892 ediff-even-diff-face-B 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
893 'ediff-even-diff-face-B-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
894 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
895 ediff-even-diff-face-C 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
896 'ediff-even-diff-face-C-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
897 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
898 ediff-odd-diff-face-A 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
899 'ediff-odd-diff-face-A-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
900 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
901 ediff-odd-diff-face-B 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
902 'ediff-odd-diff-face-B-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
903 (copy-face (if (and ediff-use-faces ediff-highlight-all-diffs)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
904 ediff-odd-diff-face-C 'default)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
905 'ediff-odd-diff-face-C-var)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
906 )
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
907
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
908
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
909 ;;; Overlays
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
910
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
911 (ediff-defvar-local ediff-current-diff-overlay-A nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
912 "Overlay for the current difference region in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
913 (ediff-defvar-local ediff-current-diff-overlay-B nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
914 "Overlay for the current difference region in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
915 (ediff-defvar-local ediff-current-diff-overlay-C nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
916 "Overlay for the current difference region in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
917
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
918 (defun ediff-make-current-diff-overlay (type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
919 (let ((overlay (intern (format "ediff-current-diff-overlay-%S" type)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
920 (buffer (ediff-get-buffer type))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
921 (face (face-name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
922 (symbol-value
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
923 (intern (format "ediff-current-diff-face-%S" type))))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
924 (set overlay
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
925 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
926 (ediff-overlay-put (symbol-value overlay) 'face face)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
927 (ediff-overlay-put (symbol-value overlay) 'ediff ediff-control-buffer)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
928 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
929
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
930 ;; Compute priority of ediff overlay.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
931 (defun ediff-highest-priority (start end buffer)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
932 (let ((pos (max 1 (1- start)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
933 ovr-list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
934 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
935 (1+ ediff-shadow-overlay-priority)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
936 (ediff-eval-in-buffer buffer
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
937 (while (< pos (min (point-max) (1+ end)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
938 (setq ovr-list (append (overlays-at pos) ovr-list))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
939 (setq pos (next-overlay-change pos)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
940 (1+ (apply '+
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
941 (mapcar (function
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
942 (lambda (ovr)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
943 (if ovr
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
944 (or (ediff-overlay-get ovr 'priority) 0)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
945 0)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
946 ovr-list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
947 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
948 ))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
949
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
950 ) ; end of window-system-only code.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
951
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
952
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
953 (defvar ediff-toggle-read-only-function nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
954 "*Specifies the function to be used to toggle read-only.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
955 If nil, Ediff tries to deduce the function from the binding of C-x C-q.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
956 Normally, this is the `toggle-read-only' function, but, if version
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
957 control is used, it could be `vc-toggle-read-only' or `rcs-toggle-read-only'.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
958
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
959 (ediff-defvar-local ediff-file-checked-out-flag nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
960 "If t, indicates that buffer has been already checked out.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
961
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
962
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
963
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
964 ;;; Misc
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
965
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
966 ;; when emacs will have before/after-string in overlays, this variable will
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
967 ;; be deleted
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
968 (defconst ediff-saved-variables
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
969 '(;;buffer-read-only
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
970 buffer-auto-save-file-name)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
971 "Buffer-local variables saved and restored during an Ediff session.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
972
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
973 ;; to be deleted in due time
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
974 (defconst ediff-working-values '(nil)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
975 "Values to be assigned to `ediff-saved-variables' during diff.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
976
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
977 ;; if nil, this silences some messages
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
978 (defconst ediff-verbose-p t)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
979
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
980 (defvar ediff-no-emacs-help-in-control-buffer nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
981 "*Non-nil means C-h should not invoke Emacs help in control buffer.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
982 Instead, C-h jumps to previous difference.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
983
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
984 (defvar ediff-temp-file-prefix
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
985 (let ((env (or (getenv "TMPDIR")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
986 (getenv "TMP")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
987 (getenv "TEMP")))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
988 d)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
989 (setq d (if (and env (> (length env) 0))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
990 env
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
991 (if (memq system-type '(vax-vms axp-vms))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
992 "SYS$SCRATCH:"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
993 "/tmp")))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
994 ;; The following is to make sure we get something to which we can
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
995 ;; add directory levels on VMS.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
996 (setq d (file-name-as-directory (directory-file-name d)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
997 ;;(concat d "ediff")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
998 )
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
999 "*Prefix to put on Ediff temporary file names.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1000 Do not start with `~/' or `~user-name/'.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1001
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1002 (defvar ediff-temp-file-mode 384 ; u=rw only
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1003 "*Mode for Ediff temporary files.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1004
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1005 ;; Metacharacters that have to be protected from the shell when executing
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1006 ;; a diff/diff3 command.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1007 (defvar ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1008 "Characters that must be quoted with \\ when used in a shell command line.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1009 More precisely, a regexp to match any one such character.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1010
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1011
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1012 (ediff-defvar-local ediff-temp-file-A nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1013 "Temporary file used for refining difference regions in buffer A.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1014 (ediff-defvar-local ediff-temp-file-B nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1015 "Temporary file used for refining difference regions in buffer B.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1016 (ediff-defvar-local ediff-temp-file-C nil
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1017 "Temporary file used for refining difference regions in buffer C.")
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1018
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1019 ;;; In-line functions
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1020
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1021 (defsubst ediff-file-remote-p (file-name)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1022 (if (fboundp ediff-ange-ftp-ftp-name)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1023 (funcall ediff-ange-ftp-ftp-name file-name)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1024
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1025 (defsubst ediff-frame-has-menubar ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1026 (and window-system
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1027 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1028 current-menubar
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1029 (let ((lines (cdr (assq 'menu-bar-lines
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1030 (frame-parameters (ediff-selected-frame))))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1031 (or (eq lines t) (and (numberp lines) (< 0 lines))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1032 )))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1033
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1034 (defsubst ediff-frame-unsplittable-p (frame)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1035 (cdr (assq 'unsplittable (ediff-frame-parameters frame))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1036
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1037 (defsubst ediff-get-next-window (wind prev-wind)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1038 (or (window-live-p wind)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1039 (setq wind (if prev-wind
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1040 (next-window wind)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1041 (selected-window)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1042
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1043 (defsubst ediff-convert-diffs-to-overlays (diff-list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1044 (ediff-set-diff-overlays-in-one-buffer 'A diff-list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1045 (ediff-set-diff-overlays-in-one-buffer 'B diff-list)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1046 (if ediff-3way-job
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1047 (ediff-set-diff-overlays-in-one-buffer 'C diff-list))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1048 (message "Processing difference regions ... done"))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1049
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1050
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1051 (defsubst ediff-kill-buffer-carefully (buf)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1052 "Kill buffer BUF if it exists."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1053 (if (ediff-buffer-live-p buf)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1054 (kill-buffer (get-buffer buf))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1055
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1056
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1057 (defsubst ediff-highlight-diff (n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1058 "Put face on diff N. Invoked for X displays only."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1059 (ediff-highlight-diff-in-one-buffer n 'A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1060 (ediff-highlight-diff-in-one-buffer n 'B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1061 (ediff-highlight-diff-in-one-buffer n 'C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1062
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1063
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1064 (defsubst ediff-unhighlight-diff ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1065 "Remove overlays from buffers A, B, and C."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1066 (ediff-unhighlight-diff-in-one-buffer 'A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1067 (ediff-unhighlight-diff-in-one-buffer 'B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1068 (ediff-unhighlight-diff-in-one-buffer 'C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1069
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1070 ;; delete highlighting overlays, restore faces to their original form
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1071 (defsubst ediff-unhighlight-diffs-totally ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1072 (ediff-unhighlight-diffs-totally-in-one-buffer 'A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1073 (ediff-unhighlight-diffs-totally-in-one-buffer 'B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1074 (ediff-unhighlight-diffs-totally-in-one-buffer 'C))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1075
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1076
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1077 ;; arg is a record for a given diff in a difference vector
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1078 ;; this record is itself a vector
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1079 (defsubst ediff-clear-fine-diff-vector (diff-record)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1080 (if diff-record
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1081 (mapcar 'ediff-delete-overlay
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1082 (ediff-get-fine-diff-vector-from-diff-record diff-record))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1083
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1084 (defsubst ediff-clear-fine-differences-in-one-buffer (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1085 (ediff-clear-fine-diff-vector (ediff-get-difference n buf-type))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1086 (ediff-set-fine-diff-vector n buf-type nil))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1087
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1088 (defsubst ediff-clear-fine-differences (n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1089 (ediff-clear-fine-differences-in-one-buffer n 'A)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1090 (ediff-clear-fine-differences-in-one-buffer n 'B)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1091 (if ediff-3way-job
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1092 (ediff-clear-fine-differences-in-one-buffer n 'C)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1093
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1094
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1095 (defsubst ediff-convert-fine-diffs-to-overlays (diff-list region-num)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1096 (ediff-set-fine-overlays-in-one-buffer 'A diff-list region-num)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1097 (ediff-set-fine-overlays-in-one-buffer 'B diff-list region-num)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1098 (if ediff-3way-job
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1099 (ediff-set-fine-overlays-in-one-buffer 'C diff-list region-num)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1100 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1101
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1102 (defsubst ediff-mouse-event-p (event)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1103 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1104 (button-event-p event)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1105 (string-match "mouse" (format "%S" (event-basic-type event)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1106 ))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1107
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1108 (defsubst ediff-frame-iconified-p (frame)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1109 (if (and window-system (ediff-frame-live-p frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1110 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1111 (screen-iconified-p frame)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1112 (eq (frame-visible-p frame) 'icon))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1113
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1114 (defsubst ediff-window-visible-p (wind)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1115 (and (window-live-p wind)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1116 ;; under non-wondow system, window-live-p also means window is visible
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1117 (or (not window-system)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1118 (ediff-frame-visible-p (ediff-window-frame wind)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1119
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1120
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1121 (defsubst ediff-frame-char-width (frame)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1122 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1123 (/ (screen-pixel-width frame) (screen-width frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1124 (frame-char-width frame)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1125
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1126 (defsubst ediff-frame-char-height (frame)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1127 (if ediff-xemacs-p
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1128 (/ (screen-pixel-height frame) (screen-height frame))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1129 (frame-char-height frame)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1130
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1131
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1132 (defsubst ediff-empty-overlay-p (overl)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1133 (= (ediff-overlay-start overl) (ediff-overlay-end overl)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1134
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1135 ;; t if diff region is empty.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1136 ;; In case of buffer C, t also if it is not a 3way
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1137 ;; comparison job (merging jobs return t as well).
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1138 (defun ediff-empty-diff-region-p (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1139 (if (eq buf-type 'C)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1140 (or (not ediff-3way-comparison-job)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1141 (= (ediff-get-diff-posn 'C 'beg n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1142 (ediff-get-diff-posn 'C 'end n)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1143 (= (ediff-get-diff-posn buf-type 'beg n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1144 (ediff-get-diff-posn buf-type 'end n))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1145
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1146 ;; Test if diff region is white space only.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1147 ;; If 2-way job and buf-type = C, then returns t.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1148 (defun ediff-whitespace-diff-region-p (n buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1149 (or (and (eq buf-type 'C) (not ediff-3way-job))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1150 (let ((beg (ediff-get-diff-posn buf-type 'beg n))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1151 (end (ediff-get-diff-posn buf-type 'end n)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1152 (ediff-eval-in-buffer (ediff-get-buffer buf-type)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1153 (save-excursion
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1154 (goto-char beg)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1155 (skip-chars-forward ediff-whitespace)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1156 (>= (point) end))))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1157
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1158 ;; temporarily uses DIR to abbreviate file name
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1159 ;; if DIR is nil, use default-directory
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1160 (defsubst ediff-abbreviate-filename (file dir)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1161 (let* ((dir (or dir default-directory))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1162 (directory-abbrev-alist (list (cons dir ""))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1163 (abbreviate-file-name file)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1164
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1165 (defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1166 (ediff-eval-in-buffer
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1167 (ediff-eval-in-buffer ctrl-buf (ediff-get-buffer buf-type))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1168 (buffer-substring
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1169 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1170 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf)))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1171
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1172 ;; If ediff modified mode line, strip the modification
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1173 (defsubst ediff-strip-mode-line-format ()
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1174 (if (member (car mode-line-format) '(" A: " " B: " " C: "))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1175 (setq mode-line-format (nth 2 mode-line-format))))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1176
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1177 ;; Verify that we have a difference selected.
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1178 (defsubst ediff-valid-difference-p (&optional n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1179 (or n (setq n ediff-current-difference))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1180 (and (>= n 0) (< n ediff-number-of-differences)))
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1181
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1182 (defsubst ediff-show-all-diffs (n)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1183 "Don't skip difference regions."
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1184 nil)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1185
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1186 (provide 'ediff-init)
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1187
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1188
57316020d271 Initial revision
Karl Heuer <kwzh@gnu.org>
parents:
diff changeset
1189 ;;; ediff-init.el ends here