Mercurial > emacs
annotate lisp/ediff-util.el @ 80057:1db7c78912f4
*** empty log message ***
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 05 Feb 2008 14:24:26 +0000 |
parents | 73661ddc7ac7 |
children | 107ccd98fa12 |
rev | line source |
---|---|
11042 | 1 ;;; ediff-util.el --- the core commands and utilities of ediff |
14169 | 2 |
62727
79e4354d107b
(ediff-mode): Use run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents:
54090
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
79721 | 4 ;; 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
5 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
11042 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75389
diff
changeset
|
12 ;; the Free Software Foundation; either version 3, or (at your option) |
11042 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
14169 | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 ;; Boston, MA 02110-1301, USA. | |
11042 | 24 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36857
diff
changeset
|
25 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36857
diff
changeset
|
26 |
11042 | 27 ;;; Code: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
28 |
11042 | 29 |
18054 | 30 ;; Compiler pacifier |
31 (defvar ediff-patch-diagnostics) | |
32 (defvar ediff-patchbufer) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
33 (defvar ediff-use-toolbar-p) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
34 (defvar ediff-toolbar-height) |
18054 | 35 (defvar ediff-toolbar) |
36 (defvar ediff-toolbar-3way) | |
37 (defvar bottom-toolbar) | |
38 (defvar bottom-toolbar-visible-p) | |
39 (defvar bottom-toolbar-height) | |
40 (defvar mark-active) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
41 (defvar ediff-emacs-p) |
18054 | 42 |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
43 (defvar ediff-after-quit-hook-internal nil) |
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
44 |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
45 (and noninteractive |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
46 (eval-when-compile |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
47 (load "reporter" 'noerror))) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
48 |
18054 | 49 (eval-when-compile |
50 (let ((load-path (cons (expand-file-name ".") load-path))) | |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
51 (provide 'ediff-util) ; to break recursive load cycle |
18054 | 52 (or (featurep 'ediff-init) |
53 (load "ediff-init.el" nil nil 'nosuffix)) | |
54 (or (featurep 'ediff-help) | |
55 (load "ediff-help.el" nil nil 'nosuffix)) | |
56 (or (featurep 'ediff-mult) | |
57 (load "ediff-mult.el" nil nil 'nosuffix)) | |
58 (or (featurep 'ediff-wind) | |
59 (load "ediff-wind.el" nil nil 'nosuffix)) | |
60 (or (featurep 'ediff-diff) | |
61 (load "ediff-diff.el" nil nil 'nosuffix)) | |
62 (or (featurep 'ediff-merg) | |
63 (load "ediff-merg.el" nil nil 'nosuffix)) | |
64 (or (featurep 'ediff) | |
65 (load "ediff.el" nil nil 'nosuffix)) | |
66 (or (featurep 'ediff-tbar) | |
21940 | 67 ediff-emacs-p |
18054 | 68 (load "ediff-tbar.el" 'noerror nil 'nosuffix)) |
69 )) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
70 ;; end pacifier |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
71 |
21940 | 72 |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
73 (require 'ediff-init) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
74 (require 'ediff-help) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
75 (require 'ediff-mult) |
18054 | 76 (require 'ediff-wind) |
77 (require 'ediff-diff) | |
78 (require 'ediff-merg) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
79 |
18054 | 80 (if ediff-xemacs-p |
21940 | 81 (require 'ediff-tbar)) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
82 |
11042 | 83 |
84 ;;; Functions | |
85 | |
86 (defun ediff-mode () | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
87 "Ediff mode controls all operations in a single Ediff session. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
88 This mode is entered through one of the following commands: |
11042 | 89 `ediff' |
90 `ediff-files' | |
91 `ediff-buffers' | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
92 `ebuffers' |
11042 | 93 `ediff3' |
94 `ediff-files3' | |
95 `ediff-buffers3' | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
96 `ebuffers3' |
11042 | 97 `ediff-merge' |
98 `ediff-merge-files' | |
99 `ediff-merge-files-with-ancestor' | |
100 `ediff-merge-buffers' | |
101 `ediff-merge-buffers-with-ancestor' | |
102 `ediff-merge-revisions' | |
103 `ediff-merge-revisions-with-ancestor' | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
104 `ediff-windows-wordwise' |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
105 `ediff-windows-linewise' |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
106 `ediff-regions-wordwise' |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
107 `ediff-regions-linewise' |
11042 | 108 `epatch' |
109 `ediff-patch-file' | |
110 `ediff-patch-buffer' | |
111 `epatch-buffer' | |
18839 | 112 `erevision' |
11042 | 113 `ediff-revision' |
114 | |
115 Commands: | |
116 \\{ediff-mode-map}" | |
117 (kill-all-local-variables) | |
118 (setq major-mode 'ediff-mode) | |
119 (setq mode-name "Ediff") | |
64215
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
120 ;; We use run-hooks instead of run-mode-hooks for two reasons. |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
121 ;; The ediff control buffer is read-only and it is not supposed to be |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
122 ;; modified by minor modes and such. So, run-mode-hooks doesn't do anything |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
123 ;; useful here on top of what run-hooks does. |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
124 ;; Second, changing run-hooks to run-mode-hooks would require an |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
125 ;; if-statement, since XEmacs doesn't have this. |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
126 (run-hooks 'ediff-mode-hook)) |
11042 | 127 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
128 |
11042 | 129 |
130 ;;; Build keymaps | |
131 | |
132 (ediff-defvar-local ediff-mode-map nil | |
133 "Local keymap used in Ediff mode. | |
134 This is local to each Ediff Control Panel, so they may vary from invocation | |
135 to invocation.") | |
136 | |
137 ;; Set up the keymap in the control buffer | |
138 (defun ediff-set-keys () | |
139 "Set up Ediff keymap, if necessary." | |
140 (if (null ediff-mode-map) | |
141 (ediff-setup-keymap)) | |
142 (use-local-map ediff-mode-map)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
143 |
11042 | 144 ;; Reload Ediff keymap. For debugging only. |
145 (defun ediff-reload-keymap () | |
146 (interactive) | |
147 (setq ediff-mode-map nil) | |
148 (ediff-set-keys)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
149 |
11042 | 150 |
151 (defun ediff-setup-keymap () | |
152 "Set up the keymap used in the control buffer of Ediff." | |
153 (setq ediff-mode-map (make-sparse-keymap)) | |
154 (suppress-keymap ediff-mode-map) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
155 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
156 (define-key ediff-mode-map |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
157 (if ediff-emacs-p [mouse-2] [button2]) 'ediff-help-for-quick-help) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
158 (define-key ediff-mode-map "\C-m" 'ediff-help-for-quick-help) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
159 |
11042 | 160 (define-key ediff-mode-map "p" 'ediff-previous-difference) |
161 (define-key ediff-mode-map "\C-?" 'ediff-previous-difference) | |
162 (define-key ediff-mode-map [delete] 'ediff-previous-difference) | |
163 (define-key ediff-mode-map "\C-h" (if ediff-no-emacs-help-in-control-buffer | |
164 'ediff-previous-difference nil)) | |
19774 | 165 ;; must come after C-h, or else C-h wipes out backspace's binding in XEmacs |
166 (define-key ediff-mode-map [backspace] 'ediff-previous-difference) | |
11042 | 167 (define-key ediff-mode-map "n" 'ediff-next-difference) |
168 (define-key ediff-mode-map " " 'ediff-next-difference) | |
169 (define-key ediff-mode-map "j" 'ediff-jump-to-difference) | |
170 (define-key ediff-mode-map "g" nil) | |
171 (define-key ediff-mode-map "ga" 'ediff-jump-to-difference-at-point) | |
172 (define-key ediff-mode-map "gb" 'ediff-jump-to-difference-at-point) | |
173 (define-key ediff-mode-map "q" 'ediff-quit) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
174 (define-key ediff-mode-map "D" 'ediff-show-diff-output) |
11042 | 175 (define-key ediff-mode-map "z" 'ediff-suspend) |
176 (define-key ediff-mode-map "\C-l" 'ediff-recenter) | |
177 (define-key ediff-mode-map "|" 'ediff-toggle-split) | |
178 (define-key ediff-mode-map "h" 'ediff-toggle-hilit) | |
179 (or ediff-word-mode | |
180 (define-key ediff-mode-map "@" 'ediff-toggle-autorefine)) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
181 (if ediff-narrow-job |
11042 | 182 (define-key ediff-mode-map "%" 'ediff-toggle-narrow-region)) |
183 (define-key ediff-mode-map "~" 'ediff-swap-buffers) | |
184 (define-key ediff-mode-map "v" 'ediff-scroll-vertically) | |
185 (define-key ediff-mode-map "\C-v" 'ediff-scroll-vertically) | |
186 (define-key ediff-mode-map "^" 'ediff-scroll-vertically) | |
187 (define-key ediff-mode-map "\M-v" 'ediff-scroll-vertically) | |
188 (define-key ediff-mode-map "V" 'ediff-scroll-vertically) | |
189 (define-key ediff-mode-map "<" 'ediff-scroll-horizontally) | |
190 (define-key ediff-mode-map ">" 'ediff-scroll-horizontally) | |
191 (define-key ediff-mode-map "i" 'ediff-status-info) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
192 (define-key ediff-mode-map "E" 'ediff-documentation) |
11042 | 193 (define-key ediff-mode-map "?" 'ediff-toggle-help) |
194 (define-key ediff-mode-map "!" 'ediff-update-diffs) | |
20206 | 195 (define-key ediff-mode-map "M" 'ediff-show-current-session-meta-buffer) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
196 (define-key ediff-mode-map "R" 'ediff-show-registry) |
11042 | 197 (or ediff-word-mode |
198 (define-key ediff-mode-map "*" 'ediff-make-or-kill-fine-diffs)) | |
199 (define-key ediff-mode-map "a" nil) | |
200 (define-key ediff-mode-map "b" nil) | |
201 (define-key ediff-mode-map "r" nil) | |
202 (cond (ediff-merge-job | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
203 ;; Will barf if no ancestor |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
204 (define-key ediff-mode-map "/" 'ediff-show-ancestor) |
11042 | 205 ;; In merging, we allow only A->C and B->C copying. |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
206 (define-key ediff-mode-map "a" 'ediff-copy-A-to-C) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
207 (define-key ediff-mode-map "b" 'ediff-copy-B-to-C) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
208 (define-key ediff-mode-map "r" 'ediff-restore-diff-in-merge-buffer) |
11042 | 209 (define-key ediff-mode-map "s" 'ediff-shrink-window-C) |
210 (define-key ediff-mode-map "+" 'ediff-combine-diffs) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
211 (define-key ediff-mode-map "$" nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
212 (define-key ediff-mode-map "$$" 'ediff-toggle-show-clashes-only) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
213 (define-key ediff-mode-map "$*" 'ediff-toggle-skip-changed-regions) |
11042 | 214 (define-key ediff-mode-map "&" 'ediff-re-merge)) |
215 (ediff-3way-comparison-job | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
216 (define-key ediff-mode-map "ab" 'ediff-copy-A-to-B) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
217 (define-key ediff-mode-map "ba" 'ediff-copy-B-to-A) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
218 (define-key ediff-mode-map "ac" 'ediff-copy-A-to-C) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
219 (define-key ediff-mode-map "bc" 'ediff-copy-B-to-C) |
11042 | 220 (define-key ediff-mode-map "c" nil) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
221 (define-key ediff-mode-map "ca" 'ediff-copy-C-to-A) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
222 (define-key ediff-mode-map "cb" 'ediff-copy-C-to-B) |
11042 | 223 (define-key ediff-mode-map "ra" 'ediff-restore-diff) |
224 (define-key ediff-mode-map "rb" 'ediff-restore-diff) | |
225 (define-key ediff-mode-map "rc" 'ediff-restore-diff) | |
226 (define-key ediff-mode-map "C" 'ediff-toggle-read-only)) | |
227 (t ; 2-way comparison | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
228 (define-key ediff-mode-map "a" 'ediff-copy-A-to-B) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
229 (define-key ediff-mode-map "b" 'ediff-copy-B-to-A) |
11042 | 230 (define-key ediff-mode-map "ra" 'ediff-restore-diff) |
231 (define-key ediff-mode-map "rb" 'ediff-restore-diff)) | |
232 ) ; cond | |
233 (define-key ediff-mode-map "G" 'ediff-submit-report) | |
234 (define-key ediff-mode-map "#" nil) | |
235 (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match) | |
236 (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match) | |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
237 (define-key ediff-mode-map "#c" 'ediff-toggle-ignore-case) |
11042 | 238 (or ediff-word-mode |
239 (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar)) | |
240 (define-key ediff-mode-map "o" nil) | |
241 (define-key ediff-mode-map "A" 'ediff-toggle-read-only) | |
242 (define-key ediff-mode-map "B" 'ediff-toggle-read-only) | |
243 (define-key ediff-mode-map "w" nil) | |
244 (define-key ediff-mode-map "wa" 'ediff-save-buffer) | |
245 (define-key ediff-mode-map "wb" 'ediff-save-buffer) | |
246 (define-key ediff-mode-map "wd" 'ediff-save-buffer) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
247 (define-key ediff-mode-map "=" 'ediff-inferior-compare-regions) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
248 (if (and (fboundp 'ediff-show-patch-diagnostics) (ediff-patch-job)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
249 (define-key ediff-mode-map "P" 'ediff-show-patch-diagnostics)) |
11042 | 250 (if ediff-3way-job |
251 (progn | |
252 (define-key ediff-mode-map "wc" 'ediff-save-buffer) | |
253 (define-key ediff-mode-map "gc" 'ediff-jump-to-difference-at-point) | |
254 )) | |
255 | |
256 (define-key ediff-mode-map "m" 'ediff-toggle-wide-display) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
257 |
11042 | 258 ;; Allow ediff-mode-map to be referenced indirectly |
259 (fset 'ediff-mode-map ediff-mode-map) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
260 (run-hooks 'ediff-keymap-setup-hook)) |
11042 | 261 |
262 | |
263 ;;; Setup functions | |
264 | |
18054 | 265 ;; Common startup entry for all Ediff functions It now returns control buffer |
266 ;; so other functions can do post-processing SETUP-PARAMETERS is a list of the | |
267 ;; form ((param .val) (param . val)...) This serves a similar purpose to | |
268 ;; STARTUP-HOOKS, but these parameters are set in the new control buffer right | |
269 ;; after this buf is created and before any windows are set and such. | |
11042 | 270 (defun ediff-setup (buffer-A file-A buffer-B file-B buffer-C file-C |
20206 | 271 startup-hooks setup-parameters |
272 &optional merge-buffer-file) | |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
273 (run-hooks 'ediff-before-setup-hook) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
274 ;; ediff-convert-standard-filename puts file names in the form appropriate |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
275 ;; for the OS at hand. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
276 (setq file-A (ediff-convert-standard-filename (expand-file-name file-A))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
277 (setq file-B (ediff-convert-standard-filename (expand-file-name file-B))) |
11042 | 278 (if (stringp file-C) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
279 (setq file-C |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
280 (ediff-convert-standard-filename (expand-file-name file-C)))) |
20206 | 281 (if (stringp merge-buffer-file) |
282 (progn | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
283 (setq merge-buffer-file |
20206 | 284 (ediff-convert-standard-filename |
285 (expand-file-name merge-buffer-file))) | |
286 ;; check the directory exists | |
287 (or (file-exists-p (file-name-directory merge-buffer-file)) | |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36857
diff
changeset
|
288 (error "Directory %s given as place to save the merge doesn't exist" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
289 (abbreviate-file-name |
20206 | 290 (file-name-directory merge-buffer-file)))) |
291 (if (and (file-exists-p merge-buffer-file) | |
292 (file-directory-p merge-buffer-file)) | |
293 (error "The merge buffer file %s must not be a directory" | |
294 (abbreviate-file-name merge-buffer-file))) | |
295 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
296 (let* ((control-buffer-name |
11042 | 297 (ediff-unique-buffer-name "*Ediff Control Panel" "*")) |
19047 | 298 (control-buffer (ediff-with-current-buffer buffer-A |
11042 | 299 (get-buffer-create control-buffer-name)))) |
19047 | 300 (ediff-with-current-buffer control-buffer |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
301 (ediff-mode) |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
302 |
18054 | 303 (make-local-variable 'ediff-use-long-help-message) |
304 (make-local-variable 'ediff-prefer-iconified-control-frame) | |
305 (make-local-variable 'ediff-split-window-function) | |
306 (make-local-variable 'ediff-default-variant) | |
307 (make-local-variable 'ediff-merge-window-share) | |
308 (make-local-variable 'ediff-window-setup-function) | |
309 (make-local-variable 'ediff-keep-variants) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
310 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
311 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
312 (make-local-hook 'ediff-after-quit-hook-internal) ; xemacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
313 nil ; emacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
314 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
315 |
11042 | 316 ;; unwrap set up parameters passed as argument |
317 (while setup-parameters | |
318 (set (car (car setup-parameters)) (cdr (car setup-parameters))) | |
319 (setq setup-parameters (cdr setup-parameters))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
320 |
11042 | 321 ;; set variables classifying the current ediff job |
18054 | 322 ;; must come AFTER setup-parameters |
11042 | 323 (setq ediff-3way-comparison-job (ediff-3way-comparison-job) |
324 ediff-merge-job (ediff-merge-job) | |
325 ediff-merge-with-ancestor-job (ediff-merge-with-ancestor-job) | |
326 ediff-3way-job (ediff-3way-job) | |
327 ediff-diff3-job (ediff-diff3-job) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
328 ediff-narrow-job (ediff-narrow-job) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
329 ediff-windows-job (ediff-windows-job) |
11042 | 330 ediff-word-mode-job (ediff-word-mode-job)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
331 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
332 ;; Don't delete variants in case of ediff-buffer-* jobs without asking. |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
333 ;; This is because one may loose work---dangerous. |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
334 (if (string-match "buffer" (symbol-name ediff-job-name)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
335 (setq ediff-keep-variants t)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
336 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
337 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
338 (make-local-hook 'pre-command-hook) ; xemacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
339 nil ; emacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
340 ) |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
341 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
342 (if (ediff-window-display-p) |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
343 (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
344 (setq ediff-mouse-pixel-position (mouse-pixel-position)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
345 |
11042 | 346 ;; adjust for merge jobs |
347 (if ediff-merge-job | |
348 (let ((buf | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
349 ;; If default variant is `combined', the right stuff is |
11042 | 350 ;; inserted by ediff-do-merge |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
351 ;; Note: at some point, we tried to put ancestor buffer here |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
352 ;; (which is currently buffer C. This didn't work right |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
353 ;; because the merge buffer will contain lossage: diff regions |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
354 ;; in the ancestor, which correspond to revisions that agree |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
355 ;; in both buf A and B. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
356 (cond ((eq ediff-default-variant 'default-B) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
357 buffer-B) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
358 (t buffer-A)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
359 |
11042 | 360 (setq ediff-split-window-function |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
361 ediff-merge-split-window-function) |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
362 |
11042 | 363 ;; remember the ancestor buffer, if any |
364 (setq ediff-ancestor-buffer buffer-C) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
365 |
11042 | 366 (setq buffer-C |
367 (get-buffer-create | |
368 (ediff-unique-buffer-name "*ediff-merge" "*"))) | |
369 (save-excursion | |
370 (set-buffer buffer-C) | |
65627
511f8e9d22ca
2005-09-20 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65582
diff
changeset
|
371 (insert-buffer-substring buf) |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
372 (goto-char (point-min)) |
19047 | 373 (funcall (ediff-with-current-buffer buf major-mode)) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
374 (widen) ; merge buffer is always widened |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
375 (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
376 ))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
377 (setq buffer-read-only nil |
11042 | 378 ediff-buffer-A buffer-A |
379 ediff-buffer-B buffer-B | |
380 ediff-buffer-C buffer-C | |
381 ediff-control-buffer control-buffer) | |
36857
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
382 |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
383 (ediff-choose-syntax-table) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
384 |
11042 | 385 (setq ediff-control-buffer-suffix |
386 (if (string-match "<[0-9]*>" control-buffer-name) | |
387 (substring control-buffer-name | |
388 (match-beginning 0) (match-end 0)) | |
389 "") | |
390 ediff-control-buffer-number | |
391 (max | |
392 0 | |
393 (1- | |
394 (string-to-number | |
395 (substring | |
396 ediff-control-buffer-suffix | |
397 (or | |
398 (string-match "[0-9]+" ediff-control-buffer-suffix) | |
399 0)))))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
400 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
401 (setq ediff-error-buffer |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
402 (get-buffer-create (ediff-unique-buffer-name "*ediff-errors" "*"))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
403 |
19047 | 404 (ediff-with-current-buffer buffer-A (ediff-strip-mode-line-format)) |
405 (ediff-with-current-buffer buffer-B (ediff-strip-mode-line-format)) | |
11042 | 406 (if ediff-3way-job |
19047 | 407 (ediff-with-current-buffer buffer-C (ediff-strip-mode-line-format))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
408 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
19047 | 409 (ediff-with-current-buffer ediff-ancestor-buffer |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
410 (ediff-strip-mode-line-format))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
411 |
11042 | 412 (ediff-save-protected-variables) ; save variables to be restored on exit |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
413 |
11042 | 414 ;; ediff-setup-diff-regions-function must be set after setup |
415 ;; parameters are processed. | |
416 (setq ediff-setup-diff-regions-function | |
417 (if ediff-diff3-job | |
418 'ediff-setup-diff-regions3 | |
419 'ediff-setup-diff-regions)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
420 |
11042 | 421 (setq ediff-wide-bounds |
422 (list (ediff-make-bullet-proof-overlay | |
423 '(point-min) '(point-max) ediff-buffer-A) | |
424 (ediff-make-bullet-proof-overlay | |
425 '(point-min) '(point-max) ediff-buffer-B) | |
426 (ediff-make-bullet-proof-overlay | |
427 '(point-min) '(point-max) ediff-buffer-C))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
428 |
11042 | 429 ;; This has effect only on ediff-windows/regions |
430 ;; In all other cases, ediff-visible-region sets visibility bounds to | |
431 ;; ediff-wide-bounds, and ediff-narrow-bounds are ignored. | |
432 (if ediff-start-narrowed | |
433 (setq ediff-visible-bounds ediff-narrow-bounds) | |
434 (setq ediff-visible-bounds ediff-wide-bounds)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
435 |
11042 | 436 (ediff-set-keys) ; comes after parameter setup |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
437 |
11042 | 438 ;; set up ediff-narrow-bounds, if not set |
439 (or ediff-narrow-bounds | |
440 (setq ediff-narrow-bounds ediff-wide-bounds)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
441 |
19047 | 442 ;; All these must be inside ediff-with-current-buffer control-buffer, |
11042 | 443 ;; since these vars are local to control-buffer |
444 ;; These won't run if there are errors in diff | |
19047 | 445 (ediff-with-current-buffer ediff-buffer-A |
11042 | 446 (ediff-nuke-selective-display) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
447 (run-hooks 'ediff-prepare-buffer-hook) |
19047 | 448 (if (ediff-with-current-buffer control-buffer ediff-merge-job) |
11042 | 449 (setq buffer-read-only t)) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
450 ;; add control-buffer to the list of sessions--no longer used, but may |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
451 ;; be used again in the future |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
452 (or (memq control-buffer ediff-this-buffer-ediff-sessions) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
453 (setq ediff-this-buffer-ediff-sessions |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
454 (cons control-buffer ediff-this-buffer-ediff-sessions))) |
18839 | 455 (if ediff-make-buffers-readonly-at-startup |
456 (setq buffer-read-only t)) | |
11042 | 457 ) |
18839 | 458 |
19047 | 459 (ediff-with-current-buffer ediff-buffer-B |
11042 | 460 (ediff-nuke-selective-display) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
461 (run-hooks 'ediff-prepare-buffer-hook) |
19047 | 462 (if (ediff-with-current-buffer control-buffer ediff-merge-job) |
11042 | 463 (setq buffer-read-only t)) |
464 ;; add control-buffer to the list of sessions | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
465 (or (memq control-buffer ediff-this-buffer-ediff-sessions) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
466 (setq ediff-this-buffer-ediff-sessions |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
467 (cons control-buffer ediff-this-buffer-ediff-sessions))) |
18839 | 468 (if ediff-make-buffers-readonly-at-startup |
469 (setq buffer-read-only t)) | |
11042 | 470 ) |
18839 | 471 |
11042 | 472 (if ediff-3way-job |
19047 | 473 (ediff-with-current-buffer ediff-buffer-C |
11042 | 474 (ediff-nuke-selective-display) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
475 ;; the merge bufer should never be narrowed |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
476 ;; (it can happen if it is on rmail-mode or similar) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
477 (if (ediff-with-current-buffer control-buffer ediff-merge-job) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
478 (widen)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
479 (run-hooks 'ediff-prepare-buffer-hook) |
11042 | 480 ;; add control-buffer to the list of sessions |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
481 (or (memq control-buffer ediff-this-buffer-ediff-sessions) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
482 (setq ediff-this-buffer-ediff-sessions |
11042 | 483 (cons control-buffer |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
484 ediff-this-buffer-ediff-sessions))) |
18839 | 485 (if ediff-make-buffers-readonly-at-startup |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
486 (setq buffer-read-only t) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
487 (setq buffer-read-only nil)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
488 )) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
489 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
490 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
19047 | 491 (ediff-with-current-buffer ediff-ancestor-buffer |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
492 (ediff-nuke-selective-display) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
493 (setq buffer-read-only t) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
494 (run-hooks 'ediff-prepare-buffer-hook) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
495 (or (memq control-buffer ediff-this-buffer-ediff-sessions) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
496 (setq ediff-this-buffer-ediff-sessions |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
497 (cons control-buffer |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
498 ediff-this-buffer-ediff-sessions))) |
11042 | 499 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
500 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
501 ;; the following must be after setting up ediff-narrow-bounds AND after |
11042 | 502 ;; nuking selective display |
503 (funcall ediff-setup-diff-regions-function file-A file-B file-C) | |
504 (setq ediff-number-of-differences (length ediff-difference-vector-A)) | |
505 (setq ediff-current-difference -1) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
506 |
11042 | 507 (ediff-make-current-diff-overlay 'A) |
508 (ediff-make-current-diff-overlay 'B) | |
509 (if ediff-3way-job | |
510 (ediff-make-current-diff-overlay 'C)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
511 (if ediff-merge-with-ancestor-job |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
512 (ediff-make-current-diff-overlay 'Ancestor)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
513 |
11042 | 514 (ediff-setup-windows buffer-A buffer-B buffer-C control-buffer) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
515 |
11042 | 516 (let ((shift-A (ediff-overlay-start |
517 (ediff-get-value-according-to-buffer-type | |
518 'A ediff-narrow-bounds))) | |
519 (shift-B (ediff-overlay-start | |
520 (ediff-get-value-according-to-buffer-type | |
521 'B ediff-narrow-bounds))) | |
522 (shift-C (ediff-overlay-start | |
523 (ediff-get-value-according-to-buffer-type | |
524 'C ediff-narrow-bounds)))) | |
525 ;; position point in buf A | |
526 (save-excursion | |
527 (select-window ediff-window-A) | |
528 (goto-char shift-A)) | |
529 ;; position point in buf B | |
530 (save-excursion | |
531 (select-window ediff-window-B) | |
532 (goto-char shift-B)) | |
533 (if ediff-3way-job | |
534 (save-excursion | |
535 (select-window ediff-window-C) | |
536 (goto-char shift-C))) | |
537 ) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
538 |
11042 | 539 (select-window ediff-control-window) |
540 (ediff-visible-region) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
541 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
542 (run-hooks 'startup-hooks) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
543 (ediff-arrange-autosave-in-merge-jobs merge-buffer-file) |
20206 | 544 |
11042 | 545 (ediff-refresh-mode-lines) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
546 (setq buffer-read-only t) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
547 (setq ediff-session-registry |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
548 (cons control-buffer ediff-session-registry)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
549 (ediff-update-registry) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
550 (if (ediff-buffer-live-p ediff-meta-buffer) |
20206 | 551 (ediff-update-meta-buffer |
552 ediff-meta-buffer nil ediff-meta-session-number)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
553 (run-hooks 'ediff-startup-hook) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
554 ) ; eval in control-buffer |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
555 control-buffer)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
556 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
557 |
11042 | 558 ;; This function assumes that we are in the window where control buffer is |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
559 ;; to reside. |
11042 | 560 (defun ediff-setup-control-buffer (ctl-buf) |
561 "Set up window for control buffer." | |
562 (if (window-dedicated-p (selected-window)) | |
563 (set-buffer ctl-buf) ; we are in control frame but just in case | |
564 (switch-to-buffer ctl-buf)) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
565 (let ((window-min-height 2)) |
11042 | 566 (erase-buffer) |
567 (ediff-set-help-message) | |
568 (insert ediff-help-message) | |
569 (shrink-window-if-larger-than-buffer) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
570 (or (ediff-multiframe-setup-p) |
11042 | 571 (ediff-indent-help-message)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
572 (ediff-set-help-overlays) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
573 |
11042 | 574 (set-buffer-modified-p nil) |
575 (ediff-refresh-mode-lines) | |
576 (setq ediff-control-window (selected-window)) | |
577 (setq ediff-window-config-saved | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
578 (format "%S%S%S%S%S%S%S" |
11042 | 579 ediff-control-window |
580 ediff-window-A | |
581 ediff-window-B | |
582 ediff-window-C | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
583 ediff-split-window-function |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
584 (ediff-multiframe-setup-p) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
585 ediff-wide-display-p)) |
18054 | 586 |
587 ;; In multiframe, toolbar is set in ediff-setup-control-frame | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
588 (if (not (ediff-multiframe-setup-p)) |
18054 | 589 (ediff-make-bottom-toolbar)) ; this checks if toolbar is requested |
11042 | 590 (goto-char (point-min)) |
591 (skip-chars-forward ediff-whitespace))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
592 |
20206 | 593 ;; This executes in control buffer and sets auto-save, visited file name, etc, |
594 ;; in the merge buffer | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
595 (defun ediff-arrange-autosave-in-merge-jobs (merge-buffer-file) |
20206 | 596 (if (not ediff-merge-job) |
597 () | |
598 (if (stringp merge-buffer-file) | |
599 (setq ediff-autostore-merges t | |
600 ediff-merge-store-file merge-buffer-file)) | |
601 (if (stringp ediff-merge-store-file) | |
602 (progn | |
603 ;; save before leaving ctl buffer | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
604 (ediff-verify-file-merge-buffer ediff-merge-store-file) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
605 (setq merge-buffer-file ediff-merge-store-file) |
20206 | 606 (ediff-with-current-buffer ediff-buffer-C |
607 (set-visited-file-name merge-buffer-file)))) | |
608 (ediff-with-current-buffer ediff-buffer-C | |
609 (setq buffer-offer-save t) ; ask before killing buffer | |
610 ;; make sure the contents is auto-saved | |
611 (auto-save-mode 1)) | |
612 )) | |
11042 | 613 |
614 | |
615 ;;; Commands for working with Ediff | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
616 |
11042 | 617 (defun ediff-update-diffs () |
618 "Recompute difference regions in buffers A, B, and C. | |
619 Buffers are not synchronized with their respective files, so changes done | |
620 to these buffers are not saved at this point---the user can do this later, | |
621 if necessary." | |
622 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
623 (ediff-barf-if-not-control-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
624 (if (and (ediff-buffer-live-p ediff-ancestor-buffer) |
19047 | 625 (not |
626 (y-or-n-p | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
627 "Ancestor buffer will not be used. Recompute diffs anyway? "))) |
19047 | 628 (error "Recomputation of differences canceled")) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
629 |
19047 | 630 (let ((point-A (ediff-with-current-buffer ediff-buffer-A (point))) |
631 ;;(point-B (ediff-with-current-buffer ediff-buffer-B (point))) | |
11042 | 632 (tmp-buffer (get-buffer-create ediff-tmp-buffer)) |
19047 | 633 (buf-A-file-name (buffer-file-name ediff-buffer-A)) |
634 (buf-B-file-name (buffer-file-name ediff-buffer-B)) | |
635 ;; (null ediff-buffer-C) is no problem, as we later check if | |
636 ;; ediff-buffer-C is alive | |
637 (buf-C-file-name (buffer-file-name ediff-buffer-C)) | |
11042 | 638 (overl-A (ediff-get-value-according-to-buffer-type |
639 'A ediff-narrow-bounds)) | |
640 (overl-B (ediff-get-value-according-to-buffer-type | |
641 'B ediff-narrow-bounds)) | |
642 (overl-C (ediff-get-value-according-to-buffer-type | |
643 'C ediff-narrow-bounds)) | |
644 beg-A end-A beg-B end-B beg-C end-C | |
645 file-A file-B file-C) | |
19047 | 646 |
647 (if (stringp buf-A-file-name) | |
648 (setq buf-A-file-name (file-name-nondirectory buf-A-file-name))) | |
649 (if (stringp buf-B-file-name) | |
650 (setq buf-B-file-name (file-name-nondirectory buf-B-file-name))) | |
651 (if (stringp buf-C-file-name) | |
652 (setq buf-C-file-name (file-name-nondirectory buf-C-file-name))) | |
653 | |
11042 | 654 (ediff-unselect-and-select-difference -1) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
655 |
11042 | 656 (setq beg-A (ediff-overlay-start overl-A) |
657 beg-B (ediff-overlay-start overl-B) | |
658 beg-C (ediff-overlay-start overl-C) | |
659 end-A (ediff-overlay-end overl-A) | |
660 end-B (ediff-overlay-end overl-B) | |
661 end-C (ediff-overlay-end overl-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
662 |
11042 | 663 (if ediff-word-mode |
664 (progn | |
665 (ediff-wordify beg-A end-A ediff-buffer-A tmp-buffer) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
666 (setq file-A (ediff-make-temp-file tmp-buffer "regA")) |
11042 | 667 (ediff-wordify beg-B end-B ediff-buffer-B tmp-buffer) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
668 (setq file-B (ediff-make-temp-file tmp-buffer "regB")) |
11042 | 669 (if ediff-3way-job |
670 (progn | |
671 (ediff-wordify beg-C end-C ediff-buffer-C tmp-buffer) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
672 (setq file-C (ediff-make-temp-file tmp-buffer "regC")))) |
11042 | 673 ) |
674 ;; not word-mode | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
675 (setq file-A (ediff-make-temp-file ediff-buffer-A buf-A-file-name)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
676 (setq file-B (ediff-make-temp-file ediff-buffer-B buf-B-file-name)) |
11042 | 677 (if ediff-3way-job |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
678 (setq file-C (ediff-make-temp-file ediff-buffer-C buf-C-file-name))) |
11042 | 679 ) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
680 |
11042 | 681 (ediff-clear-diff-vector 'ediff-difference-vector-A 'fine-diffs-also) |
682 (ediff-clear-diff-vector 'ediff-difference-vector-B 'fine-diffs-also) | |
683 (ediff-clear-diff-vector 'ediff-difference-vector-C 'fine-diffs-also) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
684 (ediff-clear-diff-vector |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
685 'ediff-difference-vector-Ancestor 'fine-diffs-also) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
686 ;; let them garbage collect. we can't use the ancestor after recomputing |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
687 ;; the diffs. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
688 (setq ediff-difference-vector-Ancestor nil |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
689 ediff-ancestor-buffer nil |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
690 ediff-state-of-merge nil) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
691 |
11042 | 692 (setq ediff-killed-diffs-alist nil) ; invalidate saved killed diff regions |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
693 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
694 ;; In case of merge job, fool it into thinking that it is just doing |
11042 | 695 ;; comparison |
696 (let ((ediff-setup-diff-regions-function ediff-setup-diff-regions-function) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
697 (ediff-3way-comparison-job ediff-3way-comparison-job) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
698 (ediff-merge-job ediff-merge-job) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
699 (ediff-merge-with-ancestor-job ediff-merge-with-ancestor-job) |
11042 | 700 (ediff-job-name ediff-job-name)) |
701 (if ediff-merge-job | |
702 (setq ediff-setup-diff-regions-function 'ediff-setup-diff-regions3 | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
703 ediff-3way-comparison-job t |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
704 ediff-merge-job nil |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
705 ediff-merge-with-ancestor-job nil |
11042 | 706 ediff-job-name 'ediff-files3)) |
707 (funcall ediff-setup-diff-regions-function file-A file-B file-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
708 |
11042 | 709 (setq ediff-number-of-differences (length ediff-difference-vector-A)) |
710 (delete-file file-A) | |
711 (delete-file file-B) | |
712 (if file-C | |
713 (delete-file file-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
714 |
11042 | 715 (if ediff-3way-job |
716 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
717 |
11042 | 718 (ediff-jump-to-difference (ediff-diff-at-point 'A point-A)) |
719 (message "") | |
720 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
721 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
722 ;; Not bound to any key---to dangerous. A user can do it if necessary. |
11042 | 723 (defun ediff-revert-buffers-then-recompute-diffs (noconfirm) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
724 "Revert buffers A, B and C. Then rerun Ediff on file A and file B." |
11042 | 725 (interactive "P") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
726 (ediff-barf-if-not-control-buffer) |
11042 | 727 (let ((bufA ediff-buffer-A) |
728 (bufB ediff-buffer-B) | |
729 (bufC ediff-buffer-C) | |
730 (ctl-buf ediff-control-buffer) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
731 (keep-variants ediff-keep-variants) |
11042 | 732 (ancestor-buf ediff-ancestor-buffer) |
733 (ancestor-job ediff-merge-with-ancestor-job) | |
734 (merge ediff-merge-job) | |
735 (comparison ediff-3way-comparison-job)) | |
19047 | 736 (ediff-with-current-buffer bufA |
11042 | 737 (revert-buffer t noconfirm)) |
19047 | 738 (ediff-with-current-buffer bufB |
11042 | 739 (revert-buffer t noconfirm)) |
740 ;; this should only be executed in a 3way comparison, not in merge | |
741 (if comparison | |
19047 | 742 (ediff-with-current-buffer bufC |
11042 | 743 (revert-buffer t noconfirm))) |
744 (if merge | |
745 (progn | |
746 (set-buffer ctl-buf) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
747 ;; the argument says whether to reverse the meaning of |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
748 ;; ediff-keep-variants, i.e., ediff-really-quit runs here with |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
749 ;; variants kept. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
750 (ediff-really-quit (not keep-variants)) |
11042 | 751 (kill-buffer bufC) |
752 (if ancestor-job | |
753 (ediff-merge-buffers-with-ancestor bufA bufB ancestor-buf) | |
754 (ediff-merge-buffers bufA bufB))) | |
755 (ediff-update-diffs)))) | |
756 | |
757 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
758 ;; optional NO-REHIGHLIGHT says to not rehighlight buffers |
11042 | 759 (defun ediff-recenter (&optional no-rehighlight) |
760 "Bring the highlighted region of all buffers being compared into view. | |
761 Reestablish the default three-window display." | |
762 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
763 (ediff-barf-if-not-control-buffer) |
11042 | 764 (let (buffer-read-only) |
765 (if (and (ediff-buffer-live-p ediff-buffer-A) | |
766 (ediff-buffer-live-p ediff-buffer-B) | |
767 (or (not ediff-3way-job) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
768 (ediff-buffer-live-p ediff-buffer-C))) |
11042 | 769 (ediff-setup-windows |
770 ediff-buffer-A ediff-buffer-B ediff-buffer-C ediff-control-buffer) | |
771 (or (eq this-command 'ediff-quit) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
772 (message ediff-KILLED-VITAL-BUFFER |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
773 (beep 1))) |
11042 | 774 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
775 |
11042 | 776 ;; set visibility range appropriate to this invocation of Ediff. |
777 (ediff-visible-region) | |
778 ;; raise | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
779 (if (and (ediff-window-display-p) |
11042 | 780 (symbolp this-command) |
781 (symbolp last-command) | |
782 ;; Either one of the display-changing commands | |
783 (or (memq this-command | |
784 '(ediff-recenter | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
785 ediff-dir-action ediff-registry-action |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
786 ediff-patch-action |
11042 | 787 ediff-toggle-wide-display ediff-toggle-multiframe)) |
788 ;; Or one of the movement cmds and prev cmd was an Ediff cmd | |
14040 | 789 ;; This avoids raising frames unnecessarily. |
11042 | 790 (and (memq this-command |
791 '(ediff-next-difference | |
792 ediff-previous-difference | |
793 ediff-jump-to-difference | |
794 ediff-jump-to-difference-at-point)) | |
795 (not (string-match "^ediff-" (symbol-name last-command))) | |
796 ))) | |
797 (progn | |
798 (if (window-live-p ediff-window-A) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
799 (raise-frame (window-frame ediff-window-A))) |
11042 | 800 (if (window-live-p ediff-window-B) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
801 (raise-frame (window-frame ediff-window-B))) |
11042 | 802 (if (window-live-p ediff-window-C) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
803 (raise-frame (window-frame ediff-window-C))))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
804 (if (and (ediff-window-display-p) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
805 (frame-live-p ediff-control-frame) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
806 (not ediff-use-long-help-message) |
11042 | 807 (not (ediff-frame-iconified-p ediff-control-frame))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
808 (raise-frame ediff-control-frame)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
809 |
11042 | 810 ;; Redisplay whatever buffers are showing, if there is a selected difference |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
811 (let ((control-frame ediff-control-frame) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
812 (control-buf ediff-control-buffer)) |
11042 | 813 (if (and (ediff-buffer-live-p ediff-buffer-A) |
814 (ediff-buffer-live-p ediff-buffer-B) | |
815 (or (not ediff-3way-job) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
816 (ediff-buffer-live-p ediff-buffer-C))) |
11042 | 817 (progn |
818 (or no-rehighlight | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
819 (ediff-select-difference ediff-current-difference)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
820 |
11042 | 821 (ediff-recenter-one-window 'A) |
822 (ediff-recenter-one-window 'B) | |
823 (if ediff-3way-job | |
824 (ediff-recenter-one-window 'C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
825 |
19047 | 826 (ediff-with-current-buffer control-buf |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
827 (ediff-recenter-ancestor) ; check if ancestor is alive |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
828 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
829 (if (and (ediff-multiframe-setup-p) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
830 (not ediff-use-long-help-message) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
831 (not (ediff-frame-iconified-p ediff-control-frame))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
832 ;; never grab mouse on quit in this place |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
833 (ediff-reset-mouse |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
834 control-frame |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
835 (eq this-command 'ediff-quit)))) |
11042 | 836 )) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
837 |
52828
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
838 (or no-rehighlight |
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
839 (ediff-restore-highlighting)) |
19047 | 840 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines)) |
11042 | 841 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
842 |
11042 | 843 ;; this function returns to the window it was called from |
844 ;; (which was the control window) | |
845 (defun ediff-recenter-one-window (buf-type) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
846 (if (ediff-valid-difference-p) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
847 ;; context must be saved before switching to windows A/B/C |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
848 (let* ((ctl-wind (selected-window)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
849 (shift (ediff-overlay-start |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
850 (ediff-get-value-according-to-buffer-type |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
851 buf-type ediff-narrow-bounds))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
852 (job-name ediff-job-name) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
853 (control-buf ediff-control-buffer) |
19047 | 854 (window-name (ediff-get-symbol-from-alist |
855 buf-type ediff-window-alist)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
856 (window (if (window-live-p (symbol-value window-name)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
857 (symbol-value window-name)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
858 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
859 (if (and window ediff-windows-job) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
860 (set-window-start window shift)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
861 (if window |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
862 (progn |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
863 (select-window window) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
864 (ediff-deactivate-mark) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
865 (ediff-position-region |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
866 (ediff-get-diff-posn buf-type 'beg nil control-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
867 (ediff-get-diff-posn buf-type 'end nil control-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
868 (ediff-get-diff-posn buf-type 'beg nil control-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
869 job-name |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
870 ))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
871 (select-window ctl-wind) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
872 ))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
873 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
874 (defun ediff-recenter-ancestor () |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
875 ;; do half-hearted job by recentering the ancestor buffer, if it is alive and |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
876 ;; visible. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
877 (if (and (ediff-buffer-live-p ediff-ancestor-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
878 (ediff-valid-difference-p)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
879 (let ((window (ediff-get-visible-buffer-window ediff-ancestor-buffer)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
880 (ctl-wind (selected-window)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
881 (job-name ediff-job-name) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
882 (ctl-buf ediff-control-buffer)) |
19047 | 883 (ediff-with-current-buffer ediff-ancestor-buffer |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
884 (goto-char (ediff-get-diff-posn 'Ancestor 'beg nil ctl-buf)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
885 (if window |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
886 (progn |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
887 (select-window window) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
888 (ediff-position-region |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
889 (ediff-get-diff-posn 'Ancestor 'beg nil ctl-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
890 (ediff-get-diff-posn 'Ancestor 'end nil ctl-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
891 (ediff-get-diff-posn 'Ancestor 'beg nil ctl-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
892 job-name)))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
893 (select-window ctl-wind) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
894 ))) |
11042 | 895 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
896 |
11042 | 897 ;; This will have to be refined for 3way jobs |
898 (defun ediff-toggle-split () | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
899 "Toggle vertical/horizontal window split. |
11042 | 900 Does nothing if file-A and file-B are in different frames." |
901 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
902 (ediff-barf-if-not-control-buffer) |
11042 | 903 (let* ((wind-A (if (window-live-p ediff-window-A) ediff-window-A)) |
904 (wind-B (if (window-live-p ediff-window-B) ediff-window-B)) | |
905 (wind-C (if (window-live-p ediff-window-C) ediff-window-C)) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
906 (frame-A (if wind-A (window-frame wind-A))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
907 (frame-B (if wind-B (window-frame wind-B))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
908 (frame-C (if wind-C (window-frame wind-C)))) |
11042 | 909 (if (or (eq frame-A frame-B) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
910 (not (frame-live-p frame-A)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
911 (not (frame-live-p frame-B)) |
11042 | 912 (if ediff-3way-comparison-job |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
913 (or (not (frame-live-p frame-C)) |
11042 | 914 (eq frame-A frame-C) (eq frame-B frame-C)))) |
915 (setq ediff-split-window-function | |
916 (if (eq ediff-split-window-function 'split-window-vertically) | |
917 'split-window-horizontally | |
918 'split-window-vertically)) | |
919 (message "Buffers being compared are in different frames")) | |
920 (ediff-recenter 'no-rehighlight))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
921 |
11042 | 922 (defun ediff-toggle-hilit () |
923 "Switch between highlighting using ASCII flags and highlighting using faces. | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
924 On a dumb terminal, switches between ASCII highlighting and no highlighting." |
11042 | 925 (interactive) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
926 (ediff-barf-if-not-control-buffer) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
927 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
928 (ediff-unselect-and-select-difference |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
929 ediff-current-difference 'unselect-only) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
930 ;; cycle through highlighting |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
931 (cond ((and ediff-use-faces |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
932 (ediff-has-face-support-p) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
933 ediff-highlight-all-diffs) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
934 (message "Unhighlighting unselected difference regions") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
935 (setq ediff-highlight-all-diffs nil |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
936 ediff-highlighting-style 'face)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
937 ((or (and ediff-use-faces (ediff-has-face-support-p) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
938 (eq ediff-highlighting-style 'face)) ; has face support |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
939 (and (not (ediff-has-face-support-p)) ; no face support |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
940 (eq ediff-highlighting-style 'off))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
941 (message "Highlighting with ASCII flags") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
942 (setq ediff-highlighting-style 'ascii |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
943 ediff-highlight-all-diffs nil |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
944 ediff-use-faces nil)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
945 ((eq ediff-highlighting-style 'ascii) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
946 (message "ASCII highlighting flags removed") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
947 (setq ediff-highlighting-style 'off |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
948 ediff-highlight-all-diffs nil)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
949 ((ediff-has-face-support-p) ; catch-all for cases with face support |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
950 (message "Re-highlighting all difference regions") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
951 (setq ediff-use-faces t |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
952 ediff-highlighting-style 'face |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
953 ediff-highlight-all-diffs t))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
954 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
955 (if (and ediff-use-faces ediff-highlight-all-diffs) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
956 (ediff-paint-background-regions) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
957 (ediff-paint-background-regions 'unhighlight)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
958 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
959 (ediff-unselect-and-select-difference |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
960 ediff-current-difference 'select-only)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
961 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
962 |
11042 | 963 (defun ediff-toggle-autorefine () |
964 "Toggle auto-refine mode." | |
965 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
966 (ediff-barf-if-not-control-buffer) |
11042 | 967 (if ediff-word-mode |
968 (error "No fine differences in this mode")) | |
969 (cond ((eq ediff-auto-refine 'nix) | |
970 (setq ediff-auto-refine 'on) | |
971 (ediff-make-fine-diffs ediff-current-difference 'noforce) | |
972 (message "Auto-refining is ON")) | |
973 ((eq ediff-auto-refine 'on) | |
974 (message "Auto-refining is OFF") | |
975 (setq ediff-auto-refine 'off)) | |
976 (t ;; nix 'em | |
977 (ediff-set-fine-diff-properties ediff-current-difference 'default) | |
978 (message "Refinements are HIDDEN") | |
979 (setq ediff-auto-refine 'nix)) | |
980 )) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
981 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
982 (defun ediff-show-ancestor () |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
983 "Show the ancestor buffer in a suitable window." |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
984 (interactive) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
985 (ediff-recenter) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
986 (or (ediff-buffer-live-p ediff-ancestor-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
987 (if ediff-merge-with-ancestor-job |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
988 (error "Lost connection to ancestor buffer...sorry") |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
989 (error "Not merging with ancestor"))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
990 (let (wind) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
991 (cond ((setq wind (ediff-get-visible-buffer-window ediff-ancestor-buffer)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
992 (raise-frame (window-frame wind))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
993 (t (set-window-buffer ediff-window-C ediff-ancestor-buffer))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
994 |
11042 | 995 (defun ediff-make-or-kill-fine-diffs (arg) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
996 "Compute fine diffs. With negative prefix arg, kill fine diffs. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
997 In both cases, operates on the current difference region." |
11042 | 998 (interactive "P") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
999 (ediff-barf-if-not-control-buffer) |
11042 | 1000 (cond ((eq arg '-) |
1001 (ediff-clear-fine-differences ediff-current-difference)) | |
1002 ((and (numberp arg) (< arg 0)) | |
1003 (ediff-clear-fine-differences ediff-current-difference)) | |
1004 (t (ediff-make-fine-diffs)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1005 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1006 |
11042 | 1007 (defun ediff-toggle-help () |
1008 "Toggle short/long help message." | |
1009 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1010 (ediff-barf-if-not-control-buffer) |
11042 | 1011 (let (buffer-read-only) |
1012 (erase-buffer) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1013 (setq ediff-use-long-help-message (not ediff-use-long-help-message)) |
11042 | 1014 (ediff-set-help-message)) |
1015 ;; remember the icon status of the control frame when the user requested | |
1016 ;; full control message | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1017 (if (and ediff-use-long-help-message (ediff-multiframe-setup-p)) |
11042 | 1018 (setq ediff-prefer-iconified-control-frame |
1019 (ediff-frame-iconified-p ediff-control-frame))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1020 |
11042 | 1021 (setq ediff-window-config-saved "") ; force redisplay |
1022 (ediff-recenter 'no-rehighlight)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1023 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1024 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1025 ;; If BUF, this is the buffer to toggle, not current buffer. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1026 (defun ediff-toggle-read-only (&optional buf) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1027 "Toggle read-only in current buffer. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1028 If buffer is under version control and locked, check it out first. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1029 If optional argument BUF is specified, toggle read-only in that buffer instead |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1030 of the current buffer." |
11042 | 1031 (interactive) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1032 (ediff-barf-if-not-control-buffer) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1033 (let ((ctl-buf (if (null buf) (current-buffer))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1034 (buf-type (ediff-char-to-buftype last-command-char))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1035 (or buf (ediff-recenter)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1036 (or buf |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1037 (setq buf (ediff-get-buffer buf-type))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1038 |
19047 | 1039 (ediff-with-current-buffer buf ; eval in buf A/B/C |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1040 (let* ((file (buffer-file-name buf)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1041 (file-writable (and file |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1042 (file-exists-p file) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1043 (file-writable-p file))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1044 (toggle-ro-cmd (cond (ediff-toggle-read-only-function) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1045 ((ediff-file-checked-out-p file) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1046 'toggle-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1047 (file-writable 'toggle-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1048 (t (key-binding "\C-x\C-q"))))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1049 ;; If the file is checked in, make sure we don't make buffer modifiable |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1050 ;; without warning the user. The user can fool our checks by making the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1051 ;; buffer non-RO without checking the file out. We regard this as a |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1052 ;; user problem. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1053 (if (and (ediff-file-checked-in-p file) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1054 ;; If ctl-buf is null, this means we called this |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1055 ;; non-interactively, in which case don't ask questions |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1056 ctl-buf) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1057 (cond ((not buffer-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1058 (setq toggle-ro-cmd 'toggle-read-only)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1059 ((and (or (beep 1) t) ; always beep |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1060 (y-or-n-p |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1061 (format |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1062 "File %s is under version control. Check it out? " |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1063 (ediff-abbreviate-file-name file)))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1064 ;; if we checked the file out, we should also change the |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1065 ;; original state of buffer-read-only to nil. If we don't |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1066 ;; do this, the mode line will show %%, since the file was |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1067 ;; RO before ediff started, so the user will think the file |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1068 ;; is checked in. |
19047 | 1069 (ediff-with-current-buffer ctl-buf |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1070 (ediff-change-saved-variable |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1071 'buffer-read-only nil buf-type))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1072 (t |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1073 (setq toggle-ro-cmd 'toggle-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1074 (beep 1) (beep 1) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1075 (message |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1076 "Boy, this is risky! Don't modify this file...") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1077 (sit-for 3)))) ; let the user see the warning |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1078 (if (and toggle-ro-cmd |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1079 (string-match "toggle-read-only" (symbol-name toggle-ro-cmd))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1080 (save-excursion |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1081 (save-window-excursion |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1082 (select-window (ediff-get-visible-buffer-window buf)) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1083 (command-execute toggle-ro-cmd))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1084 (error "Don't know how to toggle read-only in buffer %S" buf)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1085 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1086 ;; Check if we made the current buffer updatable, but its file is RO. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1087 ;; Signal a warning in this case. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1088 (if (and file (not buffer-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1089 (eq this-command 'ediff-toggle-read-only) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1090 (file-exists-p file) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1091 (not (file-writable-p file))) |
53865
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
1092 (progn |
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
1093 (beep 1) |
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
1094 (message "Warning: file %s is read-only" |
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
1095 (ediff-abbreviate-file-name file)))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1096 )))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1097 |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1098 ;; checkout if visited file is checked in |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1099 (defun ediff-maybe-checkout (buf) |
21940 | 1100 (let ((file (expand-file-name (buffer-file-name buf))) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1101 (checkout-function (key-binding "\C-x\C-q"))) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1102 (if (and (ediff-file-checked-in-p file) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1103 (or (beep 1) t) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1104 (y-or-n-p |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1105 (format |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1106 "File %s is under version control. Check it out? " |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1107 (ediff-abbreviate-file-name file)))) |
19047 | 1108 (ediff-with-current-buffer buf |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1109 (command-execute checkout-function))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1110 |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1111 |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1112 ;; This is a simple-minded check for whether a file is under version control. |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1113 ;; If file,v exists but file doesn't, this file is considered to be not checked |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1114 ;; in and not checked out for the purpose of patching (since patch won't be |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1115 ;; able to read such a file anyway). |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1116 ;; FILE is a string representing file name |
21940 | 1117 ;;(defun ediff-file-under-version-control (file) |
1118 ;; (let* ((filedir (file-name-directory file)) | |
1119 ;; (file-nondir (file-name-nondirectory file)) | |
1120 ;; (trial (concat file-nondir ",v")) | |
1121 ;; (full-trial (concat filedir trial)) | |
1122 ;; (full-rcs-trial (concat filedir "RCS/" trial))) | |
1123 ;; (and (stringp file) | |
1124 ;; (file-exists-p file) | |
1125 ;; (or | |
1126 ;; (and | |
1127 ;; (file-exists-p full-trial) | |
1128 ;; ;; in FAT FS, `file,v' and `file' may turn out to be the same! | |
1129 ;; ;; don't be fooled by this! | |
1130 ;; (not (equal (file-attributes file) | |
1131 ;; (file-attributes full-trial)))) | |
1132 ;; ;; check if a version is in RCS/ directory | |
1133 ;; (file-exists-p full-rcs-trial))) | |
1134 ;; )) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1135 |
21940 | 1136 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
1137 (defun ediff-file-checked-out-p (file) |
21940 | 1138 (or (not (featurep 'vc-hooks)) |
1139 (and (vc-backend file) | |
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1140 (if (fboundp 'vc-state) |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1141 (or (memq (vc-state file) '(edited needs-merge)) |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1142 (stringp (vc-state file))) |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1143 ;; XEmacs has no vc-state |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1144 (vc-locking-user file)) |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1145 ))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1146 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
1147 (defun ediff-file-checked-in-p (file) |
21940 | 1148 (and (featurep 'vc-hooks) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1149 ;; CVS files are considered not checked in |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1150 (not (memq (vc-backend file) '(nil CVS))) |
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1151 (if (fboundp 'vc-state) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
47520
diff
changeset
|
1152 (and |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
47520
diff
changeset
|
1153 (not (memq (vc-state file) '(edited needs-merge))) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
47520
diff
changeset
|
1154 (not (stringp (vc-state file)))) |
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1155 ;; XEmacs has no vc-state |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1156 (not (vc-locking-user file))) |
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
1157 )) |
21940 | 1158 |
1159 (defun ediff-file-compressed-p (file) | |
1160 (condition-case nil | |
1161 (require 'jka-compr) | |
1162 (error)) | |
1163 (if (featurep 'jka-compr) | |
1164 (string-match (jka-compr-build-file-regexp) file))) | |
1165 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1166 |
11042 | 1167 (defun ediff-swap-buffers () |
1168 "Rotate the display of buffers A, B, and C." | |
1169 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1170 (ediff-barf-if-not-control-buffer) |
11042 | 1171 (if (and (window-live-p ediff-window-A) (window-live-p ediff-window-B)) |
1172 (let ((buf ediff-buffer-A) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1173 (values ediff-buffer-values-orig-A) |
11042 | 1174 (diff-vec ediff-difference-vector-A) |
1175 (hide-regexp ediff-regexp-hide-A) | |
1176 (focus-regexp ediff-regexp-focus-A) | |
1177 (wide-visibility-p (eq ediff-visible-bounds ediff-wide-bounds)) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1178 (overlay (if (ediff-has-face-support-p) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1179 ediff-current-diff-overlay-A))) |
11042 | 1180 (if ediff-3way-comparison-job |
1181 (progn | |
1182 (set-window-buffer ediff-window-A ediff-buffer-C) | |
1183 (set-window-buffer ediff-window-B ediff-buffer-A) | |
1184 (set-window-buffer ediff-window-C ediff-buffer-B) | |
1185 ) | |
1186 (set-window-buffer ediff-window-A ediff-buffer-B) | |
1187 (set-window-buffer ediff-window-B ediff-buffer-A)) | |
1188 ;; swap diff buffers | |
1189 (if ediff-3way-comparison-job | |
1190 (setq ediff-buffer-A ediff-buffer-C | |
1191 ediff-buffer-C ediff-buffer-B | |
1192 ediff-buffer-B buf) | |
1193 (setq ediff-buffer-A ediff-buffer-B | |
1194 ediff-buffer-B buf)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1195 |
11042 | 1196 ;; swap saved buffer characteristics |
1197 (if ediff-3way-comparison-job | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1198 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-C |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1199 ediff-buffer-values-orig-C ediff-buffer-values-orig-B |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1200 ediff-buffer-values-orig-B values) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1201 (setq ediff-buffer-values-orig-A ediff-buffer-values-orig-B |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1202 ediff-buffer-values-orig-B values)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1203 |
11042 | 1204 ;; swap diff vectors |
1205 (if ediff-3way-comparison-job | |
1206 (setq ediff-difference-vector-A ediff-difference-vector-C | |
1207 ediff-difference-vector-C ediff-difference-vector-B | |
1208 ediff-difference-vector-B diff-vec) | |
1209 (setq ediff-difference-vector-A ediff-difference-vector-B | |
1210 ediff-difference-vector-B diff-vec)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1211 |
11042 | 1212 ;; swap hide/focus regexp |
1213 (if ediff-3way-comparison-job | |
1214 (setq ediff-regexp-hide-A ediff-regexp-hide-C | |
1215 ediff-regexp-hide-C ediff-regexp-hide-B | |
1216 ediff-regexp-hide-B hide-regexp | |
1217 ediff-regexp-focus-A ediff-regexp-focus-C | |
1218 ediff-regexp-focus-C ediff-regexp-focus-B | |
1219 ediff-regexp-focus-B focus-regexp) | |
1220 (setq ediff-regexp-hide-A ediff-regexp-hide-B | |
1221 ediff-regexp-hide-B hide-regexp | |
1222 ediff-regexp-focus-A ediff-regexp-focus-B | |
1223 ediff-regexp-focus-B focus-regexp)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1224 |
11042 | 1225 ;; The following is needed for XEmacs, since there one can't move |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1226 ;; overlay to another buffer. In Emacs, this swap is redundant. |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1227 (if (ediff-has-face-support-p) |
11042 | 1228 (if ediff-3way-comparison-job |
1229 (setq ediff-current-diff-overlay-A ediff-current-diff-overlay-C | |
1230 ediff-current-diff-overlay-C ediff-current-diff-overlay-B | |
1231 ediff-current-diff-overlay-B overlay) | |
1232 (setq ediff-current-diff-overlay-A ediff-current-diff-overlay-B | |
1233 ediff-current-diff-overlay-B overlay))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1234 |
11042 | 1235 ;; swap wide bounds |
1236 (setq ediff-wide-bounds | |
1237 (cond (ediff-3way-comparison-job | |
1238 (list (nth 2 ediff-wide-bounds) | |
1239 (nth 0 ediff-wide-bounds) | |
1240 (nth 1 ediff-wide-bounds))) | |
1241 (ediff-3way-job | |
1242 (list (nth 1 ediff-wide-bounds) | |
1243 (nth 0 ediff-wide-bounds) | |
1244 (nth 2 ediff-wide-bounds))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1245 (t |
11042 | 1246 (list (nth 1 ediff-wide-bounds) |
1247 (nth 0 ediff-wide-bounds))))) | |
1248 ;; swap narrow bounds | |
1249 (setq ediff-narrow-bounds | |
1250 (cond (ediff-3way-comparison-job | |
1251 (list (nth 2 ediff-narrow-bounds) | |
1252 (nth 0 ediff-narrow-bounds) | |
1253 (nth 1 ediff-narrow-bounds))) | |
1254 (ediff-3way-job | |
1255 (list (nth 1 ediff-narrow-bounds) | |
1256 (nth 0 ediff-narrow-bounds) | |
1257 (nth 2 ediff-narrow-bounds))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1258 (t |
11042 | 1259 (list (nth 1 ediff-narrow-bounds) |
1260 (nth 0 ediff-narrow-bounds))))) | |
1261 (if wide-visibility-p | |
1262 (setq ediff-visible-bounds ediff-wide-bounds) | |
1263 (setq ediff-visible-bounds ediff-narrow-bounds)) | |
1264 )) | |
1265 (if ediff-3way-job | |
1266 (ediff-set-state-of-all-diffs-in-all-buffers ediff-control-buffer)) | |
1267 (ediff-recenter 'no-rehighlight) | |
1268 ) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1269 |
11042 | 1270 |
1271 (defun ediff-toggle-wide-display () | |
1272 "Toggle wide/regular display. | |
1273 This is especially useful when comparing buffers side-by-side." | |
1274 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1275 (ediff-barf-if-not-control-buffer) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1276 (or (ediff-window-display-p) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1277 (error "%sEmacs is not running as a window application" |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1278 (if ediff-emacs-p "" "X"))) |
11042 | 1279 (ediff-recenter 'no-rehighlight) ; make sure buffs are displayed in windows |
1280 (let ((ctl-buf ediff-control-buffer)) | |
1281 (setq ediff-wide-display-p (not ediff-wide-display-p)) | |
1282 (if (not ediff-wide-display-p) | |
19047 | 1283 (ediff-with-current-buffer ctl-buf |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1284 (modify-frame-parameters |
11042 | 1285 ediff-wide-display-frame ediff-wide-display-orig-parameters) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1286 ;;(sit-for (if ediff-xemacs-p 0.4 0)) |
11042 | 1287 ;; restore control buf, since ctl window may have been deleted |
1288 ;; during resizing | |
1289 (set-buffer ctl-buf) | |
1290 (setq ediff-wide-display-orig-parameters nil | |
1291 ediff-window-B nil) ; force update of window config | |
1292 (ediff-recenter 'no-rehighlight)) | |
1293 (funcall ediff-make-wide-display-function) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1294 ;;(sit-for (if ediff-xemacs-p 0.4 0)) |
19047 | 1295 (ediff-with-current-buffer ctl-buf |
11042 | 1296 (setq ediff-window-B nil) ; force update of window config |
1297 (ediff-recenter 'no-rehighlight))))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1298 |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1299 ;;;###autoload |
11042 | 1300 (defun ediff-toggle-multiframe () |
18054 | 1301 "Switch from multiframe display to single-frame display and back. |
1302 To change the default, set the variable `ediff-window-setup-function', | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1303 which see." |
11042 | 1304 (interactive) |
18054 | 1305 (let (window-setup-func) |
1306 (or (ediff-window-display-p) | |
1307 (error "%sEmacs is not running as a window application" | |
1308 (if ediff-emacs-p "" "X"))) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1309 |
11042 | 1310 (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe) |
18054 | 1311 (setq window-setup-func 'ediff-setup-windows-plain)) |
11042 | 1312 ((eq ediff-window-setup-function 'ediff-setup-windows-plain) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1313 (if (ediff-in-control-buffer-p) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1314 (ediff-kill-bottom-toolbar)) |
18054 | 1315 (setq window-setup-func 'ediff-setup-windows-multiframe))) |
1316 | |
1317 ;; change default | |
1318 (setq-default ediff-window-setup-function window-setup-func) | |
1319 ;; change in all active ediff sessions | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1320 (mapcar (lambda(buf) (ediff-with-current-buffer buf |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1321 (setq ediff-window-setup-function window-setup-func |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1322 ediff-window-B nil))) |
18054 | 1323 ediff-session-registry) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1324 (if (ediff-in-control-buffer-p) |
18054 | 1325 (ediff-recenter 'no-rehighlight)))) |
1326 | |
1327 | |
1328 ;;;###autoload | |
1329 (defun ediff-toggle-use-toolbar () | |
1330 "Enable or disable Ediff toolbar. | |
1331 Works only in versions of Emacs that support toolbars. | |
1332 To change the default, set the variable `ediff-use-toolbar-p', which see." | |
1333 (interactive) | |
1334 (if (featurep 'ediff-tbar) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1335 (progn |
18054 | 1336 (or (ediff-window-display-p) |
1337 (error "%sEmacs is not running as a window application" | |
1338 (if ediff-emacs-p "" "X"))) | |
1339 (if (ediff-use-toolbar-p) | |
1340 (ediff-kill-bottom-toolbar)) | |
1341 ;; do this only after killing the toolbar | |
1342 (setq ediff-use-toolbar-p (not ediff-use-toolbar-p)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1343 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1344 (mapcar (lambda(buf) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1345 (ediff-with-current-buffer buf |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1346 ;; force redisplay |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1347 (setq ediff-window-config-saved "") |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1348 )) |
18054 | 1349 ediff-session-registry) |
1350 (if (ediff-in-control-buffer-p) | |
1351 (ediff-recenter 'no-rehighlight))))) | |
1352 | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1353 |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1354 ;; if was using toolbar, kill it |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1355 (defun ediff-kill-bottom-toolbar () |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1356 ;; Using ctl-buffer or ediff-control-window for LOCALE does not |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1357 ;; work properly in XEmacs 19.14: we have to use |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1358 ;;(selected-frame). |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1359 ;; The problem with this is that any previous bottom-toolbar |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1360 ;; will not re-appear after our cleanup here. Is there a way |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1361 ;; to do "push" and "pop" toolbars ? --marcpa |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1362 (if (ediff-use-toolbar-p) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1363 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1364 (progn ; xemacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1365 (set-specifier bottom-toolbar (list (selected-frame) nil)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1366 (set-specifier bottom-toolbar-visible-p (list (selected-frame) nil))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1367 nil ; emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1368 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1369 )) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1370 |
18054 | 1371 ;; If wants to use toolbar, make it. |
1372 ;; If not, zero the toolbar for XEmacs. | |
1373 ;; Do nothing for Emacs. | |
1374 (defun ediff-make-bottom-toolbar (&optional frame) | |
1375 (if (ediff-window-display-p) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
1376 (progn |
18054 | 1377 (setq frame (or frame (selected-frame))) |
1378 (cond ((ediff-use-toolbar-p) ; this checks for XEmacs | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1379 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1380 (progn ; xemacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1381 (set-specifier |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1382 bottom-toolbar |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1383 (list frame (if (ediff-3way-comparison-job) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1384 ediff-toolbar-3way ediff-toolbar))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1385 (set-specifier bottom-toolbar-visible-p (list frame t)) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1386 (set-specifier bottom-toolbar-height |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1387 (list frame ediff-toolbar-height))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1388 nil ; emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1389 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1390 ) |
21940 | 1391 ((ediff-has-toolbar-support-p) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1392 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1393 (set-specifier bottom-toolbar-height (list frame 0)) ; xemacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1394 nil ; emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1395 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1396 ) |
18054 | 1397 )) |
1398 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1399 |
11042 | 1400 ;; Merging |
1401 | |
1402 (defun ediff-toggle-show-clashes-only () | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1403 "Toggle the mode that shows only the merge regions where both variants differ from the ancestor." |
11042 | 1404 (interactive) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1405 (ediff-barf-if-not-control-buffer) |
11042 | 1406 (if (not ediff-merge-with-ancestor-job) |
1407 (error "This command makes sense only when merging with an ancestor")) | |
1408 (setq ediff-show-clashes-only (not ediff-show-clashes-only)) | |
1409 (if ediff-show-clashes-only | |
1410 (message "Focus on regions where both buffers differ from the ancestor") | |
1411 (message "Canceling focus on regions where changes clash"))) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1412 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1413 (defun ediff-toggle-skip-changed-regions () |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1414 "Toggle the mode that skips the merge regions that differ from the default." |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1415 (interactive) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1416 (ediff-barf-if-not-control-buffer) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1417 (setq ediff-skip-merge-regions-that-differ-from-default |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1418 (not ediff-skip-merge-regions-that-differ-from-default)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1419 (if ediff-skip-merge-regions-that-differ-from-default |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1420 (message "Skipping regions that differ from default setting") |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1421 (message "Showing regions that differ from default setting"))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1422 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1423 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1424 |
11042 | 1425 ;; Widening/narrowing |
1426 | |
1427 (defun ediff-toggle-narrow-region () | |
1428 "Toggle narrowing in buffers A, B, and C. | |
1429 Used in ediff-windows/regions only." | |
1430 (interactive) | |
1431 (if (eq ediff-buffer-A ediff-buffer-B) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1432 (error ediff-NO-DIFFERENCES)) |
11042 | 1433 (if (eq ediff-visible-bounds ediff-wide-bounds) |
1434 (setq ediff-visible-bounds ediff-narrow-bounds) | |
1435 (setq ediff-visible-bounds ediff-wide-bounds)) | |
1436 (ediff-recenter 'no-rehighlight)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1437 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1438 ;; Narrow bufs A/B/C to ediff-visible-bounds. If this is currently set to |
11042 | 1439 ;; ediff-wide-bounds, then this actually widens. |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1440 ;; This function does nothing if job-name is not |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1441 ;; ediff-regions-wordwise/linewise or ediff-windows-wordwise/linewise. |
11042 | 1442 ;; Does nothing if buffer-A = buffer-B since we can't narrow |
1443 ;; to two different regions in one buffer. | |
1444 (defun ediff-visible-region () | |
1445 (if (or (eq ediff-buffer-A ediff-buffer-B) | |
1446 (eq ediff-buffer-A ediff-buffer-C) | |
1447 (eq ediff-buffer-C ediff-buffer-B)) | |
1448 () | |
1449 ;; If ediff-*-regions/windows, ediff-visible-bounds is already set | |
1450 ;; Otherwise, always use full range. | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1451 (if (not ediff-narrow-job) |
11042 | 1452 (setq ediff-visible-bounds ediff-wide-bounds)) |
1453 (let ((overl-A (ediff-get-value-according-to-buffer-type | |
1454 'A ediff-visible-bounds)) | |
1455 (overl-B (ediff-get-value-according-to-buffer-type | |
1456 'B ediff-visible-bounds)) | |
1457 (overl-C (ediff-get-value-according-to-buffer-type | |
1458 'C ediff-visible-bounds)) | |
1459 ) | |
19047 | 1460 (ediff-with-current-buffer ediff-buffer-A |
20206 | 1461 (if (ediff-overlay-buffer overl-A) |
1462 (narrow-to-region | |
1463 (ediff-overlay-start overl-A) (ediff-overlay-end overl-A)))) | |
19047 | 1464 (ediff-with-current-buffer ediff-buffer-B |
20206 | 1465 (if (ediff-overlay-buffer overl-B) |
1466 (narrow-to-region | |
1467 (ediff-overlay-start overl-B) (ediff-overlay-end overl-B)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1468 |
20206 | 1469 (if (and ediff-3way-job (ediff-overlay-buffer overl-C)) |
19047 | 1470 (ediff-with-current-buffer ediff-buffer-C |
11042 | 1471 (narrow-to-region |
1472 (ediff-overlay-start overl-C) (ediff-overlay-end overl-C)))) | |
1473 ))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1474 |
11042 | 1475 |
1476 ;; Window scrolling operations | |
1477 | |
1478 ;; Performs some operation on the two file windows (if they are showing). | |
1479 ;; Traps all errors on the operation in windows A/B/C. | |
1480 ;; Usually, errors come from scrolling off the | |
1481 ;; beginning or end of the buffer, and this gives error messages. | |
1482 (defun ediff-operate-on-windows (operation arg) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1483 |
11042 | 1484 ;; make sure windows aren't dead |
1485 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) | |
1486 (ediff-recenter 'no-rehighlight)) | |
1487 (if (not (and (ediff-buffer-live-p ediff-buffer-A) | |
1488 (ediff-buffer-live-p ediff-buffer-B) | |
1489 (or (not ediff-3way-job) ediff-buffer-C) | |
1490 )) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1491 (error ediff-KILLED-VITAL-BUFFER)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1492 |
11042 | 1493 (let* ((wind (selected-window)) |
1494 (wind-A ediff-window-A) | |
1495 (wind-B ediff-window-B) | |
1496 (wind-C ediff-window-C) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1497 (coefA (ediff-get-region-size-coefficient 'A operation)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1498 (coefB (ediff-get-region-size-coefficient 'B operation)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1499 (three-way ediff-3way-job) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1500 (coefC (if three-way |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1501 (ediff-get-region-size-coefficient 'C operation)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1502 |
11042 | 1503 (select-window wind-A) |
1504 (condition-case nil | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1505 (funcall operation (round (* coefA arg))) |
11042 | 1506 (error)) |
1507 (select-window wind-B) | |
1508 (condition-case nil | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1509 (funcall operation (round (* coefB arg))) |
11042 | 1510 (error)) |
1511 (if three-way | |
1512 (progn | |
1513 (select-window wind-C) | |
1514 (condition-case nil | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1515 (funcall operation (round (* coefC arg))) |
11042 | 1516 (error)))) |
1517 (select-window wind))) | |
1518 | |
1519 (defun ediff-scroll-vertically (&optional arg) | |
1520 "Vertically scroll buffers A, B \(and C if appropriate\). | |
1521 With optional argument ARG, scroll ARG lines; otherwise scroll by nearly | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1522 the one half of the height of window-A." |
11042 | 1523 (interactive "P") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1524 (ediff-barf-if-not-control-buffer) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1525 |
11042 | 1526 ;; make sure windows aren't dead |
1527 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) | |
1528 (ediff-recenter 'no-rehighlight)) | |
1529 (if (not (and (ediff-buffer-live-p ediff-buffer-A) | |
1530 (ediff-buffer-live-p ediff-buffer-B) | |
1531 (or (not ediff-3way-job) | |
1532 (ediff-buffer-live-p ediff-buffer-C)) | |
1533 )) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1534 (error ediff-KILLED-VITAL-BUFFER)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1535 |
11042 | 1536 (ediff-operate-on-windows |
1537 (if (memq last-command-char '(?v ?\C-v)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1538 'scroll-up |
11042 | 1539 'scroll-down) |
1540 ;; calculate argument to scroll-up/down | |
1541 ;; if there is an explicit argument | |
1542 (if (and arg (not (equal arg '-))) | |
1543 ;; use it | |
1544 (prefix-numeric-value arg) | |
1545 ;; if not, see if we can determine a default amount (the window height) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1546 (let (default-amount) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1547 (setq default-amount |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1548 (- (/ (min (window-height ediff-window-A) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1549 (window-height ediff-window-B) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1550 (if ediff-3way-job |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1551 (window-height ediff-window-C) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1552 500)) ; some large number |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1553 2) |
11042 | 1554 1 next-screen-context-lines)) |
1555 ;; window found | |
1556 (if arg | |
1557 ;; C-u as argument means half of default amount | |
1558 (/ default-amount 2) | |
1559 ;; no argument means default amount | |
1560 default-amount))))) | |
1561 | |
1562 | |
1563 (defun ediff-scroll-horizontally (&optional arg) | |
1564 "Horizontally scroll buffers A, B \(and C if appropriate\). | |
1565 If an argument is given, that is how many columns are scrolled, else nearly | |
1566 the width of the A/B/C windows." | |
1567 (interactive "P") | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1568 (ediff-barf-if-not-control-buffer) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1569 |
11042 | 1570 ;; make sure windows aren't dead |
1571 (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B))) | |
1572 (ediff-recenter 'no-rehighlight)) | |
1573 (if (not (and (ediff-buffer-live-p ediff-buffer-A) | |
1574 (ediff-buffer-live-p ediff-buffer-B) | |
1575 (or (not ediff-3way-job) | |
1576 (ediff-buffer-live-p ediff-buffer-C)) | |
1577 )) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1578 (error ediff-KILLED-VITAL-BUFFER)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1579 |
11042 | 1580 (ediff-operate-on-windows |
36456
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1581 ;; Arrange for scroll-left and scroll-right being called |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1582 ;; interactively so that they set the window's min_hscroll. |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1583 ;; Otherwise, automatic hscrolling will undo the effect of |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1584 ;; hscrolling. |
11042 | 1585 (if (= last-command-char ?<) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1586 (lambda (arg) |
36456
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1587 (let ((prefix-arg arg)) |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1588 (call-interactively 'scroll-left))) |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1589 (lambda (arg) |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1590 (let ((prefix-arg arg)) |
1474cd438ac1
(ediff-scroll-horizontally): Arrange for
Gerd Moellmann <gerd@gnu.org>
parents:
36043
diff
changeset
|
1591 (call-interactively 'scroll-right)))) |
11042 | 1592 ;; calculate argument to scroll-left/right |
1593 ;; if there is an explicit argument | |
1594 (if (and arg (not (equal arg '-))) | |
1595 ;; use it | |
1596 (prefix-numeric-value arg) | |
1597 ;; if not, see if we can determine a default amount | |
1598 ;; (half the window width) | |
1599 (if (null ediff-control-window) | |
1600 ;; no control window, use nil | |
1601 nil | |
1602 (let ((default-amount | |
1603 (- (/ (min (window-width ediff-window-A) | |
1604 (window-width ediff-window-B) | |
1605 (if ediff-3way-comparison-job | |
1606 (window-width ediff-window-C) | |
1607 500) ; some large number | |
1608 ) | |
1609 2) | |
1610 3))) | |
1611 ;; window found | |
1612 (if arg | |
1613 ;; C-u as argument means half of default amount | |
1614 (/ default-amount 2) | |
1615 ;; no argument means default amount | |
1616 default-amount)))))) | |
1617 | |
1618 | |
1619 ;;BEG, END show the region to be positioned. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1620 ;;JOB-NAME holds ediff-job-name. The ediff-windows job positions regions |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1621 ;;differently. |
11042 | 1622 (defun ediff-position-region (beg end pos job-name) |
1623 (if (> end (point-max)) | |
1624 (setq end (point-max))) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1625 (if ediff-windows-job |
11042 | 1626 (if (pos-visible-in-window-p end) |
1627 () ; do nothing, wind is already positioned | |
1628 ;; at this point, windows are positioned at the beginning of the | |
1629 ;; file regions (not diff-regions) being compared. | |
1630 (save-excursion | |
1631 (move-to-window-line (- (window-height) 2)) | |
1632 (let ((amount (+ 2 (count-lines (point) end)))) | |
1633 (scroll-up amount)))) | |
1634 (set-window-start (selected-window) beg) | |
1635 (if (pos-visible-in-window-p end) | |
1636 ;; Determine the number of lines that the region occupies | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1637 (let ((lines 0) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1638 (prev-point 0)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1639 (while ( and (> end (progn |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1640 (move-to-window-line lines) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1641 (point))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1642 ;; `end' may be beyond the window bottom, so check |
14040 | 1643 ;; that we are making progress |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1644 (< prev-point (point))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1645 (setq prev-point (point)) |
11042 | 1646 (setq lines (1+ lines))) |
1647 ;; And position the beginning on the right line | |
1648 (goto-char beg) | |
1649 (recenter (/ (1+ (max (- (1- (window-height (selected-window))) | |
1650 lines) | |
1651 1) | |
1652 ) | |
1653 2)))) | |
1654 (goto-char pos) | |
1655 )) | |
1656 | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1657 ;; get number of lines from window start to region end |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1658 (defun ediff-get-lines-to-region-end (buf-type &optional n ctl-buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1659 (or n (setq n ediff-current-difference)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1660 (or ctl-buf (setq ctl-buf ediff-control-buffer)) |
19047 | 1661 (ediff-with-current-buffer ctl-buf |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1662 (let* ((buf (ediff-get-buffer buf-type)) |
19047 | 1663 (wind (eval (ediff-get-symbol-from-alist |
1664 buf-type ediff-window-alist))) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1665 (beg (window-start wind)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1666 (end (ediff-get-diff-posn buf-type 'end)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1667 lines) |
19047 | 1668 (ediff-with-current-buffer buf |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1669 (if (< beg end) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1670 (setq lines (count-lines beg end)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1671 (setq lines 0)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1672 lines |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1673 )))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1674 |
21940 | 1675 ;; Calculate the number of lines from window end to the start of diff region |
1676 (defun ediff-get-lines-to-region-start (buf-type &optional diff-num ctl-buf) | |
1677 (or diff-num (setq diff-num ediff-current-difference)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1678 (or ctl-buf (setq ctl-buf ediff-control-buffer)) |
19047 | 1679 (ediff-with-current-buffer ctl-buf |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1680 (let* ((buf (ediff-get-buffer buf-type)) |
19047 | 1681 (wind (eval (ediff-get-symbol-from-alist |
1682 buf-type ediff-window-alist))) | |
21940 | 1683 (end (or (window-end wind) (window-end wind t))) |
1684 (beg (ediff-get-diff-posn buf-type 'beg diff-num))) | |
19047 | 1685 (ediff-with-current-buffer buf |
21940 | 1686 (if (< beg end) |
1687 (count-lines (max beg (point-min)) (min end (point-max))) 0)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1688 ))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1689 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1690 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1691 ;; region size coefficient is a coefficient by which to adjust scrolling |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1692 ;; up/down of the window displaying buffer of type BUFTYPE. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1693 ;; The purpose of this coefficient is to make the windows scroll in sync, so |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1694 ;; that it won't happen that one diff region is scrolled off while the other is |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1695 ;; still seen. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1696 ;; |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1697 ;; If the difference region is invalid, the coefficient is 1 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1698 (defun ediff-get-region-size-coefficient (buf-type op &optional n ctl-buf) |
19047 | 1699 (ediff-with-current-buffer (or ctl-buf ediff-control-buffer) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1700 (if (ediff-valid-difference-p n) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1701 (let* ((func (cond ((eq op 'scroll-down) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1702 'ediff-get-lines-to-region-start) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1703 ((eq op 'scroll-up) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1704 'ediff-get-lines-to-region-end) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1705 (t '(lambda (a b c) 0)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1706 (max-lines (max (funcall func 'A n ctl-buf) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1707 (funcall func 'B n ctl-buf) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1708 (if (ediff-buffer-live-p ediff-buffer-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1709 (funcall func 'C n ctl-buf) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1710 0)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1711 ;; this covers the horizontal coefficient as well: |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1712 ;; if max-lines = 0 then coef = 1 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1713 (if (> max-lines 0) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1714 (/ (+ (funcall func buf-type n ctl-buf) 0.0) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1715 (+ max-lines 0.0)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1716 1)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1717 1))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1718 |
11042 | 1719 |
1720 (defun ediff-next-difference (&optional arg) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1721 "Advance to the next difference. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1722 With a prefix argument, go forward that many differences." |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1723 (interactive "p") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1724 (ediff-barf-if-not-control-buffer) |
11042 | 1725 (if (< ediff-current-difference ediff-number-of-differences) |
1726 (let ((n (min ediff-number-of-differences | |
23017
3261e4a5f472
(ediff-next-difference, ediff-previous-difference): Handle nil as arg.
Richard M. Stallman <rms@gnu.org>
parents:
21940
diff
changeset
|
1727 (+ ediff-current-difference (or arg 1)))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1728 non-clash-skip skip-changed regexp-skip) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1729 |
18054 | 1730 (ediff-visible-region) |
11042 | 1731 (or (>= n ediff-number-of-differences) |
1732 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) | |
20003 | 1733 ;; this won't exec if regexp-skip is t |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
1734 (setq non-clash-skip (ediff-merge-region-is-non-clash-to-skip n) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1735 skip-changed |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1736 (ediff-skip-merge-region-if-changed-from-default-p n)) |
11042 | 1737 (ediff-install-fine-diff-if-necessary n)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1738 ;; Skip loop |
11042 | 1739 (while (and (< n ediff-number-of-differences) |
1740 (or | |
1741 ;; regexp skip | |
1742 regexp-skip | |
1743 ;; skip clashes, if necessary | |
20003 | 1744 non-clash-skip |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1745 ;; skip processed regions |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1746 skip-changed |
11042 | 1747 ;; skip difference regions that differ in white space |
1748 (and ediff-ignore-similar-regions | |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
1749 (ediff-merge-region-is-non-clash n) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1750 (or (eq (ediff-no-fine-diffs-p n) t) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1751 (and (ediff-merge-job) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1752 (eq (ediff-no-fine-diffs-p n) 'C))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1753 ))) |
11042 | 1754 (setq n (1+ n)) |
1755 (if (= 0 (mod n 20)) | |
1756 (message "Skipped over region %d and counting ..." n)) | |
1757 (or (>= n ediff-number-of-differences) | |
1758 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) | |
20003 | 1759 ;; this won't exec if regexp-skip is t |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
1760 (setq non-clash-skip (ediff-merge-region-is-non-clash-to-skip n) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1761 skip-changed |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1762 (ediff-skip-merge-region-if-changed-from-default-p n)) |
11042 | 1763 (ediff-install-fine-diff-if-necessary n)) |
1764 ) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1765 (message "") |
11042 | 1766 (ediff-unselect-and-select-difference n) |
1767 ) ; let | |
1768 (ediff-visible-region) | |
1769 (error "At end of the difference list"))) | |
1770 | |
1771 (defun ediff-previous-difference (&optional arg) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1772 "Go to the previous difference. |
11042 | 1773 With a prefix argument, go back that many differences." |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1774 (interactive "p") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1775 (ediff-barf-if-not-control-buffer) |
11042 | 1776 (if (> ediff-current-difference -1) |
23017
3261e4a5f472
(ediff-next-difference, ediff-previous-difference): Handle nil as arg.
Richard M. Stallman <rms@gnu.org>
parents:
21940
diff
changeset
|
1777 (let ((n (max -1 (- ediff-current-difference (or arg 1)))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1778 non-clash-skip skip-changed regexp-skip) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1779 |
18054 | 1780 (ediff-visible-region) |
11042 | 1781 (or (< n 0) |
1782 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) | |
20003 | 1783 ;; this won't exec if regexp-skip is t |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
1784 (setq non-clash-skip (ediff-merge-region-is-non-clash-to-skip n) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1785 skip-changed |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1786 (ediff-skip-merge-region-if-changed-from-default-p n)) |
11042 | 1787 (ediff-install-fine-diff-if-necessary n)) |
1788 (while (and (> n -1) | |
1789 (or | |
1790 ;; regexp skip | |
1791 regexp-skip | |
1792 ;; skip clashes, if necessary | |
20003 | 1793 non-clash-skip |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1794 ;; skipp changed regions |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1795 skip-changed |
11042 | 1796 ;; skip difference regions that differ in white space |
1797 (and ediff-ignore-similar-regions | |
66687
26faad662ac6
2005-11-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65856
diff
changeset
|
1798 (ediff-merge-region-is-non-clash n) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1799 (or (eq (ediff-no-fine-diffs-p n) t) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1800 (and (ediff-merge-job) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1801 (eq (ediff-no-fine-diffs-p n) 'C))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1802 ))) |
11042 | 1803 (if (= 0 (mod (1+ n) 20)) |
1804 (message "Skipped over region %d and counting ..." (1+ n))) | |
1805 (setq n (1- n)) | |
1806 (or (< n 0) | |
1807 (setq regexp-skip (funcall ediff-skip-diff-region-function n)) | |
20003 | 1808 ;; this won't exec if regexp-skip is t |
65856
d64aeb0dc54e
2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
65689
diff
changeset
|
1809 (setq non-clash-skip (ediff-merge-region-is-non-clash-to-skip n) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1810 skip-changed |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1811 (ediff-skip-merge-region-if-changed-from-default-p n)) |
11042 | 1812 (ediff-install-fine-diff-if-necessary n)) |
1813 ) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1814 (message "") |
11042 | 1815 (ediff-unselect-and-select-difference n) |
1816 ) ; let | |
1817 (ediff-visible-region) | |
1818 (error "At beginning of the difference list"))) | |
1819 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1820 ;; The diff number is as perceived by the user (i.e., 1+ the internal |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1821 ;; representation) |
11042 | 1822 (defun ediff-jump-to-difference (difference-number) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1823 "Go to the difference specified as a prefix argument. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1824 If the prefix is negative, count differences from the end." |
11042 | 1825 (interactive "p") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1826 (ediff-barf-if-not-control-buffer) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1827 (setq difference-number |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1828 (cond ((< difference-number 0) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1829 (+ ediff-number-of-differences difference-number)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1830 ((> difference-number 0) (1- difference-number)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1831 (t -1))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1832 ;; -1 is allowed by ediff-unselect-and-select-difference --- it is the |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1833 ;; position before the first one. |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1834 (if (and (>= difference-number -1) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1835 (<= difference-number ediff-number-of-differences)) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
1836 (ediff-unselect-and-select-difference difference-number) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1837 (error ediff-BAD-DIFF-NUMBER |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1838 this-command (1+ difference-number) ediff-number-of-differences))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1839 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1840 (defun ediff-jump-to-difference-at-point (arg) |
11042 | 1841 "Go to difference closest to the point in buffer A, B, or C. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1842 The buffer depends on last command character \(a, b, or c\) that invoked this |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1843 command. For instance, if the command was `ga' then the point value in buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1844 A is used. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1845 With a prefix argument, synchronize all files around the current point position |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1846 in the specified buffer." |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1847 (interactive "P") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1848 (ediff-barf-if-not-control-buffer) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1849 (let* ((buf-type (ediff-char-to-buftype last-command-char)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1850 (buffer (ediff-get-buffer buf-type)) |
19047 | 1851 (pt (ediff-with-current-buffer buffer (point))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1852 (diff-no (ediff-diff-at-point buf-type nil (if arg 'after))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1853 (past-last-diff (< ediff-number-of-differences diff-no)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1854 (beg (if past-last-diff |
19047 | 1855 (ediff-with-current-buffer buffer (point-max)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1856 (ediff-get-diff-posn buf-type 'beg (1- diff-no)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1857 ctl-wind wind-A wind-B wind-C |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1858 shift) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1859 (if past-last-diff |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1860 (ediff-jump-to-difference -1) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1861 (ediff-jump-to-difference diff-no)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1862 (setq ctl-wind (selected-window) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1863 wind-A ediff-window-A |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1864 wind-B ediff-window-B |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1865 wind-C ediff-window-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1866 (if arg |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1867 (progn |
19047 | 1868 (ediff-with-current-buffer buffer |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1869 (setq shift (- beg pt))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1870 (select-window wind-A) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1871 (if past-last-diff (goto-char (point-max))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1872 (condition-case nil |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1873 (backward-char shift) ; noerror, if beginning of buffer |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1874 (error)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1875 (recenter) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1876 (select-window wind-B) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1877 (if past-last-diff (goto-char (point-max))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1878 (condition-case nil |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1879 (backward-char shift) ; noerror, if beginning of buffer |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1880 (error)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1881 (recenter) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1882 (if (window-live-p wind-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1883 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1884 (select-window wind-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1885 (if past-last-diff (goto-char (point-max))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1886 (condition-case nil |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1887 (backward-char shift) ; noerror, if beginning of buffer |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1888 (error)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1889 (recenter) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1890 )) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1891 (select-window ctl-wind) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1892 )) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1893 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1894 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1895 |
11042 | 1896 ;; find region most related to the current point position (or POS, if given) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1897 ;; returns diff number as seen by the user (i.e., 1+ the internal |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1898 ;; representation) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1899 ;; The optional argument WHICH-DIFF can be `after' or `before'. If `after', |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1900 ;; find the diff after the point. If `before', find the diff before the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1901 ;; point. If the point is inside a diff, return that diff. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1902 (defun ediff-diff-at-point (buf-type &optional pos which-diff) |
11042 | 1903 (let ((buffer (ediff-get-buffer buf-type)) |
1904 (ctl-buffer ediff-control-buffer) | |
1905 (max-dif-num (1- ediff-number-of-differences)) | |
1906 (diff-no -1) | |
1907 (prev-beg 0) | |
1908 (prev-end 0) | |
1909 (beg 0) | |
1910 (end 0)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1911 |
19047 | 1912 (ediff-with-current-buffer buffer |
11042 | 1913 (setq pos (or pos (point))) |
1914 (while (and (or (< pos prev-beg) (> pos beg)) | |
1915 (< diff-no max-dif-num)) | |
1916 (setq diff-no (1+ diff-no)) | |
1917 (setq prev-beg beg | |
1918 prev-end end) | |
1919 (setq beg (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer) | |
1920 end (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) | |
1921 ) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
1922 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1923 ;; boost diff-no by 1, if past the last diff region |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1924 (if (and (memq which-diff '(after before)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1925 (> pos beg) (= diff-no max-dif-num)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1926 (setq diff-no (1+ diff-no))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1927 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1928 (cond ((eq which-diff 'after) (1+ diff-no)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1929 ((eq which-diff 'before) diff-no) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1930 ((< (abs (count-lines pos (max 1 prev-end))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1931 (abs (count-lines pos (max 1 beg)))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1932 diff-no) ; choose prev difference |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1933 (t |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1934 (1+ diff-no))) ; choose next difference |
11042 | 1935 ))) |
1936 | |
1937 | |
1938 ;;; Copying diffs. | |
1939 | |
1940 (defun ediff-diff-to-diff (arg &optional keys) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1941 "Copy buffer-X'th difference region to buffer Y \(X,Y are A, B, or C\). |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1942 If numerical prefix argument, copy the difference specified in the arg. |
11042 | 1943 Otherwise, copy the difference given by `ediff-current-difference'. |
1944 This command assumes it is bound to a 2-character key sequence, `ab', `ba', | |
1945 `ac', etc., which is used to determine the types of buffers to be used for | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1946 copying difference regions. The first character in the sequence specifies |
11042 | 1947 the source buffer and the second specifies the target. |
1948 | |
1949 If the second optional argument, a 2-character string, is given, use it to | |
1950 determine the source and the target buffers instead of the command keys." | |
1951 (interactive "P") | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1952 (ediff-barf-if-not-control-buffer) |
11042 | 1953 (or keys (setq keys (this-command-keys))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1954 (if (eq arg '-) (setq arg -1)) ; translate neg arg to -1 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1955 (if (numberp arg) (ediff-jump-to-difference arg)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1956 |
11042 | 1957 (let* ((key1 (aref keys 0)) |
1958 (key2 (aref keys 1)) | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1959 (char1 (ediff-event-key key1)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
1960 (char2 (ediff-event-key key2)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1961 ediff-verbose-p) |
11042 | 1962 (ediff-copy-diff ediff-current-difference |
1963 (ediff-char-to-buftype char1) | |
1964 (ediff-char-to-buftype char2)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1965 ;; recenter with rehighlighting, but no messages |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
1966 (ediff-recenter))) |
11042 | 1967 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1968 (defun ediff-copy-A-to-B (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1969 "Copy ARGth difference region from buffer A to B. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1970 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1971 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1972 (ediff-diff-to-diff arg "ab")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1973 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1974 (defun ediff-copy-B-to-A (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1975 "Copy ARGth difference region from buffer B to A. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1976 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1977 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1978 (ediff-diff-to-diff arg "ba")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1979 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1980 (defun ediff-copy-A-to-C (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1981 "Copy ARGth difference region from buffer A to buffer C. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1982 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1983 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1984 (ediff-diff-to-diff arg "ac")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1985 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1986 (defun ediff-copy-B-to-C (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1987 "Copy ARGth difference region from buffer B to buffer C. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1988 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1989 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1990 (ediff-diff-to-diff arg "bc")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1991 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1992 (defun ediff-copy-C-to-B (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1993 "Copy ARGth difference region from buffer C to B. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
1994 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1995 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1996 (ediff-diff-to-diff arg "cb")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1997 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1998 (defun ediff-copy-C-to-A (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1999 "Copy ARGth difference region from buffer C to A. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2000 ARG is a prefix argument. If nil, copy the current difference region." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2001 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2002 (ediff-diff-to-diff arg "ca")) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2003 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2004 |
11042 | 2005 |
2006 ;; Copy diff N from FROM-BUF-TYPE \(given as A, B or C\) to TO-BUF-TYPE. | |
2007 ;; If optional DO-NOT-SAVE is non-nil, do not save the old value of the | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2008 ;; target diff. This is used in merging, when constructing the merged |
11042 | 2009 ;; version. |
2010 (defun ediff-copy-diff (n from-buf-type to-buf-type | |
2011 &optional batch-invocation reg-to-copy) | |
2012 (let* ((to-buf (ediff-get-buffer to-buf-type)) | |
2013 ;;(from-buf (if (not reg-to-copy) (ediff-get-buffer from-buf-type))) | |
2014 (ctrl-buf ediff-control-buffer) | |
2015 (saved-p t) | |
2016 (three-way ediff-3way-job) | |
2017 messg | |
2018 ediff-verbose-p | |
2019 reg-to-delete reg-to-delete-beg reg-to-delete-end) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2020 |
11042 | 2021 (setq reg-to-delete-beg |
2022 (ediff-get-diff-posn to-buf-type 'beg n ctrl-buf)) | |
2023 (setq reg-to-delete-end | |
2024 (ediff-get-diff-posn to-buf-type 'end n ctrl-buf)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2025 |
11042 | 2026 (if reg-to-copy |
2027 (setq from-buf-type nil) | |
2028 (setq reg-to-copy (ediff-get-region-contents n from-buf-type ctrl-buf))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2029 |
11042 | 2030 (setq reg-to-delete (ediff-get-region-contents |
2031 n to-buf-type ctrl-buf | |
2032 reg-to-delete-beg reg-to-delete-end)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2033 |
11042 | 2034 (if (string= reg-to-delete reg-to-copy) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2035 (setq saved-p nil) ; don't copy identical buffers |
11042 | 2036 ;; seems ok to copy |
2037 (if (or batch-invocation (ediff-test-save-region n to-buf-type)) | |
2038 (condition-case conds | |
2039 (progn | |
19047 | 2040 (ediff-with-current-buffer to-buf |
11042 | 2041 ;; to prevent flags from interfering if buffer is writable |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2042 (let ((inhibit-read-only (null buffer-read-only))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2043 |
11042 | 2044 (goto-char reg-to-delete-end) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2045 (insert reg-to-copy) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2046 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2047 (if (> reg-to-delete-end reg-to-delete-beg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2048 (kill-region reg-to-delete-beg reg-to-delete-end)) |
11042 | 2049 )) |
2050 (or batch-invocation | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2051 (setq |
11042 | 2052 messg |
2053 (ediff-save-diff-region n to-buf-type reg-to-delete)))) | |
2054 (error (message "ediff-copy-diff: %s %s" | |
2055 (car conds) | |
2056 (mapconcat 'prin1-to-string (cdr conds) " ")) | |
2057 (beep 1) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2058 (sit-for 2) ; let the user see the error msg |
11042 | 2059 (setq saved-p nil) |
2060 ))) | |
2061 ) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2062 |
11042 | 2063 ;; adjust state of difference in case 3-way and diff was copied ok |
2064 (if (and saved-p three-way) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2065 (ediff-set-state-of-diff-in-all-buffers n ctrl-buf)) |
11042 | 2066 |
2067 (if batch-invocation | |
2068 (ediff-clear-fine-differences n) | |
2069 ;; If diff3 job, we should recompute fine diffs so we clear them | |
2070 ;; before reinserting flags (and thus before ediff-recenter). | |
2071 (if (and saved-p three-way) | |
2072 (ediff-clear-fine-differences n)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2073 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2074 (ediff-refresh-mode-lines) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2075 |
11042 | 2076 ;; For diff2 jobs, don't recompute fine diffs, since we know there |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2077 ;; aren't any. So we clear diffs after ediff-recenter. |
11042 | 2078 (if (and saved-p (not three-way)) |
2079 (ediff-clear-fine-differences n)) | |
2080 ;; Make sure that the message about saving and how to restore is seen | |
2081 ;; by the user | |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
2082 (message "%s" messg)) |
11042 | 2083 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2084 |
11042 | 2085 ;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\). |
2086 ;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'. REG | |
2087 ;; is the region to save. It is redundant here, but is passed anyway, for | |
2088 ;; convenience. | |
2089 (defun ediff-save-diff-region (n buf-type reg) | |
2090 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) | |
2091 (buf (ediff-get-buffer buf-type)) | |
2092 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2093 |
11042 | 2094 (if this-buf-n-th-diff-saved |
2095 ;; either nothing saved for n-th diff and buffer or we OK'ed | |
2096 ;; overriding | |
2097 (setcdr this-buf-n-th-diff-saved reg) | |
2098 (if n-th-diff-saved ;; n-th diff saved, but for another buffer | |
2099 (nconc n-th-diff-saved (list (cons buf reg))) | |
2100 (setq ediff-killed-diffs-alist ;; create record for n-th diff | |
2101 (cons (list n (cons buf reg)) | |
2102 ediff-killed-diffs-alist)))) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2103 (message "Saving old diff region #%d of buffer %S. To recover, type `r%s'" |
11042 | 2104 (1+ n) buf-type |
2105 (if ediff-merge-job | |
2106 "" (downcase (symbol-name buf-type)))) | |
2107 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2108 |
11042 | 2109 ;; Test if saving Nth difference region of buffer BUF-TYPE is possible. |
2110 (defun ediff-test-save-region (n buf-type) | |
2111 (let* ((n-th-diff-saved (assoc n ediff-killed-diffs-alist)) | |
2112 (buf (ediff-get-buffer buf-type)) | |
2113 (this-buf-n-th-diff-saved (assoc buf (cdr n-th-diff-saved)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2114 |
11042 | 2115 (if this-buf-n-th-diff-saved |
2116 (if (yes-or-no-p | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2117 (format |
65689
96187e7edd1b
2005-09-25 Romain Francoise <romain@orebokech.com>
Romain Francoise <romain@orebokech.com>
parents:
65680
diff
changeset
|
2118 "You've previously copied diff region %d to buffer %S. Confirm? " |
11042 | 2119 (1+ n) buf-type)) |
2120 t | |
2121 (error "Quit")) | |
2122 t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2123 |
11042 | 2124 (defun ediff-pop-diff (n buf-type) |
2125 "Pop last killed Nth diff region from buffer BUF-TYPE." | |
2126 (let* ((n-th-record (assoc n ediff-killed-diffs-alist)) | |
2127 (buf (ediff-get-buffer buf-type)) | |
2128 (saved-rec (assoc buf (cdr n-th-record))) | |
2129 (three-way ediff-3way-job) | |
2130 (ctl-buf ediff-control-buffer) | |
2131 ediff-verbose-p | |
2132 saved-diff reg-beg reg-end recovered) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2133 |
11042 | 2134 (if (cdr saved-rec) |
2135 (setq saved-diff (cdr saved-rec)) | |
2136 (if (> ediff-number-of-differences 0) | |
2137 (error "Nothing saved for diff %d in buffer %S" (1+ n) buf-type) | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2138 (error ediff-NO-DIFFERENCES))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2139 |
11042 | 2140 (setq reg-beg (ediff-get-diff-posn buf-type 'beg n ediff-control-buffer)) |
2141 (setq reg-end (ediff-get-diff-posn buf-type 'end n ediff-control-buffer)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2142 |
11042 | 2143 (condition-case conds |
19047 | 2144 (ediff-with-current-buffer buf |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2145 (let ((inhibit-read-only (null buffer-read-only))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2146 |
11042 | 2147 (goto-char reg-end) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2148 (insert saved-diff) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2149 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2150 (if (> reg-end reg-beg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2151 (kill-region reg-beg reg-end)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2152 |
11042 | 2153 (setq recovered t) |
2154 )) | |
2155 (error (message "ediff-pop-diff: %s %s" | |
2156 (car conds) | |
2157 (mapconcat 'prin1-to-string (cdr conds) " ")) | |
2158 (beep 1))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2159 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2160 ;; Clearing fine diffs is necessary for |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2161 ;; ediff-unselect-and-select-difference to properly recompute them. We |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2162 ;; can't rely on ediff-copy-diff to clear this vector, as the user might |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2163 ;; have modified diff regions after copying and, thus, may have recomputed |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2164 ;; fine diffs. |
11042 | 2165 (if recovered |
2166 (ediff-clear-fine-differences n)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2167 |
11042 | 2168 ;; adjust state of difference |
2169 (if (and three-way recovered) | |
2170 (ediff-set-state-of-diff-in-all-buffers n ctl-buf)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2171 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2172 (ediff-refresh-mode-lines) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2173 |
11042 | 2174 (if recovered |
2175 (progn | |
2176 (setq n-th-record (delq saved-rec n-th-record)) | |
2177 (message "Diff region %d in buffer %S restored" (1+ n) buf-type) | |
2178 )) | |
2179 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2180 |
11042 | 2181 (defun ediff-restore-diff (arg &optional key) |
2182 "Restore ARGth diff from `ediff-killed-diffs-alist'. | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2183 ARG is a prefix argument. If ARG is nil, restore the current-difference. |
11042 | 2184 If the second optional argument, a character, is given, use it to |
2185 determine the target buffer instead of last-command-char" | |
2186 (interactive "P") | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2187 (ediff-barf-if-not-control-buffer) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2188 (if (numberp arg) |
11042 | 2189 (ediff-jump-to-difference arg)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2190 (ediff-pop-diff ediff-current-difference |
11042 | 2191 (ediff-char-to-buftype (or key last-command-char))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2192 ;; recenter with rehighlighting, but no messages |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2193 (let (ediff-verbose-p) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2194 (ediff-recenter))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2195 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2196 (defun ediff-restore-diff-in-merge-buffer (arg) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2197 "Restore ARGth diff in the merge buffer. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2198 ARG is a prefix argument. If nil, restore the current diff." |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2199 (interactive "P") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2200 (ediff-restore-diff arg ?c)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2201 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2202 |
11042 | 2203 (defun ediff-toggle-regexp-match () |
2204 "Toggle between focusing and hiding of difference regions that match | |
2205 a regular expression typed in by the user." | |
2206 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2207 (ediff-barf-if-not-control-buffer) |
11042 | 2208 (let ((regexp-A "") |
2209 (regexp-B "") | |
2210 (regexp-C "") | |
2211 msg-connective alt-msg-connective alt-connective) | |
2212 (cond | |
2213 ((or (and (eq ediff-skip-diff-region-function | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2214 ediff-focus-on-regexp-matches-function) |
11042 | 2215 (eq last-command-char ?f)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2216 (and (eq ediff-skip-diff-region-function |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2217 ediff-hide-regexp-matches-function) |
11042 | 2218 (eq last-command-char ?h))) |
2219 (message "Selective browsing by regexp turned off") | |
2220 (setq ediff-skip-diff-region-function 'ediff-show-all-diffs)) | |
2221 ((eq last-command-char ?h) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2222 (setq ediff-skip-diff-region-function ediff-hide-regexp-matches-function |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2223 regexp-A |
11042 | 2224 (read-string |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2225 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2226 "Ignore A-regions matching this regexp (default %s): " |
11042 | 2227 ediff-regexp-hide-A)) |
2228 regexp-B | |
2229 (read-string | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2230 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2231 "Ignore B-regions matching this regexp (default %s): " |
11042 | 2232 ediff-regexp-hide-B))) |
2233 (if ediff-3way-comparison-job | |
2234 (setq regexp-C | |
2235 (read-string | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2236 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2237 "Ignore C-regions matching this regexp (default %s): " |
11042 | 2238 ediff-regexp-hide-C)))) |
2239 (if (eq ediff-hide-regexp-connective 'and) | |
2240 (setq msg-connective "BOTH" | |
2241 alt-msg-connective "ONE OF" | |
2242 alt-connective 'or) | |
2243 (setq msg-connective "ONE OF" | |
2244 alt-msg-connective "BOTH" | |
2245 alt-connective 'and)) | |
2246 (if (y-or-n-p | |
2247 (format | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2248 "Ignore regions that match %s regexps, OK? " |
53865
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
2249 msg-connective)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2250 (message "Will ignore regions that match %s regexps" msg-connective) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2251 (setq ediff-hide-regexp-connective alt-connective) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2252 (message "Will ignore regions that match %s regexps" |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2253 alt-msg-connective)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2254 |
11042 | 2255 (or (string= regexp-A "") (setq ediff-regexp-hide-A regexp-A)) |
2256 (or (string= regexp-B "") (setq ediff-regexp-hide-B regexp-B)) | |
2257 (or (string= regexp-C "") (setq ediff-regexp-hide-C regexp-C))) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2258 |
11042 | 2259 ((eq last-command-char ?f) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2260 (setq ediff-skip-diff-region-function |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2261 ediff-focus-on-regexp-matches-function |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2262 regexp-A |
11042 | 2263 (read-string |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2264 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2265 "Focus on A-regions matching this regexp (default %s): " |
11042 | 2266 ediff-regexp-focus-A)) |
2267 regexp-B | |
2268 (read-string | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2269 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2270 "Focus on B-regions matching this regexp (default %s): " |
11042 | 2271 ediff-regexp-focus-B))) |
2272 (if ediff-3way-comparison-job | |
2273 (setq regexp-C | |
2274 (read-string | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2275 (format |
65680
ed770a0a7846
2005-09-24 Emilio C. Lopes <eclig@gmx.net>
Romain Francoise <romain@orebokech.com>
parents:
65627
diff
changeset
|
2276 "Focus on C-regions matching this regexp (default %s): " |
11042 | 2277 ediff-regexp-focus-C)))) |
2278 (if (eq ediff-focus-regexp-connective 'and) | |
2279 (setq msg-connective "BOTH" | |
2280 alt-msg-connective "ONE OF" | |
2281 alt-connective 'or) | |
2282 (setq msg-connective "ONE OF" | |
2283 alt-msg-connective "BOTH" | |
2284 alt-connective 'and)) | |
2285 (if (y-or-n-p | |
2286 (format | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2287 "Focus on regions that match %s regexps, OK? " |
53865
6a6dc234f296
(ediff-toggle-read-only): Remove extra format
Andreas Schwab <schwab@suse.de>
parents:
52828
diff
changeset
|
2288 msg-connective)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2289 (message "Will focus on regions that match %s regexps" |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2290 msg-connective) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2291 (setq ediff-focus-regexp-connective alt-connective) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2292 (message "Will focus on regions that match %s regexps" |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2293 alt-msg-connective)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2294 |
11042 | 2295 (or (string= regexp-A "") (setq ediff-regexp-focus-A regexp-A)) |
2296 (or (string= regexp-B "") (setq ediff-regexp-focus-B regexp-B)) | |
2297 (or (string= regexp-C "") (setq ediff-regexp-focus-C regexp-C)))))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2298 |
11042 | 2299 (defun ediff-toggle-skip-similar () |
2300 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2301 (ediff-barf-if-not-control-buffer) |
11042 | 2302 (if (not (eq ediff-auto-refine 'on)) |
2303 (error | |
2304 "Can't skip over whitespace regions: first turn auto-refining on")) | |
2305 (setq ediff-ignore-similar-regions (not ediff-ignore-similar-regions)) | |
2306 (if ediff-ignore-similar-regions | |
2307 (message | |
2308 "Skipping regions that differ only in white space & line breaks") | |
2309 (message "Skipping over white-space differences turned off"))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2310 |
11042 | 2311 (defun ediff-focus-on-regexp-matches (n) |
2312 "Focus on diffs that match regexp `ediff-regexp-focus-A/B'. | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2313 Regions to be ignored according to this function are those where |
11042 | 2314 buf A region doesn't match `ediff-regexp-focus-A' and buf B region |
2315 doesn't match `ediff-regexp-focus-B'. | |
2316 This function returns nil if the region number N (specified as | |
2317 an argument) is not to be ignored and t if region N is to be ignored. | |
2318 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2319 N is a region number used by Ediff internally. It is 1 less |
11042 | 2320 the number seen by the user." |
2321 (if (ediff-valid-difference-p n) | |
2322 (let* ((ctl-buf ediff-control-buffer) | |
2323 (regex-A ediff-regexp-focus-A) | |
2324 (regex-B ediff-regexp-focus-B) | |
2325 (regex-C ediff-regexp-focus-C) | |
19047 | 2326 (reg-A-match (ediff-with-current-buffer ediff-buffer-A |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2327 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2328 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2329 (ediff-get-diff-posn 'A 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2330 (ediff-get-diff-posn 'A 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2331 (goto-char (point-min)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2332 (re-search-forward regex-A nil t)))) |
19047 | 2333 (reg-B-match (ediff-with-current-buffer ediff-buffer-B |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2334 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2335 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2336 (ediff-get-diff-posn 'B 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2337 (ediff-get-diff-posn 'B 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2338 (re-search-forward regex-B nil t)))) |
11042 | 2339 (reg-C-match (if ediff-3way-comparison-job |
19047 | 2340 (ediff-with-current-buffer ediff-buffer-C |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2341 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2342 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2343 (ediff-get-diff-posn 'C 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2344 (ediff-get-diff-posn 'C 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2345 (re-search-forward regex-C nil t)))))) |
11042 | 2346 (not (eval (if ediff-3way-comparison-job |
2347 (list ediff-focus-regexp-connective | |
2348 reg-A-match reg-B-match reg-C-match) | |
2349 (list ediff-focus-regexp-connective | |
2350 reg-A-match reg-B-match)))) | |
2351 ))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2352 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2353 (defun ediff-hide-regexp-matches (n) |
11042 | 2354 "Hide diffs that match regexp `ediff-regexp-hide-A/B/C'. |
2355 Regions to be ignored are those where buf A region matches | |
2356 `ediff-regexp-hide-A' and buf B region matches `ediff-regexp-hide-B'. | |
2357 This function returns nil if the region number N (specified as | |
2358 an argument) is not to be ignored and t if region N is to be ignored. | |
2359 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2360 N is a region number used by Ediff internally. It is 1 less |
11042 | 2361 the number seen by the user." |
2362 (if (ediff-valid-difference-p n) | |
2363 (let* ((ctl-buf ediff-control-buffer) | |
2364 (regex-A ediff-regexp-hide-A) | |
2365 (regex-B ediff-regexp-hide-B) | |
2366 (regex-C ediff-regexp-hide-C) | |
19047 | 2367 (reg-A-match (ediff-with-current-buffer ediff-buffer-A |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2368 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2369 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2370 (ediff-get-diff-posn 'A 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2371 (ediff-get-diff-posn 'A 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2372 (goto-char (point-min)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2373 (re-search-forward regex-A nil t)))) |
19047 | 2374 (reg-B-match (ediff-with-current-buffer ediff-buffer-B |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2375 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2376 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2377 (ediff-get-diff-posn 'B 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2378 (ediff-get-diff-posn 'B 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2379 (goto-char (point-min)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2380 (re-search-forward regex-B nil t)))) |
11042 | 2381 (reg-C-match (if ediff-3way-comparison-job |
19047 | 2382 (ediff-with-current-buffer ediff-buffer-C |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2383 (save-restriction |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2384 (narrow-to-region |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2385 (ediff-get-diff-posn 'C 'beg n ctl-buf) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2386 (ediff-get-diff-posn 'C 'end n ctl-buf)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2387 (goto-char (point-min)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2388 (re-search-forward regex-C nil t)))))) |
11042 | 2389 (eval (if ediff-3way-comparison-job |
2390 (list ediff-hide-regexp-connective | |
2391 reg-A-match reg-B-match reg-C-match) | |
2392 (list ediff-hide-regexp-connective reg-A-match reg-B-match))) | |
2393 ))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2394 |
11042 | 2395 |
2396 | |
2397 ;;; Quitting, suspending, etc. | |
2398 | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2399 (defun ediff-quit (reverse-default-keep-variants) |
11042 | 2400 "Finish an Ediff session and exit Ediff. |
2401 Unselects the selected difference, if any, restores the read-only and modified | |
2402 flags of the compared file buffers, kills Ediff buffers for this session | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2403 \(but not buffers A, B, C\). |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2404 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2405 If `ediff-keep-variants' is nil, the user will be asked whether the buffers |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2406 containing the variants should be removed \(if they haven't been modified\). |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2407 If it is t, they will be preserved unconditionally. A prefix argument, |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2408 temporarily reverses the meaning of this variable." |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2409 (interactive "P") |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2410 (ediff-barf-if-not-control-buffer) |
18054 | 2411 (let ((ctl-buf (current-buffer))) |
2412 (if (y-or-n-p (format "Quit this Ediff session%s? " | |
2413 (if (ediff-buffer-live-p ediff-meta-buffer) | |
2414 " & show containing session group" ""))) | |
2415 (progn | |
2416 (message "") | |
2417 (set-buffer ctl-buf) | |
2418 (ediff-really-quit reverse-default-keep-variants)) | |
2419 (message "")))) | |
11042 | 2420 |
2421 | |
2422 ;; Perform the quit operations. | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2423 (defun ediff-really-quit (reverse-default-keep-variants) |
11042 | 2424 (ediff-unhighlight-diffs-totally) |
2425 (ediff-clear-diff-vector 'ediff-difference-vector-A 'fine-diffs-also) | |
2426 (ediff-clear-diff-vector 'ediff-difference-vector-B 'fine-diffs-also) | |
2427 (ediff-clear-diff-vector 'ediff-difference-vector-C 'fine-diffs-also) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2428 (ediff-clear-diff-vector 'ediff-difference-vector-Ancestor 'fine-diffs-also) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2429 |
11042 | 2430 (ediff-delete-temp-files) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2431 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2432 ;; Restore the visibility range. This affects only ediff-*-regions/windows. |
11042 | 2433 ;; Since for other job names ediff-visible-region sets |
2434 ;; ediff-visible-bounds to ediff-wide-bounds, the settings below are | |
2435 ;; ignored for such jobs. | |
2436 (if ediff-quit-widened | |
2437 (setq ediff-visible-bounds ediff-wide-bounds) | |
2438 (setq ediff-visible-bounds ediff-narrow-bounds)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2439 |
11042 | 2440 ;; Apply selective display to narrow or widen |
2441 (ediff-visible-region) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2442 (mapcar (lambda (overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2443 (if (ediff-overlayp overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2444 (ediff-delete-overlay overl))) |
11042 | 2445 ediff-wide-bounds) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2446 (mapcar (lambda (overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2447 (if (ediff-overlayp overl) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2448 (ediff-delete-overlay overl))) |
11042 | 2449 ediff-narrow-bounds) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2450 |
11042 | 2451 ;; restore buffer mode line id's in buffer-A/B/C |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2452 (let ((control-buffer ediff-control-buffer) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2453 (meta-buffer ediff-meta-buffer) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2454 (after-quit-hook-internal ediff-after-quit-hook-internal) |
20206 | 2455 (session-number ediff-meta-session-number) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2456 ;; suitable working frame |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2457 (warp-frame (if (and (ediff-window-display-p) (eq ediff-grab-mouse t)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2458 (cond ((window-live-p ediff-window-A) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2459 (window-frame ediff-window-A)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2460 ((window-live-p ediff-window-B) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2461 (window-frame ediff-window-B)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2462 (t (next-frame)))))) |
11042 | 2463 (condition-case nil |
19047 | 2464 (ediff-with-current-buffer ediff-buffer-A |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2465 (setq ediff-this-buffer-ediff-sessions |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2466 (delq control-buffer ediff-this-buffer-ediff-sessions)) |
11042 | 2467 (kill-local-variable 'mode-line-buffer-identification) |
2468 (kill-local-variable 'mode-line-format) | |
2469 ) | |
2470 (error)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2471 |
11042 | 2472 (condition-case nil |
19047 | 2473 (ediff-with-current-buffer ediff-buffer-B |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2474 (setq ediff-this-buffer-ediff-sessions |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2475 (delq control-buffer ediff-this-buffer-ediff-sessions)) |
11042 | 2476 (kill-local-variable 'mode-line-buffer-identification) |
2477 (kill-local-variable 'mode-line-format) | |
2478 ) | |
2479 (error)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2480 |
11042 | 2481 (condition-case nil |
19047 | 2482 (ediff-with-current-buffer ediff-buffer-C |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2483 (setq ediff-this-buffer-ediff-sessions |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2484 (delq control-buffer ediff-this-buffer-ediff-sessions)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2485 (kill-local-variable 'mode-line-buffer-identification) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2486 (kill-local-variable 'mode-line-format) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2487 ) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2488 (error)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2489 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2490 (condition-case nil |
19047 | 2491 (ediff-with-current-buffer ediff-ancestor-buffer |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2492 (setq ediff-this-buffer-ediff-sessions |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2493 (delq control-buffer ediff-this-buffer-ediff-sessions)) |
11042 | 2494 (kill-local-variable 'mode-line-buffer-identification) |
2495 (kill-local-variable 'mode-line-format) | |
2496 ) | |
2497 (error)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2498 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2499 (setq ediff-session-registry |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2500 (delq ediff-control-buffer ediff-session-registry)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2501 (ediff-update-registry) |
11042 | 2502 ;; restore state of buffers to what it was before ediff |
2503 (ediff-restore-protected-variables) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2504 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2505 ;; If the user interrupts (canceling saving the merge buffer), continue |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2506 ;; normally. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2507 (condition-case nil |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2508 (if (ediff-merge-job) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2509 (run-hooks 'ediff-quit-merge-hook)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2510 (quit)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2511 |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2512 (run-hooks 'ediff-cleanup-hook) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2513 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2514 (ediff-janitor |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2515 'ask |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2516 ;; reverse-default-keep-variants is t if the user quits with a prefix arg |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2517 (if reverse-default-keep-variants |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2518 (not ediff-keep-variants) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2519 ediff-keep-variants)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2520 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2521 ;; one hook here is ediff-cleanup-mess, which kills the control buffer and |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2522 ;; other auxiliary buffers. we made it into a hook to let the users do their |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2523 ;; own cleanup, if needed. |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2524 (run-hooks 'ediff-quit-hook) |
20206 | 2525 (ediff-update-meta-buffer meta-buffer nil session-number) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2526 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2527 ;; warp mouse into a working window |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2528 (setq warp-frame ; if mouse is over a reasonable frame, use it |
19870 | 2529 (cond ((ediff-good-frame-under-mouse)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2530 (t warp-frame))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2531 (if (and (ediff-window-display-p) (frame-live-p warp-frame) ediff-grab-mouse) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2532 (set-mouse-position (if ediff-emacs-p |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2533 warp-frame |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2534 (frame-selected-window warp-frame)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2535 2 1)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2536 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2537 (run-hooks 'after-quit-hook-internal) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2538 )) |
19870 | 2539 |
2540 ;; Returns frame under mouse, if this frame is not a minibuffer | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2541 ;; frame. Otherwise: nil |
19870 | 2542 (defun ediff-good-frame-under-mouse () |
2543 (let ((frame-or-win (car (mouse-position))) | |
2544 (buf-name "") | |
2545 frame obj-ok) | |
2546 (setq obj-ok | |
2547 (if ediff-emacs-p | |
2548 (frame-live-p frame-or-win) | |
2549 (window-live-p frame-or-win))) | |
2550 (if obj-ok | |
2551 (setq frame (if ediff-emacs-p frame-or-win (window-frame frame-or-win)) | |
2552 buf-name | |
2553 (buffer-name (window-buffer (frame-selected-window frame))))) | |
2554 (if (string-match "Minibuf" buf-name) | |
2555 nil | |
2556 frame))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2557 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2558 |
11042 | 2559 (defun ediff-delete-temp-files () |
20206 | 2560 (if (and (stringp ediff-temp-file-A) (file-exists-p ediff-temp-file-A)) |
11042 | 2561 (delete-file ediff-temp-file-A)) |
20206 | 2562 (if (and (stringp ediff-temp-file-B) (file-exists-p ediff-temp-file-B)) |
11042 | 2563 (delete-file ediff-temp-file-B)) |
20206 | 2564 (if (and (stringp ediff-temp-file-C) (file-exists-p ediff-temp-file-C)) |
11042 | 2565 (delete-file ediff-temp-file-C))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2566 |
11042 | 2567 |
2568 ;; Kill control buffer, other auxiliary Ediff buffers. | |
2569 ;; Leave one of the frames split between buffers A/B/C | |
2570 (defun ediff-cleanup-mess () | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2571 (let* ((buff-A ediff-buffer-A) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2572 (buff-B ediff-buffer-B) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2573 (buff-C ediff-buffer-C) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2574 (ctl-buf ediff-control-buffer) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2575 (ctl-wind (ediff-get-visible-buffer-window ctl-buf)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2576 (ctl-frame ediff-control-frame) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2577 (three-way-job ediff-3way-job) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2578 (main-frame (cond ((window-live-p ediff-window-A) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2579 (window-frame ediff-window-A)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2580 ((window-live-p ediff-window-B) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2581 (window-frame ediff-window-B))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2582 |
11042 | 2583 (ediff-kill-buffer-carefully ediff-diff-buffer) |
2584 (ediff-kill-buffer-carefully ediff-custom-diff-buffer) | |
2585 (ediff-kill-buffer-carefully ediff-fine-diff-buffer) | |
2586 (ediff-kill-buffer-carefully ediff-tmp-buffer) | |
2587 (ediff-kill-buffer-carefully ediff-error-buffer) | |
2588 (ediff-kill-buffer-carefully ediff-msg-buffer) | |
2589 (ediff-kill-buffer-carefully ediff-debug-buffer) | |
18054 | 2590 (if (boundp 'ediff-patch-diagnostics) |
2591 (ediff-kill-buffer-carefully ediff-patch-diagnostics)) | |
11042 | 2592 |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2593 ;; delete control frame or window |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2594 (cond ((and (ediff-window-display-p) (frame-live-p ctl-frame)) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2595 (delete-frame ctl-frame)) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2596 ((window-live-p ctl-wind) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2597 (delete-window ctl-wind))) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2598 |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2599 ;; Hide bottom toolbar. --marcpa |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2600 (if (not (ediff-multiframe-setup-p)) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2601 (ediff-kill-bottom-toolbar)) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2602 |
11042 | 2603 (ediff-kill-buffer-carefully ctl-buf) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2604 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2605 (if (frame-live-p main-frame) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2606 (select-frame main-frame)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2607 |
11042 | 2608 ;; display only if not visible |
2609 (condition-case nil | |
2610 (or (ediff-get-visible-buffer-window buff-B) | |
2611 (switch-to-buffer buff-B)) | |
2612 (error)) | |
2613 (condition-case nil | |
2614 (or (ediff-get-visible-buffer-window buff-A) | |
2615 (progn | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2616 (if (and (ediff-get-visible-buffer-window buff-B) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2617 (ediff-buffer-live-p buff-A)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2618 (funcall ediff-split-window-function)) |
11042 | 2619 (switch-to-buffer buff-A))) |
2620 (error)) | |
2621 (if three-way-job | |
2622 (condition-case nil | |
2623 (or (ediff-get-visible-buffer-window buff-C) | |
2624 (progn | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2625 (if (and (or (ediff-get-visible-buffer-window buff-A) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2626 (ediff-get-visible-buffer-window buff-B)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2627 (ediff-buffer-live-p buff-C)) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2628 (funcall ediff-split-window-function)) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2629 (switch-to-buffer buff-C))) |
11042 | 2630 (error))) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
2631 (balance-windows) |
11042 | 2632 (message "") |
2633 )) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2634 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2635 (defun ediff-janitor (ask keep-variants) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2636 "Kill buffers A, B, and, possibly, C, if these buffers aren't modified. |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2637 In merge jobs, buffer C is not deleted here, but rather according to |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2638 ediff-quit-merge-hook. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2639 A side effect of cleaning up may be that you should be careful when comparing |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2640 the same buffer in two separate Ediff sessions: quitting one of them might |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2641 delete this buffer in another session as well." |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2642 (ediff-dispose-of-variant-according-to-user |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2643 ediff-buffer-A 'A ask keep-variants) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2644 (ediff-dispose-of-variant-according-to-user |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2645 ediff-buffer-B 'B ask keep-variants) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2646 (if ediff-merge-job ; don't del buf C if merging--del ancestor buf instead |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2647 (ediff-dispose-of-variant-according-to-user |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2648 ediff-ancestor-buffer 'Ancestor ask keep-variants) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2649 (ediff-dispose-of-variant-according-to-user |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2650 ediff-buffer-C 'C ask keep-variants) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2651 )) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2652 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2653 ;; Kill the variant buffer, according to user directives (ask, kill |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2654 ;; unconditionaly, keep) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2655 ;; BUFF is the buffer, BUFF-TYPE is either 'A, or 'B, 'C, 'Ancestor |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2656 (defun ediff-dispose-of-variant-according-to-user (buff bufftype ask keep-variants) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2657 ;; if this is indirect buffer, kill it and substitute with direct buf |
43220
69c91aaa067a
2002-02-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
2658 (if (and (ediff-buffer-live-p buff) |
69c91aaa067a
2002-02-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42602
diff
changeset
|
2659 (ediff-with-current-buffer buff ediff-temp-indirect-buffer)) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2660 (let ((wind (ediff-get-visible-buffer-window buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2661 (base (buffer-base-buffer buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2662 (modified-p (buffer-modified-p buff))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2663 (if (and (window-live-p wind) (ediff-buffer-live-p base)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2664 (set-window-buffer wind base)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2665 ;; Kill indirect buffer even if it is modified, because the base buffer |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2666 ;; is still there. Note that if the base buffer is dead then so will be |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2667 ;; the indirect buffer |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2668 (ediff-with-current-buffer buff |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2669 (set-buffer-modified-p nil)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2670 (ediff-kill-buffer-carefully buff) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2671 (ediff-with-current-buffer base |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2672 (set-buffer-modified-p modified-p))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2673 ;; otherwise, ask or use the value of keep-variants |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2674 (or (not (ediff-buffer-live-p buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2675 keep-variants |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2676 (buffer-modified-p buff) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2677 (and ask |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2678 (not (y-or-n-p (format "Kill buffer %S [%s]? " |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2679 bufftype (buffer-name buff))))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2680 (ediff-kill-buffer-carefully buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2681 )) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2682 |
18054 | 2683 (defun ediff-maybe-save-and-delete-merge (&optional save-and-continue) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2684 "Default hook to run on quitting a merge job. |
18054 | 2685 This can also be used to save merge buffer in the middle of an Ediff session. |
2686 | |
2687 If the optional SAVE-AND-CONTINUE argument is non-nil, save merge buffer and | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2688 continue. Otherwise: |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2689 If `ediff-autostore-merges' is nil, this does nothing. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2690 If it is t, it saves the merge buffer in the file `ediff-merge-store-file' |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2691 or asks the user, if the latter is nil. It then asks the user whether to |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2692 delete the merge buffer. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2693 If `ediff-autostore-merges' is neither nil nor t, the merge buffer is saved |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2694 only if this merge job is part of a group, i.e., was invoked from within |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2695 `ediff-merge-directories', `ediff-merge-directory-revisions', and such." |
18054 | 2696 (let ((merge-store-file ediff-merge-store-file) |
2697 (ediff-autostore-merges ; fake ediff-autostore-merges, if necessary | |
2698 (if save-and-continue t ediff-autostore-merges))) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2699 (if ediff-autostore-merges |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2700 (cond ((stringp merge-store-file) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2701 ;; store, ask to delete |
18054 | 2702 (ediff-write-merge-buffer-and-maybe-kill |
2703 ediff-buffer-C merge-store-file 'show-file save-and-continue)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2704 ((eq ediff-autostore-merges t) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2705 ;; ask for file name |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2706 (setq merge-store-file |
51072
52709955c5a5
2003-05-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
49588
diff
changeset
|
2707 (read-file-name "Save the result of the merge in file: ")) |
18054 | 2708 (ediff-write-merge-buffer-and-maybe-kill |
2709 ediff-buffer-C merge-store-file nil save-and-continue)) | |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2710 ((and (ediff-buffer-live-p ediff-meta-buffer) |
19047 | 2711 (ediff-with-current-buffer ediff-meta-buffer |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
2712 (ediff-merge-metajob))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2713 ;; The parent metajob passed nil as the autostore file. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2714 nil))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2715 )) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2716 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2717 ;; write merge buffer. If the optional argument save-and-continue is non-nil, |
18054 | 2718 ;; then don't kill the merge buffer |
2719 (defun ediff-write-merge-buffer-and-maybe-kill (buf file | |
2720 &optional | |
2721 show-file save-and-continue) | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2722 (if (not (eq (find-buffer-visiting file) buf)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2723 (let ((warn-message |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2724 (format "Another buffer is visiting file %s. Too dangerous to save the merge buffer" |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2725 file))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2726 (beep) |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
2727 (message "%s" warn-message) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2728 (with-output-to-temp-buffer ediff-msg-buffer |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2729 (princ "\n\n") |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2730 (princ warn-message) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2731 (princ "\n\n") |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2732 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2733 (sit-for 2)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2734 (ediff-with-current-buffer buf |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2735 (if (or (not (file-exists-p file)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2736 (y-or-n-p (format "File %s exists, overwrite? " file))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2737 (progn |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2738 ;;(write-region (point-min) (point-max) file) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2739 (ediff-with-current-buffer buf |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2740 (set-visited-file-name file) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2741 (save-buffer)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2742 (if show-file |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2743 (progn |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2744 (message "Merge buffer saved in: %s" file) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2745 (set-buffer-modified-p nil) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2746 (sit-for 3))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2747 (if (and |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2748 (not save-and-continue) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2749 (y-or-n-p "Merge buffer saved. Now kill the buffer? ")) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2750 (ediff-kill-buffer-carefully buf))))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
2751 )) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
2752 |
11042 | 2753 ;; The default way of suspending Ediff. |
2754 ;; Buries Ediff buffers, kills all windows. | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2755 (defun ediff-default-suspend-function () |
11042 | 2756 (let* ((buf-A ediff-buffer-A) |
2757 (buf-B ediff-buffer-B) | |
2758 (buf-C ediff-buffer-C) | |
2759 (buf-A-wind (ediff-get-visible-buffer-window buf-A)) | |
2760 (buf-B-wind (ediff-get-visible-buffer-window buf-B)) | |
2761 (buf-C-wind (ediff-get-visible-buffer-window buf-C)) | |
18054 | 2762 (buf-patch (if (boundp 'ediff-patchbufer) ediff-patchbufer nil)) |
2763 (buf-patch-diag (if (boundp 'ediff-patch-diagnostics) | |
2764 ediff-patch-diagnostics nil)) | |
11042 | 2765 (buf-err ediff-error-buffer) |
2766 (buf-diff ediff-diff-buffer) | |
2767 (buf-custom-diff ediff-custom-diff-buffer) | |
2768 (buf-fine-diff ediff-fine-diff-buffer)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2769 |
11042 | 2770 ;; hide the control panel |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2771 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2772 (iconify-frame ediff-control-frame) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2773 (bury-buffer)) |
11042 | 2774 (if buf-err (bury-buffer buf-err)) |
2775 (if buf-diff (bury-buffer buf-diff)) | |
2776 (if buf-custom-diff (bury-buffer buf-custom-diff)) | |
2777 (if buf-fine-diff (bury-buffer buf-fine-diff)) | |
2778 (if buf-patch (bury-buffer buf-patch)) | |
2779 (if buf-patch-diag (bury-buffer buf-patch-diag)) | |
2780 (if (window-live-p buf-A-wind) | |
2781 (progn | |
2782 (select-window buf-A-wind) | |
2783 (delete-other-windows) | |
2784 (bury-buffer)) | |
18054 | 2785 (if (ediff-buffer-live-p buf-A) |
2786 (progn | |
2787 (set-buffer buf-A) | |
2788 (bury-buffer)))) | |
11042 | 2789 (if (window-live-p buf-B-wind) |
2790 (progn | |
2791 (select-window buf-B-wind) | |
2792 (delete-other-windows) | |
2793 (bury-buffer)) | |
18054 | 2794 (if (ediff-buffer-live-p buf-B) |
2795 (progn | |
2796 (set-buffer buf-B) | |
2797 (bury-buffer)))) | |
11042 | 2798 (if (window-live-p buf-C-wind) |
2799 (progn | |
2800 (select-window buf-C-wind) | |
2801 (delete-other-windows) | |
2802 (bury-buffer)) | |
18054 | 2803 (if (ediff-buffer-live-p buf-C) |
2804 (progn | |
2805 (set-buffer buf-C) | |
2806 (bury-buffer)))) | |
11042 | 2807 )) |
2808 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2809 |
11042 | 2810 (defun ediff-suspend () |
2811 "Suspend Ediff. | |
2812 To resume, switch to the appropriate `Ediff Control Panel' | |
2813 buffer and then type \\[ediff-recenter]. Ediff will automatically set | |
2814 up an appropriate window config." | |
2815 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2816 (ediff-barf-if-not-control-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2817 (run-hooks 'ediff-suspend-hook) |
11042 | 2818 (message |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2819 "To resume, type M-x eregistry and select the desired Ediff session")) |
11042 | 2820 |
2821 | |
2822 (defun ediff-status-info () | |
2823 "Show the names of the buffers or files being operated on by Ediff. | |
2824 Hit \\[ediff-recenter] to reset the windows afterward." | |
2825 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2826 (ediff-barf-if-not-control-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2827 (save-excursion |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2828 (ediff-skip-unsuitable-frames)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2829 (with-output-to-temp-buffer ediff-msg-buffer |
33392
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
2830 (ediff-with-current-buffer standard-output |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
2831 (fundamental-mode)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
2832 (raise-frame (selected-frame)) |
11042 | 2833 (princ (ediff-version)) |
2834 (princ "\n\n") | |
19047 | 2835 (ediff-with-current-buffer ediff-buffer-A |
11042 | 2836 (if buffer-file-name |
2837 (princ | |
2838 (format "File A = %S\n" buffer-file-name)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2839 (princ |
11042 | 2840 (format "Buffer A = %S\n" (buffer-name))))) |
19047 | 2841 (ediff-with-current-buffer ediff-buffer-B |
11042 | 2842 (if buffer-file-name |
2843 (princ | |
2844 (format "File B = %S\n" buffer-file-name)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2845 (princ |
11042 | 2846 (format "Buffer B = %S\n" (buffer-name))))) |
2847 (if ediff-3way-job | |
19047 | 2848 (ediff-with-current-buffer ediff-buffer-C |
11042 | 2849 (if buffer-file-name |
2850 (princ | |
2851 (format "File C = %S\n" buffer-file-name)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2852 (princ |
11042 | 2853 (format "Buffer C = %S\n" (buffer-name)))))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2854 (princ (format "Customized diff output %s\n" |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2855 (if (ediff-buffer-live-p ediff-custom-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2856 (concat "\tin buffer " |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2857 (buffer-name ediff-custom-diff-buffer)) |
18054 | 2858 " is not available"))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2859 (princ (format "Plain diff output %s\n" |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2860 (if (ediff-buffer-live-p ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2861 (concat "\tin buffer " |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2862 (buffer-name ediff-diff-buffer)) |
18054 | 2863 " is not available"))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2864 |
19047 | 2865 (let* ((A-line (ediff-with-current-buffer ediff-buffer-A |
11042 | 2866 (1+ (count-lines (point-min) (point))))) |
19047 | 2867 (B-line (ediff-with-current-buffer ediff-buffer-B |
11042 | 2868 (1+ (count-lines (point-min) (point))))) |
2869 C-line) | |
2870 (princ (format "\Buffer A's point is on line %d\n" A-line)) | |
2871 (princ (format "Buffer B's point is on line %d\n" B-line)) | |
2872 (if ediff-3way-job | |
2873 (progn | |
19047 | 2874 (setq C-line (ediff-with-current-buffer ediff-buffer-C |
11042 | 2875 (1+ (count-lines (point-min) (point))))) |
2876 (princ (format "Buffer C's point is on line %d\n" C-line))))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2877 |
11042 | 2878 (princ (format "\nCurrent difference number = %S\n" |
2879 (cond ((< ediff-current-difference 0) 'start) | |
2880 ((>= ediff-current-difference | |
2881 ediff-number-of-differences) 'end) | |
2882 (t (1+ ediff-current-difference))))) | |
2883 | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2884 (princ |
18054 | 2885 (format "\n%s regions that differ in white space & line breaks only" |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2886 (if ediff-ignore-similar-regions |
18054 | 2887 "Ignoring" "Showing"))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2888 (if (and ediff-merge-job ediff-show-clashes-only) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2889 (princ |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2890 "\nFocusing on regions where both buffers differ from the ancestor")) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2891 (if (and ediff-skip-merge-regions-that-differ-from-default ediff-merge-job) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2892 (princ |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
2893 "\nSkipping merge regions that differ from default setting")) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2894 |
11042 | 2895 (cond ((eq ediff-skip-diff-region-function 'ediff-show-all-diffs) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2896 (princ "\nSelective browsing by regexp is off\n")) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2897 ((eq ediff-skip-diff-region-function |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2898 ediff-hide-regexp-matches-function) |
11042 | 2899 (princ |
2900 "\nIgnoring regions that match") | |
2901 (princ | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2902 (format |
11042 | 2903 "\n\t regexp `%s' in buffer A %S\n\t regexp `%s' in buffer B\n" |
2904 ediff-regexp-hide-A ediff-hide-regexp-connective | |
2905 ediff-regexp-hide-B))) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2906 ((eq ediff-skip-diff-region-function |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2907 ediff-focus-on-regexp-matches-function) |
11042 | 2908 (princ |
2909 "\nFocusing on regions that match") | |
2910 (princ | |
2911 (format | |
2912 "\n\t regexp `%s' in buffer A %S\n\t regexp `%s' in buffer B\n" | |
2913 ediff-regexp-focus-A ediff-focus-regexp-connective | |
2914 ediff-regexp-focus-B))) | |
2915 (t (princ "\nSelective browsing via a user-defined method.\n"))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2916 |
11042 | 2917 (princ |
2918 (format "\nBugs/suggestions: type `%s' while in Ediff Control Panel." | |
2919 (substitute-command-keys "\\[ediff-submit-report]"))) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2920 ) ; with output |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2921 (if (frame-live-p ediff-control-frame) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2922 (ediff-reset-mouse ediff-control-frame)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2923 (if (window-live-p ediff-control-window) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2924 (select-window ediff-control-window))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2925 |
11042 | 2926 |
2927 | |
2928 | |
2929 ;;; Support routines | |
2930 | |
2931 ;; Select a difference by placing the ASCII flags around the appropriate | |
2932 ;; group of lines in the A, B buffers | |
2933 ;; This may have to be modified for buffer C, when it will be supported. | |
2934 (defun ediff-select-difference (n) | |
2935 (if (and (ediff-buffer-live-p ediff-buffer-A) | |
2936 (ediff-buffer-live-p ediff-buffer-B) | |
2937 (ediff-valid-difference-p n)) | |
2938 (progn | |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2939 (cond |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2940 ((and (ediff-has-face-support-p) ediff-use-faces) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2941 (ediff-highlight-diff n)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2942 ((eq ediff-highlighting-style 'ascii) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2943 (ediff-place-flags-in-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2944 'A ediff-buffer-A ediff-control-buffer n) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2945 (ediff-place-flags-in-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2946 'B ediff-buffer-B ediff-control-buffer n) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2947 (if ediff-3way-job |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2948 (ediff-place-flags-in-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2949 'C ediff-buffer-C ediff-control-buffer n)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2950 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2951 (ediff-place-flags-in-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2952 'Ancestor ediff-ancestor-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
2953 ediff-control-buffer n)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2954 )) |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2955 |
11042 | 2956 (ediff-install-fine-diff-if-necessary n) |
52828
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
2957 ;; set current difference here so the hook will be able to refer to it |
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
2958 (setq ediff-current-difference n) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2959 (run-hooks 'ediff-select-hook)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2960 |
11042 | 2961 |
2962 ;; Unselect a difference by removing the ASCII flags in the buffers. | |
2963 ;; This may have to be modified for buffer C, when it will be supported. | |
2964 (defun ediff-unselect-difference (n) | |
2965 (if (ediff-valid-difference-p n) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2966 (progn |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
2967 (cond ((and (ediff-has-face-support-p) ediff-use-faces) |
11042 | 2968 (ediff-unhighlight-diff)) |
2969 ((eq ediff-highlighting-style 'ascii) | |
2970 (ediff-remove-flags-from-buffer | |
2971 ediff-buffer-A | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2972 (ediff-get-diff-overlay n 'A)) |
11042 | 2973 (ediff-remove-flags-from-buffer |
2974 ediff-buffer-B | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2975 (ediff-get-diff-overlay n 'B)) |
11042 | 2976 (if ediff-3way-job |
2977 (ediff-remove-flags-from-buffer | |
2978 ediff-buffer-C | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2979 (ediff-get-diff-overlay n 'C))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2980 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2981 (ediff-remove-flags-from-buffer |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2982 ediff-ancestor-buffer |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2983 (ediff-get-diff-overlay n 'Ancestor))) |
11042 | 2984 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2985 |
11042 | 2986 ;; unhighlight fine diffs |
2987 (ediff-set-fine-diff-properties ediff-current-difference 'default) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
2988 (run-hooks 'ediff-unselect-hook)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
2989 |
11042 | 2990 |
2991 ;; Unselects prev diff and selects a new one, if FLAG has value other than | |
2992 ;; 'select-only or 'unselect-only. If FLAG is 'select-only, the | |
2993 ;; next difference is selected, but the current selection is not | |
2994 ;; unselected. If FLAG is 'unselect-only then the current selection is | |
2995 ;; unselected, but the next one is not selected. If NO-RECENTER is non-nil, | |
2996 ;; don't recenter buffers after selecting/unselecting. | |
2997 (defun ediff-unselect-and-select-difference (n &optional flag no-recenter) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2998 (let ((ediff-current-difference n)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
2999 (or no-recenter |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3000 (ediff-recenter 'no-rehighlight))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3001 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3002 (let ((control-buf ediff-control-buffer)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3003 (unwind-protect |
11042 | 3004 (progn |
3005 (or (eq flag 'select-only) | |
3006 (ediff-unselect-difference ediff-current-difference)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3007 |
11042 | 3008 (or (eq flag 'unselect-only) |
3009 (ediff-select-difference n)) | |
52828
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
3010 ;; need to set current diff here even though it is also set in |
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
3011 ;; ediff-select-difference because ediff-select-difference might not |
d08ef8842be1
2003-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
52401
diff
changeset
|
3012 ;; be called if unselect-only is specified |
11042 | 3013 (setq ediff-current-difference n) |
3014 ) ; end protected section | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3015 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3016 (ediff-with-current-buffer control-buf (ediff-refresh-mode-lines))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3017 )) |
11042 | 3018 |
3019 | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3020 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3021 (defun ediff-highlight-diff-in-one-buffer (n buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3022 (if (ediff-buffer-live-p (ediff-get-buffer buf-type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3023 (let* ((buff (ediff-get-buffer buf-type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3024 (last (ediff-with-current-buffer buff (point-max))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3025 (begin (ediff-get-diff-posn buf-type 'beg n)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3026 (end (ediff-get-diff-posn buf-type 'end n)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3027 (xtra (if (equal begin end) 1 0)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3028 (end-hilit (min last (+ end xtra))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3029 (current-diff-overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3030 (symbol-value |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3031 (ediff-get-symbol-from-alist |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3032 buf-type ediff-current-diff-overlay-alist)))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3033 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3034 (if ediff-xemacs-p |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3035 (ediff-move-overlay current-diff-overlay begin end-hilit) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3036 (ediff-move-overlay current-diff-overlay begin end-hilit buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3037 (ediff-overlay-put current-diff-overlay 'priority |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3038 (ediff-highest-priority begin end-hilit buff)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3039 (ediff-overlay-put current-diff-overlay 'ediff-diff-num n) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3040 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3041 ;; unhighlight the background overlay for diff n so it won't |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3042 ;; interfere with the current diff overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3043 (ediff-set-overlay-face (ediff-get-diff-overlay n buf-type) nil) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3044 ))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3045 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3046 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3047 (defun ediff-unhighlight-diff-in-one-buffer (buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3048 (if (ediff-buffer-live-p (ediff-get-buffer buf-type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3049 (let ((current-diff-overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3050 (symbol-value |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3051 (ediff-get-symbol-from-alist |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3052 buf-type ediff-current-diff-overlay-alist))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3053 (overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3054 (ediff-get-diff-overlay ediff-current-difference buf-type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3055 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3056 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3057 (ediff-move-overlay current-diff-overlay 1 1) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3058 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3059 ;; rehighlight the overlay in the background of the |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3060 ;; current difference region |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3061 (ediff-set-overlay-face |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3062 overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3063 (if (and (ediff-has-face-support-p) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3064 ediff-use-faces ediff-highlight-all-diffs) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3065 (ediff-background-face buf-type ediff-current-difference))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3066 ))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3067 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3068 (defun ediff-unhighlight-diffs-totally-in-one-buffer (buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3069 (ediff-unselect-and-select-difference -1) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3070 (if (and (ediff-has-face-support-p) ediff-use-faces) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3071 (let* ((inhibit-quit t) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3072 (current-diff-overlay-var |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3073 (ediff-get-symbol-from-alist |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3074 buf-type ediff-current-diff-overlay-alist)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3075 (current-diff-overlay (symbol-value current-diff-overlay-var))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3076 (ediff-paint-background-regions 'unhighlight) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3077 (if (ediff-overlayp current-diff-overlay) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3078 (ediff-delete-overlay current-diff-overlay)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3079 (set current-diff-overlay-var nil) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3080 ))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3081 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3082 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
3083 (defun ediff-highlight-diff (n) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3084 "Put face on diff N. Invoked for X displays only." |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3085 (ediff-highlight-diff-in-one-buffer n 'A) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3086 (ediff-highlight-diff-in-one-buffer n 'B) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3087 (ediff-highlight-diff-in-one-buffer n 'C) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3088 (ediff-highlight-diff-in-one-buffer n 'Ancestor) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3089 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3090 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3091 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
3092 (defun ediff-unhighlight-diff () |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3093 "Remove overlays from buffers A, B, and C." |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3094 (ediff-unhighlight-diff-in-one-buffer 'A) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3095 (ediff-unhighlight-diff-in-one-buffer 'B) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3096 (ediff-unhighlight-diff-in-one-buffer 'C) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3097 (ediff-unhighlight-diff-in-one-buffer 'Ancestor) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3098 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3099 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3100 ;; delete highlighting overlays, restore faces to their original form |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
3101 (defun ediff-unhighlight-diffs-totally () |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3102 (ediff-unhighlight-diffs-totally-in-one-buffer 'A) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3103 (ediff-unhighlight-diffs-totally-in-one-buffer 'B) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3104 (ediff-unhighlight-diffs-totally-in-one-buffer 'C) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3105 (ediff-unhighlight-diffs-totally-in-one-buffer 'Ancestor) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3106 ) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3107 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3108 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3109 ;; This is adapted from a similar function in `emerge.el'. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3110 ;; PROMPT should not have a trailing ': ', so that it can be modified |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3111 ;; according to context. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3112 ;; If DEFAULT-FILE is set, it should be used as the default value. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3113 ;; If DEFAULT-DIR is non-nil, use it as the default directory. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3114 ;; Otherwise, use the value of Emacs' variable `default-directory.' |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3115 (defun ediff-read-file-name (prompt default-dir default-file &optional no-dirs) |
11042 | 3116 ;; hack default-dir if it is not set |
3117 (setq default-dir | |
3118 (file-name-as-directory | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3119 (ediff-abbreviate-file-name |
11042 | 3120 (expand-file-name (or default-dir |
3121 (and default-file | |
3122 (file-name-directory default-file)) | |
3123 default-directory))))) | |
3124 | |
3125 ;; strip the directory from default-file | |
3126 (if default-file | |
3127 (setq default-file (file-name-nondirectory default-file))) | |
3128 (if (string= default-file "") | |
3129 (setq default-file nil)) | |
3130 | |
3131 (let (f) | |
3132 (setq f (expand-file-name | |
3133 (read-file-name | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3134 (format "%s%s " |
11042 | 3135 prompt |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3136 (cond (default-file |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3137 (concat " (default " default-file "):")) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3138 (t (concat " (default " default-dir "):")))) |
11042 | 3139 default-dir |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3140 (or default-file default-dir) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3141 t ; must match, no-confirm |
11042 | 3142 (if default-file (file-name-directory default-file)) |
3143 ) | |
3144 default-dir | |
3145 )) | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3146 ;; If user entered a directory name, expand the default file in that |
11042 | 3147 ;; directory. This allows the user to enter a directory name for the |
3148 ;; B-file and diff against the default-file in that directory instead | |
3149 ;; of a DIRED listing! | |
3150 (if (and (file-directory-p f) default-file) | |
3151 (setq f (expand-file-name | |
3152 (file-name-nondirectory default-file) f))) | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3153 (if (and no-dirs (file-directory-p f)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3154 (error "File %s is a directory" f)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3155 f)) |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3156 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3157 ;; If PREFIX is given, then it is used as a prefix for the temp file |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3158 ;; name. Otherwise, `ediff' is used. If FILE is given, use this |
11042 | 3159 ;; file and don't create a new one. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3160 ;; In MS-DOS, make sure the prefix isn't too long, or else |
23674
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3161 ;; `make-temp-name' isn't guaranteed to return a unique filename. |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3162 ;; Also, save buffer from START to END in the file. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3163 ;; START defaults to (point-min), END to (point-max) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3164 (defun ediff-make-temp-file (buff &optional prefix given-file start end) |
23674
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3165 (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) |
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3166 (short-p p) |
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
3167 (coding-system-for-write ediff-coding-system-for-write) |
23674
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3168 f short-f) |
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3169 (if (and (fboundp 'msdos-long-file-names) |
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3170 (not (msdos-long-file-names)) |
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3171 (> (length p) 2)) |
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3172 (setq short-p (substring p 0 2))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3173 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3174 (setq f (concat ediff-temp-file-prefix p) |
23674
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3175 short-f (concat ediff-temp-file-prefix short-p) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3176 f (cond (given-file) |
66894
0b958d61a229
2005-11-15 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
66687
diff
changeset
|
3177 ((find-file-name-handler f 'insert-file-contents) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3178 ;; to thwart file handlers in write-region, e.g., if file |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3179 ;; name ends with .Z or .gz |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3180 ;; This is needed so that patches produced by ediff will |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3181 ;; have more meaningful names |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3182 (ediff-make-empty-tmp-file short-f)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3183 (prefix |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3184 ;; Prefix is most often the same as the file name for the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3185 ;; variant. Here we are trying to use the original file |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3186 ;; name but in the temp directory. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3187 (ediff-make-empty-tmp-file f 'keep-name)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3188 (t |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3189 ;; If don't care about name, add some random stuff |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3190 ;; to proposed file name. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3191 (ediff-make-empty-tmp-file short-f)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3192 |
11042 | 3193 ;; create the file |
19047 | 3194 (ediff-with-current-buffer buff |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3195 (write-region (if start start (point-min)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3196 (if end end (point-max)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3197 f |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3198 nil ; don't append---erase |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3199 'no-message) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3200 (set-file-modes f ediff-temp-file-mode) |
23674
4b1d22478c9f
(ediff-make-temp-file): Run the prefix through
Eli Zaretskii <eliz@gnu.org>
parents:
23381
diff
changeset
|
3201 (expand-file-name f)))) |
11042 | 3202 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3203 ;; Create a temporary file. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3204 ;; The returned file name (created by appending some random characters at the |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3205 ;; end of PROPOSED-NAME is guaranteed to point to a newly created empty file. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3206 ;; This is a replacement for make-temp-name, which eliminates a security hole. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3207 ;; If KEEP-PROPOSED-NAME isn't nil, try to keep PROPOSED-NAME, unless such file |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3208 ;; already exists. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3209 ;; It is a modified version of make-temp-file in emacs 20.5 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3210 (defun ediff-make-empty-tmp-file (proposed-name &optional keep-proposed-name) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3211 (let ((file proposed-name)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3212 (while (condition-case () |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3213 (progn |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3214 (if (or (file-exists-p file) (not keep-proposed-name)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3215 (setq file (make-temp-name proposed-name))) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3216 ;; the with-temp-buffer thing is a workaround for an XEmacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3217 ;; bug: write-region complains that we are trying to visit a |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3218 ;; file in an indirect buffer, failing to notice that the |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3219 ;; VISIT flag is unset and that we are actually writing from a |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3220 ;; string and not from any buffer. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3221 (with-temp-buffer |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3222 (write-region "" nil file nil 'silent nil 'excl)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3223 nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3224 (file-already-exists t)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3225 ;; the file was somehow created by someone else between |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3226 ;; `make-temp-name' and `write-region', let's try again. |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3227 nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3228 file)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3229 |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3230 |
11042 | 3231 ;; Quote metacharacters (using \) when executing diff in Unix, but not in |
3232 ;; EMX OS/2 | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3233 ;;(defun ediff-protect-metachars (str) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3234 ;; (or (memq system-type '(emx vax-vms axp-vms)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3235 ;; (let ((limit 0)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3236 ;; (while (string-match ediff-metachars str limit) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3237 ;; (setq str (concat (substring str 0 (match-beginning 0)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3238 ;; "\\" |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3239 ;; (substring str (match-beginning 0)))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3240 ;; (setq limit (1+ (match-end 0)))))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3241 ;; str) |
11042 | 3242 |
3243 ;; Make sure the current buffer (for a file) has the same contents as the | |
3244 ;; file on disk, and attempt to remedy the situation if not. | |
3245 ;; Signal an error if we can't make them the same, or the user doesn't want | |
3246 ;; to do what is necessary to make them the same. | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3247 ;; Also, Ediff always offers to revert obsolete buffers, whether they |
11042 | 3248 ;; are modified or not. |
3249 (defun ediff-verify-file-buffer (&optional file-magic) | |
3250 ;; First check if the file has been modified since the buffer visited it. | |
3251 (if (verify-visited-file-modtime (current-buffer)) | |
3252 (if (buffer-modified-p) | |
3253 ;; If buffer is not obsolete and is modified, offer to save | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3254 (if (yes-or-no-p |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3255 (format "Buffer %s has been modified. Save it in file %s? " |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3256 (buffer-name) |
11042 | 3257 buffer-file-name)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3258 (condition-case nil |
11042 | 3259 (save-buffer) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3260 (error |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3261 (beep) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3262 (message "Couldn't save %s" buffer-file-name))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3263 (error "Buffer is out of sync for file %s" buffer-file-name)) |
11042 | 3264 ;; If buffer is not obsolete and is not modified, do nothing |
3265 nil) | |
3266 ;; If buffer is obsolete, offer to revert | |
3267 (if (yes-or-no-p | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3268 (format "File %s was modified since visited by buffer %s. REVERT file %s? " |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3269 buffer-file-name |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3270 (buffer-name) |
11042 | 3271 buffer-file-name)) |
3272 (progn | |
3273 (if file-magic | |
3274 (erase-buffer)) | |
3275 (revert-buffer t t)) | |
3276 (error "Buffer out of sync for file %s" buffer-file-name)))) | |
3277 | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3278 ;; if there is another buffer visiting the file of the merge buffer, offer to |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3279 ;; save and delete the buffer; else bark |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3280 (defun ediff-verify-file-merge-buffer (file) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3281 (let ((buff (if (stringp file) (find-buffer-visiting file))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3282 warn-message) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3283 (or (null buff) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3284 (progn |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3285 (setq warn-message |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3286 (format "Buffer %s is visiting %s. Save and kill the buffer? " |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3287 (buffer-name buff) file)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3288 (with-output-to-temp-buffer ediff-msg-buffer |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3289 (princ "\n\n") |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3290 (princ warn-message) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3291 (princ "\n\n")) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3292 (if (y-or-n-p |
65582
4d1085b02d64
Message format spec fixes (1)
Deepak Goel <deego@gnufans.org>
parents:
64762
diff
changeset
|
3293 (message "%s" warn-message)) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3294 (with-current-buffer buff |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3295 (save-buffer) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3296 (kill-buffer (current-buffer))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3297 (error "Too dangerous to merge versions of a file visited by another buffer")))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3298 )) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3299 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3300 |
11042 | 3301 |
19774 | 3302 (defun ediff-filename-magic-p (file) |
3303 (or (ediff-file-compressed-p file) | |
3304 (ediff-file-remote-p file))) | |
3305 | |
3306 | |
11042 | 3307 (defun ediff-save-buffer (arg) |
3308 "Safe way of saving buffers A, B, C, and the diff output. | |
3309 `wa' saves buffer A, `wb' saves buffer B, `wc' saves buffer C, | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3310 and `wd' saves the diff output. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3311 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3312 With prefix argument, `wd' saves plain diff output. |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3313 Without an argument, it saves customized diff argument, if available |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3314 \(and plain output, if customized output was not generated\)." |
11042 | 3315 (interactive "P") |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3316 (ediff-barf-if-not-control-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3317 (ediff-compute-custom-diffs-maybe) |
19047 | 3318 (ediff-with-current-buffer |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3319 (cond ((memq last-command-char '(?a ?b ?c)) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3320 (ediff-get-buffer |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3321 (ediff-char-to-buftype last-command-char))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3322 ((eq last-command-char ?d) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3323 (message "Saving diff output ...") |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3324 (sit-for 1) ; let the user see the message |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3325 (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3326 ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3327 ((ediff-buffer-live-p ediff-custom-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3328 ediff-custom-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3329 ((ediff-buffer-live-p ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3330 ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3331 (t (error "Output from `diff' not found")))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3332 ) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3333 (save-buffer))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3334 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3335 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3336 ;; idea suggested by Hannu Koivisto <azure@iki.fi> |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3337 (defun ediff-clone-buffer-for-region-comparison (buff region-name) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3338 (let ((cloned-buff (ediff-make-cloned-buffer buff region-name)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3339 (pop-up-windows t) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3340 wind |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3341 other-wind |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3342 msg-buf) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3343 (ediff-with-current-buffer cloned-buff |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3344 (setq ediff-temp-indirect-buffer t)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3345 (pop-to-buffer cloned-buff) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3346 (setq wind (ediff-get-visible-buffer-window cloned-buff)) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3347 (select-window wind) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3348 (delete-other-windows) |
75389
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
3349 (ediff-activate-mark) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3350 (split-window-vertically) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3351 (ediff-select-lowest-window) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3352 (setq other-wind (selected-window)) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3353 (with-temp-buffer |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3354 (erase-buffer) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3355 (insert |
75389
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
3356 (format "\n ******* Mark a region in buffer %s (or confirm the existing one) *******\n" |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3357 (buffer-name cloned-buff))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3358 (insert |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3359 (ediff-with-current-buffer buff |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3360 (format "\n\t When done, type %s Use %s to abort\n " |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3361 (ediff-format-bindings-of 'exit-recursive-edit) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3362 (ediff-format-bindings-of 'abort-recursive-edit)))) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3363 (goto-char (point-min)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3364 (setq msg-buf (current-buffer)) |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3365 (set-window-buffer other-wind msg-buf) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3366 (shrink-window-if-larger-than-buffer) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3367 (if (window-live-p wind) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3368 (select-window wind)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3369 (condition-case nil |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3370 (recursive-edit) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3371 (quit |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3372 (ediff-kill-buffer-carefully cloned-buff))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3373 ) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3374 cloned-buff)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3375 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3376 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3377 (defun ediff-clone-buffer-for-window-comparison (buff wind region-name) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3378 (let ((cloned-buff (ediff-make-cloned-buffer buff region-name))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3379 (ediff-with-current-buffer cloned-buff |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3380 (setq ediff-temp-indirect-buffer t)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3381 (set-window-buffer wind cloned-buff) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3382 cloned-buff)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3383 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3384 (defun ediff-clone-buffer-for-current-diff-comparison (buff buf-type reg-name) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3385 (let ((cloned-buff (ediff-make-cloned-buffer buff reg-name)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3386 (reg-start (ediff-get-diff-posn buf-type 'beg)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3387 (reg-end (ediff-get-diff-posn buf-type 'end))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3388 (ediff-with-current-buffer cloned-buff |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3389 ;; set region to be the current diff region |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3390 (goto-char reg-start) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3391 (set-mark reg-end) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3392 (setq ediff-temp-indirect-buffer t)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3393 cloned-buff)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3394 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3395 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3396 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3397 (defun ediff-make-cloned-buffer (buff region-name) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3398 (ediff-make-indirect-buffer |
44615
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3399 buff (generate-new-buffer-name |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3400 (concat (if (stringp buff) buff (buffer-name buff)) region-name)) |
a1448e19a9f8
* viper-ex.el: Patch by Samuel Padgett. Copyright papers received.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
44028
diff
changeset
|
3401 )) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3402 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3403 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3404 (defun ediff-make-indirect-buffer (base-buf indirect-buf-name) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3405 (ediff-cond-compile-for-xemacs-or-emacs |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3406 (make-indirect-buffer base-buf indirect-buf-name) ; xemacs |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3407 (make-indirect-buffer base-buf indirect-buf-name 'clone) ; emacs |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3408 )) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3409 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3410 |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3411 ;; This function operates only from an ediff control buffer |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3412 (defun ediff-compute-custom-diffs-maybe () |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3413 (let ((buf-A-file-name (buffer-file-name ediff-buffer-A)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3414 (buf-B-file-name (buffer-file-name ediff-buffer-B)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3415 file-A file-B) |
54090
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3416 (unless (and buf-A-file-name (file-exists-p buf-A-file-name)) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3417 (setq file-A |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3418 (ediff-make-temp-file ediff-buffer-A))) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3419 (unless (and buf-B-file-name (file-exists-p buf-B-file-name)) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3420 (setq file-B |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3421 (ediff-make-temp-file ediff-buffer-B))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3422 (or (ediff-buffer-live-p ediff-custom-diff-buffer) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3423 (setq ediff-custom-diff-buffer |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3424 (get-buffer-create |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3425 (ediff-unique-buffer-name "*ediff-custom-diff" "*")))) |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3426 (ediff-with-current-buffer ediff-custom-diff-buffer |
54090
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3427 (setq buffer-read-only nil) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3428 (erase-buffer)) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3429 (ediff-exec-process |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3430 ediff-custom-diff-program ediff-custom-diff-buffer 'synchronize |
54090
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3431 ediff-custom-diff-options |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3432 ;; repetition of buf-A-file-name is needed so it'll return a file |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3433 (or (and buf-A-file-name (file-exists-p buf-A-file-name) buf-A-file-name) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3434 file-A) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3435 (or (and buf-B-file-name (file-exists-p buf-B-file-name) buf-B-file-name) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3436 file-B)) |
36043
5d6b76d28b83
2001-02-12 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
35411
diff
changeset
|
3437 ;; put the diff file in diff-mode, if it is available |
5d6b76d28b83
2001-02-12 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
35411
diff
changeset
|
3438 (if (fboundp 'diff-mode) |
5d6b76d28b83
2001-02-12 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
35411
diff
changeset
|
3439 (with-current-buffer ediff-custom-diff-buffer |
5d6b76d28b83
2001-02-12 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
35411
diff
changeset
|
3440 (diff-mode))) |
54090
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3441 (and file-A (file-exists-p file-A) (delete-file file-A)) |
e83349d94786
* ediff-util.el (ediff-compute-custom-diffs-maybe): Avoid creating
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
53865
diff
changeset
|
3442 (and file-B (file-exists-p file-B) (delete-file file-B)) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3443 )) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3444 |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3445 (defun ediff-show-diff-output (arg) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3446 (interactive "P") |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3447 (ediff-barf-if-not-control-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3448 (ediff-compute-custom-diffs-maybe) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3449 (save-excursion |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3450 (ediff-skip-unsuitable-frames ' ok-unsplittable)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3451 (let ((buf (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3452 ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3453 ((ediff-buffer-live-p ediff-custom-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3454 ediff-custom-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3455 ((ediff-buffer-live-p ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3456 ediff-diff-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3457 (t |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3458 (beep) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3459 (message "Output from `diff' not found") |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3460 nil)))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3461 (if buf |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3462 (progn |
19047 | 3463 (ediff-with-current-buffer buf |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3464 (goto-char (point-min))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3465 (switch-to-buffer buf) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3466 (raise-frame (selected-frame))))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3467 (if (frame-live-p ediff-control-frame) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3468 (ediff-reset-mouse ediff-control-frame)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3469 (if (window-live-p ediff-control-window) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3470 (select-window ediff-control-window))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3471 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3472 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3473 (defun ediff-inferior-compare-regions () |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3474 "Compare regions in an active Ediff session. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3475 Like ediff-regions-linewise but is called from under an active Ediff session on |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3476 the files that belong to that session. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3477 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3478 After quitting the session invoked via this function, type C-l to the parent |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3479 Ediff Control Panel to restore highlighting." |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3480 (interactive) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3481 (let ((answer "") |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3482 (possibilities (list ?A ?B ?C)) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
3483 (zmacs-regions t) |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3484 use-current-diff-p |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3485 begA begB endA endB bufA bufB) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3486 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3487 (if (ediff-valid-difference-p ediff-current-difference) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3488 (progn |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3489 (ediff-set-fine-diff-properties ediff-current-difference 'default) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3490 (ediff-unhighlight-diff))) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3491 (ediff-paint-background-regions 'unhighlight) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3492 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3493 (cond ((ediff-merge-job) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3494 (setq bufB ediff-buffer-C) |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3495 ;; ask which buffer to compare to the merge buffer |
18054 | 3496 (while (cond ((eq answer ?A) |
3497 (setq bufA ediff-buffer-A | |
3498 possibilities '(?B)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3499 nil) |
18054 | 3500 ((eq answer ?B) |
3501 (setq bufA ediff-buffer-B | |
3502 possibilities '(?A)) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3503 nil) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3504 ((equal answer "")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3505 (t (beep 1) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
3506 (message "Valid values are A or B") |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3507 (sit-for 2) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3508 t)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3509 (let ((cursor-in-echo-area t)) |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3510 (message |
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3511 "Which buffer to compare to the merge buffer (A or B)? ") |
18054 | 3512 (setq answer (capitalize (read-char-exclusive)))))) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3513 |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3514 ((ediff-3way-comparison-job) |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3515 ;; ask which two buffers to compare |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3516 (while (cond ((memq answer possibilities) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3517 (setq possibilities (delq answer possibilities)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3518 (setq bufA |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3519 (eval |
19047 | 3520 (ediff-get-symbol-from-alist |
3521 answer ediff-buffer-alist))) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3522 nil) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3523 ((equal answer "")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3524 (t (beep 1) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3525 (message |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
3526 "Valid values are %s" |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3527 (mapconcat 'char-to-string possibilities " or ")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3528 (sit-for 2) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3529 t)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3530 (let ((cursor-in-echo-area t)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3531 (message "Enter the 1st buffer you want to compare (%s): " |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3532 (mapconcat 'char-to-string possibilities " or ")) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3533 (setq answer (capitalize (read-char-exclusive))))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3534 (setq answer "") ; silence error msg |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3535 (while (cond ((memq answer possibilities) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3536 (setq possibilities (delq answer possibilities)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3537 (setq bufB |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3538 (eval |
19047 | 3539 (ediff-get-symbol-from-alist |
3540 answer ediff-buffer-alist))) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3541 nil) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3542 ((equal answer "")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3543 (t (beep 1) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3544 (message |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
3545 "Valid values are %s" |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3546 (mapconcat 'char-to-string possibilities " or ")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3547 (sit-for 2) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3548 t)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3549 (let ((cursor-in-echo-area t)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3550 (message "Enter the 2nd buffer you want to compare (%s): " |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3551 (mapconcat 'char-to-string possibilities "/")) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3552 (setq answer (capitalize (read-char-exclusive)))))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3553 (t ; 2way comparison |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3554 (setq bufA ediff-buffer-A |
18054 | 3555 bufB ediff-buffer-B |
3556 possibilities nil))) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3557 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3558 (if (and (ediff-valid-difference-p ediff-current-difference) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3559 (y-or-n-p "Compare currently highlighted difference regions? ")) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3560 (setq use-current-diff-p t)) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3561 |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3562 (setq bufA (if use-current-diff-p |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3563 (ediff-clone-buffer-for-current-diff-comparison |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3564 bufA 'A "-Region.A-") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3565 (ediff-clone-buffer-for-region-comparison bufA "-Region.A-"))) |
19047 | 3566 (ediff-with-current-buffer bufA |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3567 (setq begA (region-beginning) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3568 endA (region-end)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3569 (goto-char begA) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3570 (beginning-of-line) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3571 (setq begA (point)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3572 (goto-char endA) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3573 (end-of-line) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3574 (or (eobp) (forward-char)) ; include the newline char |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3575 (setq endA (point))) |
43714
1c34b0b56515
* ediff-init.el: comments.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43220
diff
changeset
|
3576 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3577 (setq bufB (if use-current-diff-p |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3578 (ediff-clone-buffer-for-current-diff-comparison |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3579 bufB 'B "-Region.B-") |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3580 (ediff-clone-buffer-for-region-comparison bufB "-Region.B-"))) |
19047 | 3581 (ediff-with-current-buffer bufB |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3582 (setq begB (region-beginning) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3583 endB (region-end)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3584 (goto-char begB) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3585 (beginning-of-line) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3586 (setq begB (point)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3587 (goto-char endB) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3588 (end-of-line) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3589 (or (eobp) (forward-char)) ; include the newline char |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3590 (setq endB (point))) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3591 |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3592 |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3593 (ediff-regions-internal |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3594 bufA begA endA bufB begB endB |
44028
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3595 nil ; setup-hook |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3596 (if use-current-diff-p ; job name |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3597 'ediff-regions-wordwise |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3598 'ediff-regions-linewise) |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3599 (if use-current-diff-p ; word mode, if diffing current diff |
182881d68883
* ediff-diff.el (ediff-install-fine-diff-if-necessary): take
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
43714
diff
changeset
|
3600 t nil) |
18054 | 3601 ;; setup param to pass to ediff-setup |
3602 (list (cons 'ediff-split-window-function ediff-split-window-function))) | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3603 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3604 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3605 |
11042 | 3606 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3607 (defun ediff-remove-flags-from-buffer (buffer overlay) |
19047 | 3608 (ediff-with-current-buffer buffer |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3609 (let ((inhibit-read-only t)) |
11042 | 3610 (if ediff-xemacs-p |
3611 (ediff-overlay-put overlay 'begin-glyph nil) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3612 (ediff-overlay-put overlay 'before-string nil)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3613 |
11042 | 3614 (if ediff-xemacs-p |
3615 (ediff-overlay-put overlay 'end-glyph nil) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3616 (ediff-overlay-put overlay 'after-string nil)) |
11042 | 3617 ))) |
3618 | |
3619 | |
3620 | |
3621 (defun ediff-place-flags-in-buffer (buf-type buffer ctl-buffer diff) | |
19047 | 3622 (ediff-with-current-buffer buffer |
11042 | 3623 (ediff-place-flags-in-buffer1 buf-type ctl-buffer diff))) |
3624 | |
3625 | |
3626 (defun ediff-place-flags-in-buffer1 (buf-type ctl-buffer diff-no) | |
19047 | 3627 (let* ((curr-overl (ediff-with-current-buffer ctl-buffer |
11042 | 3628 (ediff-get-diff-overlay diff-no buf-type))) |
3629 (before (ediff-get-diff-posn buf-type 'beg diff-no ctl-buffer)) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3630 after beg-of-line flag) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3631 |
11042 | 3632 ;; insert flag before the difference |
3633 (goto-char before) | |
3634 (setq beg-of-line (bolp)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3635 |
19047 | 3636 (setq flag (ediff-with-current-buffer ctl-buffer |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3637 (if (eq ediff-highlighting-style 'ascii) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3638 (if beg-of-line |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3639 ediff-before-flag-bol ediff-before-flag-mol)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3640 |
11042 | 3641 ;; insert the flag itself |
3642 (if ediff-xemacs-p | |
3643 (ediff-overlay-put curr-overl 'begin-glyph flag) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3644 (ediff-overlay-put curr-overl 'before-string flag)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3645 |
11042 | 3646 ;; insert the flag after the difference |
3647 ;; `after' must be set here, after the before-flag was inserted | |
3648 (setq after (ediff-get-diff-posn buf-type 'end diff-no ctl-buffer)) | |
3649 (goto-char after) | |
3650 (setq beg-of-line (bolp)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3651 |
19047 | 3652 (setq flag (ediff-with-current-buffer ctl-buffer |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3653 (if (eq ediff-highlighting-style 'ascii) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3654 (if beg-of-line |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3655 ediff-after-flag-eol ediff-after-flag-mol)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3656 |
11042 | 3657 ;; insert the flag itself |
3658 (if ediff-xemacs-p | |
3659 (ediff-overlay-put curr-overl 'end-glyph flag) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3660 (ediff-overlay-put curr-overl 'after-string flag)) |
11042 | 3661 )) |
3662 | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3663 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3664 ;;; Some diff region tests |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3665 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3666 ;; t if diff region is empty. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3667 ;; In case of buffer C, t also if it is not a 3way |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3668 ;; comparison job (merging jobs return t as well). |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3669 (defun ediff-empty-diff-region-p (n buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3670 (if (eq buf-type 'C) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3671 (or (not ediff-3way-comparison-job) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3672 (= (ediff-get-diff-posn 'C 'beg n) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3673 (ediff-get-diff-posn 'C 'end n))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3674 (= (ediff-get-diff-posn buf-type 'beg n) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3675 (ediff-get-diff-posn buf-type 'end n)))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3676 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3677 ;; Test if diff region is white space only. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3678 ;; If 2-way job and buf-type = C, then returns t. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3679 (defun ediff-whitespace-diff-region-p (n buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3680 (or (and (eq buf-type 'C) (not ediff-3way-job)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3681 (ediff-empty-diff-region-p n buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3682 (let ((beg (ediff-get-diff-posn buf-type 'beg n)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3683 (end (ediff-get-diff-posn buf-type 'end n))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3684 (ediff-with-current-buffer (ediff-get-buffer buf-type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3685 (save-excursion |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3686 (goto-char beg) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3687 (skip-chars-forward ediff-whitespace) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3688 (>= (point) end)))))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3689 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3690 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
3691 (defun ediff-get-region-contents (n buf-type ctrl-buf &optional start end) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3692 (ediff-with-current-buffer |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3693 (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3694 (buffer-substring |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3695 (or start (ediff-get-diff-posn buf-type 'beg n ctrl-buf)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3696 (or end (ediff-get-diff-posn buf-type 'end n ctrl-buf))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3697 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3698 ;; Returns positions of difference sectors in the BUF-TYPE buffer. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3699 ;; BUF-TYPE should be a symbol -- `A', `B', or `C'. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3700 ;; POS is either `beg' or `end'--it specifies whether you want the position at |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3701 ;; the beginning of a difference or at the end. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3702 ;; |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3703 ;; The optional argument N says which difference (default: |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3704 ;; `ediff-current-difference'). N is the internal difference number (1- what |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3705 ;; the user sees). The optional argument CONTROL-BUF says |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3706 ;; which control buffer is in effect in case it is not the current |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3707 ;; buffer. |
11042 | 3708 (defun ediff-get-diff-posn (buf-type pos &optional n control-buf) |
3709 (let (diff-overlay) | |
3710 (or control-buf | |
3711 (setq control-buf (current-buffer))) | |
3712 | |
19047 | 3713 (ediff-with-current-buffer control-buf |
11042 | 3714 (or n (setq n ediff-current-difference)) |
3715 (if (or (< n 0) (>= n ediff-number-of-differences)) | |
3716 (if (> ediff-number-of-differences 0) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3717 (error ediff-BAD-DIFF-NUMBER |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3718 this-command (1+ n) ediff-number-of-differences) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3719 (error ediff-NO-DIFFERENCES))) |
11042 | 3720 (setq diff-overlay (ediff-get-diff-overlay n buf-type))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3721 (if (not (ediff-buffer-live-p (ediff-overlay-buffer diff-overlay))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
3722 (error ediff-KILLED-VITAL-BUFFER)) |
11042 | 3723 (if (eq pos 'beg) |
3724 (ediff-overlay-start diff-overlay) | |
3725 (ediff-overlay-end diff-overlay)) | |
3726 )) | |
3727 | |
3728 | |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3729 ;; Restore highlighting to what it should be according to ediff-use-faces, |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3730 ;; ediff-highlighting-style, and ediff-highlight-all-diffs variables. |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3731 (defun ediff-restore-highlighting (&optional ctl-buf) |
19047 | 3732 (ediff-with-current-buffer (or ctl-buf (current-buffer)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3733 (if (and (ediff-has-face-support-p) |
16248
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3734 ediff-use-faces |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3735 ediff-highlight-all-diffs) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3736 (ediff-paint-background-regions)) |
b2fae8abc5b0
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
15480
diff
changeset
|
3737 (ediff-select-difference ediff-current-difference))) |
11042 | 3738 |
3739 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3740 |
11042 | 3741 ;; null out difference overlays so they won't slow down future |
3742 ;; editing operations | |
3743 ;; VEC is either a difference vector or a fine-diff vector | |
3744 (defun ediff-clear-diff-vector (vec-var &optional fine-diffs-also) | |
3745 (if (vectorp (symbol-value vec-var)) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3746 (mapcar (lambda (elt) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3747 (ediff-delete-overlay |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3748 (ediff-get-diff-overlay-from-diff-record elt)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3749 (if fine-diffs-also |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3750 (ediff-clear-fine-diff-vector elt)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3751 ) |
11042 | 3752 (symbol-value vec-var))) |
3753 ;; allow them to be garbage collected | |
3754 (set vec-var nil)) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3755 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3756 |
11042 | 3757 |
3758 ;;; Misc | |
3759 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3760 ;; In Emacs, this just makes overlay. In the future, when Emacs will start |
11042 | 3761 ;; supporting sticky overlays, this function will make a sticky overlay. |
3762 ;; BEG and END are expressions telling where overlay starts. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3763 ;; If they are numbers or buffers, then all is well. Otherwise, they must |
11042 | 3764 ;; be expressions to be evaluated in buffer BUF in order to get the overlay |
3765 ;; bounds. | |
3766 ;; If BUFF is not a live buffer, then return nil; otherwise, return the | |
3767 ;; newly created overlay. | |
3768 (defun ediff-make-bullet-proof-overlay (beg end buff) | |
3769 (if (ediff-buffer-live-p buff) | |
3770 (let (overl) | |
19047 | 3771 (ediff-with-current-buffer buff |
11042 | 3772 (or (number-or-marker-p beg) |
3773 (setq beg (eval beg))) | |
3774 (or (number-or-marker-p end) | |
3775 (setq end (eval end))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3776 (setq overl |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3777 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3778 (make-extent beg end buff) ; xemacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3779 ;; advance front and rear of the overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3780 (make-overlay beg end buff nil 'rear-advance) ; emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3781 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3782 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3783 ;; never detach |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3784 (ediff-overlay-put |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3785 overl (if ediff-emacs-p 'evaporate 'detachable) nil) |
38514
10482dd382e7
* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38422
diff
changeset
|
3786 ;; make overlay open-ended |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3787 ;; In emacs, it is made open ended at creation time |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3788 (if ediff-xemacs-p |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3789 (progn |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3790 (ediff-overlay-put overl 'start-open nil) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
3791 (ediff-overlay-put overl 'end-open nil))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3792 (ediff-overlay-put overl 'ediff-diff-num 0) |
11042 | 3793 overl)))) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3794 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3795 |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3796 (defun ediff-make-current-diff-overlay (type) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3797 (if (ediff-has-face-support-p) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3798 (let ((overlay (ediff-get-symbol-from-alist |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3799 type ediff-current-diff-overlay-alist)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3800 (buffer (ediff-get-buffer type)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3801 (face (face-name |
64215
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
3802 (ediff-get-symbol-from-alist |
a4c59075cac8
* viper-cmd.el (viper--key-maps): new variable.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
64091
diff
changeset
|
3803 type ediff-current-diff-face-alist)))) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3804 (set overlay |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3805 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3806 (ediff-set-overlay-face (symbol-value overlay) face) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3807 (ediff-overlay-put (symbol-value overlay) 'ediff ediff-control-buffer)) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
3808 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3809 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3810 |
11042 | 3811 ;; Like other-buffer, but prefers visible buffers and ignores temporary or |
3812 ;; other insignificant buffers (those beginning with "^[ *]"). | |
3813 ;; Gets one arg--buffer name or a list of buffer names (it won't return | |
3814 ;; these buffers). | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3815 ;; EXCL-BUFF-LIST is an exclusion list. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3816 (defun ediff-other-buffer (excl-buff-lst) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3817 (or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst))) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3818 (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3819 ;; we compute this the second time because we need to do memq on it |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3820 ;; later, and nconc above will break it. Either this or use slow |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3821 ;; append instead of nconc |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3822 (selected-buffers (ediff-get-selected-buffers)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3823 (prefered-buffer (car all-buffers)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3824 visible-dired-buffers |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3825 (excl-buff-name-list |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3826 (mapcar |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3827 (lambda (b) (cond ((stringp b) b) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3828 ((bufferp b) (buffer-name b)))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3829 excl-buff-lst)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3830 ;; if at least one buffer on the exclusion list is dired, then force |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3831 ;; all others to be dired. This is because this means that the user |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3832 ;; has already chosen a dired buffer before |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3833 (use-dired-major-mode |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3834 (cond ((null (ediff-buffer-live-p (car excl-buff-lst))) 'unknown) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3835 ((eq (ediff-with-current-buffer (car excl-buff-lst) major-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3836 'dired-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3837 'yes) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3838 (t 'no))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3839 ;; significant-buffers must be visible and not belong |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3840 ;; to the exclusion list `buff-list' |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3841 ;; We also exclude temporary buffers, but keep mail and gnus buffers |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3842 ;; Furthermore, we exclude dired buffers, unless they are the only |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3843 ;; ones visible (and there are at least two of them). |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3844 ;; Also, any visible window not on the exclusion list that is first in |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3845 ;; the buffer list is chosen regardless. (This is because the user |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3846 ;; clicked on it or did something to distinguish it). |
11042 | 3847 (significant-buffers |
3848 (mapcar | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3849 (lambda (x) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3850 (cond ((member (buffer-name x) excl-buff-name-list) nil) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3851 ((memq x selected-buffers) x) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3852 ((not (ediff-get-visible-buffer-window x)) nil) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3853 ((eq x prefered-buffer) x) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3854 ;; if prev selected buffer is dired, look only at |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3855 ;; dired. |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3856 ((eq use-dired-major-mode 'yes) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3857 (if (eq (ediff-with-current-buffer x major-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3858 'dired-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3859 x nil)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3860 ((eq (ediff-with-current-buffer x major-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3861 'dired-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3862 (if (null use-dired-major-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3863 ;; don't know if we must enforce dired. |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3864 ;; Remember this buffer in case |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3865 ;; dired buffs are the only ones visible. |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3866 (setq visible-dired-buffers |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3867 (cons x visible-dired-buffers))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3868 ;; skip, if dired is not forced |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3869 nil) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3870 ((memq (ediff-with-current-buffer x major-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3871 '(rmail-mode |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3872 vm-mode |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3873 gnus-article-mode |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3874 mh-show-mode)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3875 x) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3876 ((string-match "^[ *]" (buffer-name x)) nil) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3877 ((string= "*scratch*" (buffer-name x)) nil) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3878 (t x))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3879 all-buffers)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3880 (clean-significant-buffers (delq nil significant-buffers)) |
11042 | 3881 less-significant-buffers) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3882 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3883 (if (and (null clean-significant-buffers) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3884 (> (length visible-dired-buffers) 0)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3885 (setq clean-significant-buffers visible-dired-buffers)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3886 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3887 (cond (clean-significant-buffers (car clean-significant-buffers)) |
11042 | 3888 ;; try also buffers that are not displayed in windows |
3889 ((setq less-significant-buffers | |
3890 (delq nil | |
3891 (mapcar | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3892 (lambda (x) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3893 (cond ((member (buffer-name x) excl-buff-name-list) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3894 nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3895 ((eq use-dired-major-mode 'yes) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3896 (if (eq (ediff-with-current-buffer |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3897 x major-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3898 'dired-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3899 x nil)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3900 ((eq (ediff-with-current-buffer x major-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3901 'dired-mode) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3902 nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3903 ((string-match "^[ *]" (buffer-name x)) nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3904 ((string= "*scratch*" (buffer-name x)) nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3905 (t x))) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3906 all-buffers))) |
11042 | 3907 (car less-significant-buffers)) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3908 (t "*scratch*")) |
11042 | 3909 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3910 |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3911 |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3912 ;; If current buffer is a Buffer-menu buffer, then take the selected buffers |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3913 ;; and append the buffer at the cursor to the end. |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3914 ;; This list would be the preferred list. |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3915 (defun ediff-get-selected-buffers () |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3916 (if (eq major-mode 'Buffer-menu-mode) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3917 (let ((lis (condition-case nil |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3918 (list (Buffer-menu-buffer t)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3919 (error)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3920 )) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3921 (save-excursion |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3922 (goto-char (point-max)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3923 (while (search-backward "\n>" nil t) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3924 (forward-char 1) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3925 (setq lis (cons (Buffer-menu-buffer t) lis))) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3926 lis)) |
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26263
diff
changeset
|
3927 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3928 |
11042 | 3929 ;; Construct a unique buffer name. |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3930 ;; The first one tried is prefixsuffix, then prefix<2>suffix, |
11042 | 3931 ;; prefix<3>suffix, etc. |
3932 (defun ediff-unique-buffer-name (prefix suffix) | |
3933 (if (null (get-buffer (concat prefix suffix))) | |
3934 (concat prefix suffix) | |
3935 (let ((n 2)) | |
3936 (while (get-buffer (format "%s<%d>%s" prefix n suffix)) | |
3937 (setq n (1+ n))) | |
3938 (format "%s<%d>%s" prefix n suffix)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3939 |
11042 | 3940 |
3941 (defun ediff-submit-report () | |
3942 "Submit bug report on Ediff." | |
3943 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
3944 (ediff-barf-if-not-control-buffer) |
11042 | 3945 (let ((reporter-prompt-for-summary-p t) |
3946 (ctl-buf ediff-control-buffer) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3947 (ediff-device-type (ediff-device-type)) |
11042 | 3948 varlist salutation buffer-name) |
3949 (setq varlist '(ediff-diff-program ediff-diff-options | |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
3950 ediff-diff3-program ediff-diff3-options |
11042 | 3951 ediff-patch-program ediff-patch-options |
3952 ediff-shell | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3953 ediff-use-faces |
11042 | 3954 ediff-auto-refine ediff-highlighting-style |
3955 ediff-buffer-A ediff-buffer-B ediff-control-buffer | |
3956 ediff-forward-word-function | |
3957 ediff-control-frame | |
3958 ediff-control-frame-parameters | |
3959 ediff-control-frame-position-function | |
3960 ediff-prefer-iconified-control-frame | |
3961 ediff-window-setup-function | |
3962 ediff-split-window-function | |
3963 ediff-job-name | |
3964 ediff-word-mode | |
3965 buffer-name | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3966 ediff-device-type |
11042 | 3967 )) |
3968 (setq salutation " | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3969 Congratulations! You may have unearthed a bug in Ediff! |
11042 | 3970 |
3971 Please make a concise and accurate summary of what happened | |
3972 and mail it to the address above. | |
3973 ----------------------------------------------------------- | |
3974 ") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3975 |
11042 | 3976 (ediff-skip-unsuitable-frames) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
3977 (ediff-reset-mouse) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
3978 |
11042 | 3979 (switch-to-buffer ediff-msg-buffer) |
3980 (erase-buffer) | |
3981 (delete-other-windows) | |
3982 (insert " | |
3983 Please read this first: | |
3984 ---------------------- | |
3985 | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3986 Some ``bugs'' may actually be no bugs at all. For instance, if you are |
11042 | 3987 reporting that certain difference regions are not matched as you think they |
3988 should, this is most likely due to the way Unix diff program decides what | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3989 constitutes a difference region. Ediff is an Emacs interface to diff, and |
11042 | 3990 it has nothing to do with those decisions---it only takes the output from |
3991 diff and presents it in a way that is better suited for human browsing and | |
3992 manipulation. | |
3993 | |
3994 If Emacs happens to dump core, this is NOT an Ediff problem---it is | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
3995 an Emacs bug. Report this to Emacs maintainers. |
11042 | 3996 |
3997 Another popular topic for reports is compilation messages. Because Ediff | |
3998 interfaces to several other packages and runs under Emacs and XEmacs, | |
3999 byte-compilation may produce output like this: | |
4000 | |
4001 While compiling toplevel forms in file ediff.el: | |
4002 ** reference to free variable pm-color-alist | |
4003 ........................ | |
4004 While compiling the end of the data: | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4005 ** The following functions are not known to be defined: |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4006 ediff-valid-color-p, ediff-set-face, |
11042 | 4007 ........................ |
4008 | |
4009 These are NOT errors, but inevitable warnings, which ought to be ignored. | |
4010 | |
4011 Please do not report those and similar things. However, comments and | |
4012 suggestions are always welcome. | |
4013 | |
4014 Mail anyway? (y or n) ") | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4015 |
11042 | 4016 (if (y-or-n-p "Mail anyway? ") |
4017 (progn | |
4018 (if (ediff-buffer-live-p ctl-buf) | |
4019 (set-buffer ctl-buf)) | |
4020 (setq buffer-name (buffer-name)) | |
4021 (require 'reporter) | |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4022 (reporter-submit-bug-report "kifer@cs.stonybrook.edu" |
11042 | 4023 (ediff-version) |
4024 varlist | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4025 nil |
11042 | 4026 'delete-other-windows |
4027 salutation)) | |
4028 (bury-buffer) | |
4029 (beep 1)(message "Bug report aborted") | |
4030 (if (ediff-buffer-live-p ctl-buf) | |
19047 | 4031 (ediff-with-current-buffer ctl-buf |
11042 | 4032 (ediff-recenter 'no-rehighlight)))) |
4033 )) | |
36857
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4034 |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4035 |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4036 ;; Find an appropriate syntax table for everyone to use |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4037 ;; If buffer B is not fundamental or text mode, use its syntax table |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4038 ;; Otherwise, use buffer B's. |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4039 ;; The syntax mode is used in ediff-forward-word-function |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4040 ;; The important thing is that every buffer should use the same syntax table |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4041 ;; during the refinement operation |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4042 (defun ediff-choose-syntax-table () |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4043 (setq ediff-syntax-table |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4044 (ediff-with-current-buffer ediff-buffer-A |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4045 (if (not (memq major-mode |
36857
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4046 '(fundamental-mode text-mode indented-text-mode))) |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4047 (syntax-table)))) |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4048 (if (not ediff-syntax-table) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4049 (setq ediff-syntax-table |
36857
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4050 (ediff-with-current-buffer ediff-buffer-B |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4051 (syntax-table)))) |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4052 ) |
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
36456
diff
changeset
|
4053 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4054 |
11042 | 4055 (defun ediff-deactivate-mark () |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4056 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4057 (zmacs-deactivate-region) ; xemacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4058 (deactivate-mark) ; emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4059 )) |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
4060 (defun ediff-activate-mark () |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4061 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4062 (zmacs-activate-region) ; xemacs |
75389
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
4063 (progn |
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
4064 (make-local-variable 'transient-mark-mode) |
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
4065 (setq mark-active t |
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
4066 transient-mark-mode t) ; emacs |
11ae87f329da
2007-01-23 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
75347
diff
changeset
|
4067 ) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4068 )) |
11042 | 4069 |
4070 (cond ((fboundp 'nuke-selective-display) | |
47520
a37b476e1aec
2002-09-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46822
diff
changeset
|
4071 ;; XEmacs has nuke-selective-display |
a37b476e1aec
2002-09-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46822
diff
changeset
|
4072 (defalias 'ediff-nuke-selective-display 'nuke-selective-display)) |
11042 | 4073 (t |
4074 (defun ediff-nuke-selective-display () | |
4075 (save-excursion | |
4076 (save-restriction | |
4077 (widen) | |
4078 (goto-char (point-min)) | |
4079 (let ((mod-p (buffer-modified-p)) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4080 buffer-read-only end) |
11042 | 4081 (and (eq t selective-display) |
4082 (while (search-forward "\^M" nil t) | |
4083 (end-of-line) | |
4084 (setq end (point)) | |
4085 (beginning-of-line) | |
4086 (while (search-forward "\^M" end t) | |
4087 (delete-char -1) | |
4088 (insert "\^J")))) | |
4089 (set-buffer-modified-p mod-p) | |
4090 (setq selective-display nil))))) | |
4091 )) | |
4092 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4093 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4094 ;; The next two are modified versions from emerge.el. |
11042 | 4095 ;; VARS must be a list of symbols |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4096 ;; ediff-save-variables returns an association list: ((var . val) ...) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4097 (defsubst ediff-save-variables (vars) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4098 (mapcar (lambda (v) (cons v (symbol-value v))) |
11042 | 4099 vars)) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4100 ;; VARS is a list of variable symbols. |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4101 (defun ediff-restore-variables (vars assoc-list) |
11042 | 4102 (while vars |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4103 (set (car vars) (cdr (assoc (car vars) assoc-list))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4104 (setq vars (cdr vars)))) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4105 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4106 (defun ediff-change-saved-variable (var value buf-type) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4107 (let* ((assoc-list |
19047 | 4108 (symbol-value (ediff-get-symbol-from-alist |
4109 buf-type | |
4110 ediff-buffer-values-orig-alist))) | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4111 (assoc-elt (assoc var assoc-list))) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4112 (if assoc-elt |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4113 (setcdr assoc-elt value)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4114 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4115 |
11042 | 4116 ;; must execute in control buf |
4117 (defun ediff-save-protected-variables () | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4118 (setq ediff-buffer-values-orig-A |
19047 | 4119 (ediff-with-current-buffer ediff-buffer-A |
11042 | 4120 (ediff-save-variables ediff-protected-variables))) |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4121 (setq ediff-buffer-values-orig-B |
19047 | 4122 (ediff-with-current-buffer ediff-buffer-B |
11042 | 4123 (ediff-save-variables ediff-protected-variables))) |
4124 (if ediff-3way-comparison-job | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4125 (setq ediff-buffer-values-orig-C |
19047 | 4126 (ediff-with-current-buffer ediff-buffer-C |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4127 (ediff-save-variables ediff-protected-variables)))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4128 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4129 (setq ediff-buffer-values-orig-Ancestor |
19047 | 4130 (ediff-with-current-buffer ediff-ancestor-buffer |
11042 | 4131 (ediff-save-variables ediff-protected-variables))))) |
4132 | |
4133 ;; must execute in control buf | |
4134 (defun ediff-restore-protected-variables () | |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4135 (let ((values-A ediff-buffer-values-orig-A) |
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4136 (values-B ediff-buffer-values-orig-B) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4137 (values-C ediff-buffer-values-orig-C) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4138 (values-Ancestor ediff-buffer-values-orig-Ancestor)) |
19047 | 4139 (ediff-with-current-buffer ediff-buffer-A |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4140 (ediff-restore-variables ediff-protected-variables values-A)) |
19047 | 4141 (ediff-with-current-buffer ediff-buffer-B |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4142 (ediff-restore-variables ediff-protected-variables values-B)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4143 (if ediff-3way-comparison-job |
19047 | 4144 (ediff-with-current-buffer ediff-buffer-C |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4145 (ediff-restore-variables ediff-protected-variables values-C))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4146 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
19047 | 4147 (ediff-with-current-buffer ediff-ancestor-buffer |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4148 (ediff-restore-variables ediff-protected-variables values-Ancestor))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4149 )) |
11042 | 4150 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4151 ;; save BUFFER in FILE. used in hooks. |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4152 (defun ediff-save-buffer-in-file (buffer file) |
19047 | 4153 (ediff-with-current-buffer buffer |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4154 (write-file file))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4155 |
11042 | 4156 |
4157 ;;; Debug | |
4158 | |
4159 (ediff-defvar-local ediff-command-begin-time '(0 0 0) "") | |
4160 | |
4161 ;; calculate time used by command | |
4162 (defun ediff-calc-command-time () | |
4163 (let ((end (current-time)) | |
4164 micro sec) | |
4165 (setq micro | |
4166 (if (>= (nth 2 end) (nth 2 ediff-command-begin-time)) | |
4167 (- (nth 2 end) (nth 2 ediff-command-begin-time)) | |
4168 (+ (nth 2 end) (- 1000000 (nth 2 ediff-command-begin-time))))) | |
4169 (setq sec (- (nth 1 end) (nth 1 ediff-command-begin-time))) | |
4170 (or (equal ediff-command-begin-time '(0 0 0)) | |
4171 (message "Elapsed time: %d second(s) + %d microsecond(s)" sec micro)))) | |
4172 | |
4173 (defsubst ediff-save-time () | |
4174 (setq ediff-command-begin-time (current-time))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4175 |
11042 | 4176 (defun ediff-profile () |
4177 "Toggle profiling Ediff commands." | |
4178 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4179 (ediff-barf-if-not-control-buffer) |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
4180 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4181 (ediff-cond-compile-for-xemacs-or-emacs |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4182 (make-local-hook 'post-command-hook) ; xemacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4183 nil ; emacs form |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4184 ) |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
4185 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4186 (let ((pre-hook 'pre-command-hook) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4187 (post-hook 'post-command-hook)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4188 (if (not (equal ediff-command-begin-time '(0 0 0))) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4189 (progn (remove-hook pre-hook 'ediff-save-time) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4190 (remove-hook post-hook 'ediff-calc-command-time) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4191 (setq ediff-command-begin-time '(0 0 0)) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4192 (message "Ediff profiling disabled")) |
42288
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
4193 (add-hook pre-hook 'ediff-save-time t 'local) |
3ce98f3e0608
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
38514
diff
changeset
|
4194 (add-hook post-hook 'ediff-calc-command-time nil 'local) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4195 (message "Ediff profiling enabled")))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4196 |
11042 | 4197 (defun ediff-print-diff-vector (diff-vector-var) |
4198 (princ (format "\n*** %S ***\n" diff-vector-var)) | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4199 (mapcar (lambda (overl-vec) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4200 (princ |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4201 (format |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4202 "Diff %d: \tOverlay: %S |
11042 | 4203 \t\tFine diffs: %s |
4204 \t\tNo-fine-diff-flag: %S | |
4205 \t\tState-of-diff:\t %S | |
4206 \t\tState-of-merge:\t %S | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4207 " |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4208 (1+ (ediff-overlay-get (aref overl-vec 0) 'ediff-diff-num)) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4209 (aref overl-vec 0) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4210 ;; fine-diff-vector |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4211 (if (= (length (aref overl-vec 1)) 0) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4212 "none\n" |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4213 (mapconcat 'prin1-to-string |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4214 (aref overl-vec 1) "\n\t\t\t ")) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4215 (aref overl-vec 2) ; no fine diff flag |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4216 (aref overl-vec 3) ; state-of-diff |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4217 (aref overl-vec 4) ; state-of-merge |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4218 ))) |
11042 | 4219 (eval diff-vector-var))) |
4220 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4221 |
11042 | 4222 |
4223 (defun ediff-debug-info () | |
4224 (interactive) | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4225 (ediff-barf-if-not-control-buffer) |
11042 | 4226 (with-output-to-temp-buffer ediff-debug-buffer |
33392
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4227 (ediff-with-current-buffer standard-output |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4228 (fundamental-mode)) |
11042 | 4229 (princ (format "\nCtl buffer: %S\n" ediff-control-buffer)) |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4230 (ediff-print-diff-vector (intern "ediff-difference-vector-A")) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4231 (ediff-print-diff-vector (intern "ediff-difference-vector-B")) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4232 (ediff-print-diff-vector (intern "ediff-difference-vector-C")) |
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4233 (ediff-print-diff-vector (intern "ediff-difference-vector-Ancestor")) |
11042 | 4234 )) |
4235 | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4236 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4237 ;;; General utilities |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4238 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4239 ;; this uses comparison-func to decide who is a member |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4240 (defun ediff-member (elt lis comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4241 (while (and lis (not (funcall comparison-func (car lis) elt))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4242 (setq lis (cdr lis))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4243 lis) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4244 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4245 ;; Make a readable representation of the invocation sequence for FUNC-DEF. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4246 ;; It would either be a key or M-x something. |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4247 (defun ediff-format-bindings-of (func-def) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4248 (let ((desc (car (where-is-internal func-def |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4249 overriding-local-map |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4250 nil nil)))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4251 (if desc |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4252 (key-description desc) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4253 (format "M-x %s" func-def)))) |
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
4254 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4255 ;; this uses comparison-func to decide who is a member, and this determines how |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4256 ;; intersection looks like |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4257 (defun ediff-intersection (lis1 lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4258 (let ((result (list 'a))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4259 (while lis1 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4260 (if (ediff-member (car lis1) lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4261 (nconc result (list (car lis1)))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4262 (setq lis1 (cdr lis1))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4263 (cdr result))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4264 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4265 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4266 ;; eliminates duplicates using comparison-func |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4267 (defun ediff-union (lis1 lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4268 (let ((result (list 'a))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4269 (while lis1 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4270 (or (ediff-member (car lis1) (cdr result) comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4271 (nconc result (list (car lis1)))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4272 (setq lis1 (cdr lis1))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4273 (while lis2 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4274 (or (ediff-member (car lis2) (cdr result) comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4275 (nconc result (list (car lis2)))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4276 (setq lis2 (cdr lis2))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4277 (cdr result))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4278 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4279 ;; eliminates duplicates using comparison-func |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4280 (defun ediff-set-difference (lis1 lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4281 (let ((result (list 'a))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4282 (while lis1 |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4283 (or (ediff-member (car lis1) (cdr result) comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4284 (ediff-member (car lis1) lis2 comparison-func) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4285 (nconc result (list (car lis1)))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4286 (setq lis1 (cdr lis1))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4287 (cdr result))) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4288 |
72974
54ea774c3eed
* viper.el: Bumped up version/date of update to reflect the substantial
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
4289 (defun ediff-add-to-history (history-var newelt) |
54ea774c3eed
* viper.el: Bumped up version/date of update to reflect the substantial
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
4290 (if (fboundp 'add-to-history) |
54ea774c3eed
* viper.el: Bumped up version/date of update to reflect the substantial
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
4291 (add-to-history history-var newelt) |
54ea774c3eed
* viper.el: Bumped up version/date of update to reflect the substantial
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
4292 (set history-var (cons newelt (symbol-value history-var))))) |
54ea774c3eed
* viper.el: Bumped up version/date of update to reflect the substantial
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
4293 |
33392
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4294 (if (fboundp 'copy-sequence) |
46822
341d8797885c
(ediff-copy-list): Use `defalias' instead of
John Paul Wallington <jpw@pobox.com>
parents:
44615
diff
changeset
|
4295 (defalias 'ediff-copy-list 'copy-sequence) |
33392
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4296 (defun ediff-copy-list (list) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4297 (if (consp list) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4298 ;;;(let ((res nil)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4299 ;;; (while (consp list) (push (pop list) res)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4300 ;;; (prog1 (nreverse res) (setcdr res list))) |
33392
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4301 (let (res elt) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4302 (while (consp list) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4303 (setq elt (car list) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4304 res (cons elt res) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4305 list (cdr list))) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4306 (nreverse res)) |
25fb6fc4f66b
(ediff-status-info, ediff-debug-info): Put temp
Dave Love <fx@gnu.org>
parents:
33019
diff
changeset
|
4307 (car list)))) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26039
diff
changeset
|
4308 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
4309 |
11042 | 4310 ;; don't report error if version control package wasn't found |
4311 ;;(ediff-load-version-control 'silent) | |
4312 | |
13131
b0cb28b64a3c
(ediff-toggle-read-only,ediff-read-file-name):
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12932
diff
changeset
|
4313 (run-hooks 'ediff-load-hook) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47846
diff
changeset
|
4314 |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
4315 (provide 'ediff-util) |
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
4316 |
12085
589a32fa67a9
Converted xemacs *screen* nomenclature to *frame*.
Karl Heuer <kwzh@gnu.org>
parents:
11977
diff
changeset
|
4317 |
11042 | 4318 ;;; Local Variables: |
4319 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | |
19047 | 4320 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
4321 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) | |
11042 | 4322 ;;; End: |
4323 | |
52401 | 4324 ;;; arch-tag: f51099b6-ef4b-470f-88a1-3a0e0b03a879 |
11042 | 4325 ;;; ediff-util.el ends here |