comparison lisp/ediff/ediff-wind.el @ 134:34a5b81f86ba r20-2b1

Import from CVS: tag r20-2b1
author cvs
date Mon, 13 Aug 2007 09:30:11 +0200
parents fe104dbd9147
children 318232e2a3f0
comparison
equal deleted inserted replaced
133:b27e67717092 134:34a5b81f86ba
58 (require 'ediff-tbar) 58 (require 'ediff-tbar)
59 (error 59 (error
60 (defun ediff-compute-toolbar-width () 0))) 60 (defun ediff-compute-toolbar-width () 0)))
61 (defun ediff-compute-toolbar-width () 0)) 61 (defun ediff-compute-toolbar-width () 0))
62 62
63 63 (defgroup ediff-window nil
64 (defvar ediff-window-setup-function (if (ediff-window-display-p) 64 "Ediff window manipulation"
65 :prefix "ediff-"
66 :group 'ediff
67 :group 'frames)
68
69
70 (defcustom ediff-window-setup-function (if (ediff-window-display-p)
65 'ediff-setup-windows-multiframe 71 'ediff-setup-windows-multiframe
66 'ediff-setup-windows-plain) 72 'ediff-setup-windows-plain)
67 "*Function called to set up windows. 73 "*Function called to set up windows.
68 Ediff provides a choice of two functions: ediff-setup-windows-plain, for 74 Ediff provides a choice of two functions: ediff-setup-windows-plain, for
69 doing everything in one frame, and ediff-setup-windows-multiframe, 75 doing everything in one frame, and ediff-setup-windows-multiframe,
80 the corresponding buffers. 86 the corresponding buffers.
81 3. It should accept the following arguments: 87 3. It should accept the following arguments:
82 buffer-A, buffer-B, buffer-C, control-buffer 88 buffer-A, buffer-B, buffer-C, control-buffer
83 Buffer C may not be used in jobs that compare only two buffers. 89 Buffer C may not be used in jobs that compare only two buffers.
84 If you plan to do something fancy, take a close look at how the two 90 If you plan to do something fancy, take a close look at how the two
85 provided functions are written.") 91 provided functions are written."
92 :type 'function
93 :group 'ediff-window)
86 94
87 ;; indicates if we are in a multiframe setup 95 ;; indicates if we are in a multiframe setup
88 (ediff-defvar-local ediff-multiframe nil "") 96 (ediff-defvar-local ediff-multiframe nil "")
89 97
90 ;; Share of the frame occupied by the merge window (buffer C) 98 ;; Share of the frame occupied by the merge window (buffer C)
101 ;; Ediff's window configuration. 109 ;; Ediff's window configuration.
102 ;; Used to minimize the need to rearrange windows. 110 ;; Used to minimize the need to rearrange windows.
103 (ediff-defvar-local ediff-window-config-saved "" "") 111 (ediff-defvar-local ediff-window-config-saved "" "")
104 112
105 113
106 (defvar ediff-split-window-function 'split-window-vertically 114 (defcustom ediff-split-window-function 'split-window-vertically
107 "*The function used to split the main window between buffer-A and buffer-B. 115 "*The function used to split the main window between buffer-A and buffer-B.
108 You can set it to a horizontal split instead of the default vertical split 116 You can set it to a horizontal split instead of the default vertical split
109 by setting this variable to `split-window-horizontally'. 117 by setting this variable to `split-window-horizontally'.
110 You can also have your own function to do fancy splits. 118 You can also have your own function to do fancy splits.
111 This variable has no effect when buffer-A/B are shown in different frames. 119 This variable has no effect when buffer-A/B are shown in different frames.
112 In this case, Ediff will use those frames to display these buffers.") 120 In this case, Ediff will use those frames to display these buffers."
113 121 :type 'function
114 (defvar ediff-merge-split-window-function 'split-window-horizontally 122 :group 'ediff-window)
123
124 (defcustom ediff-merge-split-window-function 'split-window-horizontally
115 "*The function used to split the main window between buffer-A and buffer-B. 125 "*The function used to split the main window between buffer-A and buffer-B.
116 You can set it to a vertical split instead of the default horizontal split 126 You can set it to a vertical split instead of the default horizontal split
117 by setting this variable to `split-window-vertically'. 127 by setting this variable to `split-window-vertically'.
118 You can also have your own function to do fancy splits. 128 You can also have your own function to do fancy splits.
119 This variable has no effect when buffer-A/B/C are shown in different frames. 129 This variable has no effect when buffer-A/B/C are shown in different frames.
120 In this case, Ediff will use those frames to display these buffers.") 130 In this case, Ediff will use those frames to display these buffers."
131 :type 'function
132 :group 'ediff-window)
121 133
122 (defconst ediff-control-frame-parameters 134 (defconst ediff-control-frame-parameters
123 (list 135 (list
124 '(name . "Ediff") 136 '(name . "Ediff")
125 ;;'(unsplittable . t) 137 ;;'(unsplittable . t)
150 162
151 ;; not used for now 163 ;; not used for now
152 (defvar ediff-mouse-pixel-threshold 30 164 (defvar ediff-mouse-pixel-threshold 30
153 "If the user moves mouse more than this many pixels, Ediff won't warp mouse into control window.") 165 "If the user moves mouse more than this many pixels, Ediff won't warp mouse into control window.")
154 166
155 (defvar ediff-grab-mouse t 167 (defcustom ediff-grab-mouse t
156 "*If t, Ediff will always grab the mouse and put it in the control frame. 168 "*If t, Ediff will always grab the mouse and put it in the control frame.
157 If 'maybe, Ediff will do it sometimes, but not after operations that require 169 If 'maybe, Ediff will do it sometimes, but not after operations that require
158 relatively long time. If nil, the mouse will be entirely user's 170 relatively long time. If nil, the mouse will be entirely user's
159 responsibility.") 171 responsibility."
160 172 :type 'boolean
161 (defvar ediff-control-frame-position-function 'ediff-make-frame-position 173 :group 'ediff-window)
174
175 (defcustom ediff-control-frame-position-function 'ediff-make-frame-position
162 "Function to call to determine the desired location for the control panel. 176 "Function to call to determine the desired location for the control panel.
163 Expects three parameters: the control buffer, the desired width and height 177 Expects three parameters: the control buffer, the desired width and height
164 of the control frame. It returns an association list 178 of the control frame. It returns an association list
165 of the form \(\(top . <position>\) \(left . <position>\)\)") 179 of the form \(\(top . <position>\) \(left . <position>\)\)"
166 180 :type 'boolean
167 (defvar ediff-control-frame-upward-shift (if ediff-xemacs-p 42 14) 181 :group 'ediff-window)
182
183 (defcustom ediff-control-frame-upward-shift (if ediff-xemacs-p 42 14)
168 "*The upward shift of control frame from the top of buffer A's frame. 184 "*The upward shift of control frame from the top of buffer A's frame.
169 Measured in pixels. 185 Measured in pixels.
170 This is used by the default control frame positioning function, 186 This is used by the default control frame positioning function,
171 `ediff-make-frame-position'. This variable is provided for easy 187 `ediff-make-frame-position'. This variable is provided for easy
172 customization of the default.") 188 customization of the default."
173 189 :type 'integer
174 (defvar ediff-narrow-control-frame-leftward-shift (if ediff-xemacs-p 7 3) 190 :group 'ediff-window)
191
192 (defcustom ediff-narrow-control-frame-leftward-shift (if ediff-xemacs-p 7 3)
175 "*The leftward shift of control frame from the right edge of buf A's frame. 193 "*The leftward shift of control frame from the right edge of buf A's frame.
176 Measured in characters. 194 Measured in characters.
177 This is used by the default control frame positioning function, 195 This is used by the default control frame positioning function,
178 `ediff-make-frame-position' to adjust the position of the control frame 196 `ediff-make-frame-position' to adjust the position of the control frame
179 when it shows the short menu. This variable is provided for easy 197 when it shows the short menu. This variable is provided for easy
180 customization of the default.") 198 customization of the default."
181 199 :type 'integer
182 (defvar ediff-wide-control-frame-rightward-shift 7 200 :group 'ediff-window)
201
202 (defcustom ediff-wide-control-frame-rightward-shift 7
183 "*The rightward shift of control frame from the left edge of buf A's frame. 203 "*The rightward shift of control frame from the left edge of buf A's frame.
184 Measured in characters. 204 Measured in characters.
185 This is used by the default control frame positioning function, 205 This is used by the default control frame positioning function,
186 `ediff-make-frame-position' to adjust the position of the control frame 206 `ediff-make-frame-position' to adjust the position of the control frame
187 when it shows the full menu. This variable is provided for easy 207 when it shows the full menu. This variable is provided for easy
188 customization of the default.") 208 customization of the default."
209 :type 'integer
210 :group 'ediff-window)
189 211
190 212
191 ;; Wide frame display 213 ;; Wide frame display
192 214
193 ;; t means Ediff is using wide display 215 ;; t means Ediff is using wide display
207 the frame used for the wide display.") 229 the frame used for the wide display.")
208 230
209 ;; Frame used for the control panel in a windowing system. 231 ;; Frame used for the control panel in a windowing system.
210 (ediff-defvar-local ediff-control-frame nil "") 232 (ediff-defvar-local ediff-control-frame nil "")
211 233
212 (defvar ediff-prefer-iconified-control-frame nil 234 (defcustom ediff-prefer-iconified-control-frame nil
213 "*If t, keep control panel iconified when help message is off. 235 "*If t, keep control panel iconified when help message is off.
214 This has effect only on a windowing system. 236 This has effect only on a windowing system.
215 If t, hitting `?' to toggle control panel off iconifies it. 237 If t, hitting `?' to toggle control panel off iconifies it.
216 238
217 This is only useful in Emacs and only for certain kinds of window managers, 239 This is only useful in Emacs and only for certain kinds of window managers,
218 such as TWM and its derivatives, since the window manager must permit 240 such as TWM and its derivatives, since the window manager must permit
219 keyboard input to go into icons. XEmacs completely ignores keyboard input 241 keyboard input to go into icons. XEmacs completely ignores keyboard input
220 into icons, regardless of the window manager.") 242 into icons, regardless of the window manager."
243 :type 'boolean
244 :group 'ediff-window)
221 245
222 ;;; Functions 246 ;;; Functions
223 247
224 (defun ediff-get-window-by-clicking (wind prev-wind wind-number) 248 (defun ediff-get-window-by-clicking (wind prev-wind wind-number)
225 (let (event) 249 (let (event)