annotate lisp/ediff-init.el @ 12496:333d25d9a8b1

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