* lisp/window.el (window-in-direction): Handle values of 'up'
and 'down' for DIRECTION argument (Bug#32790). Suggested by
Juri Linkov <juri@linkov.net>.
* lisp/windmove.el (windmove-find-other-window): Don't convert
first argument of 'window-in-direction'.
(defun windmove-find-other-window (dir &optional arg window)
"Return the window object in direction DIR.
DIR, ARG, and WINDOW are handled as by `windmove-other-window-loc'."
- (window-in-direction
- (cond
- ((eq dir 'up) 'above)
- ((eq dir 'down) 'below)
- (t dir))
- window nil arg windmove-wrap-around t))
+ (window-in-direction dir window nil arg windmove-wrap-around t))
;; Selects the window that's hopefully at the location returned by
;; `windmove-other-window-loc', or screams if there's no window there.
Return nil if no suitable window can be found."
(setq window (window-normalize-window window t))
- (unless (memq direction '(above below left right))
- (error "Wrong direction %s" direction))
+ (cond
+ ((eq direction 'up)
+ (setq direction 'above))
+ ((eq direction 'down)
+ (setq direction 'below))
+ ((not (memq direction '(above below left right)))
+ (error "Wrong direction %s" direction)))
(let* ((frame (window-frame window))
(hor (memq direction '(left right)))
(first (if hor