;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:53:28 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/windmove.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`windmove.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(custom-declare-group 'windmove nil "Directional selection of windows in a frame." :prefix "windmove-" :version "21.1" :group 'windows :group 'convenience)
#@277 Whether movement off the edge of the frame wraps around.
If this variable is set to t, moving left from the leftmost window in
a frame will find the rightmost one, and similarly for the other
directions.  The minibuffer is skipped over in up/down movements if it
is inactive.
(custom-declare-variable 'windmove-wrap-around 'nil '(#$ . 775) :type 'boolean :group 'windmove)
#@247 How far away from the current window to look for an adjacent window.
Measured in characters either horizontally or vertically; setting this
to a value larger than 1 may be useful in getting around window-
placement bugs in old versions of Emacs.
(custom-declare-variable 'windmove-window-distance-delta '1 '(#$ . 1155) :type 'number :group 'windmove)
#@136 Add the two coordinates.
Both COORD1 and COORD2 are coordinate cons pairs, (HPOS . VPOS).  The
result is another coordinate cons pair.
(defalias 'windmove-coord-add #[(coord1 coord2) "@	@\\A	A\\B\207" [coord1 coord2] 3 (#$ . 1513)])
#@145 Ensure that N is between MIN-N and MAX-N inclusive by constraining.
If N is less than MIN-N, return MIN-N; if greater than MAX-N, return
MAX-N.
(defalias 'windmove-constrain-to-range #[(n min-n max-n) "	\n^]\207" [min-n n max-n] 3 (#$ . 1755)])
#@141 Ensure that N is between MIN-N and MAX-N inclusive by wrapping.
If N is less than MIN-N, return MAX-N; if greater than MAX-N, return
MIN-N.
(defalias 'windmove-constrain-around-range #[(n min-n max-n) "	W\203 \n\207\nV\203 	\207\207" [n min-n max-n] 2 (#$ . 2008)])
#@421 Return (X-MIN Y-MIN X-MAX Y-MAX) for the frame containing WINDOW.
If WINDOW is nil, return the edges for the selected frame.
(X-MIN, Y-MIN) is the zero-based coordinate of the top-left corner
of the frame; (X-MAX, Y-MAX) is the zero-based coordinate of the
bottom-right corner of the frame.
For example, if a frame has 76 rows and 181 columns, the return value
from `windmove-frame-edges' will be the list (0 0 180 75).
(defalias 'windmove-frame-edges #[(window) "\203\n \306!\202\f \307 \310\211\311	!S\312	!S\211\f\nF-\207" [window frame y-max x-max y-min x-min window-frame selected-frame 0 frame-width frame-height] 6 (#$ . 2286)])
#@591 Constrain COORD so that it is reasonable for the given movement.
This involves two things: first, make sure that the "off" coordinate
-- the one not being moved on, e.g., y for horizontal movement -- is
within frame boundaries; second, if the movement is down and we're not
moving from the minibuffer, make sure that the y coordinate does not
exceed the frame max-y, so that we don't overshoot the minibuffer
accidentally.  WINDOW is the window that movement is relative to; DIR
is the direction of the movement, one of `left', `up', `right',
or `down'.
Returns the constrained coordinate.
(defalias 'windmove-constrain-loc-for-movement #[(coord window dir) "\306!\307!\211@\nA@\310\n8\311\n8\312>\203* \313@\f#\202- @\314>\204? \315=\203I 	\204I \313A#\202L A\211.B\207" [window in-minibuffer frame-edges max-y max-x min-y windmove-frame-edges window-minibuffer-p 2 3 (up down) windmove-constrain-to-range (left right) down min-x dir coord new-y new-x] 6 (#$ . 2937)])
#@425 Takes the constrained COORD and wraps it around for the movement.
This makes an out-of-range x or y coordinate and wraps it around the
frame, giving a coordinate (hopefully) in the window on the other edge
of the frame.  WINDOW is the window that movement is relative to (nil
means the currently selected window); DIR is the direction of the
movement, one of `left', `up', `right',or `down'.
Returns the wrapped coordinate.
(defalias 'windmove-wrap-loc-for-movement #[(coord window dir) "\306!\307\203 \310!\202 \311 !\312\n!	@	A@\313	8\204- \314	8\315\n!Z\2020 \314	8\316@#\316A\f#.B\207" [window frame-edges frame-minibuffer minibuffer-active max-y max-x windmove-frame-edges minibuffer-window window-frame selected-frame minibuffer-window-active-p 2 3 window-height windmove-constrain-around-range min-y min-x coord] 6 (#$ . 3948)])
#@517 Return the coordinates of position POS in window WINDOW.
Return the window-based coodinates in a cons pair: (HPOS . VPOS),
where HPOS and VPOS are the zero-based x and y components of the
screen location of POS.  If WINDOW is nil, return the coordinates in
the currently selected window.
As an example, if point is in the top left corner of a window, then
the return value from `windmove-coordinates-of-position' is (0 . 0)
regardless of the where point is in the buffer and where the window
is placed in the frame.
(defalias 'windmove-coordinates-of-position #[(pos &optional window) "\204	 \306 \202\n \307	!S\310	!S\311\312 \313\f\nB\n\314 \315B	&\211A@\3168,B\207" [window wind usable-width usable-height pos big-hairy-result selected-window window-width window-height compute-motion window-start (0 . 0) window-hscroll 0 2] 9 (#$ . 4816)])
#@405 Return the reference location for directional window selection.
Return a coordinate (HPOS . VPOS) that is frame-based.  If ARG is nil
or not supplied, the reference point is the buffer's point in the
currently-selected window, or WINDOW if supplied; otherwise, it is the
top-left or bottom-right corner of the selected window, or WINDOW if
supplied, if ARG is greater or smaller than zero, respectively.
(defalias 'windmove-reference-loc #[(&optional arg window) "\204 \306\202 \307!\310	!\n@\nA@B\311\n8S\312\n8\311ZB\306V\203, \202E \306W\2036 \f\202E \306U\205E \313\314\315	!	\"\",\207" [arg window edges effective-arg bottom-right top-left 0 prefix-numeric-value window-edges 2 3 windmove-coord-add windmove-coordinates-of-position window-point] 5 (#$ . 5677)])
#@283 Return a location in the window to be moved to.
Return value is a frame-based (HPOS . VPOS) value that should be moved
to.  DIR is one of `left', `up', `right', or `down'; an optional ARG
is handled as by `windmove-reference-loc'; WINDOW is the window that
movement is relative to.
(defalias 'windmove-other-window-loc #[(dir &optional arg window) "\306!\307	\"\f\310=\203 @Z\nAB\202P \f\311=\203* \n@A@ZB\202P \f\312=\203; \3138\\\nAB\202P \f\314=\203L \n@\3158\\B\202P \316\317\f\"*\207" [window arg refpoint edges dir windmove-window-distance-delta window-edges windmove-reference-loc left up right 2 down 3 error "Invalid direction of movement: %s"] 4 (#$ . 6464)])
#@112 Return the window object in direction DIR.
DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'.
(defalias 'windmove-find-other-window #[(dir &optional arg window) "\206 \306 \307\n	#\310\f	\n#\203  \311	\n#\202! \f\312\f@\fA\",\207" [window actual-current-window dir arg raw-other-window-loc constrained-other-window-loc selected-window windmove-other-window-loc windmove-constrain-loc-for-movement windmove-wrap-loc-for-movement window-at windmove-wrap-around other-window-loc] 4 (#$ . 7154)])
#@162 Move to the window at direction DIR.
DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'.
If no window is at direction DIR, an error is signaled.
(defalias 'windmove-do-window-select #[(dir &optional arg window) "\304	\n#\211\204 \305\306\"\202& \307!\203# \310!\204# \305\311!\202& \312!)\207" [dir arg window other-window windmove-find-other-window error "No window at %s" window-minibuffer-p minibuffer-window-active-p "Can't move to inactive minibuffer" select-window] 5 (#$ . 7684)])
#@358 Select the window to the left of the current one.
With no prefix argument, or with prefix argument equal to zero,
"left" is relative to the position of point in the window; otherwise
it is relative to the top edge (for positive ARG) or the bottom edge
(for negative ARG) of the current window.
If no window is at the desired location, an error is signaled.
(defalias 'windmove-left #[(&optional arg) "\301\302\"\207" [arg windmove-do-window-select left] 3 (#$ . 8202) "P"])
#@347 Select the window above the current one.
With no prefix argument, or with prefix argument equal to zero, "up"
is relative to the position of point in the window; otherwise it is
relative to the left edge (for positive ARG) or the right edge (for
negative ARG) of the current window.
If no window is at the desired location, an error is signaled.
(defalias 'windmove-up #[(&optional arg) "\301\302\"\207" [arg windmove-do-window-select up] 3 (#$ . 8684) "P"])
#@360 Select the window to the right of the current one.
With no prefix argument, or with prefix argument equal to zero,
"right" is relative to the position of point in the window;
otherwise it is relative to the top edge (for positive ARG) or the
bottom edge (for negative ARG) of the current window.
If no window is at the desired location, an error is signaled.
(defalias 'windmove-right #[(&optional arg) "\301\302\"\207" [arg windmove-do-window-select right] 3 (#$ . 9151) "P"])
#@349 Select the window below the current one.
With no prefix argument, or with prefix argument equal to zero,
"down" is relative to the position of point in the window; otherwise
it is relative to the left edge (for positive ARG) or the right edge
(for negative ARG) of the current window.
If no window is at the desired location, an error is signaled.
(defalias 'windmove-down #[(&optional arg) "\301\302\"\207" [arg windmove-do-window-select down] 3 (#$ . 9637) "P"])
#@44 Set up default keybindings for `windmove'.
(defalias 'windmove-default-keybindings #[nil "\300\301\302\"\210\300\303\304\"\210\300\305\306\"\210\300\307\310\"\207" [global-set-key [(shift left)] windmove-left [(shift up)] windmove-up [(shift right)] windmove-right [(shift down)] windmove-down] 3 (#$ . 10109) nil])
(provide 'windmove)
