diff --git a/lisp/windmove.el b/lisp/windmove.el index f5650684097..42e10b591f6 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -464,12 +464,7 @@ movement is relative to." (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. diff --git a/lisp/window.el b/lisp/window.el index a7318308ef1..47dbf0e1c86 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2288,8 +2288,13 @@ if WRAP is non-nil, always act as if MINI were nil. 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