Subject: bug#78997: Fix for windmove-do-window-select erroring on 'no-select

From: JJ <[email-masked]>
Date: Fri, 11 Jul 2025 12:56:58 -0700

See attached patch and commit message.

From 8e884d855b64f58c59571d52f6ee3210de5a8068 Mon Sep 17 00:00:00 2001
From: JJ <[email-masked]>
Date: Fri, 11 Jul 2025 12:34:35 -0700
Subject: [PATCH] Fix for windmove-do-window-select erroring if other-window is
 'no-select

If the variable windmove-create-window is set to a function that returns 'no-select, windmove-do-window-select is intended to ignore the final window selection.

However, because other-window is passed to window-minibuffer-p before checking if other-window is 'no-select, window-minibuffer-p will instead throw a type error, and the (eq other-window 'no-select) case will never be reached. This patch moves this case up a line to avoid this.
---
 lisp/windmove.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index d69a09f..ed76c67 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -422,10 +422,10 @@ repeated commands."
 
     (cond ((null other-window)
            (user-error "No window %s from selected window" dir))
+          ((eq other-window 'no-select))
           ((and (window-minibuffer-p other-window)
                 (not (minibuffer-window-active-p other-window)))
            (user-error "Minibuffer is inactive"))
-          ((eq other-window 'no-select))
           (t
            (select-window other-window)))))
 
-- 
2.50.0