Function: windmove-wrap-loc-for-movement

windmove-wrap-loc-for-movement is a byte-compiled function defined in windmove.el.gz.

This function is obsolete since 27.1; no longer used.

Signature

(windmove-wrap-loc-for-movement COORD WINDOW)

Documentation

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). Returns the wrapped coordinate.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/windmove.el.gz
(defun windmove-wrap-loc-for-movement (coord window)
  "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).  Returns the wrapped coordinate."
  (declare (obsolete "no longer used." "27.1"))
  (with-suppressed-warnings ((obsolete windmove-frame-edges
                                       windmove-constrain-around-range))
    (let* ((frame-edges (windmove-frame-edges window))
           (frame-minibuffer (minibuffer-window (if window
                                                    (window-frame window)
                                                  (selected-frame))))
           (minibuffer-active (minibuffer-window-active-p
                               frame-minibuffer)))
      (let ((min-x (nth 0 frame-edges))
            (min-y (nth 1 frame-edges))
            (max-x (nth 2 frame-edges))
            (max-y (if (not minibuffer-active)
                       (- (nth 3 frame-edges)
                          (window-height frame-minibuffer))
                     (nth 3 frame-edges))))
        (cons
         (windmove-constrain-around-range (car coord) min-x max-x)
         (windmove-constrain-around-range (cdr coord) min-y max-y))))))