Function: windmove-other-window-loc

windmove-other-window-loc is a byte-compiled function defined in windmove.el.gz.

This function is obsolete since 27.1; no longer used.

Signature

(windmove-other-window-loc DIR &optional ARG WINDOW)

Documentation

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.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/windmove.el.gz
(defun windmove-other-window-loc (dir &optional arg window)
  "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."
  (declare (obsolete "no longer used." "27.1"))
  (let ((edges (window-edges window))   ; edges: (x0, y0, x1, y1)
        (refpoint (with-suppressed-warnings
                      ((obsolete windmove-reference-loc))
                    (windmove-reference-loc arg window)))) ; (x . y)
    (cond
     ((eq dir 'left)
      (cons (- (nth 0 edges)
               windmove-window-distance-delta)
            (cdr refpoint)))            ; (x0-d, y)
     ((eq dir 'up)
      (cons (car refpoint)
            (- (nth 1 edges)
               windmove-window-distance-delta))) ; (x, y0-d)
     ((eq dir 'right)
      (cons (+ (1- (nth 2 edges))	; -1 to get actual max x
               windmove-window-distance-delta)
            (cdr refpoint)))            ; (x1+d-1, y)
     ((eq dir 'down)			; -1 to get actual max y
      (cons (car refpoint)
            (+ (1- (nth 3 edges))
               windmove-window-distance-delta))) ; (x, y1+d-1)
     (t (error "Invalid direction of movement: %s" dir)))))