Mercurial > emacs
annotate lisp/ediff-wind.el @ 94620:070ce953fab4
Correct buggy dispatch logic.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Sun, 04 May 2008 23:24:49 +0000 |
parents | c0dfa9027738 |
children | ee5932bf781d |
rev | line source |
---|---|
11042 | 1 ;;; ediff-wind.el --- window manipulation utilities |
14169 | 2 |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64091
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, |
79721 | 4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
11042 | 5 |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
6 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
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:
75347
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 |
14169 | 27 ;;; Code: |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
28 |
11042 | 29 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
30 ;; Compiler pacifier |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
31 (defvar icon-title-format) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
32 (defvar top-toolbar-height) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
33 (defvar bottom-toolbar-height) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
34 (defvar left-toolbar-height) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
35 (defvar right-toolbar-height) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
36 (defvar left-toolbar-width) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
37 (defvar right-toolbar-width) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
38 (defvar default-menubar) |
42602
633233bf2bbf
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
42288
diff
changeset
|
39 (defvar top-gutter) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
40 (defvar frame-icon-title-format) |
18054 | 41 (defvar ediff-diff-status) |
42 | |
87691
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
43 ;; declare-function does not exist in XEmacs |
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
44 (eval-and-compile |
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
45 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) |
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
46 |
18054 | 47 (eval-when-compile |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
48 (require 'ediff-util) |
94604
c0dfa9027738
Simplify compilation requirements.
Glenn Morris <rgm@gnu.org>
parents:
94042
diff
changeset
|
49 (require 'ediff-help)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
50 ;; end pacifier |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
51 |
18054 | 52 (require 'ediff-init) |
11042 | 53 |
18054 | 54 ;; be careful with ediff-tbar |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
55 (if (featurep 'xemacs) |
93773
d7554c14325c
2008-04-06 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
93652
diff
changeset
|
56 (require 'ediff-tbar) |
18054 | 57 (defun ediff-compute-toolbar-width () 0)) |
58 | |
59 (defgroup ediff-window nil | |
64010
2dd49ab983ac
(ediff-window): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
60 "Ediff window manipulation." |
18054 | 61 :prefix "ediff-" |
62 :group 'ediff | |
63 :group 'frames) | |
64 | |
65 | |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
66 ;; Determine which window setup function to use based on current window system. |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
67 (defun ediff-choose-window-setup-function-automatically () |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
68 (if (ediff-window-display-p) |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
69 'ediff-setup-windows-multiframe |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
70 'ediff-setup-windows-plain)) |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
71 |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
72 (defcustom ediff-window-setup-function (ediff-choose-window-setup-function-automatically) |
11042 | 73 "*Function called to set up windows. |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
74 Ediff provides a choice of two functions: `ediff-setup-windows-plain', for |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
75 doing everything in one frame and `ediff-setup-windows-multiframe', which sets |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
76 the control panel in a separate frame. By default, the appropriate function is |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
77 chosen automatically depending on the current window system. |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
78 However, `ediff-toggle-multiframe' can be used to toggle between the multiframe |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
79 display and the single frame display. |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
80 If the multiframe function detects that one of the buffers A/B is seen in some |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
81 other frame, it will try to keep that buffer in that frame. |
11042 | 82 |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
83 If you don't like any of the two provided functions, write your own one. |
11042 | 84 The basic guidelines: |
85 1. It should leave the control buffer current and the control window | |
26934 | 86 selected. |
87 2. It should set `ediff-window-A', `ediff-window-B', `ediff-window-C', | |
88 and `ediff-control-window' to contain window objects that display | |
11042 | 89 the corresponding buffers. |
90 3. It should accept the following arguments: | |
91 buffer-A, buffer-B, buffer-C, control-buffer | |
92 Buffer C may not be used in jobs that compare only two buffers. | |
93 If you plan to do something fancy, take a close look at how the two | |
18054 | 94 provided functions are written." |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
95 :type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe) |
46694
9b8e9cf6b790
(ediff-window-setup-function): Extend type declaration.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
43220
diff
changeset
|
96 (const :tag "Single Frame" ediff-setup-windows-plain) |
9b8e9cf6b790
(ediff-window-setup-function): Extend type declaration.
Markus Rost <rost@math.uni-bielefeld.de>
parents:
43220
diff
changeset
|
97 (function :tag "Other function")) |
18054 | 98 :group 'ediff-window) |
11042 | 99 |
100 ;; indicates if we are in a multiframe setup | |
101 (ediff-defvar-local ediff-multiframe nil "") | |
102 | |
103 ;; Share of the frame occupied by the merge window (buffer C) | |
104 (ediff-defvar-local ediff-merge-window-share 0.45 "") | |
105 | |
106 ;; The control window. | |
107 (ediff-defvar-local ediff-control-window nil "") | |
108 ;; Official window for buffer A | |
109 (ediff-defvar-local ediff-window-A nil "") | |
110 ;; Official window for buffer B | |
111 (ediff-defvar-local ediff-window-B nil "") | |
112 ;; Official window for buffer C | |
113 (ediff-defvar-local ediff-window-C nil "") | |
114 ;; Ediff's window configuration. | |
115 ;; Used to minimize the need to rearrange windows. | |
116 (ediff-defvar-local ediff-window-config-saved "" "") | |
117 | |
19047 | 118 ;; Association between buff-type and ediff-window-* |
119 (defconst ediff-window-alist | |
120 '((A . ediff-window-A) | |
121 (?A . ediff-window-A) | |
122 (B . ediff-window-B) | |
123 (?B . ediff-window-B) | |
124 (C . ediff-window-C) | |
125 (?C . ediff-window-C))) | |
126 | |
11042 | 127 |
18054 | 128 (defcustom ediff-split-window-function 'split-window-vertically |
11042 | 129 "*The function used to split the main window between buffer-A and buffer-B. |
130 You can set it to a horizontal split instead of the default vertical split | |
131 by setting this variable to `split-window-horizontally'. | |
132 You can also have your own function to do fancy splits. | |
133 This variable has no effect when buffer-A/B are shown in different frames. | |
18054 | 134 In this case, Ediff will use those frames to display these buffers." |
94042
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
135 :type '(choice |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
136 (const :tag "Split vertically" split-window-vertically) |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
137 (const :tag "Split horizontally" split-window-horizontally) |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
138 function) |
18054 | 139 :group 'ediff-window) |
11042 | 140 |
18054 | 141 (defcustom ediff-merge-split-window-function 'split-window-horizontally |
11042 | 142 "*The function used to split the main window between buffer-A and buffer-B. |
143 You can set it to a vertical split instead of the default horizontal split | |
144 by setting this variable to `split-window-vertically'. | |
145 You can also have your own function to do fancy splits. | |
146 This variable has no effect when buffer-A/B/C are shown in different frames. | |
18054 | 147 In this case, Ediff will use those frames to display these buffers." |
94042
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
148 :type '(choice |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
149 (const :tag "Split vertically" split-window-vertically) |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
150 (const :tag "Split horizontally" split-window-horizontally) |
62c45d39d360
(ediff-split-window-function, ediff-merge-split-window-function):
Reiner Steib <Reiner.Steib@gmx.de>
parents:
93975
diff
changeset
|
151 function) |
18054 | 152 :group 'ediff-window) |
11042 | 153 |
86469
ab1a84d62068
Load ediff-*.el files silently.
Glenn Morris <rgm@gnu.org>
parents:
86105
diff
changeset
|
154 ;; Definitions hidden from the compiler by compat wrappers. |
87691
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
155 (declare-function ediff-display-pixel-width "ediff-init") |
f2c8fd594360
2008-01-10 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
87678
diff
changeset
|
156 (declare-function ediff-display-pixel-height "ediff-init") |
86469
ab1a84d62068
Load ediff-*.el files silently.
Glenn Morris <rgm@gnu.org>
parents:
86105
diff
changeset
|
157 |
11042 | 158 (defconst ediff-control-frame-parameters |
26934 | 159 (list |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
160 '(name . "Ediff") |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
161 ;;'(unsplittable . t) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
162 '(minibuffer . nil) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
163 '(user-position . t) ; Emacs only |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
164 '(vertical-scroll-bars . nil) ; Emacs only |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
165 '(scrollbar-width . 0) ; XEmacs only |
48034
2bdc2b912091
2002-10-27 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
47846
diff
changeset
|
166 '(scrollbar-height . 0) ; XEmacs only |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
167 '(menu-bar-lines . 0) ; Emacs only |
33842
f6a67d77484a
* ediff-diff.el: Moved variables around to have it compile under NT.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
33317
diff
changeset
|
168 '(tool-bar-lines . 0) ; Emacs 21+ only |
71382
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
169 '(left-fringe . 0) |
4033086b16b6
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68997
diff
changeset
|
170 '(right-fringe . 0) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
171 ;; don't lower but auto-raise |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
172 '(auto-lower . nil) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
173 '(auto-raise . t) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
174 '(visibility . nil) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
175 ;; make initial frame small to avoid distraction |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
176 '(width . 1) '(height . 1) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
177 ;; this blocks queries from window manager as to where to put |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
178 ;; ediff's control frame. we put the frame outside the display, |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
179 ;; so the initial frame won't jump all over the screen |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
180 (cons 'top (if (fboundp 'ediff-display-pixel-height) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
181 (1+ (ediff-display-pixel-height)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
182 3000)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
183 (cons 'left (if (fboundp 'ediff-display-pixel-width) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
184 (1+ (ediff-display-pixel-width)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
185 3000)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
186 ) |
11042 | 187 "Frame parameters for displaying Ediff Control Panel. |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
188 Used internally---not a user option.") |
11042 | 189 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
190 ;; position of the mouse; used to decide whether to warp the mouse into ctl |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
191 ;; frame |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
192 (ediff-defvar-local ediff-mouse-pixel-position nil "") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
193 |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
194 ;; not used for now |
13948
60556fda3e6f
(ediff-mouse-pixel-threshold): Renamed from
Karl Heuer <kwzh@gnu.org>
parents:
13132
diff
changeset
|
195 (defvar ediff-mouse-pixel-threshold 30 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
196 "If the user moves mouse more than this many pixels, Ediff won't warp mouse into control window.") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
197 |
18054 | 198 (defcustom ediff-grab-mouse t |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
199 "*If t, Ediff will always grab the mouse and put it in the control frame. |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
200 If 'maybe, Ediff will do it sometimes, but not after operations that require |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
201 relatively long time. If nil, the mouse will be entirely user's |
18054 | 202 responsibility." |
203 :type 'boolean | |
204 :group 'ediff-window) | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
205 |
18054 | 206 (defcustom ediff-control-frame-position-function 'ediff-make-frame-position |
11042 | 207 "Function to call to determine the desired location for the control panel. |
208 Expects three parameters: the control buffer, the desired width and height | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
209 of the control frame. It returns an association list |
18054 | 210 of the form \(\(top . <position>\) \(left . <position>\)\)" |
18839 | 211 :type 'function |
18054 | 212 :group 'ediff-window) |
11042 | 213 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
214 (defcustom ediff-control-frame-upward-shift 42 |
11042 | 215 "*The upward shift of control frame from the top of buffer A's frame. |
216 Measured in pixels. | |
217 This is used by the default control frame positioning function, | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
218 `ediff-make-frame-position'. This variable is provided for easy |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
219 customization of the default control frame positioning." |
18054 | 220 :type 'integer |
221 :group 'ediff-window) | |
11042 | 222 |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
223 (defcustom ediff-narrow-control-frame-leftward-shift (if (featurep 'xemacs) 7 3) |
11042 | 224 "*The leftward shift of control frame from the right edge of buf A's frame. |
225 Measured in characters. | |
226 This is used by the default control frame positioning function, | |
227 `ediff-make-frame-position' to adjust the position of the control frame | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
228 when it shows the short menu. This variable is provided for easy |
18054 | 229 customization of the default." |
230 :type 'integer | |
231 :group 'ediff-window) | |
11042 | 232 |
18054 | 233 (defcustom ediff-wide-control-frame-rightward-shift 7 |
11042 | 234 "*The rightward shift of control frame from the left edge of buf A's frame. |
235 Measured in characters. | |
236 This is used by the default control frame positioning function, | |
237 `ediff-make-frame-position' to adjust the position of the control frame | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
238 when it shows the full menu. This variable is provided for easy |
18054 | 239 customization of the default." |
240 :type 'integer | |
241 :group 'ediff-window) | |
11042 | 242 |
243 | |
244 ;; Wide frame display | |
245 | |
246 ;; t means Ediff is using wide display | |
247 (ediff-defvar-local ediff-wide-display-p nil "") | |
248 ;; keeps frame config for toggling wide display | |
26934 | 249 (ediff-defvar-local ediff-wide-display-orig-parameters nil |
11042 | 250 "Frame parameters to be restored when the user wants to toggle the wide |
251 display off.") | |
252 (ediff-defvar-local ediff-wide-display-frame nil | |
253 "Frame to be used for wide display.") | |
254 (ediff-defvar-local ediff-make-wide-display-function 'ediff-make-wide-display | |
255 "The value is a function that is called to create a wide display. | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
256 The function is called without arguments. It should resize the frame in |
11042 | 257 which buffers A, B, and C are to be displayed, and it should save the old |
258 frame parameters in `ediff-wide-display-orig-parameters'. | |
259 The variable `ediff-wide-display-frame' should be set to contain | |
260 the frame used for the wide display.") | |
261 | |
262 ;; Frame used for the control panel in a windowing system. | |
263 (ediff-defvar-local ediff-control-frame nil "") | |
264 | |
18054 | 265 (defcustom ediff-prefer-iconified-control-frame nil |
11042 | 266 "*If t, keep control panel iconified when help message is off. |
267 This has effect only on a windowing system. | |
13948
60556fda3e6f
(ediff-mouse-pixel-threshold): Renamed from
Karl Heuer <kwzh@gnu.org>
parents:
13132
diff
changeset
|
268 If t, hitting `?' to toggle control panel off iconifies it. |
11042 | 269 |
270 This is only useful in Emacs and only for certain kinds of window managers, | |
271 such as TWM and its derivatives, since the window manager must permit | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
272 keyboard input to go into icons. XEmacs completely ignores keyboard input |
18054 | 273 into icons, regardless of the window manager." |
274 :type 'boolean | |
275 :group 'ediff-window) | |
11042 | 276 |
277 ;;; Functions | |
278 | |
279 (defun ediff-get-window-by-clicking (wind prev-wind wind-number) | |
280 (let (event) | |
281 (message | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
282 "Select windows by clicking. Please click on Window %d " wind-number) |
11042 | 283 (while (not (ediff-mouse-event-p (setq event (ediff-read-event)))) |
284 (if (sit-for 1) ; if sequence of events, wait till the final word | |
285 (beep 1)) | |
286 (message "Please click on Window %d " wind-number)) | |
287 (ediff-read-event) ; discard event | |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
288 (setq wind (if (featurep 'xemacs) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
289 (event-window event) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
290 (posn-window (event-start event)))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
291 |
11042 | 292 |
27899
42f9a58e0fc4
* viper-cmd.el (viper-envelop-ESC-key): added the option to
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
26934
diff
changeset
|
293 ;; Select the lowest window on the frame. |
11042 | 294 (defun ediff-select-lowest-window () |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
295 (if (featurep 'xemacs) |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
296 (select-window (frame-lowest-window)) |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
297 (let* ((lowest-window (selected-window)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
298 (bottom-edge (car (cdr (cdr (cdr (window-edges)))))) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
299 (last-window (save-excursion |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
300 (other-window -1) (selected-window))) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
301 (window-search t)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
302 (while window-search |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
303 (let* ((this-window (next-window)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
304 (next-bottom-edge |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
305 (car (cdr (cdr (cdr (window-edges this-window))))))) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
306 (if (< bottom-edge next-bottom-edge) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
307 (setq bottom-edge next-bottom-edge |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
308 lowest-window this-window)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
309 (select-window this-window) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
310 (when (eq last-window this-window) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
311 (select-window lowest-window) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
312 (setq window-search nil))))))) |
11042 | 313 |
314 | |
315 ;;; Common window setup routines | |
316 | |
317 ;; Set up the window configuration. If POS is given, set the points to | |
318 ;; the beginnings of the buffers. | |
319 ;; When 3way comparison is added, this will have to choose the appropriate | |
320 ;; setup function based on ediff-job-name | |
321 (defun ediff-setup-windows (buffer-A buffer-B buffer-C control-buffer) | |
322 ;; Make sure we are not in the minibuffer window when we try to delete | |
323 ;; all other windows. | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
324 (run-hooks 'ediff-before-setup-windows-hook) |
11042 | 325 (if (eq (selected-window) (minibuffer-window)) |
326 (other-window 1)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
327 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
328 ;; in case user did a no-no on a tty |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
329 (or (ediff-window-display-p) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
330 (setq ediff-window-setup-function 'ediff-setup-windows-plain)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
331 |
11042 | 332 (or (ediff-keep-window-config control-buffer) |
26934 | 333 (funcall |
19047 | 334 (ediff-with-current-buffer control-buffer ediff-window-setup-function) |
11042 | 335 buffer-A buffer-B buffer-C control-buffer)) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
336 (run-hooks 'ediff-after-setup-windows-hook)) |
11042 | 337 |
338 ;; Just set up 3 windows. | |
339 ;; Usually used without windowing systems | |
340 ;; With windowing, we want to use dedicated frames. | |
341 (defun ediff-setup-windows-plain (buffer-A buffer-B buffer-C control-buffer) | |
19047 | 342 (ediff-with-current-buffer control-buffer |
11042 | 343 (setq ediff-multiframe nil)) |
344 (if ediff-merge-job | |
345 (ediff-setup-windows-plain-merge | |
346 buffer-A buffer-B buffer-C control-buffer) | |
26934 | 347 (ediff-setup-windows-plain-compare |
11042 | 348 buffer-A buffer-B buffer-C control-buffer))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
349 |
11042 | 350 (defun ediff-setup-windows-plain-merge (buf-A buf-B buf-C control-buffer) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
351 ;; skip dedicated and unsplittable frames |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
352 (ediff-destroy-control-frame control-buffer) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
353 (let ((window-min-height 1) |
26934 | 354 split-window-function |
11042 | 355 merge-window-share merge-window-lines |
356 wind-A wind-B wind-C) | |
19047 | 357 (ediff-with-current-buffer control-buffer |
11042 | 358 (setq merge-window-share ediff-merge-window-share |
359 ;; this lets us have local versions of ediff-split-window-function | |
360 split-window-function ediff-split-window-function)) | |
361 (delete-other-windows) | |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
362 (set-window-dedicated-p (selected-window) nil) |
11042 | 363 (split-window-vertically) |
364 (ediff-select-lowest-window) | |
365 (ediff-setup-control-buffer control-buffer) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
366 |
11042 | 367 ;; go to the upper window and split it betw A, B, and possibly C |
26934 | 368 (other-window 1) |
11042 | 369 (setq merge-window-lines |
370 (max 2 (round (* (window-height) merge-window-share)))) | |
371 (switch-to-buffer buf-A) | |
372 (setq wind-A (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
373 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
374 ;; XEmacs used to have a lot of trouble with display |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
375 ;; It did't set things right unless we tell it to sit still |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
376 ;; 19.12 seems ok. |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
377 ;;(if (featurep 'xemacs) (sit-for 0)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
378 |
11042 | 379 (split-window-vertically (max 2 (- (window-height) merge-window-lines))) |
26934 | 380 (if (eq (selected-window) wind-A) |
11042 | 381 (other-window 1)) |
382 (setq wind-C (selected-window)) | |
383 (switch-to-buffer buf-C) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
384 |
11042 | 385 (select-window wind-A) |
386 (funcall split-window-function) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
387 |
11042 | 388 (if (eq (selected-window) wind-A) |
389 (other-window 1)) | |
390 (switch-to-buffer buf-B) | |
391 (setq wind-B (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
392 |
19047 | 393 (ediff-with-current-buffer control-buffer |
11042 | 394 (setq ediff-window-A wind-A |
395 ediff-window-B wind-B | |
396 ediff-window-C wind-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
397 |
11042 | 398 (ediff-select-lowest-window) |
399 (ediff-setup-control-buffer control-buffer) | |
400 )) | |
401 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
402 |
11042 | 403 ;; This function handles all comparison jobs, including 3way jobs |
404 (defun ediff-setup-windows-plain-compare (buf-A buf-B buf-C control-buffer) | |
405 ;; skip dedicated and unsplittable frames | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
406 (ediff-destroy-control-frame control-buffer) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
407 (let ((window-min-height 1) |
11042 | 408 split-window-function wind-width-or-height |
409 three-way-comparison | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
410 wind-A-start wind-B-start wind-A wind-B wind-C) |
19047 | 411 (ediff-with-current-buffer control-buffer |
11042 | 412 (setq wind-A-start (ediff-overlay-start |
413 (ediff-get-value-according-to-buffer-type | |
414 'A ediff-narrow-bounds)) | |
415 wind-B-start (ediff-overlay-start | |
416 (ediff-get-value-according-to-buffer-type | |
417 'B ediff-narrow-bounds)) | |
418 ;; this lets us have local versions of ediff-split-window-function | |
419 split-window-function ediff-split-window-function | |
420 three-way-comparison ediff-3way-comparison-job)) | |
421 (delete-other-windows) | |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
422 (set-window-dedicated-p (selected-window) nil) |
11042 | 423 (split-window-vertically) |
424 (ediff-select-lowest-window) | |
425 (ediff-setup-control-buffer control-buffer) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
426 |
11042 | 427 ;; go to the upper window and split it betw A, B, and possibly C |
26934 | 428 (other-window 1) |
11042 | 429 (switch-to-buffer buf-A) |
430 (setq wind-A (selected-window)) | |
431 (if three-way-comparison | |
432 (setq wind-width-or-height | |
433 (/ (if (eq split-window-function 'split-window-vertically) | |
434 (window-height wind-A) | |
435 (window-width wind-A)) | |
436 3))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
437 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
438 ;; XEmacs used to have a lot of trouble with display |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
439 ;; It did't set things right unless we told it to sit still |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
440 ;; 19.12 seems ok. |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
441 ;;(if (featurep 'xemacs) (sit-for 0)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
442 |
11042 | 443 (funcall split-window-function wind-width-or-height) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
444 |
11042 | 445 (if (eq (selected-window) wind-A) |
446 (other-window 1)) | |
447 (switch-to-buffer buf-B) | |
448 (setq wind-B (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
449 |
11042 | 450 (if three-way-comparison |
451 (progn | |
452 (funcall split-window-function) ; equally | |
453 (if (eq (selected-window) wind-B) | |
454 (other-window 1)) | |
455 (switch-to-buffer buf-C) | |
456 (setq wind-C (selected-window)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
457 |
19047 | 458 (ediff-with-current-buffer control-buffer |
11042 | 459 (setq ediff-window-A wind-A |
460 ediff-window-B wind-B | |
461 ediff-window-C wind-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
462 |
11042 | 463 ;; It is unlikely that we will want to implement 3way window comparison. |
464 ;; So, only buffers A and B are used here. | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
465 (if ediff-windows-job |
11042 | 466 (progn |
467 (set-window-start wind-A wind-A-start) | |
468 (set-window-start wind-B wind-B-start))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
469 |
11042 | 470 (ediff-select-lowest-window) |
471 (ediff-setup-control-buffer control-buffer) | |
472 )) | |
473 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
474 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
475 ;; dispatch an appropriate window setup function |
11042 | 476 (defun ediff-setup-windows-multiframe (buf-A buf-B buf-C control-buf) |
19047 | 477 (ediff-with-current-buffer control-buf |
11042 | 478 (setq ediff-multiframe t)) |
479 (if ediff-merge-job | |
480 (ediff-setup-windows-multiframe-merge buf-A buf-B buf-C control-buf) | |
481 (ediff-setup-windows-multiframe-compare buf-A buf-B buf-C control-buf))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
482 |
11042 | 483 (defun ediff-setup-windows-multiframe-merge (buf-A buf-B buf-C control-buf) |
484 ;;; Algorithm: | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
485 ;;; 1. Never use frames that have dedicated windows in them---it is bad to |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
486 ;;; destroy dedicated windows. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
487 ;;; 2. If A and B are in the same frame but C's frame is different--- use one |
26934 | 488 ;;; frame for A and B and use a separate frame for C. |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
489 ;;; 3. If C's frame is non-existent, then: if the first suitable |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
490 ;;; non-dedicated frame is different from A&B's, then use it for C. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
491 ;;; Otherwise, put A,B, and C in one frame. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
492 ;;; 4. If buffers A, B, C are is separate frames, use them to display these |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
493 ;;; buffers. |
11042 | 494 |
26934 | 495 ;; Skip dedicated or iconified frames. |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
496 ;; Unsplittable frames are taken care of later. |
11042 | 497 (ediff-skip-unsuitable-frames 'ok-unsplittable) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
498 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
499 (let* ((window-min-height 1) |
11042 | 500 (wind-A (ediff-get-visible-buffer-window buf-A)) |
501 (wind-B (ediff-get-visible-buffer-window buf-B)) | |
502 (wind-C (ediff-get-visible-buffer-window buf-C)) | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
503 (frame-A (if wind-A (window-frame wind-A))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
504 (frame-B (if wind-B (window-frame wind-B))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
505 (frame-C (if wind-C (window-frame wind-C))) |
11042 | 506 ;; on wide display, do things in one frame |
26934 | 507 (force-one-frame |
19047 | 508 (ediff-with-current-buffer control-buf ediff-wide-display-p)) |
11042 | 509 ;; this lets us have local versions of ediff-split-window-function |
26934 | 510 (split-window-function |
19047 | 511 (ediff-with-current-buffer control-buf ediff-split-window-function)) |
11042 | 512 (orig-wind (selected-window)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
513 (orig-frame (selected-frame)) |
11042 | 514 (use-same-frame (or force-one-frame |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
515 ;; A and C must be in one frame |
11042 | 516 (eq frame-A (or frame-C orig-frame)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
517 ;; B and C must be in one frame |
11042 | 518 (eq frame-B (or frame-C orig-frame)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
519 ;; A or B is not visible |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
520 (not (frame-live-p frame-A)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
521 (not (frame-live-p frame-B)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
522 ;; A or B is not suitable for display |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
523 (not (ediff-window-ok-for-display wind-A)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
524 (not (ediff-window-ok-for-display wind-B)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
525 ;; A and B in the same frame, and no good frame |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
526 ;; for C |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
527 (and (eq frame-A frame-B) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
528 (not (frame-live-p frame-C))) |
11042 | 529 )) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
530 ;; use-same-frame-for-AB implies wind A and B are ok for display |
11042 | 531 (use-same-frame-for-AB (and (not use-same-frame) |
532 (eq frame-A frame-B))) | |
19047 | 533 (merge-window-share (ediff-with-current-buffer control-buf |
11042 | 534 ediff-merge-window-share)) |
535 merge-window-lines | |
536 designated-minibuffer-frame | |
537 done-A done-B done-C) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
538 |
11042 | 539 ;; buf-A on its own |
540 (if (and (window-live-p wind-A) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
541 (null use-same-frame) ; implies wind-A is suitable |
11042 | 542 (null use-same-frame-for-AB)) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
543 (progn ; bug A on its own |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
544 ;; buffer buf-A is seen in live wind-A |
11042 | 545 (select-window wind-A) |
546 (delete-other-windows) | |
547 (setq wind-A (selected-window)) | |
548 (setq done-A t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
549 |
11042 | 550 ;; buf-B on its own |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
551 (if (and (window-live-p wind-B) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
552 (null use-same-frame) ; implies wind-B is suitable |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
553 (null use-same-frame-for-AB)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
554 (progn ; buf B on its own |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
555 ;; buffer buf-B is seen in live wind-B |
11042 | 556 (select-window wind-B) |
557 (delete-other-windows) | |
558 (setq wind-B (selected-window)) | |
559 (setq done-B t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
560 |
11042 | 561 ;; buf-C on its own |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
562 (if (and (window-live-p wind-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
563 (ediff-window-ok-for-display wind-C) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
564 (null use-same-frame)) ; buf C on its own |
11042 | 565 (progn |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
566 ;; buffer buf-C is seen in live wind-C |
11042 | 567 (select-window wind-C) |
568 (delete-other-windows) | |
569 (setq wind-C (selected-window)) | |
570 (setq done-C t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
571 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
572 (if (and use-same-frame-for-AB ; implies wind A and B are suitable |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
573 (window-live-p wind-A)) |
26934 | 574 (progn |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
575 ;; wind-A must already be displaying buf-A |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
576 (select-window wind-A) |
11042 | 577 (delete-other-windows) |
578 (setq wind-A (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
579 |
11042 | 580 (funcall split-window-function) |
26934 | 581 (if (eq (selected-window) wind-A) |
11042 | 582 (other-window 1)) |
583 (switch-to-buffer buf-B) | |
584 (setq wind-B (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
585 |
11042 | 586 (setq done-A t |
587 done-B t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
588 |
11042 | 589 (if use-same-frame |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
590 (let ((window-min-height 1)) |
18054 | 591 (if (and (eq frame-A frame-B) |
592 (eq frame-B frame-C) | |
593 (frame-live-p frame-A)) | |
594 (select-frame frame-A) | |
595 ;; avoid dedicated and non-splittable windows | |
596 (ediff-skip-unsuitable-frames)) | |
11042 | 597 (delete-other-windows) |
598 (setq merge-window-lines | |
599 (max 2 (round (* (window-height) merge-window-share)))) | |
600 (switch-to-buffer buf-A) | |
601 (setq wind-A (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
602 |
11042 | 603 (split-window-vertically |
604 (max 2 (- (window-height) merge-window-lines))) | |
26934 | 605 (if (eq (selected-window) wind-A) |
11042 | 606 (other-window 1)) |
607 (setq wind-C (selected-window)) | |
608 (switch-to-buffer buf-C) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
609 |
11042 | 610 (select-window wind-A) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
611 |
11042 | 612 (funcall split-window-function) |
26934 | 613 (if (eq (selected-window) wind-A) |
11042 | 614 (other-window 1)) |
615 (switch-to-buffer buf-B) | |
616 (setq wind-B (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
617 |
11042 | 618 (setq done-A t |
619 done-B t | |
620 done-C t) | |
621 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
622 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
623 (or done-A ; Buf A to be set in its own frame, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
624 ;;; or it was set before because use-same-frame = 1 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
625 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
626 ;; Buf-A was not set up yet as it wasn't visible, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
627 ;; and use-same-frame = nil, use-same-frame-for-AB = nil |
11042 | 628 (select-window orig-wind) |
629 (delete-other-windows) | |
630 (switch-to-buffer buf-A) | |
631 (setq wind-A (selected-window)) | |
632 )) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
633 (or done-B ; Buf B to be set in its own frame, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
634 ;;; or it was set before because use-same-frame = 1 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
635 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
636 ;; Buf-B was not set up yet as it wasn't visible |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
637 ;; and use-same-frame = nil, use-same-frame-for-AB = nil |
11042 | 638 (select-window orig-wind) |
639 (delete-other-windows) | |
640 (switch-to-buffer buf-B) | |
641 (setq wind-B (selected-window)) | |
642 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
643 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
644 (or done-C ; Buf C to be set in its own frame, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
645 ;;; or it was set before because use-same-frame = 1 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
646 (progn |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
647 ;; Buf-C was not set up yet as it wasn't visible |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
648 ;; and use-same-frame = nil |
11042 | 649 (select-window orig-wind) |
650 (delete-other-windows) | |
651 (switch-to-buffer buf-C) | |
652 (setq wind-C (selected-window)) | |
653 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
654 |
19047 | 655 (ediff-with-current-buffer control-buf |
11042 | 656 (setq ediff-window-A wind-A |
657 ediff-window-B wind-B | |
658 ediff-window-C wind-C) | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
659 (setq frame-A (window-frame ediff-window-A) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
660 designated-minibuffer-frame |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
661 (window-frame (minibuffer-window frame-A)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
662 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
663 (ediff-setup-control-frame control-buf designated-minibuffer-frame) |
11042 | 664 )) |
665 | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
666 |
11042 | 667 ;; Window setup for all comparison jobs, including 3way comparisons |
668 (defun ediff-setup-windows-multiframe-compare (buf-A buf-B buf-C control-buf) | |
669 ;;; Algorithm: | |
26934 | 670 ;;; If a buffer is seen in a frame, use that frame for that buffer. |
11042 | 671 ;;; If it is not seen, use the current frame. |
672 ;;; If both buffers are not seen, they share the current frame. If one | |
673 ;;; of the buffers is not seen, it is placed in the current frame (where | |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
674 ;;; ediff started). If that frame is displaying the other buffer, it is |
11042 | 675 ;;; shared between the two buffers. |
676 ;;; However, if we decide to put both buffers in one frame | |
677 ;;; and the selected frame isn't splittable, we create a new frame and | |
678 ;;; put both buffers there, event if one of this buffers is visible in | |
679 ;;; another frame. | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
680 |
11042 | 681 ;; Skip dedicated or iconified frames. |
682 ;; Unsplittable frames are taken care of later. | |
683 (ediff-skip-unsuitable-frames 'ok-unsplittable) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
684 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
685 (let* ((window-min-height 1) |
11042 | 686 (wind-A (ediff-get-visible-buffer-window buf-A)) |
687 (wind-B (ediff-get-visible-buffer-window buf-B)) | |
688 (wind-C (ediff-get-visible-buffer-window buf-C)) | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
689 (frame-A (if wind-A (window-frame wind-A))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
690 (frame-B (if wind-B (window-frame wind-B))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
691 (frame-C (if wind-C (window-frame wind-C))) |
19047 | 692 (ctl-frame-exists-p (ediff-with-current-buffer control-buf |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
693 (frame-live-p ediff-control-frame))) |
11042 | 694 ;; on wide display, do things in one frame |
26934 | 695 (force-one-frame |
19047 | 696 (ediff-with-current-buffer control-buf ediff-wide-display-p)) |
11042 | 697 ;; this lets us have local versions of ediff-split-window-function |
26934 | 698 (split-window-function |
19047 | 699 (ediff-with-current-buffer control-buf ediff-split-window-function)) |
11042 | 700 (three-way-comparison |
19047 | 701 (ediff-with-current-buffer control-buf ediff-3way-comparison-job)) |
11042 | 702 (orig-wind (selected-window)) |
703 (use-same-frame (or force-one-frame | |
704 (eq frame-A frame-B) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
705 (not (ediff-window-ok-for-display wind-A)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
706 (not (ediff-window-ok-for-display wind-B)) |
11042 | 707 (if three-way-comparison |
708 (or (eq frame-A frame-C) | |
709 (eq frame-B frame-C) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
710 (not (ediff-window-ok-for-display wind-C)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
711 (not (frame-live-p frame-A)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
712 (not (frame-live-p frame-B)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
713 (not (frame-live-p frame-C)))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
714 (and (not (frame-live-p frame-B)) |
11042 | 715 (or ctl-frame-exists-p |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
716 (eq frame-A (selected-frame)))) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
717 (and (not (frame-live-p frame-A)) |
11042 | 718 (or ctl-frame-exists-p |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
719 (eq frame-B (selected-frame)))))) |
26934 | 720 wind-A-start wind-B-start |
11042 | 721 designated-minibuffer-frame |
722 done-A done-B done-C) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
723 |
19047 | 724 (ediff-with-current-buffer control-buf |
11042 | 725 (setq wind-A-start (ediff-overlay-start |
726 (ediff-get-value-according-to-buffer-type | |
727 'A ediff-narrow-bounds)) | |
728 wind-B-start (ediff-overlay-start | |
729 (ediff-get-value-according-to-buffer-type | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
730 'B ediff-narrow-bounds)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
731 |
11042 | 732 (if (and (window-live-p wind-A) (null use-same-frame)) ; buf-A on its own |
733 (progn | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
734 ;; buffer buf-A is seen in live wind-A |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
735 (select-window wind-A) ; must be displaying buf-A |
11042 | 736 (delete-other-windows) |
737 (setq wind-A (selected-window)) | |
738 (setq done-A t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
739 |
11042 | 740 (if (and (window-live-p wind-B) (null use-same-frame)) ; buf B on its own |
741 (progn | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
742 ;; buffer buf-B is seen in live wind-B |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
743 (select-window wind-B) ; must be displaying buf-B |
11042 | 744 (delete-other-windows) |
745 (setq wind-B (selected-window)) | |
746 (setq done-B t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
747 |
11042 | 748 (if (and (window-live-p wind-C) (null use-same-frame)) ; buf C on its own |
749 (progn | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
750 ;; buffer buf-C is seen in live wind-C |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
751 (select-window wind-C) ; must be displaying buf-C |
11042 | 752 (delete-other-windows) |
753 (setq wind-C (selected-window)) | |
754 (setq done-C t))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
755 |
11042 | 756 (if use-same-frame |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
757 (let (wind-width-or-height) ; this affects 3way setups only |
18054 | 758 (if (and (eq frame-A frame-B) (frame-live-p frame-A)) |
759 (select-frame frame-A) | |
760 ;; avoid dedicated and non-splittable windows | |
761 (ediff-skip-unsuitable-frames)) | |
11042 | 762 (delete-other-windows) |
763 (switch-to-buffer buf-A) | |
764 (setq wind-A (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
765 |
11042 | 766 (if three-way-comparison |
767 (setq wind-width-or-height | |
768 (/ | |
769 (if (eq split-window-function 'split-window-vertically) | |
770 (window-height wind-A) | |
771 (window-width wind-A)) | |
772 3))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
773 |
11042 | 774 (funcall split-window-function wind-width-or-height) |
26934 | 775 (if (eq (selected-window) wind-A) |
11042 | 776 (other-window 1)) |
777 (switch-to-buffer buf-B) | |
778 (setq wind-B (selected-window)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
779 |
11042 | 780 (if three-way-comparison |
781 (progn | |
782 (funcall split-window-function) ; equally | |
783 (if (memq (selected-window) (list wind-A wind-B)) | |
784 (other-window 1)) | |
785 (switch-to-buffer buf-C) | |
786 (setq wind-C (selected-window)))) | |
787 (setq done-A t | |
788 done-B t | |
789 done-C t) | |
790 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
791 |
11042 | 792 (or done-A ; Buf A to be set in its own frame |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
793 ;;; or it was set before because use-same-frame = 1 |
26934 | 794 (progn |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
795 ;; Buf-A was not set up yet as it wasn't visible, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
796 ;; and use-same-frame = nil |
11042 | 797 (select-window orig-wind) |
798 (delete-other-windows) | |
799 (switch-to-buffer buf-A) | |
800 (setq wind-A (selected-window)) | |
801 )) | |
802 (or done-B ; Buf B to be set in its own frame | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
803 ;;; or it was set before because use-same-frame = 1 |
26934 | 804 (progn |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
805 ;; Buf-B was not set up yet as it wasn't visible, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
806 ;; and use-same-frame = nil |
11042 | 807 (select-window orig-wind) |
808 (delete-other-windows) | |
809 (switch-to-buffer buf-B) | |
810 (setq wind-B (selected-window)) | |
811 )) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
812 |
11042 | 813 (if three-way-comparison |
814 (or done-C ; Buf C to be set in its own frame | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
815 ;;; or it was set before because use-same-frame = 1 |
26934 | 816 (progn |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
817 ;; Buf-C was not set up yet as it wasn't visible, |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
818 ;; and use-same-frame = nil |
11042 | 819 (select-window orig-wind) |
820 (delete-other-windows) | |
821 (switch-to-buffer buf-C) | |
822 (setq wind-C (selected-window)) | |
823 ))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
824 |
19047 | 825 (ediff-with-current-buffer control-buf |
11042 | 826 (setq ediff-window-A wind-A |
827 ediff-window-B wind-B | |
828 ediff-window-C wind-C) | |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
829 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
830 (setq frame-A (window-frame ediff-window-A) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
831 designated-minibuffer-frame |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
832 (window-frame (minibuffer-window frame-A)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
833 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
834 ;; It is unlikely that we'll implement a version of ediff-windows that |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
835 ;; would compare 3 windows at once. So, we don't use buffer C here. |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
836 (if ediff-windows-job |
11042 | 837 (progn |
838 (set-window-start wind-A wind-A-start) | |
839 (set-window-start wind-B wind-B-start))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
840 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
841 (ediff-setup-control-frame control-buf designated-minibuffer-frame) |
11042 | 842 )) |
843 | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
844 ;; skip unsplittable frames and frames that have dedicated windows. |
11042 | 845 ;; create a new splittable frame if none is found |
846 (defun ediff-skip-unsuitable-frames (&optional ok-unsplittable) | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
847 (if (ediff-window-display-p) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
848 (let ((wind-frame (window-frame (selected-window))) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
849 seen-windows) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
31928
diff
changeset
|
850 (while (and (not (memq (selected-window) seen-windows)) |
11042 | 851 (or |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
852 (ediff-frame-has-dedicated-windows wind-frame) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
853 (ediff-frame-iconified-p wind-frame) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
854 ;; skip small windows |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
855 (< (frame-height wind-frame) |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
856 (* 3 window-min-height)) |
11042 | 857 (if ok-unsplittable |
858 nil | |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
859 (ediff-frame-unsplittable-p wind-frame)))) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
860 ;; remember history |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
31928
diff
changeset
|
861 (setq seen-windows (cons (selected-window) seen-windows)) |
11042 | 862 ;; try new window |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
863 (other-window 1 t) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
864 (setq wind-frame (window-frame (selected-window))) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
865 ) |
33019
6306740f6938
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
31928
diff
changeset
|
866 (if (memq (selected-window) seen-windows) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
867 ;; fed up, no appropriate frames |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
868 (setq wind-frame (make-frame '((unsplittable))))) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
869 |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
870 (select-frame wind-frame) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
871 ))) |
11042 | 872 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
873 (defun ediff-frame-has-dedicated-windows (frame) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
874 (let (ans) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
875 (walk-windows |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
876 (lambda (wind) (if (window-dedicated-p wind) |
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
877 (setq ans t))) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
878 'ignore-minibuffer |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
879 frame) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
880 ans)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
881 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
882 ;; window is ok, if it is only one window on the frame, not counting the |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
883 ;; minibuffer, or none of the frame's windows is dedicated. |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
884 ;; The idea is that it is bad to destroy dedicated windows while creating an |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
885 ;; ediff window setup |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
886 (defun ediff-window-ok-for-display (wind) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
887 (and |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
888 (window-live-p wind) |
26934 | 889 (or |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
890 ;; only one window |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
891 (eq wind (next-window wind 'ignore-minibuffer (window-frame wind))) |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
892 ;; none is dedicated (in multiframe setup) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
893 (not (ediff-frame-has-dedicated-windows (window-frame wind))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
894 ))) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
895 |
11042 | 896 ;; Prepare or refresh control frame |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
897 (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
898 (let ((window-min-height 1) |
11042 | 899 ctl-frame-iconified-p dont-iconify-ctl-frame deiconify-ctl-frame |
26934 | 900 ctl-frame old-ctl-frame lines |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
901 ;; user-grabbed-mouse |
26934 | 902 fheight fwidth adjusted-parameters) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
903 |
19047 | 904 (ediff-with-current-buffer ctl-buffer |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
905 (if (and (featurep 'xemacs) (featurep 'menubar)) |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
906 (set-buffer-menubar nil)) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
907 ;;(setq user-grabbed-mouse (ediff-user-grabbed-mouse)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
908 (run-hooks 'ediff-before-setup-control-frame-hook)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
909 |
19047 | 910 (setq old-ctl-frame (ediff-with-current-buffer ctl-buffer ediff-control-frame)) |
911 (ediff-with-current-buffer ctl-buffer | |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
912 (setq ctl-frame (if (frame-live-p old-ctl-frame) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
913 old-ctl-frame |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
914 (make-frame ediff-control-frame-parameters)) |
29977
ebf68f69b586
(ediff-setup-control-frame): Remove :box
Gerd Moellmann <gerd@gnu.org>
parents:
27899
diff
changeset
|
915 ediff-control-frame ctl-frame) |
33050
84f89d78d87a
2000-10-29 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
33019
diff
changeset
|
916 ;; protect against undefined face-attribute |
36857
f6386773ce30
2001-03-17 Michael Kifer <kifer@cs.sunysb.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
33842
diff
changeset
|
917 (condition-case nil |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
918 (if (and (featurep 'emacs) (face-attribute 'mode-line :box)) |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
919 (set-face-attribute 'mode-line ctl-frame :box nil)) |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
920 (error))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
921 |
11042 | 922 (setq ctl-frame-iconified-p (ediff-frame-iconified-p ctl-frame)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
923 (select-frame ctl-frame) |
11042 | 924 (if (window-dedicated-p (selected-window)) |
925 () | |
926 (delete-other-windows) | |
927 (switch-to-buffer ctl-buffer)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
928 |
11042 | 929 ;; must be before ediff-setup-control-buffer |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
930 ;; just a precaution--we should be in ctl-buffer already |
19047 | 931 (ediff-with-current-buffer ctl-buffer |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
932 (make-local-variable 'frame-title-format) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
933 (make-local-variable 'frame-icon-title-format) ; XEmacs |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
934 (make-local-variable 'icon-title-format)) ; Emacs |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
935 |
11042 | 936 (ediff-setup-control-buffer ctl-buffer) |
937 (setq dont-iconify-ctl-frame | |
938 (not (string= ediff-help-message ediff-brief-help-message))) | |
26934 | 939 (setq deiconify-ctl-frame |
11042 | 940 (and (eq this-command 'ediff-toggle-help) |
941 dont-iconify-ctl-frame)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
942 |
11042 | 943 ;; 1 more line for the modeline |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
944 (setq lines (1+ (count-lines (point-min) (point-max))) |
11042 | 945 fheight lines |
16766
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
946 fwidth (max (+ (ediff-help-message-line-length) 2) |
beb94a5271e2
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
16248
diff
changeset
|
947 (ediff-compute-toolbar-width)) |
18054 | 948 adjusted-parameters |
949 (list | |
950 ;; possibly change surrogate minibuffer | |
951 (cons 'minibuffer | |
952 (minibuffer-window | |
953 designated-minibuffer-frame)) | |
954 (cons 'width fwidth) | |
67202
3423d9dbb1b7
2005-11-29 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
67117
diff
changeset
|
955 (cons 'height fheight) |
3423d9dbb1b7
2005-11-29 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
67117
diff
changeset
|
956 (cons 'user-position t) |
3423d9dbb1b7
2005-11-29 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
67117
diff
changeset
|
957 )) |
47846
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
958 |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
959 ;; adjust autoraise |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
960 (setq adjusted-parameters |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
961 (cons (if ediff-use-long-help-message |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
962 '(auto-raise . nil) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
963 '(auto-raise . t)) |
8e6ed5c1f142
2002-10-12 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
46694
diff
changeset
|
964 adjusted-parameters)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
965 |
11042 | 966 ;; In XEmacs, buffer menubar needs to be killed before frame parameters |
26934 | 967 ;; are changed. |
21940 | 968 (if (ediff-has-toolbar-support-p) |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
969 (when (featurep 'xemacs) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
970 (if (ediff-has-gutter-support-p) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
971 (set-specifier top-gutter (list ctl-frame nil))) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
972 (sit-for 0) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
973 (set-specifier top-toolbar-height (list ctl-frame 0)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
974 ;;(set-specifier bottom-toolbar-height (list ctl-frame 0)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
975 (set-specifier left-toolbar-width (list ctl-frame 0)) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
976 (set-specifier right-toolbar-width (list ctl-frame 0)))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
977 |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
978 ;; Under OS/2 (emx) we have to call modify frame parameters twice, in order |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
979 ;; to make sure that at least once we do it for non-iconified frame. If |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
980 ;; appears that in the OS/2 port of Emacs, one can't modify frame |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
981 ;; parameters of iconified frames. As a precaution, we do likewise for |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
982 ;; windows-nt. |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
983 (if (memq system-type '(emx windows-nt windows-95)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
984 (modify-frame-parameters ctl-frame adjusted-parameters)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
985 |
18054 | 986 ;; make or zap toolbar (if not requested) |
987 (ediff-make-bottom-toolbar ctl-frame) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
988 |
11042 | 989 (goto-char (point-min)) |
18054 | 990 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
991 (modify-frame-parameters ctl-frame adjusted-parameters) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
992 (make-frame-visible ctl-frame) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
993 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
994 ;; This works around a bug in 19.25 and earlier. There, if frame gets |
11042 | 995 ;; iconified, the current buffer changes to that of the frame that |
996 ;; becomes exposed as a result of this iconification. | |
997 ;; So, we make sure the current buffer doesn't change. | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
998 (select-frame ctl-frame) |
11042 | 999 (ediff-refresh-control-frame) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1000 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1001 (cond ((and ediff-prefer-iconified-control-frame |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1002 (not ctl-frame-iconified-p) (not dont-iconify-ctl-frame)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1003 (iconify-frame ctl-frame)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1004 ((or deiconify-ctl-frame (not ctl-frame-iconified-p)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1005 (raise-frame ctl-frame))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1006 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1007 (set-window-dedicated-p (selected-window) t) |
18054 | 1008 |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
1009 ;; Now move the frame. We must do it separately due to an obscure bug in |
18054 | 1010 ;; XEmacs |
1011 (modify-frame-parameters | |
1012 ctl-frame | |
1013 (funcall ediff-control-frame-position-function ctl-buffer fwidth fheight)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1014 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1015 ;; synchronize so the cursor will move to control frame |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1016 ;; per RMS suggestion |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1017 (if (ediff-window-display-p) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1018 (let ((count 7)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1019 (sit-for .1) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1020 (while (and (not (frame-visible-p ctl-frame)) (> count 0)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1021 (setq count (1- count)) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1022 (sit-for .3)))) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1023 |
11042 | 1024 (or (ediff-frame-iconified-p ctl-frame) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1025 ;; don't warp the mouse, unless ediff-grab-mouse = t |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1026 (ediff-reset-mouse ctl-frame |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1027 (or (eq this-command 'ediff-quit) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1028 (not (eq ediff-grab-mouse t))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1029 |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1030 (when (featurep 'xemacs) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1031 (ediff-with-current-buffer ctl-buffer |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1032 (make-local-hook 'select-frame-hook) |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1033 (add-hook 'select-frame-hook |
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1034 'ediff-xemacs-select-frame-hook nil 'local))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1035 |
19047 | 1036 (ediff-with-current-buffer ctl-buffer |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1037 (run-hooks 'ediff-after-setup-control-frame-hook)))) |
18054 | 1038 |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1039 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1040 (defun ediff-destroy-control-frame (ctl-buffer) |
19047 | 1041 (ediff-with-current-buffer ctl-buffer |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1042 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1043 (let ((ctl-frame ediff-control-frame)) |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
1044 (if (and (featurep 'xemacs) (featurep 'menubar)) |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
1045 (set-buffer-menubar default-menubar)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1046 (setq ediff-control-frame nil) |
92506
bf22da1ce4da
Expand all ediff-cond-compile-for-xemacs-or-emacs calls to a featurep test.
Glenn Morris <rgm@gnu.org>
parents:
87691
diff
changeset
|
1047 (delete-frame ctl-frame)))) |
93652
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
1048 (if ediff-multiframe |
6523ed37006c
2008-04-04 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
92506
diff
changeset
|
1049 (ediff-skip-unsuitable-frames)) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1050 ;;(ediff-reset-mouse nil) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1051 ) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1052 |
11042 | 1053 |
1054 ;; finds a good place to clip control frame | |
1055 (defun ediff-make-frame-position (ctl-buffer ctl-frame-width ctl-frame-height) | |
19047 | 1056 (ediff-with-current-buffer ctl-buffer |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1057 (let* ((frame-A (window-frame ediff-window-A)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1058 (frame-A-parameters (frame-parameters frame-A)) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1059 (frame-A-top (eval (cdr (assoc 'top frame-A-parameters)))) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1060 (frame-A-left (eval (cdr (assoc 'left frame-A-parameters)))) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1061 (frame-A-width (frame-width frame-A)) |
11042 | 1062 (ctl-frame ediff-control-frame) |
1063 horizontal-adjustment upward-adjustment | |
26934 | 1064 ctl-frame-top ctl-frame-left) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1065 |
11042 | 1066 ;; Multiple control frames are clipped based on the value of |
26263
4f315ca65976
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
21940
diff
changeset
|
1067 ;; ediff-control-buffer-number. This is done in order not to obscure |
11042 | 1068 ;; other active control panels. |
1069 (setq horizontal-adjustment (* 2 ediff-control-buffer-number) | |
1070 upward-adjustment (* -14 ediff-control-buffer-number)) | |
1071 | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1072 (setq ctl-frame-top |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1073 (- frame-A-top upward-adjustment ediff-control-frame-upward-shift) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1074 ctl-frame-left |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1075 (+ frame-A-left |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1076 (if ediff-use-long-help-message |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1077 (* (ediff-frame-char-width ctl-frame) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1078 (+ ediff-wide-control-frame-rightward-shift |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1079 horizontal-adjustment)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1080 (- (* frame-A-width (ediff-frame-char-width frame-A)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1081 (* (ediff-frame-char-width ctl-frame) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1082 (+ ctl-frame-width |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1083 ediff-narrow-control-frame-leftward-shift |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1084 horizontal-adjustment)))))) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1085 (setq ctl-frame-top |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1086 (min ctl-frame-top |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1087 (- (ediff-display-pixel-height) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1088 (* 2 ctl-frame-height |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1089 (ediff-frame-char-height ctl-frame)))) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1090 ctl-frame-left |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1091 (min ctl-frame-left |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1092 (- (ediff-display-pixel-width) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1093 (* ctl-frame-width (ediff-frame-char-width ctl-frame))))) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1094 ;; keep ctl frame within the visible bounds |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1095 (setq ctl-frame-top (max ctl-frame-top 1) |
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1096 ctl-frame-left (max ctl-frame-left 1)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1097 |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1098 (list (cons 'top ctl-frame-top) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1099 (cons 'left ctl-frame-left)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1100 ))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1101 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1102 (defun ediff-xemacs-select-frame-hook () |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1103 (if (and (equal (selected-frame) ediff-control-frame) |
14582
c768f6d7daaa
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14169
diff
changeset
|
1104 (not ediff-use-long-help-message)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1105 (raise-frame ediff-control-frame))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1106 |
11042 | 1107 (defun ediff-make-wide-display () |
1108 "Construct an alist of parameters for the wide display. | |
1109 Saves the old frame parameters in `ediff-wide-display-orig-parameters'. | |
1110 The frame to be resized is kept in `ediff-wide-display-frame'. | |
1111 This function modifies only the left margin and the width of the display. | |
1112 It assumes that it is called from within the control buffer." | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1113 (if (not (fboundp 'ediff-display-pixel-width)) |
26934 | 1114 (error "Can't determine display width")) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1115 (let* ((frame-A (window-frame ediff-window-A)) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1116 (frame-A-params (frame-parameters frame-A)) |
11042 | 1117 (cw (ediff-frame-char-width frame-A)) |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1118 (wd (- (/ (ediff-display-pixel-width) cw) 5))) |
26934 | 1119 (setq ediff-wide-display-orig-parameters |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1120 (list (cons 'left (max 0 (eval (cdr (assoc 'left frame-A-params))))) |
11042 | 1121 (cons 'width (cdr (assoc 'width frame-A-params)))) |
1122 ediff-wide-display-frame frame-A) | |
67202
3423d9dbb1b7
2005-11-29 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
67117
diff
changeset
|
1123 (modify-frame-parameters |
3423d9dbb1b7
2005-11-29 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
67117
diff
changeset
|
1124 frame-A `((left . ,cw) (width . ,wd) (user-position t))))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1125 |
11042 | 1126 |
1127 ;; Revise the mode line to display which difference we have selected | |
1128 ;; Also resets modelines of buffers A/B, since they may be clobbered by | |
1129 ;; anothe invocations of Ediff. | |
1130 (defun ediff-refresh-mode-lines () | |
1131 (let (buf-A-state-diff buf-B-state-diff buf-C-state-diff buf-C-state-merge) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1132 |
11042 | 1133 (if (ediff-valid-difference-p) |
1134 (setq | |
1135 buf-C-state-diff (ediff-get-state-of-diff ediff-current-difference 'C) | |
1136 buf-C-state-merge (ediff-get-state-of-merge ediff-current-difference) | |
1137 buf-A-state-diff (ediff-get-state-of-diff ediff-current-difference 'A) | |
1138 buf-B-state-diff (ediff-get-state-of-diff ediff-current-difference 'B) | |
1139 buf-A-state-diff (if buf-A-state-diff | |
1140 (format "[%s] " buf-A-state-diff) | |
1141 "") | |
1142 buf-B-state-diff (if buf-B-state-diff | |
1143 (format "[%s] " buf-B-state-diff) | |
1144 "") | |
1145 buf-C-state-diff (if (and (ediff-buffer-live-p ediff-buffer-C) | |
1146 (or buf-C-state-diff buf-C-state-merge)) | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1147 (format "[%s%s%s] " |
11042 | 1148 (or buf-C-state-diff "") |
1149 (if buf-C-state-merge | |
1150 (concat " " buf-C-state-merge) | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1151 "") |
26934 | 1152 (if (ediff-get-state-of-ancestor |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1153 ediff-current-difference) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1154 " AncestorEmpty" |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1155 "") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1156 ) |
11042 | 1157 "")) |
1158 (setq buf-A-state-diff "" | |
1159 buf-B-state-diff "" | |
1160 buf-C-state-diff "")) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1161 |
11042 | 1162 ;; control buffer format |
1163 (setq mode-line-format | |
18054 | 1164 (if (ediff-narrow-control-frame-p) |
1165 (list " " mode-line-buffer-identification) | |
1166 (list "-- " mode-line-buffer-identification " Quick Help"))) | |
11042 | 1167 ;; control buffer id |
26934 | 1168 (setq mode-line-buffer-identification |
11042 | 1169 (if (ediff-narrow-control-frame-p) |
1170 (ediff-make-narrow-control-buffer-id 'skip-name) | |
1171 (ediff-make-wide-control-buffer-id))) | |
1172 ;; Force mode-line redisplay | |
1173 (force-mode-line-update) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1174 |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1175 (if (and (ediff-window-display-p) (frame-live-p ediff-control-frame)) |
11042 | 1176 (ediff-refresh-control-frame)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1177 |
19047 | 1178 (ediff-with-current-buffer ediff-buffer-A |
11042 | 1179 (setq ediff-diff-status buf-A-state-diff) |
1180 (ediff-strip-mode-line-format) | |
1181 (setq mode-line-format | |
1182 (list " A: " 'ediff-diff-status mode-line-format)) | |
1183 (force-mode-line-update)) | |
19047 | 1184 (ediff-with-current-buffer ediff-buffer-B |
11042 | 1185 (setq ediff-diff-status buf-B-state-diff) |
1186 (ediff-strip-mode-line-format) | |
1187 (setq mode-line-format | |
1188 (list " B: " 'ediff-diff-status mode-line-format)) | |
1189 (force-mode-line-update)) | |
1190 (if ediff-3way-job | |
19047 | 1191 (ediff-with-current-buffer ediff-buffer-C |
11042 | 1192 (setq ediff-diff-status buf-C-state-diff) |
1193 (ediff-strip-mode-line-format) | |
1194 (setq mode-line-format | |
1195 (list " C: " 'ediff-diff-status mode-line-format)) | |
1196 (force-mode-line-update))) | |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1197 (if (ediff-buffer-live-p ediff-ancestor-buffer) |
19047 | 1198 (ediff-with-current-buffer ediff-ancestor-buffer |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1199 (ediff-strip-mode-line-format) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1200 ;; we keep the second dummy string in the mode line format of the |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1201 ;; ancestor, since for other buffers Ediff prepends 2 strings and |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1202 ;; ediff-strip-mode-line-format expects that. |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1203 (setq mode-line-format |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1204 (list " Ancestor: " |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1205 (cond ((not (stringp buf-C-state-merge)) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1206 "") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1207 ((string-match "prefer-A" buf-C-state-merge) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1208 "[=diff(B)] ") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1209 ((string-match "prefer-B" buf-C-state-merge) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1210 "[=diff(A)] ") |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1211 (t "")) |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1212 mode-line-format)))) |
11042 | 1213 )) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1214 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1215 |
11042 | 1216 (defun ediff-refresh-control-frame () |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
1217 (if (featurep 'emacs) |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1218 ;; set frame/icon titles for Emacs |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1219 (modify-frame-parameters |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1220 ediff-control-frame |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1221 (list (cons 'title (ediff-make-base-title)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1222 (cons 'icon-name (ediff-make-narrow-control-buffer-id)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1223 )) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1224 ;; set frame/icon titles for XEmacs |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1225 (setq frame-title-format (ediff-make-base-title) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1226 frame-icon-title-format (ediff-make-narrow-control-buffer-id)) |
13132
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1227 ;; force an update of the frame title |
7ed272c3c177
(ediff-make-frame-position): fixed bugs.
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
12559
diff
changeset
|
1228 (modify-frame-parameters ediff-control-frame '(())))) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1229 |
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1230 |
11042 | 1231 (defun ediff-make-narrow-control-buffer-id (&optional skip-name) |
1232 (concat | |
1233 (if skip-name | |
1234 " " | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1235 (ediff-make-base-title)) |
26934 | 1236 (cond ((< ediff-current-difference 0) |
11042 | 1237 (format " _/%d" ediff-number-of-differences)) |
1238 ((>= ediff-current-difference ediff-number-of-differences) | |
1239 (format " $/%d" ediff-number-of-differences)) | |
1240 (t | |
1241 (format " %d/%d" | |
1242 (1+ ediff-current-difference) | |
1243 ediff-number-of-differences))))) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1244 |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1245 (defun ediff-make-base-title () |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1246 (concat |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1247 (cdr (assoc 'name ediff-control-frame-parameters)) |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1248 ediff-control-buffer-suffix)) |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1249 |
11042 | 1250 (defun ediff-make-wide-control-buffer-id () |
1251 (cond ((< ediff-current-difference 0) | |
1252 (list (format "%%b At start of %d diffs" | |
1253 ediff-number-of-differences))) | |
1254 ((>= ediff-current-difference ediff-number-of-differences) | |
1255 (list (format "%%b At end of %d diffs" | |
1256 ediff-number-of-differences))) | |
1257 (t | |
1258 (list (format "%%b diff %d of %d" | |
1259 (1+ ediff-current-difference) | |
1260 ediff-number-of-differences))))) | |
1261 | |
1262 | |
1263 | |
1264 ;; If buff is not live, return nil | |
1265 (defun ediff-get-visible-buffer-window (buff) | |
1266 (if (ediff-buffer-live-p buff) | |
85972
51aa47312c4b
* ediff-init.el (ediff-xemacs-p, ediff-emacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
83648
diff
changeset
|
1267 (if (featurep 'xemacs) |
11042 | 1268 (get-buffer-window buff t) |
1269 (get-buffer-window buff 'visible)))) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1270 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1271 |
11042 | 1272 ;;; Functions to decide when to redraw windows |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1273 |
11042 | 1274 (defun ediff-keep-window-config (control-buf) |
1275 (and (eq control-buf (current-buffer)) | |
1276 (/= (buffer-size) 0) | |
19047 | 1277 (ediff-with-current-buffer control-buf |
11042 | 1278 (let ((ctl-wind ediff-control-window) |
1279 (A-wind ediff-window-A) | |
1280 (B-wind ediff-window-B) | |
1281 (C-wind ediff-window-C)) | |
49588
37645a051842
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48034
diff
changeset
|
1282 |
11042 | 1283 (and |
1284 (ediff-window-visible-p A-wind) | |
1285 (ediff-window-visible-p B-wind) | |
1286 ;; if buffer C is defined then take it into account | |
1287 (or (not ediff-3way-job) | |
1288 (ediff-window-visible-p C-wind)) | |
1289 (eq (window-buffer A-wind) ediff-buffer-A) | |
1290 (eq (window-buffer B-wind) ediff-buffer-B) | |
1291 (or (not ediff-3way-job) | |
1292 (eq (window-buffer C-wind) ediff-buffer-C)) | |
1293 (string= ediff-window-config-saved | |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1294 (format "%S%S%S%S%S%S%S" |
11042 | 1295 ctl-wind A-wind B-wind C-wind |
12084
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1296 ediff-split-window-function |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1297 (ediff-multiframe-setup-p) |
4a13777b153b
(ediff-make-control-frame): optimized for display.
Karl Heuer <kwzh@gnu.org>
parents:
12020
diff
changeset
|
1298 ediff-wide-display-p))))))) |
11042 | 1299 |
1300 | |
68997
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
1301 (provide 'ediff-wind) |
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
1302 |
6169b51037af
2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu>
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
68651
diff
changeset
|
1303 |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1304 ;;; Local Variables: |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1305 ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
19047 | 1306 ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
1307 ;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) | |
15480
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1308 ;;; End: |
43a3308fcf61
*** empty log message ***
Michael Kifer <kifer@cs.stonybrook.edu>
parents:
14582
diff
changeset
|
1309 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93773
diff
changeset
|
1310 ;; arch-tag: 73d9a5d7-eed7-4d9c-8b4b-21d5d78eb597 |
11042 | 1311 ;;; ediff-wind.el ends here |