From: Martin Rudalics Date: Thu, 18 Oct 2018 07:11:30 +0000 (+0200) Subject: Have 'window-in-direction' handle 'up' and 'down' values (Bug#32790) X-Git-Tag: emacs-27.0.90~4281 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46106eec16ddb2294e06f9e482b9183777b90014;p=emacs.git Have 'window-in-direction' handle 'up' and 'down' values (Bug#32790) * lisp/window.el (window-in-direction): Handle values of 'up' and 'down' for DIRECTION argument (Bug#32790). Suggested by Juri Linkov . * lisp/windmove.el (windmove-find-other-window): Don't convert first argument of 'window-in-direction'. --- 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