38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1 ;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff
|
14169
|
2
|
61310
|
3 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
79721
|
4 ;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
11042
|
5
|
42602
|
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
|
11042
|
7
|
|
8 ;; This file is part of GNU Emacs.
|
|
9
|
94678
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
|
11042
|
11 ;; it under the terms of the GNU General Public License as published by
|
94678
|
12 ;; the Free Software Foundation, either version 3 of the License, or
|
|
13 ;; (at your option) any later version.
|
11042
|
14
|
|
15 ;; GNU Emacs is distributed in the hope that it will be useful,
|
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18 ;; GNU General Public License for more details.
|
|
19
|
|
20 ;; You should have received a copy of the GNU General Public License
|
94678
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
11042
|
22
|
38422
|
23 ;;; Commentary:
|
|
24
|
14169
|
25 ;;; Code:
|
11042
|
26
|
15480
|
27 ;; Start compiler pacifier
|
|
28 (defvar ediff-metajob-name)
|
|
29 (defvar ediff-meta-buffer)
|
|
30 (defvar ediff-grab-mouse)
|
|
31 (defvar ediff-mouse-pixel-position)
|
|
32 (defvar ediff-mouse-pixel-threshold)
|
|
33 (defvar ediff-whitespace)
|
|
34 (defvar ediff-multiframe)
|
21940
|
35 (defvar ediff-use-toolbar-p)
|
42602
|
36 (defvar mswindowsx-bitmap-file-path)
|
15480
|
37 ;; end pacifier
|
|
38
|
|
39 (defvar ediff-force-faces nil
|
|
40 "If t, Ediff will think that it is running on a display that supports faces.
|
|
41 This is provided as a temporary relief for users of face-capable displays
|
|
42 that Ediff doesn't know about.")
|
|
43
|
12085
|
44 ;; Are we running as a window application or on a TTY?
|
|
45 (defsubst ediff-device-type ()
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
46 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
47 (device-type (selected-device))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
48 window-system))
|
15480
|
49
|
12085
|
50 ;; in XEmacs: device-type is tty on tty and stream in batch.
|
14582
|
51 (defun ediff-window-display-p ()
|
|
52 (and (ediff-device-type) (not (memq (ediff-device-type) '(tty pc stream)))))
|
|
53
|
|
54 ;; test if supports faces
|
|
55 (defun ediff-has-face-support-p ()
|
|
56 (cond ((ediff-window-display-p))
|
|
57 (ediff-force-faces)
|
30089
|
58 ((ediff-color-display-p))
|
85972
|
59 ((featurep 'emacs) (memq (ediff-device-type) '(pc)))
|
|
60 ((featurep 'xemacs) (memq (ediff-device-type) '(tty pc)))
|
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
61 ))
|
16766
|
62
|
42602
|
63 ;; toolbar support for emacs hasn't been implemented in ediff
|
21940
|
64 (defun ediff-has-toolbar-support-p ()
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
65 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
66 (if (featurep 'toolbar) (console-on-window-system-p))))
|
21940
|
67
|
43220
|
68
|
|
69 (defun ediff-has-gutter-support-p ()
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
70 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
71 (if (featurep 'gutter) (console-on-window-system-p))))
|
43220
|
72
|
21940
|
73 (defun ediff-use-toolbar-p ()
|
|
74 (and (ediff-has-toolbar-support-p) ;Can it do it ?
|
|
75 (boundp 'ediff-use-toolbar-p)
|
|
76 ediff-use-toolbar-p)) ;Does the user want it ?
|
|
77
|
81334
|
78 ;; Defines VAR as an advertised local variable.
|
15480
|
79 ;; Performs a defvar, then executes `make-variable-buffer-local' on
|
|
80 ;; the variable. Also sets the `permanent-local' property,
|
|
81 ;; so that `kill-all-local-variables' (called by major-mode setting
|
|
82 ;; commands) won't destroy Ediff control variables.
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
83 ;;
|
15480
|
84 ;; Plagiarised from `emerge-defvar-local' for XEmacs.
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
85 (defmacro ediff-defvar-local (var value doc)
|
81334
|
86 "Defines VAR as a local variable."
|
81076
|
87 (declare (indent defun))
|
26585
|
88 `(progn
|
|
89 (defvar ,var ,value ,doc)
|
|
90 (make-variable-buffer-local ',var)
|
|
91 (put ',var 'permanent-local t)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
92
|
15480
|
93
|
|
94
|
|
95 ;; Variables that control each Ediff session---local to the control buffer.
|
|
96
|
|
97 ;; Mode variables
|
|
98 ;; The buffer in which the A variant is stored.
|
|
99 (ediff-defvar-local ediff-buffer-A nil "")
|
|
100 ;; The buffer in which the B variant is stored.
|
|
101 (ediff-defvar-local ediff-buffer-B nil "")
|
26263
|
102 ;; The buffer in which the C variant is stored or where the merge buffer lives.
|
15480
|
103 (ediff-defvar-local ediff-buffer-C nil "")
|
|
104 ;; Ancestor buffer
|
|
105 (ediff-defvar-local ediff-ancestor-buffer nil "")
|
18054
|
106 ;; The Ediff control buffer
|
15480
|
107 (ediff-defvar-local ediff-control-buffer nil "")
|
11042
|
108
|
42602
|
109 (ediff-defvar-local ediff-temp-indirect-buffer nil
|
|
110 "If t, the buffer is a temporary indirect buffer.
|
|
111 It needs to be killed when we quit the session.")
|
|
112
|
19047
|
113
|
|
114 ;; Association between buff-type and ediff-buffer-*
|
|
115 (defconst ediff-buffer-alist
|
|
116 '((?A . ediff-buffer-A)
|
|
117 (?B . ediff-buffer-B)
|
|
118 (?C . ediff-buffer-C)))
|
|
119
|
11042
|
120 ;;; Macros
|
|
121 (defmacro ediff-odd-p (arg)
|
26585
|
122 `(eq (logand ,arg 1) 1))
|
11042
|
123
|
|
124 (defmacro ediff-buffer-live-p (buf)
|
26585
|
125 `(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
|
11042
|
126
|
|
127 (defmacro ediff-get-buffer (arg)
|
26585
|
128 `(cond ((eq ,arg 'A) ediff-buffer-A)
|
|
129 ((eq ,arg 'B) ediff-buffer-B)
|
|
130 ((eq ,arg 'C) ediff-buffer-C)
|
|
131 ((eq ,arg 'Ancestor) ediff-ancestor-buffer)
|
|
132 ))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
133
|
11042
|
134 (defmacro ediff-get-value-according-to-buffer-type (buf-type list)
|
26585
|
135 `(cond ((eq ,buf-type 'A) (nth 0 ,list))
|
|
136 ((eq ,buf-type 'B) (nth 1 ,list))
|
|
137 ((eq ,buf-type 'C) (nth 2 ,list))
|
|
138 ))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
139
|
11042
|
140 (defmacro ediff-char-to-buftype (arg)
|
26585
|
141 `(cond ((memq ,arg '(?a ?A)) 'A)
|
|
142 ((memq ,arg '(?b ?B)) 'B)
|
|
143 ((memq ,arg '(?c ?C)) 'C)
|
|
144 ))
|
19047
|
145
|
19241
|
146
|
19047
|
147 ;; A-list is supposed to be of the form (A . symb) (B . symb)...)
|
|
148 ;; where the first part of any association is a buffer type and the second is
|
26263
|
149 ;; an appropriate symbol. Given buffer-type, this function returns the
|
|
150 ;; symbol. This is used to avoid using `intern'
|
19047
|
151 (defsubst ediff-get-symbol-from-alist (buf-type alist)
|
|
152 (cdr (assoc buf-type alist)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
153
|
19047
|
154 (defconst ediff-difference-vector-alist
|
|
155 '((A . ediff-difference-vector-A)
|
|
156 (B . ediff-difference-vector-B)
|
|
157 (C . ediff-difference-vector-C)
|
|
158 (Ancestor . ediff-difference-vector-Ancestor)))
|
|
159
|
11042
|
160 (defmacro ediff-get-difference (n buf-type)
|
26585
|
161 `(aref
|
|
162 (symbol-value
|
|
163 (ediff-get-symbol-from-alist
|
|
164 ,buf-type ediff-difference-vector-alist))
|
|
165 ,n))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
166
|
18054
|
167 ;; Tell if it has been previously determined that the region has
|
11042
|
168 ;; no diffs other than the white space and newlines
|
|
169 ;; The argument, N, is the diff region number used by Ediff to index the
|
26263
|
170 ;; diff vector. It is 1 less than the number seen by the user.
|
18054
|
171 ;; Returns:
|
|
172 ;; t if the diffs are whitespace in all buffers
|
|
173 ;; 'A (in 3-buf comparison only) if there are only whitespace
|
|
174 ;; diffs in bufs B and C
|
|
175 ;; 'B (in 3-buf comparison only) if there are only whitespace
|
|
176 ;; diffs in bufs A and C
|
|
177 ;; 'C (in 3-buf comparison only) if there are only whitespace
|
|
178 ;; diffs in bufs A and B
|
11042
|
179 ;;
|
26263
|
180 ;; A Difference Vector has the form:
|
11042
|
181 ;; [diff diff diff ...]
|
|
182 ;; where each diff has the form:
|
26263
|
183 ;; [overlay fine-diff-vector no-fine-diffs-flag state-of-difference]
|
11042
|
184 ;; fine-diff-vector is a vector [fine-diff fine-diff fine-diff ...]
|
26263
|
185 ;; no-fine-diffs-flag says if there are fine differences.
|
|
186 ;; state-of-difference is A, B, C, or nil, indicating which buffer is
|
|
187 ;; different from the other two (used only in 3-way jobs).
|
11042
|
188 (defmacro ediff-no-fine-diffs-p (n)
|
26585
|
189 `(aref (ediff-get-difference ,n 'A) 2))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
190
|
11042
|
191 (defmacro ediff-get-diff-overlay-from-diff-record (diff-rec)
|
26585
|
192 `(aref ,diff-rec 0))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
193
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
194 (defmacro ediff-get-diff-overlay (n buf-type)
|
26585
|
195 `(ediff-get-diff-overlay-from-diff-record
|
|
196 (ediff-get-difference ,n ,buf-type)))
|
11042
|
197
|
|
198 (defmacro ediff-get-fine-diff-vector-from-diff-record (diff-rec)
|
26585
|
199 `(aref ,diff-rec 1))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
200
|
11042
|
201 (defmacro ediff-set-fine-diff-vector (n buf-type fine-vec)
|
26585
|
202 `(aset (ediff-get-difference ,n ,buf-type) 1 ,fine-vec))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
203
|
11042
|
204 (defmacro ediff-get-state-of-diff (n buf-type)
|
26585
|
205 `(if (ediff-buffer-live-p ediff-buffer-C)
|
|
206 (aref (ediff-get-difference ,n ,buf-type) 3)))
|
11042
|
207 (defmacro ediff-set-state-of-diff (n buf-type val)
|
26585
|
208 `(aset (ediff-get-difference ,n ,buf-type) 3 ,val))
|
26263
|
209
|
11042
|
210 (defmacro ediff-get-state-of-merge (n)
|
26585
|
211 `(if ediff-state-of-merge
|
|
212 (aref (aref ediff-state-of-merge ,n) 0)))
|
11042
|
213 (defmacro ediff-set-state-of-merge (n val)
|
26585
|
214 `(if ediff-state-of-merge
|
|
215 (aset (aref ediff-state-of-merge ,n) 0 ,val)))
|
11042
|
216
|
26263
|
217 (defmacro ediff-get-state-of-ancestor (n)
|
26585
|
218 `(if ediff-state-of-merge
|
|
219 (aref (aref ediff-state-of-merge ,n) 1)))
|
26263
|
220
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
221 ;; if flag is t, puts a mark on diff region saying that
|
26263
|
222 ;; the differences are in white space only. If flag is nil,
|
11042
|
223 ;; the region is marked as essential (i.e., differences are
|
|
224 ;; not just in the white space and newlines.)
|
|
225 (defmacro ediff-mark-diff-as-space-only (n flag)
|
26585
|
226 `(aset (ediff-get-difference ,n 'A) 2 ,flag))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
227
|
11042
|
228 (defmacro ediff-get-fine-diff-vector (n buf-type)
|
26585
|
229 `(ediff-get-fine-diff-vector-from-diff-record
|
|
230 (ediff-get-difference ,n ,buf-type)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
231
|
19047
|
232 ;; Macro to switch to BUFFER, evaluate BODY, returns to original buffer.
|
|
233 ;; Doesn't save the point and mark.
|
|
234 ;; This is `with-current-buffer' with the added test for live buffers."
|
|
235 (defmacro ediff-with-current-buffer (buffer &rest body)
|
81334
|
236 "Evaluates BODY in BUFFER."
|
81076
|
237 (declare (indent 1) (debug (form body)))
|
26585
|
238 `(if (ediff-buffer-live-p ,buffer)
|
19047
|
239 (save-current-buffer
|
26585
|
240 (set-buffer ,buffer)
|
|
241 ,@body)
|
19047
|
242 (or (eq this-command 'ediff-quit)
|
|
243 (error ediff-KILLED-VITAL-BUFFER))
|
26585
|
244 ))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
245
|
11042
|
246
|
13128
|
247 (defsubst ediff-multiframe-setup-p ()
|
|
248 (and (ediff-window-display-p) ediff-multiframe))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
249
|
11042
|
250 (defmacro ediff-narrow-control-frame-p ()
|
26585
|
251 `(and (ediff-multiframe-setup-p)
|
|
252 (equal ediff-help-message ediff-brief-message-string)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
253
|
11042
|
254 (defmacro ediff-3way-comparison-job ()
|
26585
|
255 `(memq
|
|
256 ediff-job-name
|
|
257 '(ediff-files3 ediff-buffers3)))
|
11042
|
258 (ediff-defvar-local ediff-3way-comparison-job nil "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
259
|
11042
|
260 (defmacro ediff-merge-job ()
|
26585
|
261 `(memq
|
|
262 ediff-job-name
|
|
263 '(ediff-merge-files
|
|
264 ediff-merge-buffers
|
|
265 ediff-merge-files-with-ancestor
|
|
266 ediff-merge-buffers-with-ancestor
|
|
267 ediff-merge-revisions
|
|
268 ediff-merge-revisions-with-ancestor)))
|
11042
|
269 (ediff-defvar-local ediff-merge-job nil "")
|
|
270
|
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
271 (defmacro ediff-patch-job ()
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
272 `(eq ediff-job-name 'epatch))
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
273
|
11042
|
274 (defmacro ediff-merge-with-ancestor-job ()
|
26585
|
275 `(memq
|
|
276 ediff-job-name
|
|
277 '(ediff-merge-files-with-ancestor
|
|
278 ediff-merge-buffers-with-ancestor
|
|
279 ediff-merge-revisions-with-ancestor)))
|
11042
|
280 (ediff-defvar-local ediff-merge-with-ancestor-job nil "")
|
|
281
|
|
282 (defmacro ediff-3way-job ()
|
26585
|
283 `(or ediff-3way-comparison-job ediff-merge-job))
|
11042
|
284 (ediff-defvar-local ediff-3way-job nil "")
|
|
285
|
|
286 ;; A diff3 job is like a 3way job, but ediff-merge doesn't require the use
|
|
287 ;; of diff3.
|
|
288 (defmacro ediff-diff3-job ()
|
26585
|
289 `(or ediff-3way-comparison-job
|
|
290 ediff-merge-with-ancestor-job))
|
11042
|
291 (ediff-defvar-local ediff-diff3-job nil "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
292
|
12085
|
293 (defmacro ediff-windows-job ()
|
26585
|
294 `(memq ediff-job-name '(ediff-windows-wordwise ediff-windows-linewise)))
|
12085
|
295 (ediff-defvar-local ediff-windows-job nil "")
|
|
296
|
11042
|
297 (defmacro ediff-word-mode-job ()
|
26585
|
298 `(memq ediff-job-name '(ediff-windows-wordwise ediff-regions-wordwise)))
|
11042
|
299 (ediff-defvar-local ediff-word-mode-job nil "")
|
|
300
|
12085
|
301 (defmacro ediff-narrow-job ()
|
26585
|
302 `(memq ediff-job-name '(ediff-windows-wordwise
|
|
303 ediff-regions-wordwise
|
|
304 ediff-windows-linewise
|
|
305 ediff-regions-linewise)))
|
12085
|
306 (ediff-defvar-local ediff-narrow-job nil "")
|
|
307
|
13128
|
308 ;; Note: ediff-merge-directory-revisions-with-ancestor is not treated as an
|
|
309 ;; ancestor metajob, since it behaves differently.
|
|
310 (defsubst ediff-ancestor-metajob (&optional metajob)
|
|
311 (memq (or metajob ediff-metajob-name)
|
|
312 '(ediff-merge-directories-with-ancestor
|
|
313 ediff-merge-filegroups-with-ancestor)))
|
|
314 (defsubst ediff-revision-metajob (&optional metajob)
|
|
315 (memq (or metajob ediff-metajob-name)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
316 '(ediff-directory-revisions
|
13128
|
317 ediff-merge-directory-revisions
|
|
318 ediff-merge-directory-revisions-with-ancestor)))
|
15480
|
319 (defsubst ediff-patch-metajob (&optional metajob)
|
|
320 (memq (or metajob ediff-metajob-name)
|
|
321 '(ediff-multifile-patch)))
|
|
322 ;; metajob involving only one group of files, such as multipatch or directory
|
|
323 ;; revision
|
|
324 (defsubst ediff-one-filegroup-metajob (&optional metajob)
|
13128
|
325 (or (ediff-revision-metajob metajob)
|
15480
|
326 (ediff-patch-metajob metajob)
|
13128
|
327 ;; add more here
|
|
328 ))
|
43714
|
329 ;; jobs suitable for the operation of collecting diffs into a multifile patch
|
13128
|
330 (defsubst ediff-collect-diffs-metajob (&optional metajob)
|
14582
|
331 (memq (or metajob ediff-metajob-name)
|
|
332 '(ediff-directories
|
|
333 ediff-merge-directories
|
|
334 ediff-merge-directories-with-ancestor
|
43714
|
335 ediff-directory-revisions
|
14582
|
336 ediff-merge-directory-revisions
|
|
337 ediff-merge-directory-revisions-with-ancestor
|
|
338 ;; add more here
|
|
339 )))
|
16248
|
340 (defsubst ediff-merge-metajob (&optional metajob)
|
|
341 (memq (or metajob ediff-metajob-name)
|
|
342 '(ediff-merge-directories
|
|
343 ediff-merge-directories-with-ancestor
|
|
344 ediff-merge-directory-revisions
|
|
345 ediff-merge-directory-revisions-with-ancestor
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
346 ediff-merge-filegroups-with-ancestor
|
16248
|
347 ;; add more here
|
|
348 )))
|
14582
|
349
|
13128
|
350 (defsubst ediff-metajob3 (&optional metajob)
|
|
351 (memq (or metajob ediff-metajob-name)
|
|
352 '(ediff-merge-directories-with-ancestor
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
353 ediff-merge-filegroups-with-ancestor
|
13128
|
354 ediff-directories3
|
|
355 ediff-filegroups3)))
|
|
356 (defsubst ediff-comparison-metajob3 (&optional metajob)
|
|
357 (memq (or metajob ediff-metajob-name)
|
|
358 '(ediff-directories3 ediff-filegroups3)))
|
|
359
|
16766
|
360 ;; with no argument, checks if we are in ediff-control-buffer
|
|
361 ;; with argument, checks if we are in ediff-meta-buffer
|
|
362 (defun ediff-in-control-buffer-p (&optional meta-buf-p)
|
|
363 (and (boundp 'ediff-control-buffer)
|
|
364 (eq (if meta-buf-p ediff-meta-buffer ediff-control-buffer)
|
|
365 (current-buffer))))
|
|
366
|
|
367 (defsubst ediff-barf-if-not-control-buffer (&optional meta-buf-p)
|
|
368 (or (ediff-in-control-buffer-p meta-buf-p)
|
13128
|
369 (error "%S: This command runs in Ediff Control Buffer only!"
|
|
370 this-command)))
|
|
371
|
20206
|
372 (defgroup ediff-highlighting nil
|
64007
35df749b5a09
(ediff-highlighting, ediff-merge, ediff-hook): Finish `defgroup' description
Juanma Barranquero <lekktu@gmail.com>
diff
changeset
|
373 "Hilighting of difference regions in Ediff."
|
20206
|
374 :prefix "ediff-"
|
|
375 :group 'ediff)
|
|
376
|
|
377 (defgroup ediff-merge nil
|
64007
35df749b5a09
(ediff-highlighting, ediff-merge, ediff-hook): Finish `defgroup' description
Juanma Barranquero <lekktu@gmail.com>
diff
changeset
|
378 "Merging utilities."
|
20206
|
379 :prefix "ediff-"
|
|
380 :group 'ediff)
|
|
381
|
|
382 (defgroup ediff-hook nil
|
64007
35df749b5a09
(ediff-highlighting, ediff-merge, ediff-hook): Finish `defgroup' description
Juanma Barranquero <lekktu@gmail.com>
diff
changeset
|
383 "Hooks run by Ediff."
|
20206
|
384 :prefix "ediff-"
|
|
385 :group 'ediff)
|
|
386
|
11042
|
387 ;; Hook variables
|
|
388
|
33019
|
389 (defcustom ediff-before-setup-hook nil
|
|
390 "*Hooks to run before Ediff begins to set up windows and buffers.
|
|
391 This hook can be used to save the previous window config, which can be restored
|
|
392 on ediff-quit or ediff-suspend."
|
|
393 :type 'hook
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
394 :group 'ediff-hook)
|
18839
|
395 (defcustom ediff-before-setup-windows-hook nil
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
396 "*Hooks to run before Ediff sets its window configuration.
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
397 This hook is run every time when Ediff arranges its windows.
|
33019
|
398 This happens each time Ediff detects that the windows were messed up by the
|
|
399 user."
|
18839
|
400 :type 'hook
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
401 :group 'ediff-hook)
|
18839
|
402 (defcustom ediff-after-setup-windows-hook nil
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
403 "*Hooks to run after Ediff sets its window configuration.
|
18839
|
404 This can be used to set up control window or icon in a desired place."
|
|
405 :type 'hook
|
20206
|
406 :group 'ediff-hook)
|
18839
|
407 (defcustom ediff-before-setup-control-frame-hook nil
|
11042
|
408 "*Hooks run before setting up the frame to display Ediff Control Panel.
|
|
409 Can be used to change control frame parameters to position it where it
|
18839
|
410 is desirable."
|
|
411 :type 'hook
|
20206
|
412 :group 'ediff-hook)
|
18839
|
413 (defcustom ediff-after-setup-control-frame-hook nil
|
11042
|
414 "*Hooks run after setting up the frame to display Ediff Control Panel.
|
18839
|
415 Can be used to move the frame where it is desired."
|
|
416 :type 'hook
|
20206
|
417 :group 'ediff-hook)
|
18839
|
418 (defcustom ediff-startup-hook nil
|
33019
|
419 "*Hooks to run in the control buffer after Ediff has been set up and is ready for the job."
|
18839
|
420 :type 'hook
|
20206
|
421 :group 'ediff-hook)
|
18839
|
422 (defcustom ediff-select-hook nil
|
|
423 "*Hooks to run after a difference has been selected."
|
|
424 :type 'hook
|
20206
|
425 :group 'ediff-hook)
|
18839
|
426 (defcustom ediff-unselect-hook nil
|
|
427 "*Hooks to run after a difference has been unselected."
|
|
428 :type 'hook
|
20206
|
429 :group 'ediff-hook)
|
18839
|
430 (defcustom ediff-prepare-buffer-hook nil
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
431 "*Hooks run after buffers A, B, and C are set up.
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
432 For each buffer, the hooks are run with that buffer made current."
|
18839
|
433 :type 'hook
|
20206
|
434 :group 'ediff-hook)
|
18839
|
435 (defcustom ediff-load-hook nil
|
|
436 "*Hook run after Ediff is loaded. Can be used to change defaults."
|
|
437 :type 'hook
|
20206
|
438 :group 'ediff-hook)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
439
|
18839
|
440 (defcustom ediff-mode-hook nil
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
441 "*Hook run just after ediff-mode is set up in the control buffer.
|
26263
|
442 This is done before any windows or frames are created. One can use it to
|
18839
|
443 set local variables that determine how the display looks like."
|
|
444 :type 'hook
|
20206
|
445 :group 'ediff-hook)
|
18839
|
446 (defcustom ediff-keymap-setup-hook nil
|
|
447 "*Hook run just after the default bindings in Ediff keymap are set up."
|
|
448 :type 'hook
|
20206
|
449 :group 'ediff-hook)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
450
|
18839
|
451 (defcustom ediff-display-help-hook nil
|
|
452 "*Hooks run after preparing the help message."
|
|
453 :type 'hook
|
20206
|
454 :group 'ediff-hook)
|
11042
|
455
|
34860
|
456 (defcustom ediff-suspend-hook nil
|
18839
|
457 "*Hooks to run in the Ediff control buffer when Ediff is suspended."
|
|
458 :type 'hook
|
20206
|
459 :group 'ediff-hook)
|
34860
|
460 (defcustom ediff-quit-hook nil
|
18839
|
461 "*Hooks to run in the Ediff control buffer after finishing Ediff."
|
|
462 :type 'hook
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
463 :group 'ediff-hook)
|
18839
|
464 (defcustom ediff-cleanup-hook nil
|
26263
|
465 "*Hooks to run on exiting Ediff but before killing the control and variant buffers."
|
18839
|
466 :type 'hook
|
20206
|
467 :group 'ediff-hook)
|
14582
|
468
|
|
469 ;; Error messages
|
|
470 (defconst ediff-KILLED-VITAL-BUFFER
|
|
471 "You have killed a vital Ediff buffer---you must leave Ediff now!")
|
|
472 (defconst ediff-NO-DIFFERENCES
|
15480
|
473 "Sorry, comparison of identical variants is not what I am made for...")
|
|
474 (defconst ediff-BAD-DIFF-NUMBER
|
|
475 ;; %S stands for this-command, %d - diff number, %d - max diff
|
26263
|
476 "%S: Bad diff region number, %d. Valid numbers are 1 to %d")
|
16248
|
477 (defconst ediff-BAD-INFO (format "
|
|
478 *** The Info file for Ediff, a part of the standard distribution
|
|
479 *** of %sEmacs, does not seem to be properly installed.
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
480 ***
|
16248
|
481 *** Please contact your system administrator. "
|
85972
|
482 (if (featurep 'xemacs) "X" "")))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
483
|
11042
|
484 ;; Selective browsing
|
|
485
|
|
486 (ediff-defvar-local ediff-skip-diff-region-function 'ediff-show-all-diffs
|
|
487 "Function that determines the next/previous diff region to show.
|
|
488 Should return t for regions to be ignored and nil otherwise.
|
26263
|
489 This function gets a region number as an argument. The region number
|
|
490 is the one used internally by Ediff. It is 1 less than the number seen
|
11042
|
491 by the user.")
|
|
492
|
13128
|
493 (ediff-defvar-local ediff-hide-regexp-matches-function
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
494 'ediff-hide-regexp-matches
|
13128
|
495 "Function to use in determining which regions to hide.
|
|
496 See the documentation string of `ediff-hide-regexp-matches' for details.")
|
|
497 (ediff-defvar-local ediff-focus-on-regexp-matches-function
|
|
498 'ediff-focus-on-regexp-matches
|
|
499 "Function to use in determining which regions to focus on.
|
|
500 See the documentation string of `ediff-focus-on-regexp-matches' for details.")
|
|
501
|
11042
|
502 ;; Regexp that determines buf A regions to focus on when skipping to diff
|
|
503 (ediff-defvar-local ediff-regexp-focus-A "" "")
|
|
504 ;; Regexp that determines buf B regions to focus on when skipping to diff
|
|
505 (ediff-defvar-local ediff-regexp-focus-B "" "")
|
|
506 ;; Regexp that determines buf C regions to focus on when skipping to diff
|
|
507 (ediff-defvar-local ediff-regexp-focus-C "" "")
|
|
508 ;; connective that determines whether to focus regions that match both or
|
|
509 ;; one of the regexps
|
|
510 (ediff-defvar-local ediff-focus-regexp-connective 'and "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
511
|
11042
|
512 ;; Regexp that determines buf A regions to ignore when skipping to diff
|
|
513 (ediff-defvar-local ediff-regexp-hide-A "" "")
|
|
514 ;; Regexp that determines buf B regions to ignore when skipping to diff
|
|
515 (ediff-defvar-local ediff-regexp-hide-B "" "")
|
|
516 ;; Regexp that determines buf C regions to ignore when skipping to diff
|
|
517 (ediff-defvar-local ediff-regexp-hide-C "" "")
|
|
518 ;; connective that determines whether to hide regions that match both or
|
|
519 ;; one of the regexps
|
|
520 (ediff-defvar-local ediff-hide-regexp-connective 'and "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
521
|
18839
|
522
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
523 ;;; Copying difference regions between buffers.
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
524
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
525 ;; A list of killed diffs.
|
18839
|
526 ;; A diff is saved here if it is replaced by a diff
|
|
527 ;; from another buffer. This alist has the form:
|
|
528 ;; \((num (buff-object . diff) (buff-object . diff) (buff-object . diff)) ...),
|
|
529 ;; where some buffer-objects may be missing.
|
|
530 (ediff-defvar-local ediff-killed-diffs-alist nil "")
|
11042
|
531
|
36857
|
532 ;; Syntax table to use in ediff-forward-word-function
|
|
533 ;; This is chosen by a heuristic. The important thing is for all buffers to
|
|
534 ;; have the same syntax table. Which is not too important.
|
|
535 (ediff-defvar-local ediff-syntax-table nil "")
|
|
536
|
11042
|
537
|
|
538 ;; Highlighting
|
64820
|
539 (defcustom ediff-before-flag-bol (if (featurep 'xemacs) (make-glyph "->>") "->>")
|
18839
|
540 "*Flag placed before a highlighted block of differences, if block starts at beginning of a line."
|
|
541 :type 'string
|
|
542 :tag "Region before-flag at beginning of line"
|
|
543 :group 'ediff)
|
11042
|
544
|
64820
|
545 (defcustom ediff-after-flag-eol (if (featurep 'xemacs) (make-glyph "<<-") "<<-")
|
18839
|
546 "*Flag placed after a highlighted block of differences, if block ends at end of a line."
|
|
547 :type 'string
|
|
548 :tag "Region after-flag at end of line"
|
|
549 :group 'ediff)
|
|
550
|
64820
|
551 (defcustom ediff-before-flag-mol (if (featurep 'xemacs) (make-glyph "->>") "->>")
|
18839
|
552 "*Flag placed before a highlighted block of differences, if block starts in mid-line."
|
|
553 :type 'string
|
|
554 :tag "Region before-flag in the middle of line"
|
|
555 :group 'ediff)
|
64820
|
556 (defcustom ediff-after-flag-mol (if (featurep 'xemacs) (make-glyph "<<-") "<<-")
|
18839
|
557 "*Flag placed after a highlighted block of differences, if block ends in mid-line."
|
|
558 :type 'string
|
|
559 :tag "Region after-flag in the middle of line"
|
|
560 :group 'ediff)
|
11042
|
561
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
562
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
563 (ediff-defvar-local ediff-use-faces t "")
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
564 (defcustom ediff-use-faces t
|
14582
|
565 "If t, differences are highlighted using faces, if device supports faces.
|
|
566 If nil, differences are highlighted using ASCII flags, ediff-before-flag
|
11042
|
567 and ediff-after-flag. On a non-window system, differences are always
|
21940
|
568 highlighted using ASCII flags."
|
|
569 :type 'boolean
|
|
570 :group 'ediff-highlighting)
|
11042
|
571
|
|
572 ;; this indicates that diff regions are word-size, so fine diffs are
|
12085
|
573 ;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise
|
11042
|
574 (ediff-defvar-local ediff-word-mode nil "")
|
13128
|
575 ;; Name of the job (ediff-files, ediff-windows, etc.)
|
11042
|
576 (ediff-defvar-local ediff-job-name nil "")
|
|
577
|
|
578 ;; Narrowing and ediff-region/windows support
|
|
579 ;; This is a list (overlay-A overlay-B overlay-C)
|
|
580 ;; If set, Ediff compares only those parts of buffers A/B/C that lie within
|
|
581 ;; the bounds of these overlays.
|
|
582 (ediff-defvar-local ediff-narrow-bounds nil "")
|
|
583
|
|
584 ;; List (overlay-A overlay-B overlay-C), where each overlay spans the
|
|
585 ;; entire corresponding buffer.
|
|
586 (ediff-defvar-local ediff-wide-bounds nil "")
|
|
587
|
|
588 ;; Current visibility boundaries in buffers A, B, and C.
|
26263
|
589 ;; This is also a list of overlays. When the user toggles narrow/widen,
|
11042
|
590 ;; this list changes from ediff-wide-bounds to ediff-narrow-bounds.
|
|
591 ;; and back.
|
|
592 (ediff-defvar-local ediff-visible-bounds nil "")
|
|
593
|
|
594 (ediff-defvar-local ediff-start-narrowed t
|
12085
|
595 "Non-nil means start narrowed, if doing ediff-windows-* or ediff-regions-*")
|
11042
|
596 (ediff-defvar-local ediff-quit-widened t
|
|
597 "*Non-nil means: when finished, Ediff widens buffers A/B.
|
|
598 Actually, Ediff restores the scope of visibility that existed at startup.")
|
18839
|
599
|
|
600 (defcustom ediff-keep-variants t
|
42288
|
601 "*nil means prompt to remove unmodified buffers A/B/C at session end.
|
13977
|
602 Supplying a prefix argument to the quit command `q' temporarily reverses the
|
18839
|
603 meaning of this variable."
|
|
604 :type 'boolean
|
|
605 :group 'ediff)
|
11042
|
606
|
21961
|
607 (ediff-defvar-local ediff-highlight-all-diffs t "")
|
21940
|
608 (defcustom ediff-highlight-all-diffs t
|
11042
|
609 "If nil, only the selected differences are highlighted.
|
21940
|
610 Otherwise, all difference regions are highlighted, but the selected region is
|
|
611 shown in brighter colors."
|
|
612 :type 'boolean
|
|
613 :group 'ediff-highlighting)
|
11042
|
614
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
615
|
11042
|
616 ;; The suffix of the control buffer name.
|
|
617 (ediff-defvar-local ediff-control-buffer-suffix nil "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
618 ;; Same as ediff-control-buffer-suffix, but without <,>.
|
11042
|
619 ;; It's a number rather than string.
|
|
620 (ediff-defvar-local ediff-control-buffer-number nil "")
|
|
621
|
|
622
|
|
623 ;; The original values of ediff-protected-variables for buffer A
|
12085
|
624 (ediff-defvar-local ediff-buffer-values-orig-A nil "")
|
11042
|
625 ;; The original values of ediff-protected-variables for buffer B
|
12085
|
626 (ediff-defvar-local ediff-buffer-values-orig-B nil "")
|
11042
|
627 ;; The original values of ediff-protected-variables for buffer C
|
12085
|
628 (ediff-defvar-local ediff-buffer-values-orig-C nil "")
|
13128
|
629 ;; The original values of ediff-protected-variables for buffer Ancestor
|
|
630 (ediff-defvar-local ediff-buffer-values-orig-Ancestor nil "")
|
18839
|
631
|
19047
|
632 ;; association between buff-type and ediff-buffer-values-orig-*
|
|
633 (defconst ediff-buffer-values-orig-alist
|
|
634 '((A . ediff-buffer-values-orig-A)
|
|
635 (B . ediff-buffer-values-orig-B)
|
|
636 (C . ediff-buffer-values-orig-C)
|
|
637 (Ancestor . ediff-buffer-values-orig-Ancestor)))
|
|
638
|
11042
|
639 ;; Buffer-local variables to be saved then restored during Ediff sessions
|
16248
|
640 (defconst ediff-protected-variables '(
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
641 ;;buffer-read-only
|
11042
|
642 mode-line-format))
|
|
643
|
|
644 ;; Vector of differences between the variants. Each difference is
|
|
645 ;; represented by a vector of two overlays plus a vector of fine diffs,
|
|
646 ;; plus a no-fine-diffs flag. The first overlay spans the
|
|
647 ;; difference region in the A buffer and the second overlays the diff in
|
26263
|
648 ;; the B buffer. If a difference section is empty, the corresponding
|
11042
|
649 ;; overlay's endpoints coincide.
|
|
650 ;;
|
26263
|
651 ;; The precise form of a Difference Vector for one buffer is:
|
11042
|
652 ;; [diff diff diff ...]
|
|
653 ;; where each diff has the form:
|
26263
|
654 ;; [diff-overlay fine-diff-vector no-fine-diffs-flag state-of-diff]
|
11042
|
655 ;; fine-diff-vector is a vector [fine-diff-overlay fine-diff-overlay ...]
|
|
656 ;; no-fine-diffs-flag says if there are fine differences.
|
|
657 ;; state-of-difference is A, B, C, or nil, indicating which buffer is
|
26263
|
658 ;; different from the other two (used only in 3-way jobs.
|
11042
|
659 (ediff-defvar-local ediff-difference-vector-A nil "")
|
|
660 (ediff-defvar-local ediff-difference-vector-B nil "")
|
|
661 (ediff-defvar-local ediff-difference-vector-C nil "")
|
13128
|
662 (ediff-defvar-local ediff-difference-vector-Ancestor nil "")
|
19047
|
663 ;; A-list of diff vector types associated with buffer types
|
|
664 (defconst ediff-difference-vector-alist
|
|
665 '((A . ediff-difference-vector-A)
|
|
666 (B . ediff-difference-vector-B)
|
|
667 (C . ediff-difference-vector-C)
|
|
668 (Ancestor . ediff-difference-vector-Ancestor)))
|
13128
|
669
|
|
670 ;; [ status status status ...]
|
|
671 ;; Each status: [state-of-merge state-of-ancestor]
|
26263
|
672 ;; state-of-merge is default-A, default-B, prefer-A, or prefer-B. It
|
13128
|
673 ;; indicates the way a diff region was created in buffer C.
|
|
674 ;; state-of-ancestor says if the corresponding region in ancestor buffer is
|
|
675 ;; empty.
|
|
676 (ediff-defvar-local ediff-state-of-merge nil "")
|
11042
|
677
|
|
678 ;; The difference that is currently selected.
|
|
679 (ediff-defvar-local ediff-current-difference -1 "")
|
|
680 ;; Number of differences found.
|
|
681 (ediff-defvar-local ediff-number-of-differences nil "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
682
|
11042
|
683 ;; Buffer containing the output of diff, which is used by Ediff to step
|
|
684 ;; through files.
|
|
685 (ediff-defvar-local ediff-diff-buffer nil "")
|
26263
|
686 ;; Like ediff-diff-buffer, but contains context diff. It is not used by
|
11042
|
687 ;; Ediff, but it is saved in a file, if user requests so.
|
|
688 (ediff-defvar-local ediff-custom-diff-buffer nil "")
|
|
689 ;; Buffer used for diff-style fine differences between regions.
|
|
690 (ediff-defvar-local ediff-fine-diff-buffer nil "")
|
|
691 ;; Temporary buffer used for computing fine differences.
|
|
692 (defconst ediff-tmp-buffer " *ediff-tmp*" "")
|
|
693 ;; Buffer used for messages
|
|
694 (defconst ediff-msg-buffer " *ediff-message*" "")
|
|
695 ;; Buffer containing the output of diff when diff returns errors.
|
|
696 (ediff-defvar-local ediff-error-buffer nil "")
|
|
697 ;; Buffer to display debug info
|
|
698 (ediff-defvar-local ediff-debug-buffer "*ediff-debug*" "")
|
|
699
|
13128
|
700 ;; List of ediff control panels associated with each buffer A/B/C/Ancestor.
|
|
701 ;; Not used any more, but may be needed in the future.
|
|
702 (ediff-defvar-local ediff-this-buffer-ediff-sessions nil "")
|
11042
|
703
|
|
704 ;; to be deleted in due time
|
|
705 ;; List of difference overlays disturbed by working with the current diff.
|
|
706 (defvar ediff-disturbed-overlays nil "")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
707
|
11042
|
708 ;; Priority of non-selected overlays.
|
|
709 (defvar ediff-shadow-overlay-priority 100 "")
|
|
710
|
18839
|
711 (defcustom ediff-version-control-package 'vc
|
13128
|
712 "Version control package used.
|
26263
|
713 Currently, Ediff supports vc.el, rcs.el, pcl-cvs.el, and generic-sc.el. The
|
|
714 standard Emacs interface to RCS, CVS, SCCS, etc., is vc.el. However, some
|
|
715 people find the other two packages more convenient. Set this variable to the
|
18839
|
716 appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
|
|
717 :type 'symbol
|
|
718 :group 'ediff)
|
13128
|
719
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
720 (defcustom ediff-coding-system-for-read 'raw-text
|
49588
|
721 "*The coding system for read to use when running the diff program as a subprocess.
|
98855
|
722 In most cases, the default will do. However, under certain circumstances in
|
|
723 MS-Windows you might need to use something like 'raw-text-dos here.
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
724 So, if the output that your diff program sends to Emacs contains extra ^M's,
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
725 you might need to experiment here, if the default or 'raw-text-dos doesn't
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
726 work."
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
727 :type 'symbol
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
728 :group 'ediff)
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
729
|
98855
|
730 (defcustom ediff-coding-system-for-write 'emacs-internal
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
731 "*The coding system for write to use when writing out difference regions
|
98855
|
732 to temp files in buffer jobs and when Ediff needs to find fine differences."
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
733 :type 'symbol
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
734 :group 'ediff)
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
735
|
11042
|
736
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
737 (defalias 'ediff-read-event
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
738 (if (featurep 'xemacs) 'next-command-event 'read-event))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
739
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
740 (defalias 'ediff-overlayp
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
741 (if (featurep 'xemacs) 'extentp 'overlayp))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
742
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
743 (defalias 'ediff-make-overlay
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
744 (if (featurep 'xemacs) 'make-extent 'make-overlay))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
745
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
746 (defalias 'ediff-delete-overlay
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
747 (if (featurep 'xemacs) 'delete-extent 'delete-overlay))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
748
|
94275
|
749 ;; Assumes that emacs-major-version and emacs-minor-version are defined.
|
12085
|
750 (defun ediff-check-version (op major minor &optional type-of-emacs)
|
94275
|
751 "Check the current version against MAJOR and MINOR version numbers.
|
|
752 The comparison uses operator OP, which may be any of: =, >, >=, <, <=.
|
|
753 TYPE-OF-EMACS is either 'xemacs or 'emacs."
|
|
754 (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
|
|
755 ((eq type-of-emacs 'emacs) (featurep 'emacs))
|
|
756 (t))
|
|
757 (cond ((eq op '=) (and (= emacs-minor-version minor)
|
|
758 (= emacs-major-version major)))
|
|
759 ((memq op '(> >= < <=))
|
|
760 (and (or (funcall op emacs-major-version major)
|
|
761 (= emacs-major-version major))
|
|
762 (if (= emacs-major-version major)
|
|
763 (funcall op emacs-minor-version minor)
|
|
764 t)))
|
|
765 (t
|
|
766 (error "%S: Invalid op in ediff-check-version" op)))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
767
|
94275
|
768 ;; ediff-check-version seems to be totally unused anyway.
|
|
769 (make-obsolete 'ediff-check-version 'version< "23.1")
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
770
|
30089
|
771 (defun ediff-color-display-p ()
|
|
772 (condition-case nil
|
92493
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
773 (if (featurep 'xemacs)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
774 (eq (device-class (selected-device)) 'color) ; xemacs form
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
775 (display-color-p)) ; emacs form
|
42602
|
776 (error nil)))
|
13128
|
777
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
778
|
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
779 ;; A var local to each control panel buffer. Indicates highlighting style
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
780 ;; in effect for this buffer: `face', `ascii',
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
781 ;; `off' -- turned off \(on a dumb terminal only\).
|
49588
|
782 (ediff-defvar-local ediff-highlighting-style
|
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
783 (if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
784 "")
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
785
|
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
786
|
14582
|
787 (if (ediff-has-face-support-p)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
788 (if (featurep 'xemacs)
|
93652
|
789 (progn
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
790 (defalias 'ediff-valid-color-p 'valid-color-name-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
791 (defalias 'ediff-get-face 'get-face))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
792 (defalias 'ediff-valid-color-p (if (fboundp 'color-defined-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
793 'color-defined-p
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
794 'x-color-defined-p))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
795 (defalias 'ediff-get-face 'internal-get-face)))
|
14582
|
796
|
12085
|
797 (if (ediff-window-display-p)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
798 (if (featurep 'xemacs)
|
93652
|
799 (progn
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
800 (defalias 'ediff-display-pixel-width 'device-pixel-width)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
801 (defalias 'ediff-display-pixel-height 'device-pixel-height))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
802 (defalias 'ediff-display-pixel-width
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
803 (if (fboundp 'display-pixel-width)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
804 'display-pixel-width
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
805 'x-display-pixel-width))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
806 (defalias 'ediff-display-pixel-height
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
807 (if (fboundp 'display-pixel-height)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
808 'display-pixel-height
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
809 'x-display-pixel-height))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
810
|
33019
|
811 ;; A-list of current-diff-overlay symbols associated with buf types
|
19047
|
812 (defconst ediff-current-diff-overlay-alist
|
|
813 '((A . ediff-current-diff-overlay-A)
|
|
814 (B . ediff-current-diff-overlay-B)
|
|
815 (C . ediff-current-diff-overlay-C)
|
|
816 (Ancestor . ediff-current-diff-overlay-Ancestor)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
817
|
33019
|
818 ;; A-list of current-diff-face-* symbols associated with buf types
|
19047
|
819 (defconst ediff-current-diff-face-alist
|
64215
|
820 '((A . ediff-current-diff-A)
|
|
821 (B . ediff-current-diff-B)
|
|
822 (C . ediff-current-diff-C)
|
|
823 (Ancestor . ediff-current-diff-Ancestor)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
824
|
11042
|
825
|
13128
|
826 (defun ediff-set-overlay-face (extent face)
|
|
827 (ediff-overlay-put extent 'face face)
|
|
828 (ediff-overlay-put extent 'help-echo 'ediff-region-help-echo))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
829
|
30373
|
830 (defun ediff-region-help-echo (extent-or-window &optional overlay point)
|
|
831 (unless overlay
|
|
832 (setq overlay extent-or-window))
|
|
833 (let ((is-current (ediff-overlay-get overlay 'ediff))
|
|
834 (face (ediff-overlay-get overlay 'face))
|
30394
|
835 (diff-num (ediff-overlay-get overlay 'ediff-diff-num))
|
|
836 face-help)
|
13128
|
837
|
|
838 ;; This happens only for refinement overlays
|
30373
|
839 (if (stringp face)
|
|
840 (setq face (intern face)))
|
13128
|
841 (setq face-help (and face (get face 'ediff-help-echo)))
|
|
842
|
30330
|
843 (cond ((and is-current diff-num) ; current diff region
|
15480
|
844 (format "Difference region %S -- current" (1+ diff-num)))
|
30373
|
845 (face-help) ; refinement of current diff region
|
30330
|
846 (diff-num ; non-current
|
15480
|
847 (format "Difference region %S -- non-current" (1+ diff-num)))
|
30330
|
848 (t "")) ; none
|
30332
|
849 ))
|
13128
|
850
|
14534
|
851
|
16248
|
852 (defun ediff-set-face-pixmap (face pixmap)
|
|
853 "Set face pixmap on a monochrome display."
|
|
854 (if (and (ediff-window-display-p) (not (ediff-color-display-p)))
|
|
855 (condition-case nil
|
|
856 (set-face-background-pixmap face pixmap)
|
|
857 (error
|
|
858 (message "Pixmap not found for %S: %s" (face-name face) pixmap)
|
|
859 (sit-for 1)))))
|
|
860
|
14582
|
861 (defun ediff-hide-face (face)
|
60151
|
862 (if (and (ediff-has-face-support-p)
|
|
863 (boundp 'add-to-list)
|
54576
575ec50746f9
(ediff-hide-face): Check that facemenu-unlisted-faces is bound before using it.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
864 (boundp 'facemenu-unlisted-faces))
|
14582
|
865 (add-to-list 'facemenu-unlisted-faces face)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
866
|
19241
|
867
|
|
868
|
63534
|
869 (defface ediff-current-diff-A
|
85972
|
870 (if (featurep 'emacs)
|
57127
|
871 '((((class color) (min-colors 16))
|
|
872 (:foreground "firebrick" :background "pale green"))
|
|
873 (((class color))
|
|
874 (:foreground "blue3" :background "yellow3"))
|
|
875 (t (:inverse-video t)))
|
|
876 '((((type tty)) (:foreground "blue3" :background "yellow3"))
|
|
877 (((class color)) (:foreground "firebrick" :background "pale green"))
|
|
878 (t (:inverse-video t))))
|
19241
|
879 "Face for highlighting the selected difference in buffer A."
|
|
880 :group 'ediff-highlighting)
|
26263
|
881 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
882 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
883 (defvar ediff-current-diff-face-A 'ediff-current-diff-A
|
20003
|
884 "Face for highlighting the selected difference in buffer A.
|
26263
|
885 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
886 widget to customize the actual face object `ediff-current-diff-A'
|
20003
|
887 this variable represents.")
|
64215
|
888 (ediff-hide-face ediff-current-diff-face-A)
|
19241
|
889 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
|
|
890 ;; This means that some user customization may be trashed.
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
891 (and (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
892 (ediff-has-face-support-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
893 (not (ediff-color-display-p))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
894 (copy-face 'modeline ediff-current-diff-face-A))
|
19241
|
895
|
|
896
|
11042
|
897
|
63534
|
898 (defface ediff-current-diff-B
|
85972
|
899 (if (featurep 'emacs)
|
57127
|
900 '((((class color) (min-colors 16))
|
|
901 (:foreground "DarkOrchid" :background "Yellow"))
|
|
902 (((class color))
|
|
903 (:foreground "magenta3" :background "yellow3"
|
|
904 :weight bold))
|
|
905 (t (:inverse-video t)))
|
|
906 '((((type tty)) (:foreground "magenta3" :background "yellow3"
|
|
907 :weight bold))
|
|
908 (((class color)) (:foreground "DarkOrchid" :background "Yellow"))
|
|
909 (t (:inverse-video t))))
|
19241
|
910 "Face for highlighting the selected difference in buffer B."
|
|
911 :group 'ediff-highlighting)
|
26263
|
912 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
913 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
914 (defvar ediff-current-diff-face-B 'ediff-current-diff-B
|
20003
|
915 "Face for highlighting the selected difference in buffer B.
|
26263
|
916 this variable. Instead, use the customization
|
63534
|
917 widget to customize the actual face `ediff-current-diff-B'
|
20003
|
918 this variable represents.")
|
64215
|
919 (ediff-hide-face ediff-current-diff-face-B)
|
19241
|
920 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
|
|
921 ;; This means that some user customization may be trashed.
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
922 (and (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
923 (ediff-has-face-support-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
924 (not (ediff-color-display-p))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
925 (copy-face 'modeline ediff-current-diff-face-B))
|
19241
|
926
|
11042
|
927
|
63534
|
928 (defface ediff-current-diff-C
|
85972
|
929 (if (featurep 'emacs)
|
57127
|
930 '((((class color) (min-colors 16))
|
|
931 (:foreground "Navy" :background "Pink"))
|
|
932 (((class color))
|
|
933 (:foreground "cyan3" :background "yellow3" :weight bold))
|
|
934 (t (:inverse-video t)))
|
|
935 '((((type tty)) (:foreground "cyan3" :background "yellow3" :weight bold))
|
|
936 (((class color)) (:foreground "Navy" :background "Pink"))
|
|
937 (t (:inverse-video t))))
|
19241
|
938 "Face for highlighting the selected difference in buffer C."
|
|
939 :group 'ediff-highlighting)
|
26263
|
940 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
941 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
942 (defvar ediff-current-diff-face-C 'ediff-current-diff-C
|
20003
|
943 "Face for highlighting the selected difference in buffer C.
|
26263
|
944 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
945 widget to customize the actual face object `ediff-current-diff-C'
|
20003
|
946 this variable represents.")
|
64215
|
947 (ediff-hide-face ediff-current-diff-face-C)
|
19241
|
948 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
|
|
949 ;; This means that some user customization may be trashed.
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
950 (and (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
951 (ediff-has-face-support-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
952 (not (ediff-color-display-p))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
953 (copy-face 'modeline ediff-current-diff-face-C))
|
19241
|
954
|
|
955
|
63534
|
956 (defface ediff-current-diff-Ancestor
|
85972
|
957 (if (featurep 'emacs)
|
57127
|
958 '((((class color) (min-colors 16))
|
|
959 (:foreground "Black" :background "VioletRed"))
|
|
960 (((class color))
|
|
961 (:foreground "black" :background "magenta3"))
|
|
962 (t (:inverse-video t)))
|
|
963 '((((type tty)) (:foreground "black" :background "magenta3"))
|
|
964 (((class color)) (:foreground "Black" :background "VioletRed"))
|
|
965 (t (:inverse-video t))))
|
19241
|
966 "Face for highlighting the selected difference in buffer Ancestor."
|
|
967 :group 'ediff-highlighting)
|
26263
|
968 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
969 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
970 (defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-Ancestor
|
20003
|
971 "Face for highlighting the selected difference in buffer Ancestor.
|
26263
|
972 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
973 widget to customize the actual face object `ediff-current-diff-Ancestor'
|
20003
|
974 this variable represents.")
|
64215
|
975 (ediff-hide-face ediff-current-diff-face-Ancestor)
|
19241
|
976 ;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
|
|
977 ;; This means that some user customization may be trashed.
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
978 (and (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
979 (ediff-has-face-support-p)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
980 (not (ediff-color-display-p))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
981 (copy-face 'modeline ediff-current-diff-face-Ancestor))
|
19241
|
982
|
16248
|
983
|
63534
|
984 (defface ediff-fine-diff-A
|
85972
|
985 (if (featurep 'emacs)
|
57127
|
986 '((((class color) (min-colors 16))
|
|
987 (:foreground "Navy" :background "sky blue"))
|
|
988 (((class color))
|
|
989 (:foreground "white" :background "sky blue" :weight bold))
|
|
990 (t (:underline t :stipple "gray3")))
|
|
991 '((((type tty)) (:foreground "white" :background "sky blue" :weight bold))
|
|
992 (((class color)) (:foreground "Navy" :background "sky blue"))
|
|
993 (t (:underline t :stipple "gray3"))))
|
19241
|
994 "Face for highlighting the refinement of the selected diff in buffer A."
|
|
995 :group 'ediff-highlighting)
|
26263
|
996 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
997 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
998 (defvar ediff-fine-diff-face-A 'ediff-fine-diff-A
|
20003
|
999 "Face for highlighting the fine differences in buffer A.
|
26263
|
1000 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1001 widget to customize the actual face object `ediff-fine-diff-A'
|
20003
|
1002 this variable represents.")
|
64215
|
1003 (ediff-hide-face ediff-fine-diff-face-A)
|
20343
|
1004
|
63534
|
1005 (defface ediff-fine-diff-B
|
85972
|
1006 (if (featurep 'emacs)
|
57127
|
1007 '((((class color) (min-colors 16))
|
|
1008 (:foreground "Black" :background "cyan"))
|
|
1009 (((class color))
|
|
1010 (:foreground "magenta3" :background "cyan3"))
|
|
1011 (t (:underline t :stipple "gray3")))
|
|
1012 '((((type tty)) (:foreground "magenta3" :background "cyan3"))
|
|
1013 (((class color)) (:foreground "Black" :background "cyan"))
|
|
1014 (t (:underline t :stipple "gray3"))))
|
19241
|
1015 "Face for highlighting the refinement of the selected diff in buffer B."
|
|
1016 :group 'ediff-highlighting)
|
26263
|
1017 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1018 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1019 (defvar ediff-fine-diff-face-B 'ediff-fine-diff-B
|
20003
|
1020 "Face for highlighting the fine differences in buffer B.
|
26263
|
1021 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1022 widget to customize the actual face object `ediff-fine-diff-B'
|
20003
|
1023 this variable represents.")
|
64215
|
1024 (ediff-hide-face ediff-fine-diff-face-B)
|
20343
|
1025
|
63534
|
1026 (defface ediff-fine-diff-C
|
85972
|
1027 (if (featurep 'emacs)
|
57127
|
1028 '((((type pc))
|
|
1029 (:foreground "white" :background "Turquoise"))
|
|
1030 (((class color) (min-colors 16))
|
|
1031 (:foreground "Black" :background "Turquoise"))
|
|
1032 (((class color))
|
|
1033 (:foreground "yellow3" :background "Turquoise"
|
|
1034 :weight bold))
|
|
1035 (t (:underline t :stipple "gray3")))
|
|
1036 '((((type tty)) (:foreground "yellow3" :background "Turquoise"
|
|
1037 :weight bold))
|
|
1038 (((type pc)) (:foreground "white" :background "Turquoise"))
|
|
1039 (((class color)) (:foreground "Black" :background "Turquoise"))
|
|
1040 (t (:underline t :stipple "gray3"))))
|
19241
|
1041 "Face for highlighting the refinement of the selected diff in buffer C."
|
|
1042 :group 'ediff-highlighting)
|
26263
|
1043 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1044 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1045 (defvar ediff-fine-diff-face-C 'ediff-fine-diff-C
|
20003
|
1046 "Face for highlighting the fine differences in buffer C.
|
26263
|
1047 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1048 widget to customize the actual face object `ediff-fine-diff-C'
|
20003
|
1049 this variable represents.")
|
64215
|
1050 (ediff-hide-face ediff-fine-diff-face-C)
|
20343
|
1051
|
63534
|
1052 (defface ediff-fine-diff-Ancestor
|
85972
|
1053 (if (featurep 'emacs)
|
57127
|
1054 '((((class color) (min-colors 16))
|
|
1055 (:foreground "Black" :background "Green"))
|
|
1056 (((class color))
|
|
1057 (:foreground "red3" :background "green"))
|
|
1058 (t (:underline t :stipple "gray3")))
|
|
1059 '((((type tty)) (:foreground "red3" :background "green"))
|
|
1060 (((class color)) (:foreground "Black" :background "Green"))
|
|
1061 (t (:underline t :stipple "gray3"))))
|
19241
|
1062 "Face for highlighting the refinement of the selected diff in the ancestor buffer.
|
|
1063 At present, this face is not used and no fine differences are computed for the
|
|
1064 ancestor buffer."
|
|
1065 :group 'ediff-highlighting)
|
26263
|
1066 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1067 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1068 (defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-Ancestor
|
20003
|
1069 "Face for highlighting the fine differences in buffer Ancestor.
|
26263
|
1070 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1071 widget to customize the actual face object `ediff-fine-diff-Ancestor'
|
20003
|
1072 this variable represents.")
|
64215
|
1073 (ediff-hide-face ediff-fine-diff-face-Ancestor)
|
20343
|
1074
|
26263
|
1075 ;; Some installs don't have stipple or Stipple. So, try them in turn.
|
|
1076 (defvar stipple-pixmap
|
26585
|
1077 (cond ((not (ediff-has-face-support-p)) nil)
|
26263
|
1078 ((and (boundp 'x-bitmap-file-path)
|
|
1079 (locate-library "stipple" t x-bitmap-file-path)) "stipple")
|
|
1080 ((and (boundp 'mswindowsx-bitmap-file-path)
|
|
1081 (locate-library "stipple" t mswindowsx-bitmap-file-path)) "stipple")
|
|
1082 (t "Stipple")))
|
|
1083
|
63534
|
1084 (defface ediff-even-diff-A
|
85972
|
1085 (if (featurep 'emacs)
|
57127
|
1086 `((((type pc))
|
|
1087 (:foreground "green3" :background "light grey"))
|
|
1088 (((class color) (min-colors 16))
|
|
1089 (:foreground "Black" :background "light grey"))
|
|
1090 (((class color))
|
|
1091 (:foreground "red3" :background "light grey"
|
|
1092 :weight bold))
|
|
1093 (t (:italic t :stipple ,stipple-pixmap)))
|
|
1094 `((((type tty)) (:foreground "red3" :background "light grey"
|
|
1095 :weight bold))
|
|
1096 (((type pc)) (:foreground "green3" :background "light grey"))
|
|
1097 (((class color)) (:foreground "Black" :background "light grey"))
|
|
1098 (t (:italic t :stipple ,stipple-pixmap))))
|
19241
|
1099 "Face for highlighting even-numbered non-current differences in buffer A."
|
|
1100 :group 'ediff-highlighting)
|
26263
|
1101 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1102 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1103 (defvar ediff-even-diff-face-A 'ediff-even-diff-A
|
20003
|
1104 "Face for highlighting even-numbered non-current differences in buffer A.
|
26263
|
1105 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1106 widget to customize the actual face object `ediff-even-diff-A'
|
20003
|
1107 this variable represents.")
|
64215
|
1108 (ediff-hide-face ediff-even-diff-face-A)
|
20343
|
1109
|
63534
|
1110 (defface ediff-even-diff-B
|
85972
|
1111 (if (featurep 'emacs)
|
61310
|
1112 `((((class color) (min-colors 16))
|
57127
|
1113 (:foreground "White" :background "Grey"))
|
61310
|
1114 (((class color))
|
57127
|
1115 (:foreground "blue3" :background "Grey" :weight bold))
|
|
1116 (t (:italic t :stipple ,stipple-pixmap)))
|
|
1117 `((((type tty)) (:foreground "blue3" :background "Grey" :weight bold))
|
|
1118 (((class color)) (:foreground "White" :background "Grey"))
|
|
1119 (t (:italic t :stipple ,stipple-pixmap))))
|
19241
|
1120 "Face for highlighting even-numbered non-current differences in buffer B."
|
|
1121 :group 'ediff-highlighting)
|
26263
|
1122 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1123 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1124 (defvar ediff-even-diff-face-B 'ediff-even-diff-B
|
20003
|
1125 "Face for highlighting even-numbered non-current differences in buffer B.
|
26263
|
1126 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1127 widget to customize the actual face object `ediff-even-diff-B'
|
20003
|
1128 this variable represents.")
|
64215
|
1129 (ediff-hide-face ediff-even-diff-face-B)
|
20343
|
1130
|
63534
|
1131 (defface ediff-even-diff-C
|
85972
|
1132 (if (featurep 'emacs)
|
57127
|
1133 `((((type pc))
|
|
1134 (:foreground "yellow3" :background "light grey"))
|
|
1135 (((class color) (min-colors 16))
|
|
1136 (:foreground "Black" :background "light grey"))
|
|
1137 (((class color))
|
|
1138 (:foreground "yellow3" :background "light grey"
|
|
1139 :weight bold))
|
|
1140 (t (:italic t :stipple ,stipple-pixmap)))
|
|
1141 `((((type tty)) (:foreground "yellow3" :background "light grey"
|
|
1142 :weight bold))
|
|
1143 (((type pc)) (:foreground "yellow3" :background "light grey"))
|
|
1144 (((class color)) (:foreground "Black" :background "light grey"))
|
|
1145 (t (:italic t :stipple ,stipple-pixmap))))
|
19241
|
1146 "Face for highlighting even-numbered non-current differences in buffer C."
|
|
1147 :group 'ediff-highlighting)
|
26263
|
1148 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1149 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1150 (defvar ediff-even-diff-face-C 'ediff-even-diff-C
|
20003
|
1151 "Face for highlighting even-numbered non-current differences in buffer C.
|
26263
|
1152 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1153 widget to customize the actual face object `ediff-even-diff-C'
|
20003
|
1154 this variable represents.")
|
64215
|
1155 (ediff-hide-face ediff-even-diff-face-C)
|
20343
|
1156
|
63534
|
1157 (defface ediff-even-diff-Ancestor
|
85972
|
1158 (if (featurep 'emacs)
|
57127
|
1159 `((((type pc))
|
|
1160 (:foreground "cyan3" :background "light grey"))
|
|
1161 (((class color) (min-colors 16))
|
|
1162 (:foreground "White" :background "Grey"))
|
|
1163 (((class color))
|
|
1164 (:foreground "cyan3" :background "light grey"
|
|
1165 :weight bold))
|
|
1166 (t (:italic t :stipple ,stipple-pixmap)))
|
|
1167 `((((type tty)) (:foreground "cyan3" :background "light grey"
|
|
1168 :weight bold))
|
|
1169 (((type pc)) (:foreground "cyan3" :background "light grey"))
|
|
1170 (((class color)) (:foreground "White" :background "Grey"))
|
|
1171 (t (:italic t :stipple ,stipple-pixmap))))
|
19241
|
1172 "Face for highlighting even-numbered non-current differences in the ancestor buffer."
|
|
1173 :group 'ediff-highlighting)
|
26263
|
1174 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1175 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1176 (defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-Ancestor
|
20003
|
1177 "Face for highlighting even-numbered non-current differences in buffer Ancestor.
|
26263
|
1178 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1179 widget to customize the actual face object `ediff-even-diff-Ancestor'
|
20003
|
1180 this variable represents.")
|
64215
|
1181 (ediff-hide-face ediff-even-diff-face-Ancestor)
|
20343
|
1182
|
19047
|
1183 ;; Association between buffer types and even-diff-face symbols
|
|
1184 (defconst ediff-even-diff-face-alist
|
63534
|
1185 '((A . ediff-even-diff-A)
|
|
1186 (B . ediff-even-diff-B)
|
|
1187 (C . ediff-even-diff-C)
|
|
1188 (Ancestor . ediff-even-diff-Ancestor)))
|
19047
|
1189
|
63534
|
1190 (defface ediff-odd-diff-A
|
85972
|
1191 (if (featurep 'emacs)
|
57127
|
1192 '((((type pc))
|
|
1193 (:foreground "green3" :background "gray40"))
|
|
1194 (((class color) (min-colors 16))
|
|
1195 (:foreground "White" :background "Grey"))
|
|
1196 (((class color))
|
|
1197 (:foreground "red3" :background "black" :weight bold))
|
|
1198 (t (:italic t :stipple "gray1")))
|
|
1199 '((((type tty)) (:foreground "red3" :background "black" :weight bold))
|
|
1200 (((type pc)) (:foreground "green3" :background "gray40"))
|
|
1201 (((class color)) (:foreground "White" :background "Grey"))
|
|
1202 (t (:italic t :stipple "gray1"))))
|
19241
|
1203 "Face for highlighting odd-numbered non-current differences in buffer A."
|
|
1204 :group 'ediff-highlighting)
|
26263
|
1205 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1206 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1207 (defvar ediff-odd-diff-face-A 'ediff-odd-diff-A
|
20003
|
1208 "Face for highlighting odd-numbered non-current differences in buffer A.
|
26263
|
1209 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1210 widget to customize the actual face object `ediff-odd-diff-A'
|
20003
|
1211 this variable represents.")
|
64215
|
1212 (ediff-hide-face ediff-odd-diff-face-A)
|
20343
|
1213
|
19241
|
1214
|
63534
|
1215 (defface ediff-odd-diff-B
|
85972
|
1216 (if (featurep 'emacs)
|
57127
|
1217 '((((type pc))
|
|
1218 (:foreground "White" :background "gray40"))
|
|
1219 (((class color) (min-colors 16))
|
|
1220 (:foreground "Black" :background "light grey"))
|
|
1221 (((class color))
|
|
1222 (:foreground "cyan3" :background "black" :weight bold))
|
|
1223 (t (:italic t :stipple "gray1")))
|
|
1224 '((((type tty)) (:foreground "cyan3" :background "black" :weight bold))
|
|
1225 (((type pc)) (:foreground "White" :background "gray40"))
|
|
1226 (((class color)) (:foreground "Black" :background "light grey"))
|
|
1227 (t (:italic t :stipple "gray1"))))
|
19241
|
1228 "Face for highlighting odd-numbered non-current differences in buffer B."
|
|
1229 :group 'ediff-highlighting)
|
26263
|
1230 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1231 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1232 (defvar ediff-odd-diff-face-B 'ediff-odd-diff-B
|
20003
|
1233 "Face for highlighting odd-numbered non-current differences in buffer B.
|
26263
|
1234 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1235 widget to customize the actual face object `ediff-odd-diff-B'
|
20003
|
1236 this variable represents.")
|
64215
|
1237 (ediff-hide-face ediff-odd-diff-face-B)
|
20343
|
1238
|
63534
|
1239 (defface ediff-odd-diff-C
|
85972
|
1240 (if (featurep 'emacs)
|
57127
|
1241 '((((type pc))
|
|
1242 (:foreground "yellow3" :background "gray40"))
|
|
1243 (((class color) (min-colors 16))
|
|
1244 (:foreground "White" :background "Grey"))
|
|
1245 (((class color))
|
|
1246 (:foreground "yellow3" :background "black" :weight bold))
|
|
1247 (t (:italic t :stipple "gray1")))
|
|
1248 '((((type tty)) (:foreground "yellow3" :background "black" :weight bold))
|
|
1249 (((type pc)) (:foreground "yellow3" :background "gray40"))
|
|
1250 (((class color)) (:foreground "White" :background "Grey"))
|
|
1251 (t (:italic t :stipple "gray1"))))
|
19241
|
1252 "Face for highlighting odd-numbered non-current differences in buffer C."
|
|
1253 :group 'ediff-highlighting)
|
26263
|
1254 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1255 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1256 (defvar ediff-odd-diff-face-C 'ediff-odd-diff-C
|
20003
|
1257 "Face for highlighting odd-numbered non-current differences in buffer C.
|
26263
|
1258 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1259 widget to customize the actual face object `ediff-odd-diff-C'
|
20003
|
1260 this variable represents.")
|
64215
|
1261 (ediff-hide-face ediff-odd-diff-face-C)
|
20343
|
1262
|
63534
|
1263 (defface ediff-odd-diff-Ancestor
|
85972
|
1264 (if (featurep 'emacs)
|
57127
|
1265 '((((class color) (min-colors 16))
|
|
1266 (:foreground "cyan3" :background "gray40"))
|
|
1267 (((class color))
|
|
1268 (:foreground "green3" :background "black" :weight bold))
|
|
1269 (t (:italic t :stipple "gray1")))
|
|
1270 '((((type tty)) (:foreground "green3" :background "black" :weight bold))
|
|
1271 (((class color)) (:foreground "cyan3" :background "gray40"))
|
|
1272 (t (:italic t :stipple "gray1"))))
|
19241
|
1273 "Face for highlighting odd-numbered non-current differences in the ancestor buffer."
|
|
1274 :group 'ediff-highlighting)
|
26263
|
1275 ;; An internal variable. Ediff takes the face from here. When unhighlighting,
|
19241
|
1276 ;; this variable is set to nil, then again to the appropriate face.
|
63534
|
1277 (defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-Ancestor
|
20003
|
1278 "Face for highlighting odd-numbered non-current differences in buffer Ancestor.
|
26263
|
1279 DO NOT CHANGE this variable. Instead, use the customization
|
63534
|
1280 widget to customize the actual face object `ediff-odd-diff-Ancestor'
|
20003
|
1281 this variable represents.")
|
64215
|
1282 (ediff-hide-face ediff-odd-diff-face-Ancestor)
|
20343
|
1283
|
19047
|
1284 ;; Association between buffer types and odd-diff-face symbols
|
|
1285 (defconst ediff-odd-diff-face-alist
|
64215
|
1286 '((A . ediff-odd-diff-A)
|
|
1287 (B . ediff-odd-diff-B)
|
|
1288 (C . ediff-odd-diff-C)
|
|
1289 (Ancestor . ediff-odd-diff-Ancestor)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1290
|
19047
|
1291 ;; A-list of fine-diff face symbols associated with buffer types
|
|
1292 (defconst ediff-fine-diff-face-alist
|
64215
|
1293 '((A . ediff-fine-diff-A)
|
|
1294 (B . ediff-fine-diff-B)
|
|
1295 (C . ediff-fine-diff-C)
|
|
1296 (Ancestor . ediff-fine-diff-Ancestor)))
|
19047
|
1297
|
13128
|
1298 ;; Help echo
|
64215
|
1299 (put ediff-fine-diff-face-A 'ediff-help-echo
|
13128
|
1300 "A `refinement' of the current difference region")
|
64215
|
1301 (put ediff-fine-diff-face-B 'ediff-help-echo
|
13128
|
1302 "A `refinement' of the current difference region")
|
64215
|
1303 (put ediff-fine-diff-face-C 'ediff-help-echo
|
13128
|
1304 "A `refinement' of the current difference region")
|
64215
|
1305 (put ediff-fine-diff-face-Ancestor 'ediff-help-echo
|
13128
|
1306 "A `refinement' of the current difference region")
|
|
1307
|
34860
|
1308 (add-hook 'ediff-quit-hook 'ediff-cleanup-mess)
|
|
1309 (add-hook 'ediff-suspend-hook 'ediff-default-suspend-function)
|
|
1310
|
11042
|
1311
|
|
1312 ;;; Overlays
|
|
1313
|
13128
|
1314 (ediff-defvar-local ediff-current-diff-overlay-A nil
|
|
1315 "Overlay for the current difference region in buffer A.")
|
|
1316 (ediff-defvar-local ediff-current-diff-overlay-B nil
|
|
1317 "Overlay for the current difference region in buffer B.")
|
|
1318 (ediff-defvar-local ediff-current-diff-overlay-C nil
|
|
1319 "Overlay for the current difference region in buffer C.")
|
|
1320 (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
|
|
1321 "Overlay for the current difference region in the ancestor buffer.")
|
19047
|
1322
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1323 ;; Compute priority of a current ediff overlay.
|
13128
|
1324 (defun ediff-highest-priority (start end buffer)
|
|
1325 (let ((pos (max 1 (1- start)))
|
|
1326 ovr-list)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1327 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1328 (1+ ediff-shadow-overlay-priority)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1329 (ediff-with-current-buffer buffer
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1330 (while (< pos (min (point-max) (1+ end)))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1331 (setq ovr-list (append (overlays-at pos) ovr-list))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1332 (setq pos (next-overlay-change pos)))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1333 (+ 1 ediff-shadow-overlay-priority
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1334 (apply 'max
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1335 (cons
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1336 1
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1337 (mapcar
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1338 (lambda (ovr)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1339 (if (and ovr
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1340 ;; exclude ediff overlays from priority
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1341 ;; calculation, or else priority will keep
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1342 ;; increasing
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1343 (null (ediff-overlay-get ovr 'ediff))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1344 (null (ediff-overlay-get ovr 'ediff-diff-num)))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1345 ;; use the overlay priority or 0
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1346 (or (ediff-overlay-get ovr 'priority) 0)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1347 0))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1348 ovr-list))))))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1349
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1350
|
11042
|
1351 (defvar ediff-toggle-read-only-function nil
|
|
1352 "*Specifies the function to be used to toggle read-only.
|
|
1353 If nil, Ediff tries to deduce the function from the binding of C-x C-q.
|
|
1354 Normally, this is the `toggle-read-only' function, but, if version
|
|
1355 control is used, it could be `vc-toggle-read-only' or `rcs-toggle-read-only'.")
|
|
1356
|
18839
|
1357 (defcustom ediff-make-buffers-readonly-at-startup nil
|
|
1358 "*Make all variant buffers read-only when Ediff starts up.
|
|
1359 This property can be toggled interactively."
|
|
1360 :type 'boolean
|
|
1361 :group 'ediff)
|
|
1362
|
11042
|
1363
|
|
1364 ;;; Misc
|
|
1365
|
|
1366 ;; if nil, this silences some messages
|
78812
|
1367 (defvar ediff-verbose-p t)
|
16248
|
1368
|
20206
|
1369 (defcustom ediff-autostore-merges 'group-jobs-only
|
16248
|
1370 "*Save the results of merge jobs automatically.
|
75184
|
1371 With value nil, don't save automatically. With value t, always
|
|
1372 save. Anything else means save automatically only if the merge
|
|
1373 job is part of a group of jobs, such as `ediff-merge-directory'
|
|
1374 or `ediff-merge-directory-revisions'."
|
26263
|
1375 :type '(choice (const nil) (const t) (const group-jobs-only))
|
20206
|
1376 :group 'ediff-merge)
|
|
1377 (make-variable-buffer-local 'ediff-autostore-merges)
|
16248
|
1378
|
26263
|
1379 ;; file where the result of the merge is to be saved. used internally
|
16248
|
1380 (ediff-defvar-local ediff-merge-store-file nil "")
|
29165
|
1381
|
|
1382 (defcustom ediff-merge-filename-prefix "merge_"
|
|
1383 "*Prefix to be attached to saved merge buffers."
|
|
1384 :type 'string
|
|
1385 :group 'ediff-merge)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1386
|
18839
|
1387 (defcustom ediff-no-emacs-help-in-control-buffer nil
|
11042
|
1388 "*Non-nil means C-h should not invoke Emacs help in control buffer.
|
18839
|
1389 Instead, C-h would jump to previous difference."
|
|
1390 :type 'boolean
|
|
1391 :group 'ediff)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1392
|
26263
|
1393 ;; This is the same as temporary-file-directory from Emacs 20.3.
|
|
1394 ;; Copied over here because XEmacs doesn't have this variable.
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1395 (defcustom ediff-temp-file-prefix
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1396 (file-name-as-directory
|
26263
|
1397 (cond ((boundp 'temporary-file-directory) temporary-file-directory)
|
|
1398 ((fboundp 'temp-directory) (temp-directory))
|
|
1399 (t "/tmp/")))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1400 ;;; (file-name-as-directory
|
26263
|
1401 ;;; (cond ((memq system-type '(ms-dos windows-nt))
|
|
1402 ;;; (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp"))
|
|
1403 ;;; (t
|
|
1404 ;;; (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
|
11042
|
1405 "*Prefix to put on Ediff temporary file names.
|
22098
|
1406 Do not start with `~/' or `~USERNAME/'."
|
20206
|
1407 :type 'string
|
|
1408 :group 'ediff)
|
11042
|
1409
|
20206
|
1410 (defcustom ediff-temp-file-mode 384 ; u=rw only
|
|
1411 "*Mode for Ediff temporary files."
|
|
1412 :type 'integer
|
|
1413 :group 'ediff)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1414
|
11042
|
1415 ;; Metacharacters that have to be protected from the shell when executing
|
|
1416 ;; a diff/diff3 command.
|
20206
|
1417 (defcustom ediff-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]"
|
|
1418 "Regexp that matches characters that must be quoted with `\\' in shell command line.
|
|
1419 This default should work without changes."
|
|
1420 :type 'string
|
|
1421 :group 'ediff)
|
11042
|
1422
|
14582
|
1423 ;; needed to simulate frame-char-width in XEmacs.
|
64820
|
1424 (defvar ediff-H-glyph (if (featurep 'xemacs) (make-glyph "H")))
|
14582
|
1425
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1426
|
18839
|
1427 ;; Temporary file used for refining difference regions in buffer A.
|
|
1428 (ediff-defvar-local ediff-temp-file-A nil "")
|
|
1429 ;; Temporary file used for refining difference regions in buffer B.
|
|
1430 (ediff-defvar-local ediff-temp-file-B nil "")
|
|
1431 ;; Temporary file used for refining difference regions in buffer C.
|
|
1432 (ediff-defvar-local ediff-temp-file-C nil "")
|
|
1433
|
11042
|
1434
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1435 (defun ediff-file-remote-p (file-name)
|
60151
|
1436 (file-remote-p file-name))
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1437
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1438 ;; File for which we can get attributes, such as size or date
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1439 (defun ediff-listable-file (file-name)
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1440 (let ((handler (find-file-name-handler file-name 'file-local-copy)))
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1441 (or (null handler) (eq handler 'dired-handler-fn))))
|
11042
|
1442
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1443
|
11042
|
1444 (defsubst ediff-frame-unsplittable-p (frame)
|
12085
|
1445 (cdr (assq 'unsplittable (frame-parameters frame))))
|
11042
|
1446
|
|
1447 (defsubst ediff-get-next-window (wind prev-wind)
|
47583
|
1448 (cond ((window-live-p wind) wind)
|
|
1449 (prev-wind (next-window wind))
|
|
1450 (t (selected-window))
|
|
1451 ))
|
11042
|
1452
|
|
1453
|
|
1454 (defsubst ediff-kill-buffer-carefully (buf)
|
|
1455 "Kill buffer BUF if it exists."
|
|
1456 (if (ediff-buffer-live-p buf)
|
|
1457 (kill-buffer (get-buffer buf))))
|
16248
|
1458
|
18054
|
1459 (defsubst ediff-background-face (buf-type dif-num)
|
|
1460 ;; The value of dif-num is always 1- the one that user sees.
|
|
1461 ;; This is why even face is used when dif-num is odd.
|
19047
|
1462 (ediff-get-symbol-from-alist
|
|
1463 buf-type (if (ediff-odd-p dif-num)
|
|
1464 ediff-even-diff-face-alist
|
|
1465 ediff-odd-diff-face-alist)
|
|
1466 ))
|
18054
|
1467
|
16248
|
1468
|
|
1469 ;; activate faces on diff regions in buffer
|
|
1470 (defun ediff-paint-background-regions-in-one-buffer (buf-type unhighlight)
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1471 (let ((diff-vector
|
19047
|
1472 (eval (ediff-get-symbol-from-alist
|
|
1473 buf-type ediff-difference-vector-alist)))
|
16248
|
1474 overl diff-num)
|
26263
|
1475 (mapcar (lambda (rec)
|
|
1476 (setq overl (ediff-get-diff-overlay-from-diff-record rec)
|
|
1477 diff-num (ediff-overlay-get overl 'ediff-diff-num))
|
|
1478 (if (ediff-overlay-buffer overl)
|
|
1479 ;; only if overlay is alive
|
|
1480 (ediff-set-overlay-face
|
|
1481 overl
|
|
1482 (if (not unhighlight)
|
|
1483 (ediff-background-face buf-type diff-num))))
|
|
1484 )
|
16248
|
1485 diff-vector)))
|
|
1486
|
|
1487
|
|
1488 ;; activate faces on diff regions in all buffers
|
|
1489 (defun ediff-paint-background-regions (&optional unhighlight)
|
|
1490 (ediff-paint-background-regions-in-one-buffer
|
|
1491 'A unhighlight)
|
|
1492 (ediff-paint-background-regions-in-one-buffer
|
|
1493 'B unhighlight)
|
|
1494 (ediff-paint-background-regions-in-one-buffer
|
|
1495 'C unhighlight)
|
|
1496 (ediff-paint-background-regions-in-one-buffer
|
|
1497 'Ancestor unhighlight))
|
|
1498
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1499
|
11042
|
1500 ;; arg is a record for a given diff in a difference vector
|
|
1501 ;; this record is itself a vector
|
|
1502 (defsubst ediff-clear-fine-diff-vector (diff-record)
|
|
1503 (if diff-record
|
92460
|
1504 (mapc 'ediff-delete-overlay
|
|
1505 (ediff-get-fine-diff-vector-from-diff-record diff-record))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1506
|
11042
|
1507 (defsubst ediff-clear-fine-differences-in-one-buffer (n buf-type)
|
|
1508 (ediff-clear-fine-diff-vector (ediff-get-difference n buf-type))
|
|
1509 (ediff-set-fine-diff-vector n buf-type nil))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1510
|
11042
|
1511 (defsubst ediff-clear-fine-differences (n)
|
|
1512 (ediff-clear-fine-differences-in-one-buffer n 'A)
|
|
1513 (ediff-clear-fine-differences-in-one-buffer n 'B)
|
|
1514 (if ediff-3way-job
|
|
1515 (ediff-clear-fine-differences-in-one-buffer n 'C)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1516
|
11042
|
1517
|
|
1518 (defsubst ediff-mouse-event-p (event)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1519 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1520 (button-event-p event)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1521 (string-match "mouse" (format "%S" (event-basic-type event)))))
|
13128
|
1522
|
|
1523
|
|
1524 (defsubst ediff-key-press-event-p (event)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1525 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1526 (key-press-event-p event)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1527 (or (char-or-string-p event) (symbolp event))))
|
13128
|
1528
|
|
1529 (defun ediff-event-point (event)
|
|
1530 (cond ((ediff-mouse-event-p event)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1531 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1532 (event-point event)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1533 (posn-point (event-start event))))
|
13128
|
1534 ((ediff-key-press-event-p event)
|
|
1535 (point))
|
87139
|
1536 (t (error "Error"))))
|
13128
|
1537
|
|
1538 (defun ediff-event-buffer (event)
|
|
1539 (cond ((ediff-mouse-event-p event)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1540 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1541 (event-buffer event)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1542 (window-buffer (posn-window (event-start event)))))
|
13128
|
1543 ((ediff-key-press-event-p event)
|
|
1544 (current-buffer))
|
87139
|
1545 (t (error "Error"))))
|
42602
|
1546
|
|
1547 (defun ediff-event-key (event-or-key)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1548 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1549 (if (eventp event-or-key) (event-key event-or-key) event-or-key)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1550 event-or-key))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1551
|
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1552
|
11042
|
1553 (defsubst ediff-frame-iconified-p (frame)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1554 (and (ediff-window-display-p) (frame-live-p frame)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1555 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1556 (frame-iconified-p frame)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1557 (eq (frame-visible-p frame) 'icon))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1558
|
11042
|
1559 (defsubst ediff-window-visible-p (wind)
|
12085
|
1560 ;; under TTY, window-live-p also means window is visible
|
11042
|
1561 (and (window-live-p wind)
|
12085
|
1562 (or (not (ediff-window-display-p))
|
|
1563 (frame-visible-p (window-frame wind)))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1564
|
11042
|
1565
|
|
1566 (defsubst ediff-frame-char-width (frame)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1567 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1568 (/ (frame-pixel-width frame) (frame-width frame))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1569 (frame-char-width frame)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1570
|
13128
|
1571 (defun ediff-reset-mouse (&optional frame do-not-grab-mouse)
|
|
1572 (or frame (setq frame (selected-frame)))
|
12085
|
1573 (if (ediff-window-display-p)
|
13128
|
1574 (let ((frame-or-wind frame))
|
85972
|
1575 (if (featurep 'xemacs)
|
13128
|
1576 (setq frame-or-wind (frame-selected-window frame)))
|
|
1577 (or do-not-grab-mouse
|
|
1578 ;; don't set mouse if the user said to never do this
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1579 (not ediff-grab-mouse)
|
13128
|
1580 ;; Don't grab on quit, if the user doesn't want to.
|
|
1581 ;; If ediff-grab-mouse = t, then mouse won't be grabbed for
|
|
1582 ;; sessions that are not part of a group (this is done in
|
26263
|
1583 ;; ediff-recenter). The condition below affects only terminating
|
13977
|
1584 ;; sessions in session groups (in which case mouse is warped into
|
13128
|
1585 ;; a meta buffer).
|
|
1586 (and (eq ediff-grab-mouse 'maybe)
|
|
1587 (memq this-command '(ediff-quit ediff-update-diffs)))
|
|
1588 (set-mouse-position frame-or-wind 1 0))
|
|
1589 )))
|
|
1590
|
|
1591 (defsubst ediff-spy-after-mouse ()
|
|
1592 (setq ediff-mouse-pixel-position (mouse-pixel-position)))
|
|
1593
|
14582
|
1594 ;; It is not easy to find out when the user grabs the mouse, since emacs and
|
26263
|
1595 ;; xemacs behave differently when mouse is not in any frame. Also, this is
|
14582
|
1596 ;; sensitive to when the user grabbed mouse. Not used for now.
|
13128
|
1597 (defun ediff-user-grabbed-mouse ()
|
|
1598 (if ediff-mouse-pixel-position
|
|
1599 (cond ((not (eq (car ediff-mouse-pixel-position)
|
|
1600 (car (mouse-pixel-position)))))
|
|
1601 ((and (car (cdr ediff-mouse-pixel-position))
|
|
1602 (car (cdr (mouse-pixel-position)))
|
|
1603 (cdr (cdr ediff-mouse-pixel-position))
|
|
1604 (cdr (cdr (mouse-pixel-position))))
|
|
1605 (not (and (< (abs (- (car (cdr ediff-mouse-pixel-position))
|
|
1606 (car (cdr (mouse-pixel-position)))))
|
13977
|
1607 ediff-mouse-pixel-threshold)
|
13128
|
1608 (< (abs (- (cdr (cdr ediff-mouse-pixel-position))
|
|
1609 (cdr (cdr (mouse-pixel-position)))))
|
13977
|
1610 ediff-mouse-pixel-threshold))))
|
13128
|
1611 (t nil))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1612
|
11042
|
1613 (defsubst ediff-frame-char-height (frame)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1614 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1615 (glyph-height ediff-H-glyph (frame-selected-window frame))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1616 (frame-char-height frame)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1617
|
16248
|
1618 ;; Some overlay functions
|
11042
|
1619
|
18054
|
1620 (defsubst ediff-overlay-start (overl)
|
|
1621 (if (ediff-overlayp overl)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1622 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1623 (extent-start-position overl)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1624 (overlay-start overl))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1625
|
18054
|
1626 (defsubst ediff-overlay-end (overl)
|
|
1627 (if (ediff-overlayp overl)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1628 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1629 (extent-end-position overl)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1630 (overlay-end overl))))
|
18054
|
1631
|
11042
|
1632 (defsubst ediff-empty-overlay-p (overl)
|
|
1633 (= (ediff-overlay-start overl) (ediff-overlay-end overl)))
|
14582
|
1634
|
26263
|
1635 ;; like overlay-buffer in Emacs. In XEmacs, returns nil if the extent is
|
|
1636 ;; dead. Otherwise, works like extent-buffer
|
14582
|
1637 (defun ediff-overlay-buffer (overl)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1638 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1639 (and (extent-live-p overl) (extent-object overl))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1640 (overlay-buffer overl)))
|
14582
|
1641
|
26263
|
1642 ;; like overlay-get in Emacs. In XEmacs, returns nil if the extent is
|
|
1643 ;; dead. Otherwise, like extent-property
|
14582
|
1644 (defun ediff-overlay-get (overl property)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1645 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1646 (and (extent-live-p overl) (extent-property overl property))
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1647 (overlay-get overl property)))
|
16248
|
1648
|
|
1649
|
|
1650 ;; These two functions are here because XEmacs refuses to
|
|
1651 ;; handle overlays whose buffers were deleted.
|
|
1652 (defun ediff-move-overlay (overlay beg end &optional buffer)
|
|
1653 "Calls `move-overlay' in Emacs and `set-extent-endpoints' in Lemacs.
|
|
1654 Checks if overlay's buffer exists before actually doing the move."
|
|
1655 (let ((buf (and overlay (ediff-overlay-buffer overlay))))
|
|
1656 (if (ediff-buffer-live-p buf)
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1657 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1658 (set-extent-endpoints overlay beg end)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1659 (move-overlay overlay beg end buffer))
|
16248
|
1660 ;; buffer's dead
|
|
1661 (if overlay
|
|
1662 (ediff-delete-overlay overlay)))))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1663
|
16248
|
1664 (defun ediff-overlay-put (overlay prop value)
|
|
1665 "Calls `overlay-put' or `set-extent-property' depending on Emacs version.
|
|
1666 Checks if overlay's buffer exists."
|
|
1667 (if (ediff-buffer-live-p (ediff-overlay-buffer overlay))
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1668 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1669 (set-extent-property overlay prop value)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1670 (overlay-put overlay prop value))
|
16248
|
1671 (ediff-delete-overlay overlay)))
|
|
1672
|
11042
|
1673 ;; temporarily uses DIR to abbreviate file name
|
|
1674 ;; if DIR is nil, use default-directory
|
14582
|
1675 (defun ediff-abbreviate-file-name (file &optional dir)
|
13128
|
1676 (cond ((stringp dir)
|
|
1677 (let ((directory-abbrev-alist (list (cons dir ""))))
|
|
1678 (abbreviate-file-name file)))
|
42602
|
1679 (t
|
92504
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1680 (if (featurep 'xemacs)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1681 ;; XEmacs requires addl argument
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1682 (abbreviate-file-name file t)
|
ee35c677f8f3
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
diff
changeset
|
1683 (abbreviate-file-name file)))))
|
13128
|
1684
|
|
1685 ;; Takes a directory and returns the parent directory.
|
26263
|
1686 ;; does nothing to `/'. If the ARG is a regular file,
|
13128
|
1687 ;; strip the file AND the last dir.
|
|
1688 (defun ediff-strip-last-dir (dir)
|
|
1689 (if (not (stringp dir)) (setq dir default-directory))
|
|
1690 (setq dir (expand-file-name dir))
|
|
1691 (or (file-directory-p dir) (setq dir (file-name-directory dir)))
|
|
1692 (let* ((pos (1- (length dir)))
|
|
1693 (last-char (aref dir pos)))
|
|
1694 (if (and (> pos 0) (= last-char ?/))
|
|
1695 (setq dir (substring dir 0 pos)))
|
|
1696 (ediff-abbreviate-file-name (file-name-directory dir))))
|
|
1697
|
|
1698 (defun ediff-truncate-string-left (str newlen)
|
|
1699 ;; leave space for ... on the left
|
|
1700 (let ((len (length str))
|
|
1701 substr)
|
|
1702 (if (<= len newlen)
|
|
1703 str
|
|
1704 (setq newlen (max 0 (- newlen 3)))
|
|
1705 (setq substr (substring str (max 0 (- len 1 newlen))))
|
|
1706 (concat "..." substr))))
|
|
1707
|
26263
|
1708 (defsubst ediff-nonempty-string-p (string)
|
|
1709 (and (stringp string) (not (string= string ""))))
|
|
1710
|
35411
|
1711 (unless (fboundp 'subst-char-in-string)
|
|
1712 (defun subst-char-in-string (fromchar tochar string &optional inplace)
|
|
1713 "Replace FROMCHAR with TOCHAR in STRING each time it occurs.
|
|
1714 Unless optional argument INPLACE is non-nil, return a new string."
|
|
1715 (let ((i (length string))
|
|
1716 (newstr (if inplace string (copy-sequence string))))
|
|
1717 (while (> i 0)
|
|
1718 (setq i (1- i))
|
|
1719 (if (eq (aref newstr i) fromchar)
|
|
1720 (aset newstr i tochar)))
|
|
1721 newstr)))
|
|
1722
|
13128
|
1723 (defun ediff-abbrev-jobname (jobname)
|
|
1724 (cond ((eq jobname 'ediff-directories)
|
|
1725 "Compare two directories")
|
|
1726 ((eq jobname 'ediff-files)
|
|
1727 "Compare two files")
|
|
1728 ((eq jobname 'ediff-buffers)
|
|
1729 "Compare two buffers")
|
|
1730 ((eq jobname 'ediff-directories3)
|
|
1731 "Compare three directories")
|
|
1732 ((eq jobname 'ediff-files3)
|
|
1733 "Compare three files")
|
|
1734 ((eq jobname 'ediff-buffers3)
|
|
1735 "Compare three buffers")
|
|
1736 ((eq jobname 'ediff-revision)
|
|
1737 "Compare file with a version")
|
|
1738 ((eq jobname 'ediff-directory-revisions)
|
|
1739 "Compare dir files with versions")
|
|
1740 ((eq jobname 'ediff-merge-directory-revisions)
|
|
1741 "Merge dir files with versions")
|
|
1742 ((eq jobname 'ediff-merge-directory-revisions-with-ancestor)
|
|
1743 "Merge dir versions via ancestors")
|
|
1744 (t
|
33842
f6a67d77484a
* ediff-diff.el: Moved variables around to have it compile under NT.
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1745 (capitalize
|
64007
35df749b5a09
(ediff-highlighting, ediff-merge, ediff-hook): Finish `defgroup' description
Juanma Barranquero <lekktu@gmail.com>
diff
changeset
|
1746 (subst-char-in-string ?- ?\s (substring (symbol-name jobname) 6))))
|
33842
f6a67d77484a
* ediff-diff.el: Moved variables around to have it compile under NT.
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1747 ))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1748
|
13128
|
1749
|
11042
|
1750 ;; If ediff modified mode line, strip the modification
|
|
1751 (defsubst ediff-strip-mode-line-format ()
|
13128
|
1752 (if (member (car mode-line-format) '(" A: " " B: " " C: " " Ancestor: "))
|
11042
|
1753 (setq mode-line-format (nth 2 mode-line-format))))
|
|
1754
|
|
1755 ;; Verify that we have a difference selected.
|
|
1756 (defsubst ediff-valid-difference-p (&optional n)
|
|
1757 (or n (setq n ediff-current-difference))
|
|
1758 (and (>= n 0) (< n ediff-number-of-differences)))
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1759
|
11042
|
1760 (defsubst ediff-show-all-diffs (n)
|
|
1761 "Don't skip difference regions."
|
|
1762 nil)
|
13128
|
1763
|
13216
|
1764 (defsubst ediff-message-if-verbose (string &rest args)
|
|
1765 (if ediff-verbose-p
|
|
1766 (apply 'message string args)))
|
14582
|
1767
|
15480
|
1768 (defun ediff-file-attributes (filename attr-number)
|
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1769 (if (ediff-listable-file filename)
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1770 (nth attr-number (file-attributes filename))
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1771 -1)
|
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
diff
changeset
|
1772 )
|
18054
|
1773
|
15480
|
1774 (defsubst ediff-file-size (filename)
|
|
1775 (ediff-file-attributes filename 7))
|
|
1776 (defsubst ediff-file-modtime (filename)
|
|
1777 (ediff-file-attributes filename 5))
|
|
1778
|
|
1779
|
16248
|
1780 (defun ediff-convert-standard-filename (fname)
|
18054
|
1781 (if (fboundp 'convert-standard-filename)
|
16248
|
1782 (convert-standard-filename fname)
|
|
1783 fname))
|
15480
|
1784
|
92493
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1785 (if (featurep 'emacs)
|
47520
|
1786 (defalias 'ediff-with-syntax-table 'with-syntax-table)
|
92493
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1787 (if (fboundp 'with-syntax-table)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1788 (defalias 'ediff-with-syntax-table 'with-syntax-table)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1789 ;; stolen from subr.el in emacs 21
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1790 (defmacro ediff-with-syntax-table (table &rest body)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1791 (let ((old-table (make-symbol "table"))
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1792 (old-buffer (make-symbol "buffer")))
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1793 `(let ((,old-table (syntax-table))
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1794 (,old-buffer (current-buffer)))
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1795 (unwind-protect
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1796 (progn
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1797 (set-syntax-table (copy-syntax-table ,table))
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1798 ,@body)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1799 (save-current-buffer
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1800 (set-buffer ,old-buffer)
|
402ee2cfca27
* bindings.el (mode-line-remote): Add mouse-face. Improve tooltip.
Dan Nicolaescu <dann@ics.uci.edu>
diff
changeset
|
1801 (set-syntax-table ,old-table))))))))
|
36857
|
1802
|
68997
|
1803
|
64215
|
1804 (provide 'ediff-init)
|
|
1805
|
36857
|
1806
|
|
1807
|
81076
|
1808 ;; Local Variables:
|
|
1809 ;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
|
|
1810 ;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
|
|
1811 ;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
|
|
1812 ;; End:
|
33107
5049026c97b1
(ediff-prepare-buffer-hook): Expand docstring, no functional change.
Thien-Thi Nguyen <ttn@gnuvola.org>
diff
changeset
|
1813
|
81076
|
1814 ;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
|
38422
|
1815 ;;; ediff-init.el ends here
|